protected java.lang.String |
escape(java.lang.String msg)
Methods inherited from class com.ibm.btt.base.KeyedCollectionFormat |
add, addElementAt, addFirst, at, checkIndexes, format, getDataElementEmpty, getElements, getEnumeration, reinitialize, removeAll, removeAt, setElements, size, unformat, unformat |
Methods inherited from class com.ibm.btt.base.FormatElement |
exceptionInfo, externalizer, getDataElementName, getExternalizer, getName, getTagName, isCacheable, isConstant, isItConstant, isNull, readExternal, readExternal, readObject, removeExternal, rootDecorated, setDataElementName, setExternalizer, setName, setSize, toTags, writeExternal, writeExternal |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
includeDataType
protected java.lang.String includeDataType
- includeDataType tag attribute. *
unNamed
protected java.lang.String unNamed
- unNamed tag attribute. *
escape
protected java.lang.String escape
XMLFormat
public XMLFormat()
- This constructor creates an XMLFormat object.
XMLFormat
public XMLFormat(java.lang.String aName)
throws java.io.IOException
- This constructor creates an XMLFormat object with a specified name.
- Parameters:
aName - java.lang.String
- Throws:
java.io.IOException
extract
public java.lang.String[] extract(java.lang.String aString)
throws DSEInvalidArgumentException
- Extracts a String taking the substring in which the format is interested.
- Overrides:
extract in class RecordFormat
- Parameters:
aString - java.lang.String - A string which contains formated strings
- Returns:
- String[] - The first element is the part of the provided string
that is able to unformat and the second is the rest of the
provided string
- Throws:
DSEInvalidArgumentException
extractElement
public java.lang.String[] extractElement(java.lang.String elementName,
java.lang.String aString)
- Extracts from aString the element named elementName.
- Parameters:
elementName - java.lang.StringaString - java.lang.String
- Returns:
- String[]
format
public java.lang.String format(Context aContext)
throws DSEInvalidClassException,
DSEInvalidRequestException,
DSEInvalidArgumentException
- Formats data elements getting them from the context.
- Overrides:
format in class KeyedCollectionFormat
- Parameters:
aContext - com.ibm.btt.base.Context
- Returns:
- java.lang.String
- Throws:
com.ibm.btt.base.DSEInvalidClassException.
com.ibm.btt.base.DSEInvalidRequestException,
DSEInvalidArgumentException
DSEInvalidClassException
DSEInvalidRequestException
format
public java.lang.String format(KeyedCollection aKeyedCollection)
throws DSEInvalidClassException,
DSEInvalidRequestException,
DSEInvalidArgumentException
- Formats data elements, getting them from the collection passes as a
parameter.
- Parameters:
aKeyedCollection - com.ibm.btt.base.KeyedCollection
- Returns:
- java.lang.String
- Throws:
com.ibm.btt.base.DSEInvalidClassException.
com.ibm.btt.base.DSEInvalidRequestException,
DSEInvalidArgumentException
DSEInvalidClassException
DSEInvalidRequestException
formatAsXML
public java.lang.String formatAsXML(DataElement aDataElement,
FormatElement aFormatElement)
- Formats aDataElement to an XML-compliant format.
- Parameters:
aDataElement - com.ibm.btt.base.DataElementaFormatElement - com.ibm.btt.base.FormatElement
- Returns:
- java.lang.String
formatContext
public java.lang.String formatContext(Context aContext)
throws DSEInvalidClassException,
DSEInvalidRequestException,
DSEInvalidArgumentException
- This method performs the format seeking the elements to format around the
context tree of the context passed as parameter.
- Overrides:
formatContext in class RecordFormat
- Parameters:
aContext - com.ibm.btt.base.Context
- Returns:
- java.lang.String
- Throws:
DSEInvalidClassException
DSEInvalidRequestException
DSEInvalidArgumentException
formatKeyedCollection
public java.lang.String formatKeyedCollection(KeyedCollection aKeyedCollection)
throws DSEInvalidClassException,
DSEInvalidRequestException,
DSEInvalidArgumentException
- This method performs the format seeking the elements to format around the
keyedCollection passed as parameter.
- Overrides:
formatKeyedCollection in class RecordFormat
- Parameters:
aKeyedCollection - com.ibm.btt.base.KeyedCollection
- Returns:
- java.lang.String
- Throws:
DSEInvalidClassException
DSEInvalidRequestException
DSEInvalidArgumentException
getIncludeDataType
public java.lang.String getIncludeDataType()
- Gets the includeDataType property value.
- Returns:
- The includeDataType property value.
- See Also:
setIncludeDataType(java.lang.String)
getPostTag
protected java.lang.String getPostTag(java.lang.String aName)
- Returns the tag that follows each DataElement.
- Parameters:
aName - java.lang.String
- Returns:
- java.lang.String
getPreTag
protected java.lang.String getPreTag(java.lang.String aName)
- Returns the tag that preceeds each DataElement.
- Parameters:
aName - java.lang.String
- Returns:
- java.lang.String
getPreTag
protected java.lang.String getPreTag(java.lang.String aName,
java.lang.String aType)
- Returns the tag already built.
- Parameters:
aName - StringaType - String
getType
protected java.lang.String getType(FormatElement aFormatElement)
- Returns the type of the DataElement referenced in the FormatElement
- Parameters:
aFormatElement - com.ibm.btt.base.FormatElement
- Returns:
- java.lang.String
getUnNamed
public java.lang.String getUnNamed()
- Returns the value of the unNamed property.
- Returns:
- java.lang.String - The current value of unNamed
getEscape
public java.lang.String getEscape()
initializeFrom
public java.lang.Object initializeFrom(Tag aTag)
throws java.io.IOException
- Initializes an XMLFormat with the aTag attributes.
- Overrides:
initializeFrom in class RecordFormat
- Parameters:
aTag - com.ibm.btt.base.Tag
- Returns:
- java.lang.Object
- Throws:
java.io.IOException
isIncludeDataType
public boolean isIncludeDataType()
- Returns the boolean value of the includeDataType property.
- Returns:
- boolean.
- See Also:
getIncludeDataType() ,
setIncludeDataType(java.lang.String)
isUnNamed
public boolean isUnNamed()
- Returns the boolean value of the unNamed property.
- Returns:
- boolean.
- See Also:
getUnNamed() ,
setUnNamed(java.lang.String)
isEscape
public boolean isEscape()
- Check whether the formatter are required to escape the format result or
unescape the input string before unformatting.
- Returns:
- boolean
setIncludeDataType
public void setIncludeDataType(java.lang.String aString)
- Sets the includeDataType property (String) value.
- Parameters:
aString - java.lang.String - The includeDataType property value- See Also:
getIncludeDataType()
setUnNamed
public void setUnNamed(java.lang.String newUnNamed)
- Sets the value of the unNamed property.
- Parameters:
newUnNamed - java.lang.String - The new value of the property
setEscape
public void setEscape(java.lang.String newEscape)
toStrings
public Vector toStrings()
- Description copied from class:
FormatElement
- Returns a visual representation of this format element.
- Overrides:
toStrings in class RecordFormat
- Returns:
- Tag[]
- See Also:
RecordFormat.toStrings()
unformatContext
public DataElement unformatContext(java.lang.String aString,
Context aContext)
throws DSEInvalidRequestException,
DSEInvalidArgumentException
- Unformats an XMLFormat updating data elements in the context.
- Overrides:
unformatContext in class RecordFormat
- Parameters:
aString - java.lang.StringaContext - com.ibm.btt.base.Context
- Returns:
- com.ibm.btt.base.DataElement
- Throws:
com.ibm.btt.base.DSEInvalidRequestException.
com.ibm.btt.base.DSEInvalidArgumentException.
DSEInvalidRequestException
DSEInvalidArgumentException
unformatKeyedCollection
public KeyedCollection unformatKeyedCollection(java.lang.String aString,
KeyedCollection aKeyedCollection)
throws DSEInvalidRequestException,
DSEInvalidArgumentException
- Unformats an XMLFormat updating data elements in the collection passed as
a parameter.
- Overrides:
unformatKeyedCollection in class RecordFormat
- Parameters:
aString - java.lang.StringaKeyedCollection - com.ibm.btt.base.KeyedCollection
- Returns:
- com.ibm.btt.base.KeyedCollection
- Throws:
com.ibm.btt.base.DSEInvalidRequestException,
DSEInvalidArgumentException
DSEInvalidRequestException
unformatXML
public void unformatXML(java.lang.String aString,
DataElement aDataElement,
FormatElement aFormatElement)
throws DSEInvalidRequestException,
DSEInvalidArgumentException,
DSEObjectNotFoundException
- This method unformats a String XML compliant format in aDataElement.
- Parameters:
aString - java.lang.StringaDataElement - com.ibm.btt.base.DataElementaFormatElement - com.ibm.btt.base.FormatElement
- Throws:
com.ibm.btt.base.DSEInvalidRequestException,
DSEInvalidArgumentException
DSEObjectNotFoundException
DSEInvalidRequestException
unformat
public int unformat(int ndxFrom,
int ndxTo,
java.lang.String str,
DataElement de)
throws DSEInvalidRequestException,
DSEInvalidArgumentException
- Verifies that the passed DataElement is an KeyedCollection and calls
unformatKeyedCollection().
- Overrides:
unformat in class RecordFormat
- Parameters:
ndxFrom - -
the initial indexndxTo - -
the final indexstr - Stringde - DataElement
- Returns:
- int
- Throws:
DSEInvalidRequestException
DSEInvalidArgumentException
unformatKeyedCollection
public int unformatKeyedCollection(int ndxFrom,
int ndxTo,
java.lang.String aString,
KeyedCollection aKeyedCollection)
throws DSEInvalidRequestException,
DSEInvalidArgumentException
- Unformats an XMLFormat updating data elements in the collection passed as
a parameter.
- Parameters:
ndxFrom - -
the initial indexndxTo - -
the final indexaString - java.lang.StringaKeyedCollection - com.ibm.btt.base.Context
- Returns:
- int
- Throws:
DSEInvalidRequestException
DSEInvalidArgumentException
unformat
public int unformat(int ndxFrom,
int ndxTo,
java.lang.String aString,
Context aContext)
throws DSEInvalidRequestException,
DSEInvalidArgumentException
- Unformats an XMLFormat updating data elements in the context.
- Overrides:
unformat in class RecordFormat
- Parameters:
ndxFrom - -
the initial indexndxTo - -
the final indexaString - java.lang.StringaContext - com.ibm.btt.base.Context
- Returns:
- int
- Throws:
com.ibm.btt.base.DSEInvalidRequestException.
com.ibm.btt.base.DSEInvalidArgumentException.
DSEInvalidRequestException
DSEInvalidArgumentException
getNdxFrom
protected int getNdxFrom(int ndxFrom,
java.lang.String elementName,
java.lang.String aString)
- get initial index
getNdxTo
protected int getNdxTo(int ndxFrom,
java.lang.String elementName,
java.lang.String aString)
- get end index
unformatXML
public int unformatXML(int ndxFrom,
int ndxTo,
java.lang.String aString,
DataElement aDataElement,
FormatElement aFormatElement)
throws DSEInvalidRequestException,
DSEInvalidArgumentException,
DSEObjectNotFoundException
- This method unformats a String XML compliant format in aDataElement.
- Parameters:
ndxFrom - -
the initial indexndxTo - -
the final indexString - aStringaDataElement - com.ibm.btt.base.DataElementaFormatElement - com.ibm.btt.base.FormatElement
- Returns:
- java.lang.String
- Throws:
com.ibm.btt.base.DSEInvalidRequestException,
DSEInvalidArgumentException
DSEObjectNotFoundException
DSEInvalidRequestException
escape
protected java.lang.String escape(java.lang.String msg)
unescape
protected java.lang.String unescape(java.lang.String msg)
- Replace special characters with XML escapes:
- Parameters:
string - The string to be escaped.
- Returns:
- The escaped string.
- Throws:
java.io.UnsupportedEncodingException
(c) Copyright IBM Corporation 1998, 2009
|