org.ikasan.framework.component.transformation.flatfile.reader
Class BaseStringHandlingFlatFileReader

java.lang.Object
  extended by org.ikasan.framework.component.transformation.flatfile.reader.BaseFlatFileReader
      extended by org.ikasan.framework.component.transformation.flatfile.reader.BaseStringHandlingFlatFileReader
All Implemented Interfaces:
XMLReader
Direct Known Subclasses:
FixedLengthFieldFlatFileReader, SimpleDelimitedFlatFileReader

public abstract class BaseStringHandlingFlatFileReader
extends BaseFlatFileReader

Abstract base class for all flat file readers that must first convert the incoming InputSource to a String for handling

Author:
Ikasan Development Team

Field Summary
protected  boolean trimTrailingWhitespace
          Flag specifying whether trailing white space should be trimmed from each element value
 
Fields inherited from class org.ikasan.framework.component.transformation.flatfile.reader.BaseFlatFileReader
attributes, contentHandler, namespaceURI
 
Constructor Summary
BaseStringHandlingFlatFileReader(String rootElementName, boolean trimTrailingWhitespace)
          Constructor
 
Method Summary
protected  String format(String fieldValue)
          Format the field value, in this case trim whitespace and line carriages
protected  boolean isEmpty(String fieldValue)
          Determines if a field's value is empty
 void parseInputSource(InputSource source)
          Type specific method implemented by subclasses
protected abstract  void parseString(String string)
          Parse the string, is overridden by child classes
protected  void reportField(BaseFieldDefinition fieldDefinition, String rawFieldContent)
           
 
Methods inherited from class org.ikasan.framework.component.transformation.flatfile.reader.BaseFlatFileReader
getContentHandler, getDTDHandler, getEntityResolver, getErrorHandler, getFeature, getProperty, parse, parse, setContentHandler, setDTDHandler, setEntityResolver, setErrorHandler, setFeature, setNamespaceURI, setProperty
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

trimTrailingWhitespace

protected boolean trimTrailingWhitespace
Flag specifying whether trailing white space should be trimmed from each element value

Constructor Detail

BaseStringHandlingFlatFileReader

public BaseStringHandlingFlatFileReader(String rootElementName,
                                        boolean trimTrailingWhitespace)
Constructor

Parameters:
rootElementName -
trimTrailingWhitespace -
Method Detail

parseInputSource

public void parseInputSource(InputSource source)
                      throws IOException,
                             SAXException
Description copied from class: BaseFlatFileReader
Type specific method implemented by subclasses

Specified by:
parseInputSource in class BaseFlatFileReader
Throws:
IOException
SAXException

parseString

protected abstract void parseString(String string)
                             throws IOException,
                                    SAXException
Parse the string, is overridden by child classes

Parameters:
string -
Throws:
IOException
SAXException

format

protected String format(String fieldValue)
Format the field value, in this case trim whitespace and line carriages

Parameters:
fieldValue -
Returns:
formatted field value

isEmpty

protected boolean isEmpty(String fieldValue)
Determines if a field's value is empty

Parameters:
fieldValue -
Returns:
true if null, empty string or blank String

reportField

protected void reportField(BaseFieldDefinition fieldDefinition,
                           String rawFieldContent)
                    throws SAXException
Parameters:
fieldDefinition -
rawFieldContent -
Throws:
SAXException


Copyright © 2007-2012 Ikasan. All Rights Reserved.