com.ibm.dse.services.formsprint
Class FormsStringFormat

java.lang.Object
  |
  +--com.ibm.dse.base.FormatElement
        |
        +--com.ibm.dse.base.FieldFormat
              |
              +--com.ibm.dse.base.StringFormat
                    |
                    +--com.ibm.dse.services.formsprint.FormsStringFormat

public class FormsStringFormat
extends StringFormat

The FormatStringFormat class is an extension of the StringFormat used by the FormsRecordFormat to format simple fields.

See Also:
Serialized Form

Fields inherited from class com.ibm.dse.base.StringFormat
formatAs, unformatAs
 
Fields inherited from class com.ibm.dse.base.FormatElement
dataElementName, name
 
Constructor Summary
FormsStringFormat()
          This constructor creates a FormsStringFormat object.
FormsStringFormat(java.lang.String aName)
          This constructor creates a FormsStringFormat object.
 
Method Summary
 java.lang.String[] extract(java.lang.String aString)
          Called by the unformat() method of collections formats (RecordFormat, IndexedCollectionFormat etc.).
 java.lang.String formatField(DataField aDataField)
          Formats the string of aDataField, which must be an instance of com.ibm.dse.services.formsprint.DataField.
 void setCommandField(java.lang.String aCommandField)
          Sets the value for the commandField attribute.
 void setCommandGlobal(java.lang.String aCommandGlobal)
          Sets the value for the commandGlobal attribute.
 void setCommandPrompt(java.lang.String aCommandPrompt)
          Sets the value for the commandPrompt attribute.
 void setInBetweenSeparator(java.lang.String separator)
          Sets the value for the separateNameAndValue attribute.
 DataField unformatField(java.lang.String aString, DataField aDataField)
          Unformats aString extracting the aditional information added in the format process and updates the value of aDataField.
 
Methods inherited from class com.ibm.dse.base.StringFormat
getFormatAs, getUnformatAs, initializeFrom, setFormatAs, setUnformatAs, toString
 
Methods inherited from class com.ibm.dse.base.FieldFormat
format, format, unformat, unformat
 
Methods inherited from class com.ibm.dse.base.FormatElement
exceptionInfo, externalizer, format, getDataElementName, getExternalizer, getName, getTagName, isCacheable, isConstant, readExternal, readExternal, readObject, reinitialize, removeExternal, rootDecorated, setDataElementName, setExternalizer, setName, setSize, toStrings, toTags, unformat, writeExternal, writeExternal
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

FormsStringFormat

public FormsStringFormat()
This constructor creates a FormsStringFormat object.

FormsStringFormat

public FormsStringFormat(java.lang.String aName)
                  throws java.io.IOException
This constructor creates a FormsStringFormat object.
Parameters:
aName - java.lang.String, the value for the name attribute of FormatElement
Throws:
java.io.IOException -  
Method Detail

extract

public java.lang.String[] extract(java.lang.String aString)
                           throws DSEInvalidArgumentException
Called by the unformat() method of collections formats (RecordFormat, IndexedCollectionFormat etc.). Each format element must select (extract), from the provided string, the part that it is able to unformat.
Overrides:
extract in class FormatElement
Parameters:
String - aString, a string which contains formated strings
Returns:
String[] - the first element is the part of the provided string that the format is able to unformat and the second is the rest of the provided string
Throws:
DSEInvalidArgumentException -  

formatField

public java.lang.String formatField(DataField aDataField)
                             throws DSEInvalidClassException
Formats the string of aDataField, which must be an instance of com.ibm.dse.services.formsprint.DataField. Appends: a new line, the command prompt, the command type, a white space, the name of DataField, the name-value delimiter and the value of the field.
Overrides:
formatField in class StringFormat
Parameters:
aDataField - DataField, the DataField to format
Returns:
java.lang.String - the formated string
Throws:
DSEInvalidClassException -  

setCommandField

public void setCommandField(java.lang.String aCommandField)
Sets the value for the commandField attribute.
Parameters:
aCommandField - java.lang.String, the commandField value

setCommandGlobal

public void setCommandGlobal(java.lang.String aCommandGlobal)
Sets the value for the commandGlobal attribute.
Parameters:
aCommandGlobal - java.lang.String, the commandGlobal value

setCommandPrompt

public void setCommandPrompt(java.lang.String aCommandPrompt)
Sets the value for the commandPrompt attribute.
Parameters:
aCommandPrompt - java.lang.String, the commandPrompt value

setInBetweenSeparator

public void setInBetweenSeparator(java.lang.String separator)
Sets the value for the separateNameAndValue attribute.
Parameters:
separator - java.lang.String, the separateNameAndValue value

unformatField

public DataField unformatField(java.lang.String aString,
                               DataField aDataField)
Unformats aString extracting the aditional information added in the format process and updates the value of aDataField.
Overrides:
unformatField in class StringFormat
Parameters:
aString - java.lang.String, the formated string
aDataField - com.ibm.dse.base.DataField, the DataField to update
Returns:
com.ibm.dse.base.DataField - the updated DataField