|
||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object org.openptk.structure.Converter
public abstract class Converter
The abstract base class for a Converter. Provides core method implementations.
Field Summary | |
---|---|
protected static java.lang.String |
GT
|
protected static java.lang.String |
GTE
|
protected static java.lang.String |
KEYVALUE
|
protected static java.lang.String |
LT
|
protected static java.lang.String |
LTE
|
protected static java.lang.String |
NEWLINE
|
protected static java.lang.String |
PAD
|
protected static java.lang.String |
QUOTE
|
protected static java.lang.String |
SEPARATOR
|
Fields inherited from interface org.openptk.structure.ConverterIF |
---|
PROP_CHILDREN, PROP_NAMEVALUE, PROP_VALUE, VALUE_CHILDREN_DISCRETE, VALUE_CHILDREN_LIST, VALUE_NAMEVALUE_COLLAPSED, VALUE_NAMEVALUE_EXPANDED, VALUE_VALUE_MULTI, VALUE_VALUE_SINGLE |
Constructor Summary | |
---|---|
Converter(ConverterType type)
Create a new Converter, set specified Type. |
Method Summary | |
---|---|
StructureIF |
decode(java.lang.String string)
Convert the String of encoded data into a StructureIF object. |
java.lang.String |
encode(StructureIF struct)
Convert the Structure into a formated String. |
ElementIF |
getStructInfo(java.lang.String structId)
Get Structure Information using provided Id. |
java.lang.String[] |
getStructInfoIds()
Return Array of Structure Information Ids. |
protected java.lang.String |
getStructProperty(java.lang.String structName,
java.lang.String propName)
Get a property value from Structure Information. |
ConverterType |
getType()
Return the Converter's Type. |
protected void |
handleError(java.lang.String msg)
Standard error handling method. |
protected java.lang.String |
pad(int qty,
java.lang.String chars)
Returns a String built by repeating the String. |
void |
setStructInfo(java.lang.String structId,
ElementIF element)
Set Structure Information using the provided Id. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
protected static java.lang.String GT
protected static java.lang.String GTE
protected static java.lang.String KEYVALUE
protected static java.lang.String LT
protected static java.lang.String LTE
protected static java.lang.String NEWLINE
protected static java.lang.String PAD
protected static java.lang.String QUOTE
protected static java.lang.String SEPARATOR
Constructor Detail |
---|
public Converter(ConverterType type)
type
- ConverterTypeMethod Detail |
---|
public StructureIF decode(java.lang.String string) throws ConverterException
decode
in interface ConverterIF
string
- Encoded representation of the data
ConverterException
public java.lang.String encode(StructureIF struct) throws ConverterException
encode
in interface ConverterIF
struct
- StructureIF of data
ConverterException
public final ElementIF getStructInfo(java.lang.String structId)
getStructInfo
in interface ConverterIF
structId
- Structure Information Id
public final java.lang.String[] getStructInfoIds()
getStructInfoIds
in interface ConverterIF
protected final java.lang.String getStructProperty(java.lang.String structName, java.lang.String propName)
structName
- Structure namepropName
- Property name
public final ConverterType getType()
getType
in interface ConverterIF
protected final void handleError(java.lang.String msg) throws ConverterException
msg
- String message containing what happened.
ConverterException
protected final java.lang.String pad(int qty, java.lang.String chars)
qty
- number of times to repeat the Stringchars
- String to repeat
public final void setStructInfo(java.lang.String structId, ElementIF element)
setStructInfo
in interface ConverterIF
structId
- Structure Information Idelement
- Structure Information
|
||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |