com.ibm.dse.base
Class FormatDecorator

java.lang.Object
  |
  +--com.ibm.dse.base.FormatElement
        |
        +--com.ibm.dse.base.FormatDecorator
Direct Known Subclasses:
CodeSetTranslator, Compressor, Delimiter, FixedLength, Identifier, JxfsFieldLabel, MaximumLength, NullCheckDecorator, SelfLength

public abstract class FormatDecorator
extends FormatElement

This is the parent abstact class of the decorators.

Decorators represent an additional process to be applied to a formatted String, independently of which concrete format element has created it.

See Also:
Serialized Form

Field Summary
 FormatElement decorated
           
 
Fields inherited from class com.ibm.dse.base.FormatElement
dataElementName, name
 
Constructor Summary
FormatDecorator()
           
 
Method Summary
abstract  java.lang.String addDecoration(java.lang.String aString)
          AddDecoration abstract method.
 java.lang.String[] extract(java.lang.String aString)
          Overrides the extract() method of FormatElement to redirect the extract() method to the decorated String.
 java.lang.String format(Context aContext)
          Calls the addDecoration() method and passing it the String requiring the decoration operation.
 java.lang.String format(DataElement aDataElement)
          Calls the addDecoration() method and passing it the String requiring the decoration operation.
 java.lang.String getDataElementName()
          Returns the dataElementName of decorated String.
 FormatElement getDecorated()
          Returns the decorated FormatElement.
 java.lang.String getName()
          Returns the value of name.
 java.lang.Boolean isConstant()
          Returns true if the String is a constant formatted String.
abstract  java.lang.String removeDecoration(java.lang.String aString)
          RemoveDecoration abstract method.
 FormatElement rootDecorated()
          Returns the FormatElement decorated using this decorator even if other docorators exist.
 FormatDecorator rootDecorator()
          Returns the decorator that is currently formatting the FormatElement.
 void setDecorated(FormatElement aFormatElement)
          Sets the value of decorated.
 java.lang.String toString()
          Returns a visual representation of this decorator.
abstract  Vector toStrings()
          Returns a Vector containing a visual representation of the format.
 DataElement unformat(java.lang.String aString, Context aContext)
          Calls the removeDecoration() method and then unformats the String.
 DataElement unformat(java.lang.String aString, DataElement aDataElement)
          Calls the removeDecoration() method and then unformats the String.
 
Methods inherited from class com.ibm.dse.base.FormatElement
exceptionInfo, externalizer, format, getExternalizer, getTagName, initializeFrom, isCacheable, readExternal, readExternal, readObject, reinitialize, removeExternal, setDataElementName, setExternalizer, setName, setSize, toTags, unformat, writeExternal, writeExternal
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

decorated

public FormatElement decorated
Constructor Detail

FormatDecorator

public FormatDecorator()
Method Detail

addDecoration

public abstract java.lang.String addDecoration(java.lang.String aString)
                                        throws DSEInvalidArgumentException
AddDecoration abstract method.

extract

public java.lang.String[] extract(java.lang.String aString)
                           throws DSEInvalidArgumentException
Overrides the extract() method of FormatElement to redirect the extract() method to the decorated String.
Overrides:
extract in class FormatElement
Parameters:
aString - String
Returns:
java.lang.String[]

format

public java.lang.String format(Context aContext)
                        throws DSEInvalidClassException,
                               DSEInvalidRequestException,
                               DSEInvalidArgumentException
Calls the addDecoration() method and passing it the String requiring the decoration operation.
Overrides:
format in class FormatElement
Parameters:
aContext - com.ibm.dse.base.Context
Returns:
java.lang.String

format

public java.lang.String format(DataElement aDataElement)
                        throws DSEInvalidClassException,
                               DSEInvalidRequestException,
                               DSEInvalidArgumentException
Calls the addDecoration() method and passing it the String requiring the decoration operation. The String is obtained from the DataElement.
Overrides:
format in class FormatElement
Parameters:
aDataElement - com.ibm.dse.base.DataElement
Returns:
java.lang.String

getDataElementName

public java.lang.String getDataElementName()
Returns the dataElementName of decorated String. Overrides the method of FormatElement.
Overrides:
getDataElementName in class FormatElement
Returns:
java.lang.String

getDecorated

public FormatElement getDecorated()
Returns the decorated FormatElement.
Returns:
FormatElement

getName

public java.lang.String getName()
Returns the value of name.
Overrides:
getName in class FormatElement
Returns:
java.lang.String

isConstant

public java.lang.Boolean isConstant()
Returns true if the String is a constant formatted String.
Overrides:
isConstant in class FormatElement
Returns:
Boolean

removeDecoration

public abstract java.lang.String removeDecoration(java.lang.String aString)
                                           throws DSEInvalidArgumentException
RemoveDecoration abstract method.
Parameters:
aString - String
Returns:
java.lang.String

rootDecorated

public FormatElement rootDecorated()
Returns the FormatElement decorated using this decorator even if other docorators exist.
Overrides:
rootDecorated in class FormatElement
Returns:
FormatElement

rootDecorator

public FormatDecorator rootDecorator()
Returns the decorator that is currently formatting the FormatElement.
Returns:
FormatDecorator

setDecorated

public void setDecorated(FormatElement aFormatElement)
Sets the value of decorated.
Parameters:
aFormatElement - FormatElement

toString

public java.lang.String toString()
Returns a visual representation of this decorator.
Overrides:
toString in class FormatElement
Returns:
java.lang.String

toStrings

public abstract Vector toStrings()
Returns a Vector containing a visual representation of the format.
Overrides:
toStrings in class FormatElement
Returns:
java.lang.String

unformat

public DataElement unformat(java.lang.String aString,
                            Context aContext)
                     throws DSEInvalidRequestException,
                            DSEInvalidArgumentException
Calls the removeDecoration() method and then unformats the String.
Overrides:
unformat in class FormatElement
Parameters:
aString - java.lang.String
aContext - com.ibm.dse.base.Context
Returns:
com.ibm.dse.base.DataElement

unformat

public DataElement unformat(java.lang.String aString,
                            DataElement aDataElement)
                     throws DSEInvalidRequestException,
                            DSEInvalidArgumentException
Calls the removeDecoration() method and then unformats the String.
Overrides:
unformat in class FormatElement
Parameters:
aString - java.lang.String
aDataElement - com.ibm.dse.base.DataElement
Returns:
com.ibm.dse.base.DataElement