|
IBM WebSphere Multichannel Bank Transformation Toolkit Javadoc | |||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectcom.ibm.btt.base.FormatElement
com.ibm.btt.base.KeyedCollectionFormat
com.ibm.btt.base.RecordFormat
com.ibm.btt.base.JSONFormat
public class JSONFormat
This class formats a KeyedCollection to an JSON-compliant format.
Field Summary | |
---|---|
protected java.lang.String |
escape
|
protected java.lang.String |
unNamed
unNamed tag attribute |
Fields inherited from class com.ibm.btt.base.KeyedCollectionFormat |
---|
dataElementEmpty, elements |
Fields inherited from class com.ibm.btt.base.FormatElement |
---|
dataElementName, externalizer, name |
Constructor Summary | |
---|---|
JSONFormat()
This constructor creates an JSONFormat object. |
|
JSONFormat(java.lang.String aName)
This constructor creates an JSONFormat object with a specified name. |
Method Summary | |
---|---|
protected java.lang.String |
escape(java.lang.String msg)
" => \" , \ => \\ |
java.lang.String[] |
extract(java.lang.String aString)
Extracts a String taking the substring in which the format is interested. |
protected static java.lang.String[] |
extractElement(java.lang.String aString)
Extracts from aString the element named elementName. |
java.lang.String |
format(Context aContext)
Formats data elements getting them from the context. |
java.lang.String |
format(KeyedCollection aKeyedCollection)
Formats data elements, getting them from the collection passes as a parameter. |
java.lang.String |
formatAsJSON(DataElement aDataElement,
FormatElement aFormatElement)
Formats aDataElement to an JSON-compliant format. |
java.lang.String |
formatContext(Context aContext)
This method performs the format seeking the elements to format around the context tree of the context passed as parameter. |
java.lang.String |
formatKeyedCollection(KeyedCollection aKeyedCollection)
This method performs the format seeking the elements to format around the keyedCollection passed as parameter. |
protected static int |
getArrayTagEndIndex(java.lang.String str)
|
java.lang.String |
getEscape()
|
protected static int |
getFirstColon(java.lang.String str)
|
protected static int |
getFirstComma(java.lang.String str)
|
protected static java.lang.String |
getNameFromJSONStr(java.lang.String str)
|
protected static int |
getObjectTagEndIndex(java.lang.String str)
|
java.lang.String |
getUnNamed()
Returns the value of the unNamed property. |
java.lang.Object |
initializeFrom(Tag aTag)
Initializes an JSONFormat with the aTag attributes. |
boolean |
isEscape()
Check whether the format are required to escape the format result or unescape the input string before unformat. |
boolean |
isUnNamed()
Returns the boolean value of the unNamed property. |
protected static java.lang.String |
removeFirstComma(java.lang.String str)
|
protected static java.lang.String |
removeSurround(java.lang.String str,
java.lang.String preStr,
java.lang.String postStr)
|
void |
setEscape(java.lang.String newEscape)
Sets the value of the escape property. |
void |
setUnNamed(java.lang.String newUnNamed)
Sets the value of the unNamed property. |
Vector |
toStrings()
Returns a visual representation of this format element. |
protected java.lang.String |
unescape(java.lang.String msg)
|
int |
unformat(int ndxFrom,
int ndxTo,
java.lang.String aString,
Context aContext)
The method is not implemented for the JSON Format. |
int |
unformat(int ndxFrom,
int ndxTo,
java.lang.String str,
DataElement de)
The method is not implemented for the JSON Format. |
DataElement |
unformatContext(java.lang.String aString,
Context aContext)
Unformats an JSONFormat updating data elements in the context. |
void |
unformatJSON(java.lang.String aString,
DataElement aDataElement,
FormatElement aFormatElement)
This method unformats a String JSON compliant format in aDataElement. |
KeyedCollection |
unformatKeyedCollection(java.lang.String aString,
KeyedCollection aKeyedCollection)
Unformats an JSONFormat updating data elements in the collection passed as a parameter. |
Methods inherited from class com.ibm.btt.base.RecordFormat |
---|
obtainDataElement, obtainDataElement, toString |
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 |
Field Detail |
---|
protected java.lang.String unNamed
protected java.lang.String escape
Constructor Detail |
---|
public JSONFormat()
public JSONFormat(java.lang.String aName) throws java.io.IOException
aName
- java.lang.String
java.io.IOException
Method Detail |
---|
public java.lang.String[] extract(java.lang.String aString) throws DSEInvalidArgumentException
extract
in class RecordFormat
aString
- java.lang.String - A string which contains formated strings
DSEInvalidArgumentException
protected static java.lang.String removeSurround(java.lang.String str, java.lang.String preStr, java.lang.String postStr)
protected static int getFirstComma(java.lang.String str)
protected static int getFirstColon(java.lang.String str)
protected static java.lang.String removeFirstComma(java.lang.String str)
protected java.lang.String escape(java.lang.String msg)
str
-
UnsupportedEncodingException
protected java.lang.String unescape(java.lang.String msg)
protected static java.lang.String getNameFromJSONStr(java.lang.String str)
protected static int getArrayTagEndIndex(java.lang.String str)
protected static int getObjectTagEndIndex(java.lang.String str)
protected static java.lang.String[] extractElement(java.lang.String aString) throws DSEInvalidArgumentException
elementName
- java.lang.StringaString
- java.lang.String
DSEInvalidArgumentException
public java.lang.String format(Context aContext) throws DSEInvalidClassException, DSEInvalidRequestException, DSEInvalidArgumentException
format
in class KeyedCollectionFormat
aContext
- com.ibm.btt.base.Context
com.ibm.btt.base.DSEInvalidClassException.
com.ibm.btt.base.DSEInvalidRequestException,
DSEInvalidArgumentException
DSEInvalidClassException
DSEInvalidRequestException
public java.lang.String format(KeyedCollection aKeyedCollection) throws DSEInvalidClassException, DSEInvalidRequestException, DSEInvalidArgumentException
aKeyedCollection
- com.ibm.btt.base.KeyedCollection
com.ibm.btt.base.DSEInvalidClassException.
com.ibm.btt.base.DSEInvalidRequestException,
DSEInvalidArgumentException
DSEInvalidClassException
DSEInvalidRequestException
public java.lang.String formatAsJSON(DataElement aDataElement, FormatElement aFormatElement)
aDataElement
- com.ibm.btt.base.DataElementaFormatElement
- com.ibm.btt.base.FormatElement
public java.lang.String formatContext(Context aContext) throws DSEInvalidClassException, DSEInvalidRequestException, DSEInvalidArgumentException
formatContext
in class RecordFormat
aContext
- com.ibm.btt.base.Context
DSEInvalidClassException
DSEInvalidRequestException
DSEInvalidArgumentException
public java.lang.String formatKeyedCollection(KeyedCollection aKeyedCollection) throws DSEInvalidClassException, DSEInvalidRequestException, DSEInvalidArgumentException
formatKeyedCollection
in class RecordFormat
aKeyedCollection
- com.ibm.btt.base.KeyedCollection
DSEInvalidClassException
DSEInvalidRequestException
DSEInvalidArgumentException
public java.lang.String getUnNamed()
public java.lang.String getEscape()
public java.lang.Object initializeFrom(Tag aTag) throws java.io.IOException
initializeFrom
in class RecordFormat
aTag
- com.ibm.btt.base.Tag
java.io.IOException
public boolean isUnNamed()
public boolean isEscape()
public void setUnNamed(java.lang.String newUnNamed)
newUnNamed
- java.lang.String - The new value of the propertypublic void setEscape(java.lang.String newEscape)
newEscape
- java.lang.Stringpublic Vector toStrings()
FormatElement
toStrings
in class RecordFormat
public DataElement unformatContext(java.lang.String aString, Context aContext) throws DSEInvalidRequestException, DSEInvalidArgumentException
unformatContext
in class RecordFormat
aString
- java.lang.StringaContext
- com.ibm.btt.base.Context
com.ibm.btt.base.DSEInvalidRequestException.
com.ibm.btt.base.DSEInvalidArgumentException.
DSEInvalidRequestException
DSEInvalidArgumentException
public KeyedCollection unformatKeyedCollection(java.lang.String aString, KeyedCollection aKeyedCollection) throws DSEInvalidRequestException, DSEInvalidArgumentException
unformatKeyedCollection
in class RecordFormat
aString
- java.lang.StringaKeyedCollection
- com.ibm.btt.base.KeyedCollection
com.ibm.btt.base.DSEInvalidRequestException,
DSEInvalidArgumentException
DSEInvalidRequestException
public void unformatJSON(java.lang.String aString, DataElement aDataElement, FormatElement aFormatElement) throws DSEInvalidRequestException, DSEInvalidArgumentException, DSEObjectNotFoundException
aString
- java.lang.StringaDataElement
- com.ibm.btt.base.DataElementaFormatElement
- com.ibm.btt.base.FormatElement
com.ibm.btt.base.DSEInvalidRequestException,
DSEInvalidArgumentException
DSEObjectNotFoundException
DSEInvalidRequestException
public int unformat(int ndxFrom, int ndxTo, java.lang.String str, DataElement de) throws DSEInvalidRequestException, DSEInvalidArgumentException
unformat
in class RecordFormat
ndxFrom
- - the initial indexndxTo
- - the final indexstr
- java.lang.Stringde
- com.ibm.btt.base.KeyedCollection
DSEInvalidRequestException
DSEInvalidArgumentException
RecordFormat.unformat(int, int, java.lang.String,
com.ibm.btt.base.DataElement)
public int unformat(int ndxFrom, int ndxTo, java.lang.String aString, Context aContext) throws DSEInvalidRequestException, DSEInvalidArgumentException
unformat
in class RecordFormat
ndxFrom
- - the initial indexndxTo
- - the final indexaString
- java.lang.StringaContext
- com.ibm.btt.base.Context
DSEInvalidRequestException
DSEInvalidArgumentException
RecordFormat.unformat(int, int, java.lang.String,
com.ibm.btt.base.Context)
|
IBM WebSphere Multichannel Bank Transformation Toolkit Javadoc | |||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |