|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objecthmi.xml.XMLStructureAdapter
public class XMLStructureAdapter
XMLStructureAdapter is an implementation of XMLStructure that is intended to be a base class that must be extended. There are two different approaches: The FIRST APPROACH is to re-implement the methods
| Field Summary | |
|---|---|
static String |
ATTRIBUTE_TOKEN_DELIMITERS
|
static String |
COMMA_SEPARATOR
|
private static boolean |
consoleAttributeEnabled
|
static int |
DECODEDARRAYSIZE
|
static boolean |
DEFAULT_RECOVER_MODE
The default-default recovery mode. |
private static Logger |
logger
|
private static StringBuilder |
lotsOfSpaces
|
private static String |
NAMESPACE
|
private static String |
NamespaceLabel
|
static String |
NEWLINE
|
private boolean |
recover
|
private static boolean |
recoverMode
|
static String |
SYSTEMNEWLINE
|
static int |
TAB
|
static String |
TAB_STRING
|
private int |
tagLine
|
private static String |
XMLTAG
|
| Constructor Summary | |
|---|---|
XMLStructureAdapter()
|
|
| Method Summary | ||
|---|---|---|
static StringBuilder |
appendAttribute(StringBuilder buf,
String attrName,
boolean boolValue)
appends an attribute of the form name="value" |
|
static StringBuilder |
appendAttribute(StringBuilder buf,
String attrName,
boolean[] bools,
char separator,
XMLFormatting fmt,
int nrElementsPerLine)
appends an attribute of the form name="value0 value1 |
|
static StringBuilder |
appendAttribute(StringBuilder buf,
String attrName,
boolean boolValue1,
boolean boolValue2)
appends an attribute of the form name="value1 value2" |
|
static StringBuilder |
appendAttribute(StringBuilder buf,
String attrName,
boolean boolValue1,
boolean boolValue2,
boolean boolValue3)
appends an attribute of the form name="value1 value2 value3" |
|
static StringBuilder |
appendAttribute(StringBuilder buf,
String attrName,
boolean boolValue1,
boolean boolValue2,
boolean boolValue3,
boolean boolValue4)
appends an attribute of the form name="value1 value2 value3 value4" |
|
static StringBuilder |
appendAttribute(StringBuilder buf,
String attrName,
double doubleValue)
appends an attribute of the form name="value" |
|
static StringBuilder |
appendAttribute(StringBuilder buf,
String attrName,
double[] doubles,
char separator)
appends an attribute of the form name="valu0 value1 ....." |
|
static StringBuilder |
appendAttribute(StringBuilder buf,
String attrName,
double doubleValue1,
double doubleValue2)
appends an attribute of the form name="value1 value2" |
|
static StringBuilder |
appendAttribute(StringBuilder buf,
String attrName,
double doubleValue1,
double doubleValue2,
double doubleValue3)
appends an attribute of the form name="value1 value2 value3" |
|
static StringBuilder |
appendAttribute(StringBuilder buf,
String attrName,
double doubleValue1,
double doubleValue2,
double doubleValue3,
double doubleValue4)
appends an attribute of the form name="value1 value2 value3 value4" |
|
static StringBuilder |
appendAttribute(StringBuilder buf,
String attrName,
float floatValue)
appends an attribute of the form name="value" |
|
static StringBuilder |
appendAttribute(StringBuilder buf,
String attrName,
float[] floats,
char separator)
appends an attribute of the form name="value0 value1 ....." |
|
static StringBuilder |
appendAttribute(StringBuilder buf,
String attrName,
float[] floats,
char separator,
XMLFormatting fmt,
int nrElementsPerLine)
appends an attribute of the form name="value0 value1 |
|
static StringBuilder |
appendAttribute(StringBuilder buf,
String attrName,
float floatValue1,
float floatValue2)
appends an attribute of the form name="value1 value2" |
|
static StringBuilder |
appendAttribute(StringBuilder buf,
String attrName,
float floatValue1,
float floatValue2,
float floatValue3)
appends an attribute of the form name="value1 value2 value3" |
|
static StringBuilder |
appendAttribute(StringBuilder buf,
String attrName,
float floatValue1,
float floatValue2,
float floatValue3,
float floatValue4)
appends an attribute of the form name="value1 value2 value3 value4" |
|
static StringBuilder |
appendAttribute(StringBuilder buf,
String attrName,
int intValue)
appends an attribute of the form name="value". |
|
static StringBuilder |
appendAttribute(StringBuilder buf,
String attrName,
int[] ints,
char separator,
XMLFormatting fmt,
int nrElementsPerLine)
appends an attribute of the form name="valu0 value1 ....." |
|
static StringBuilder |
appendAttribute(StringBuilder buf,
String attrName,
int intValue1,
int intValue2)
appends an attribute of the form name="value1 value2" |
|
static StringBuilder |
appendAttribute(StringBuilder buf,
String attrName,
int intValue1,
int intValue2,
int intValue3)
appends an attribute of the form name="value1 value2 value3" |
|
static StringBuilder |
appendAttribute(StringBuilder buf,
String attrName,
int intValue1,
int intValue2,
int intValue3,
int intValue4)
appends an attribute of the form name="value1 value2 value3 value4" |
|
static StringBuilder |
appendAttribute(StringBuilder buf,
String attrName,
long longValue)
appends an attribute of the form name="value". |
|
static StringBuilder |
appendAttribute(StringBuilder buf,
String attrName,
long longValue1,
long longValue2)
appends an attribute of the form name="value1 value2". |
|
static StringBuilder |
appendAttribute(StringBuilder buf,
String attrName,
long longValue1,
long longValue2,
long longValue3)
appends an attribute of the form name="value1 value2 value3". |
|
static StringBuilder |
appendAttribute(StringBuilder buf,
String attrName,
long longValue1,
long longValue2,
long longValue3,
long longValue4)
appends an attribute of the form name="value1 value2 value3 value4". |
|
static StringBuilder |
appendAttribute(StringBuilder buf,
String attrName,
String attrValue)
This method appends a single XML style attribute to buf. |
|
static StringBuilder |
appendAttribute(StringBuilder buf,
String attrName,
String[] strings,
char separator,
XMLFormatting fmt,
int nrElementsPerLine)
appends an attribute of the form name="value0 value1 |
|
static StringBuilder |
appendAttribute(StringBuilder buf,
String attrName,
String attrValue1,
String attrValue2)
This method appends a single XML style attribute to buf. |
|
static StringBuilder |
appendAttribute(StringBuilder buf,
String attrName,
String attrValue1,
String attrValue2,
String attrValue3)
This method appends a single XML style attribute to buf. |
|
static StringBuilder |
appendAttribute(StringBuilder buf,
String attrName,
String attrValue1,
String attrValue2,
String attrValue3,
String attrValue4)
This method appends a single XML style attribute to buf. |
|
StringBuilder |
appendAttributes(StringBuilder buf)
|
|
static StringBuilder |
appendAttributes(StringBuilder buf,
HashMap attributes)
This method appends XML style tag attributes to buf. |
|
StringBuilder |
appendAttributeString(StringBuilder buf)
Appends a String to buf that encodes the attributes for the XML encoding. |
|
StringBuilder |
appendAttributeString(StringBuilder buf,
XMLFormatting fmt)
A special case of appendAttributeString that also takes a fmt parameter. |
|
static StringBuilder |
appendBooleans(StringBuilder buf,
boolean[] bools,
char separator,
XMLFormatting fmt,
int nrElementsPerLine)
appends an array of floats, with maxNrOfElements booleans at one line. |
|
static StringBuilder |
appendCloseEmptyTag(StringBuilder buf)
Appends /> |
|
static StringBuilder |
appendCloseSTag(StringBuilder buf)
Appends > (Closing an STag) |
|
static StringBuilder |
appendComment(StringBuilder buf,
String comment)
appends an XML comment string to buf, The string appended is of the form: <! |
|
StringBuilder |
appendContent(StringBuilder buf)
Appends a String to buf that encodes the contents for the XML encoding. |
|
StringBuilder |
appendContent(StringBuilder buf,
XMLFormatting fmt)
Appends a String to buf that encodes the contents for the XML encoding. |
|
static StringBuilder |
appendDoubleElement(StringBuilder buf,
String tagName,
double value,
XMLFormatting fmt)
appends an XML element of the form "tagName"value"/tagName" |
|
static StringBuilder |
appendEmptyTag(StringBuilder buf,
String tagName)
This method appends an "empty element" XML STag with specified tag name to buf. |
|
static StringBuilder |
appendEmptyTag(StringBuilder buf,
String tagName,
HashMap attributes)
This method appends an "empty element" XML STag with specified tag name to buf. |
|
static StringBuilder |
appendEmptyTag(StringBuilder buf,
XMLFormatting fmt,
String tagName,
HashMap attributes)
This method appends an "empty element" XML STag with specified tag name to buf. |
|
static StringBuilder |
appendEmptyTag(StringBuilder buf,
XMLFormatting fmt,
String tagName,
String attrName,
String attrValue)
This method appends an "empty element" XML STag with specified tag name to buf. |
|
static StringBuilder |
appendEmptyTag(StringBuilder buf,
XMLFormatting fmt,
String tagName,
String attrName1,
String attrValue1,
String attrName2,
String attrValue2)
This method appends an "empty element" XML STag with specified tag name to buf. |
|
static StringBuilder |
appendEmptyTag(StringBuilder buf,
XMLFormatting fmt,
String tagName,
String attrName1,
String attrValue1,
String attrName2,
String attrValue2,
String attrName3,
String attrValue3)
This method appends an "empty element" XML STag with specified tag name to buf. |
|
static StringBuilder |
appendETag(StringBuilder buf,
String tagName)
appends an XML ETag to buf |
|
static StringBuilder |
appendETag(StringBuilder buf,
String tagName,
XMLFormatting fmt)
appends an XML ETag to buf, on a new line, preceded by tab spaces. |
|
static StringBuilder |
appendFloatArrayElement(StringBuilder buf,
String tagName,
float[] values,
char separator,
XMLFormatting fmt,
int nrElementsPerLine)
appends an XML element of the form "tagName"value"/tagName" |
|
static StringBuilder |
appendFloatElement(StringBuilder buf,
String tagName,
float value,
XMLFormatting fmt)
appends an XML element of the form "tagName"value"/tagName" |
|
static StringBuilder |
appendFloats(StringBuilder buf,
float[] floats,
char separator,
XMLFormatting fmt,
int nrElementsPerLine)
appends an array of floats, with maxNrOfElements floats at one line. |
|
static StringBuilder |
appendIntArrayElement(StringBuilder buf,
String tagName,
int[] values,
char separator,
XMLFormatting fmt,
int nrElementsPerLine)
appends an XML element of the form "tagName"value"/tagName" |
|
static StringBuilder |
appendIntElement(StringBuilder buf,
String tagName,
int value,
XMLFormatting fmt)
appends an XML element of the form "tagName"value"/tagName" |
|
static StringBuilder |
appendInts(StringBuilder buf,
int[] ints,
char separator,
XMLFormatting fmt,
int nrElementsPerLine)
appends an array of ints, with maxNrOfElements ints at one line. |
|
static StringBuilder |
appendLongElement(StringBuilder buf,
String tagName,
long value,
XMLFormatting fmt)
appends an XML element of the form "tagName"value"/tagName" |
|
static StringBuilder |
appendNewLine(StringBuilder buf)
|
|
static StringBuilder |
appendNewLine(StringBuilder buf,
int tab)
|
|
static StringBuilder |
appendNewLine(StringBuilder buf,
XMLFormatting fmt)
|
|
static StringBuilder |
appendOpenSTag(StringBuilder buf,
String tagName)
This method appends an XML open-STag with specified tag name to buf. |
|
static StringBuilder |
appendOptionalDoubleElement(StringBuilder buf,
String tagName,
double value,
double unspecified,
XMLFormatting fmt)
appends an XML element of the form "tagName"value"/tagName", provided that value is not the special "unspecified" value. |
|
static StringBuilder |
appendOptionalFloatElement(StringBuilder buf,
String tagName,
float value,
float unspecified,
XMLFormatting fmt)
appends an XML element of the form "tagName"value"/tagName", provided that value is not the special "unspecified" value. |
|
static StringBuilder |
appendOptionalIntElement(StringBuilder buf,
String tagName,
int value,
int unspecified,
XMLFormatting fmt)
appends an XML element of the form "tagName"value"/tagName", provided that value is not the special "unspecified" value. |
|
static StringBuilder |
appendOptionalLongElement(StringBuilder buf,
String tagName,
long value,
long unspecified,
XMLFormatting fmt)
appends an XML element of the form "tagName"value"/tagName", provided that value is not the special "unspecified" value. |
|
static StringBuilder |
appendSpaces(StringBuilder buf,
int tab)
appends a String consisting of exactly "tab" spaces. |
|
static StringBuilder |
appendSpaces(StringBuilder buf,
XMLFormatting fmt)
appends a String consisting of exactly "tab" spaces. |
|
static StringBuilder |
appendSTag(StringBuilder buf,
String tagName)
This method appends an XML STag with specified tag name to buf. |
|
static StringBuilder |
appendSTag(StringBuilder buf,
String tagName,
HashMap attributes)
This method appends an XML STag with specified tag name and attributes to buf. |
|
static StringBuilder |
appendSTag(StringBuilder buf,
String tagName,
XMLFormatting fmt)
This method appends an XML STag with specified tag name to buf. |
|
static StringBuilder |
appendStringArrayElement(StringBuilder buf,
String tagName,
String[] values,
char separator,
XMLFormatting fmt,
int nrElementsPerLine)
appends an XML element of the form "tagName"value"/tagName" |
|
static StringBuilder |
appendStrings(StringBuilder buf,
String[] strings,
char separator,
XMLFormatting fmt,
int nrElementsPerLine)
appends an array of strings, with maxNrOfElements floats at one line. |
|
static StringBuilder |
appendSystemNewLine(StringBuilder buf)
|
|
static StringBuilder |
appendTab(StringBuilder buf)
appends a String consisting of the amount of spaces for a "Tab". |
|
static StringBuilder |
appendTextElement(StringBuilder buf,
String tagName,
String value,
XMLFormatting fmt)
appends an XML element of the form "tagName"value"/tagName" The value parameter is allowed to be null, and in this case, nothing is appended at all. |
|
StringBuilder |
appendXML(StringBuilder buf)
like writeXML(PrintWriter), except that the XML encoding is appended to a StringBuilder. |
|
StringBuilder |
appendXML(StringBuilder buf,
int tab)
like writeXML(PrintWriter ,int), except that the XML encoding is appended to a StringBuilder. |
|
StringBuilder |
appendXML(StringBuilder buf,
XMLFormatting fmt)
like writeXML(PrintWriter ,int), except that the XML encoding is appended to a StringBuilder. |
|
StringBuilder |
appendXML(StringBuilder buf,
XMLFormatting fmt,
String prefix,
String namespace)
like writeXML(PrintWriter ,int), except that the XML encoding is appended to a StringBuilder. |
|
StringBuilder |
appendXML(StringBuilder buf,
XMLFormatting fmt,
XMLNameSpace xmlNamespace)
like writeXML(PrintWriter ,int), except that the XML encoding is appended to a StringBuilder. |
|
StringBuilder |
appendXMLStructure(StringBuilder buf,
XMLFormatting fmt,
XMLStructure xmlStruct)
If xmlStruct ! |
|
static
|
appendXMLStructureList(StringBuilder buf,
XMLFormatting fmt,
List<T> elements)
appends a list of XMLStructures. |
|
static StringBuilder |
appendXMLTextElementList(StringBuilder buf,
XMLFormatting fmt,
String tagName,
List<String> elements)
appends a list of uniform XMLTextElements. |
|
static int |
countTokens(String encoding)
counts the number of tokens, separated by ATTRIBUTE_TOKEN_DELIMITERS characters, within a given encoding. |
|
static int |
countTokens(String encoding,
String delimiters)
counts the number of tokens, separated by specified delimiter characters, within a given encoding. |
|
boolean |
decodeAttribute(String attrName,
String attrValue)
decodes the value from an attribute value String returns true if succesful, returns false for attribute names that are not recognized. |
|
boolean |
decodeAttribute(String attrName,
String attrValue,
XMLTokenizer tokenizer)
decodes the value from an attribute value String returns true if succesful, returns false for attribute names that are not recognized. |
|
void |
decodeAttributes(HashMap<String,String> attrMap,
XMLTokenizer tokenizer)
decodes all attributes. |
|
static boolean |
decodeBoolean(String encoding)
decodes a boolean value (true or false) |
|
static boolean[] |
decodeBooleanArray(String encoding)
decodes a int array, encoded as String of the form value0 value1 ..... value-n, |
|
static boolean[] |
decodeBooleanArray(String encoding,
boolean[] bools)
equivalent to decodeBooleanArray(encoding, ints, ATTRIBUTE_TOKEN_DELIMITERS); |
|
static boolean[] |
decodeBooleanArray(String encoding,
boolean[] bools,
String delimiters)
decodes a int array, encoded as String of the form value0 value1 ..... value-n, where the values are separated by characters specified by means of the delimiter String. |
|
static boolean[] |
decodeBooleanArray(String encoding,
String delimiters)
decodes a int array, encoded as String of the form value0 value1 ..... value-n, where the values are separated by characters specified by means of the delimiter String. |
|
void |
decodeContent(XMLTokenizer tokenizer)
decodes the XML contents, i.e. the XML between the STag and ETag of the encoding. |
|
static double |
decodeDouble(String encoding)
decodes a double |
|
static double[] |
decodeDoubleArray(String encoding)
decodes a double array, encoded as String of the form value0 value1 ..... value-n |
|
static double[] |
decodeDoubleArray(String encoding,
double[] doubles)
decodes a double array, encoded as String of the form value0 value1 ..... value-n The doubles array should be sufficiently large so that all tokens can be allocated, or else it should be null. |
|
static double[] |
decodeDoubleArray(String encoding,
double[] doubles,
String delimiters)
decodes a double array, encoded as String of the form value0 value1 ..... value-n, where the values are separated by characters specified by means of the delimiter String. |
|
static double[] |
decodeDoubleArray(String encoding,
String delimiters)
decodes a double array, encoded as String of the form value0 value1 ..... value-n |
|
static float |
decodeFloat(String encoding)
decodes a float |
|
static float[] |
decodeFloatArray(String encoding)
decodes a float array, encoded as String of the form value0 value1 ..... value-n, where the values are separated by characters specified by means of the delimiter String. |
|
static float[] |
decodeFloatArray(String encoding,
float[] floats)
equivalent to decodeFloatArray(encoding, floats, ATTRIBUTE_TOKEN_DELIMITERS); (i.e. attribute tokens have to be separated by white space) |
|
static float[] |
decodeFloatArray(String encoding,
float[] floats,
String delimiters)
decodes a float array, encoded as String of the form value0 value1 ..... value-n, where the values are separated by characters specified by means of the delimiter String. |
|
static float[] |
decodeFloatArray(String encoding,
String delimiters)
decodes a float array, encoded as String of the form value0 value1 ..... value-n, where the values are separated by characters specified by means of the delimiter String. |
|
static int |
decodeInt(String encoding)
decodes an int |
|
static int[] |
decodeIntArray(String encoding)
decodes a int array, encoded as String of the form value0 value1 ..... value-n, |
|
static int[] |
decodeIntArray(String encoding,
int[] ints)
equivalent to decodeIntArray(encoding, ints, ATTRIBUTE_TOKEN_DELIMITERS); |
|
static int[] |
decodeIntArray(String encoding,
int[] ints,
String delimiters)
decodes a int array, encoded as String of the form value0 value1 ..... value-n, where the values are separated by characters specified by means of the delimiter String. |
|
static int[] |
decodeIntArray(String encoding,
String delimiters)
decodes a int array, encoded as String of the form value0 value1 ..... value-n, where the values are separated by characters specified by means of the delimiter String. |
|
static long |
decodeLong(String encoding)
decodes a long |
|
static String[] |
decodeStringArray(String encoding)
decodes a string array, encoded as String of the form value0 value1 ..... value-n |
|
static String[] |
decodeStringArray(String encoding,
String delimiters)
decodes a String array, encoded as String of the form value0 value1 ..... value-n |
|
static String[] |
decodeStringArray(String encoding,
String[] strings)
decodes a String array, encoded as String of the form value0 value1 ..... value-n, where the values are separated by characters specified by means of the delimiter String. |
|
static String[] |
decodeStringArray(String encoding,
String[] strings,
String delimiters)
decodes a sequence of Strings, separated by specified delimiters |
|
static
|
decodeXMLStructureList(XMLTokenizer tokenizer,
String tagName,
Class<T> structureClass)
decodes a list of XMLStructures, and returns a Java List. |
|
static String |
decodeXMLValueElement(String tagName,
XMLTokenizer tokenizer)
|
|
String |
getNamespace()
Returns the (full, unabbreviated) namespace string for this XMLStructure Class |
|
String |
getOptionalAttribute(String attrName,
HashMap<String,String> attrMap)
checkes whether an attribute with specified name is present, and returns its value. |
|
String |
getOptionalAttribute(String attrName,
HashMap<String,String> attrMap,
String defaultValue)
checkes whether an attribute with specified name is present, and returns its value. |
|
boolean |
getOptionalBooleanAttribute(String attrName,
HashMap<String,String> attrMap,
boolean defaultValue)
Like getOptionalAttribute, but with the result converted to a boolean. |
|
double |
getOptionalDoubleAttribute(String attrName,
HashMap<String,String> attrMap,
double defaultValue)
Like getOptionalAttribute, but with the result converted to an double. |
|
float |
getOptionalFloatAttribute(String attrName,
HashMap<String,String> attrMap,
float defaultValue)
Like getOptionalAttribute, but with the result converted to a float. |
|
int |
getOptionalIntAttribute(String attrName,
HashMap<String,String> attrMap,
int defaultValue)
Like getOptionalAttribute, but with the result converted to an int. |
|
long |
getOptionalLongAttribute(String attrName,
HashMap<String,String> attrMap,
long defaultValue)
Like getOptionalAttribute, but with the result converted to an long. |
|
String |
getRequiredAttribute(String attrName,
HashMap<String,String> attrMap,
XMLTokenizer tokenizer)
checkes whether an attribute with specified name is present, and returns its value. |
|
boolean |
getRequiredBooleanAttribute(String attrName,
HashMap<String,String> attrMap,
XMLTokenizer tokenizer)
Like getRequiredAttribute, but with the result converted to an boolean. |
|
double |
getRequiredDoubleAttribute(String attrName,
HashMap<String,String> attrMap,
XMLTokenizer tokenizer)
Like getRequiredAttribute, but with the result converted to an double. |
|
float |
getRequiredFloatAttribute(String attrName,
HashMap<String,String> attrMap,
XMLTokenizer tokenizer)
Like getRequiredAttribute, but with the result converted to a float. |
|
int |
getRequiredIntAttribute(String attrName,
HashMap<String,String> attrMap,
XMLTokenizer tokenizer)
Like getRequiredAttribute, but with the result converted to an int. |
|
long |
getRequiredLongAttribute(String attrName,
HashMap<String,String> attrMap,
XMLTokenizer tokenizer)
Like getRequiredAttribute, but with the result converted to an long. |
|
int |
getTagLine()
returns line number of the start tag, if this Object has been decoded by using an XMLTokenizer. |
|
String |
getXMLTag()
returns the XML tag that is used to encode this type of XMLStructure. |
|
boolean |
hasContent()
returns whether the XML encoding should have an contents part, or should be an empty element tag. |
|
static
|
parseXMLElement(Class<T> tClass,
XMLTokenizer tokenizer)
|
|
void |
postProcess(XMLTokenizer tokenizer)
The postProcess method is called after the XML content has been parsed, and the ETag has been checked. |
|
void |
preProcess(XMLTokenizer tokenizer)
The preProcess method is called, afetr the XML tag has been recognized, but before attributes or XML content has been parsed. |
|
XMLStructure |
readXML(Reader in)
reconstructs this XMLStructure object by reading and parsing XML encoded text from a Reader. |
|
XMLStructure |
readXML(String s)
reconstructs this XMLStructure object by parsing an XML encoded String s This method can throw an (unchecked) ScanException in case of incorrectly formatted XML. |
|
XMLStructure |
readXML(XMLTokenizer tokenizer)
reconstructs this XMLStructureAdapter using an XMLTokenizer. |
|
static void |
setConsoleAttributeEnabled(boolean b)
|
|
static void |
setDefaultRecoverMode(boolean defaultMode)
Sets the default mode for recovery. |
|
void |
setRecoverMode(boolean mode)
Sets the mode for recovery when the ETag is not found. |
|
static String |
spaces(int tab)
returns a String consisting of exactly "tab" spaces. |
|
String |
toString()
the default toString() method returns the result of toXMLSTring() |
|
String |
toXMLString()
yields an XML encoded String of this XMLStructure object. |
|
String |
toXMLString(int tab)
yields an XML encoded String of this XMLStructure object. |
|
String |
toXMLString(String prefix,
String namespace)
yields an XML encoded String of this XMLStructure object. |
|
String |
toXMLString(XMLFormatting fmt)
yields an XML encoded String of this XMLStructure object. |
|
String |
toXMLString(XMLFormatting fmt,
String prefix,
String namespace)
yields an XML encoded String of this XMLStructure object. |
|
String |
toXMLString(XMLFormatting fmt,
XMLNameSpace xmlNamespace)
yields an XML encoded String of this XMLStructure object. |
|
void |
writeXML(PrintWriter out)
The default implementation relies on appendXML() |
|
void |
writeXML(PrintWriter out,
int tab)
writes an XML encoded String to "out". |
|
void |
writeXML(PrintWriter out,
XMLFormatting fmt)
writes an XML encoded String to "out". |
|
void |
writeXML(PrintWriter out,
XMLFormatting fmt,
XMLNameSpace xmlNamespace)
writes an XML encoded String to "out". |
|
static String |
xmlTag()
The XML tagname for XML encoding for this Class -- use this static method when you want to see if a given String equals the xml tag for this class. |
|
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
| Field Detail |
|---|
public static final boolean DEFAULT_RECOVER_MODE
private static boolean recoverMode
private static final String XMLTAG
private static final String NAMESPACE
private static String NamespaceLabel
private int tagLine
private boolean recover
private static Logger logger
private static boolean consoleAttributeEnabled
private static StringBuilder lotsOfSpaces
public static final int TAB
public static final String TAB_STRING
public static final String NEWLINE
public static final String SYSTEMNEWLINE
public static final String ATTRIBUTE_TOKEN_DELIMITERS
public static final String COMMA_SEPARATOR
public static final int DECODEDARRAYSIZE
| Constructor Detail |
|---|
public XMLStructureAdapter()
| Method Detail |
|---|
public String getXMLTag()
getXMLTag in interface XMLStructurepublic static String xmlTag()
public String getNamespace()
public boolean hasContent()
public final int getTagLine()
public XMLStructure readXML(Reader in)
throws IOException
readXML in interface XMLStructureIOExceptionpublic XMLStructure readXML(String s)
readXML in interface XMLStructure
public boolean decodeAttribute(String attrName,
String attrValue)
public boolean decodeAttribute(String attrName,
String attrValue,
XMLTokenizer tokenizer)
public void decodeContent(XMLTokenizer tokenizer)
throws IOException
IOExceptionpublic static void setDefaultRecoverMode(boolean defaultMode)
public void setRecoverMode(boolean mode)
public XMLStructure readXML(XMLTokenizer tokenizer)
throws IOException
readXML in interface XMLStructureIOException
public void decodeAttributes(HashMap<String,String> attrMap,
XMLTokenizer tokenizer)
public String getRequiredAttribute(String attrName,
HashMap<String,String> attrMap,
XMLTokenizer tokenizer)
public String getOptionalAttribute(String attrName,
HashMap<String,String> attrMap)
public String getOptionalAttribute(String attrName,
HashMap<String,String> attrMap,
String defaultValue)
public int getRequiredIntAttribute(String attrName,
HashMap<String,String> attrMap,
XMLTokenizer tokenizer)
public int getOptionalIntAttribute(String attrName,
HashMap<String,String> attrMap,
int defaultValue)
public long getRequiredLongAttribute(String attrName,
HashMap<String,String> attrMap,
XMLTokenizer tokenizer)
public long getOptionalLongAttribute(String attrName,
HashMap<String,String> attrMap,
long defaultValue)
public float getRequiredFloatAttribute(String attrName,
HashMap<String,String> attrMap,
XMLTokenizer tokenizer)
public float getOptionalFloatAttribute(String attrName,
HashMap<String,String> attrMap,
float defaultValue)
public double getRequiredDoubleAttribute(String attrName,
HashMap<String,String> attrMap,
XMLTokenizer tokenizer)
public double getOptionalDoubleAttribute(String attrName,
HashMap<String,String> attrMap,
double defaultValue)
public boolean getRequiredBooleanAttribute(String attrName,
HashMap<String,String> attrMap,
XMLTokenizer tokenizer)
public boolean getOptionalBooleanAttribute(String attrName,
HashMap<String,String> attrMap,
boolean defaultValue)
public void preProcess(XMLTokenizer tokenizer)
public void postProcess(XMLTokenizer tokenizer)
public final void writeXML(PrintWriter out)
writeXML in interface XMLStructure
public final void writeXML(PrintWriter out,
int tab)
writeXML in interface XMLStructure
public final void writeXML(PrintWriter out,
XMLFormatting fmt)
writeXML in interface XMLStructure
public final void writeXML(PrintWriter out,
XMLFormatting fmt,
XMLNameSpace xmlNamespace)
public final String toXMLString()
toXMLString in interface XMLStructurepublic final String toXMLString(int tab)
toXMLString in interface XMLStructurepublic final String toXMLString(XMLFormatting fmt)
toXMLString in interface XMLStructure
public final String toXMLString(XMLFormatting fmt,
XMLNameSpace xmlNamespace)
public final String toXMLString(XMLFormatting fmt,
String prefix,
String namespace)
public final String toXMLString(String prefix,
String namespace)
public String toString()
toString in class Object
public final StringBuilder appendXML(StringBuilder buf,
int tab)
appendXML in interface XMLStructure
public final StringBuilder appendXML(StringBuilder buf,
XMLFormatting fmt,
String prefix,
String namespace)
public final StringBuilder appendXML(StringBuilder buf,
XMLFormatting fmt)
appendXML in interface XMLStructure
public StringBuilder appendXML(StringBuilder buf,
XMLFormatting fmt,
XMLNameSpace xmlNamespace)
public final StringBuilder appendXML(StringBuilder buf)
appendXML in interface XMLStructurepublic StringBuilder appendContent(StringBuilder buf)
public StringBuilder appendContent(StringBuilder buf,
XMLFormatting fmt)
public StringBuilder appendAttributeString(StringBuilder buf,
XMLFormatting fmt)
public StringBuilder appendAttributeString(StringBuilder buf)
public StringBuilder appendAttributes(StringBuilder buf)
public StringBuilder appendXMLStructure(StringBuilder buf,
XMLFormatting fmt,
XMLStructure xmlStruct)
public static final String spaces(int tab)
public static final StringBuilder appendSpaces(StringBuilder buf,
XMLFormatting fmt)
public static final StringBuilder appendSpaces(StringBuilder buf,
int tab)
public static final StringBuilder appendTab(StringBuilder buf)
public static final StringBuilder appendComment(StringBuilder buf,
String comment)
public static final StringBuilder appendOpenSTag(StringBuilder buf,
String tagName)
public static final StringBuilder appendCloseSTag(StringBuilder buf)
public static final StringBuilder appendCloseEmptyTag(StringBuilder buf)
public static final StringBuilder appendSTag(StringBuilder buf,
String tagName)
public static final StringBuilder appendSTag(StringBuilder buf,
String tagName,
XMLFormatting fmt)
public static final StringBuilder appendSTag(StringBuilder buf,
String tagName,
HashMap attributes)
public static final StringBuilder appendEmptyTag(StringBuilder buf,
String tagName)
public static final StringBuilder appendEmptyTag(StringBuilder buf,
XMLFormatting fmt,
String tagName,
String attrName,
String attrValue)
public static final StringBuilder appendEmptyTag(StringBuilder buf,
XMLFormatting fmt,
String tagName,
String attrName1,
String attrValue1,
String attrName2,
String attrValue2)
public static final StringBuilder appendEmptyTag(StringBuilder buf,
XMLFormatting fmt,
String tagName,
String attrName1,
String attrValue1,
String attrName2,
String attrValue2,
String attrName3,
String attrValue3)
public static final StringBuilder appendEmptyTag(StringBuilder buf,
String tagName,
HashMap attributes)
public static final StringBuilder appendEmptyTag(StringBuilder buf,
XMLFormatting fmt,
String tagName,
HashMap attributes)
public static final <T extends XMLStructure> StringBuilder appendXMLStructureList(StringBuilder buf,
XMLFormatting fmt,
List<T> elements)
public static final <T extends XMLStructure> List<T> decodeXMLStructureList(XMLTokenizer tokenizer,
String tagName,
Class<T> structureClass)
throws IOException
IOException
public static final StringBuilder appendXMLTextElementList(StringBuilder buf,
XMLFormatting fmt,
String tagName,
List<String> elements)
public static final StringBuilder appendAttribute(StringBuilder buf,
String attrName,
String attrValue)
public static final StringBuilder appendAttribute(StringBuilder buf,
String attrName,
String attrValue1,
String attrValue2)
public static final StringBuilder appendAttribute(StringBuilder buf,
String attrName,
String attrValue1,
String attrValue2,
String attrValue3)
public static final StringBuilder appendAttribute(StringBuilder buf,
String attrName,
String attrValue1,
String attrValue2,
String attrValue3,
String attrValue4)
public static final StringBuilder appendAttribute(StringBuilder buf,
String attrName,
int intValue)
public static final StringBuilder appendAttribute(StringBuilder buf,
String attrName,
int intValue1,
int intValue2)
public static final StringBuilder appendAttribute(StringBuilder buf,
String attrName,
int intValue1,
int intValue2,
int intValue3)
public static final StringBuilder appendAttribute(StringBuilder buf,
String attrName,
int intValue1,
int intValue2,
int intValue3,
int intValue4)
public static final StringBuilder appendAttribute(StringBuilder buf,
String attrName,
long longValue)
public static final StringBuilder appendAttribute(StringBuilder buf,
String attrName,
long longValue1,
long longValue2)
public static final StringBuilder appendAttribute(StringBuilder buf,
String attrName,
long longValue1,
long longValue2,
long longValue3)
public static final StringBuilder appendAttribute(StringBuilder buf,
String attrName,
long longValue1,
long longValue2,
long longValue3,
long longValue4)
public static final StringBuilder appendAttribute(StringBuilder buf,
String attrName,
float floatValue)
public static final StringBuilder appendAttribute(StringBuilder buf,
String attrName,
float floatValue1,
float floatValue2)
public static final StringBuilder appendAttribute(StringBuilder buf,
String attrName,
float floatValue1,
float floatValue2,
float floatValue3)
public static final StringBuilder appendAttribute(StringBuilder buf,
String attrName,
float floatValue1,
float floatValue2,
float floatValue3,
float floatValue4)
public static final StringBuilder appendAttribute(StringBuilder buf,
String attrName,
double doubleValue)
public static final StringBuilder appendAttribute(StringBuilder buf,
String attrName,
double doubleValue1,
double doubleValue2)
public static final StringBuilder appendAttribute(StringBuilder buf,
String attrName,
double doubleValue1,
double doubleValue2,
double doubleValue3)
public static final StringBuilder appendAttribute(StringBuilder buf,
String attrName,
double doubleValue1,
double doubleValue2,
double doubleValue3,
double doubleValue4)
public static final StringBuilder appendAttribute(StringBuilder buf,
String attrName,
boolean boolValue)
public static final StringBuilder appendAttribute(StringBuilder buf,
String attrName,
boolean boolValue1,
boolean boolValue2)
public static final StringBuilder appendAttribute(StringBuilder buf,
String attrName,
boolean boolValue1,
boolean boolValue2,
boolean boolValue3)
public static final StringBuilder appendAttribute(StringBuilder buf,
String attrName,
boolean boolValue1,
boolean boolValue2,
boolean boolValue3,
boolean boolValue4)
public static final StringBuilder appendAttribute(StringBuilder buf,
String attrName,
int[] ints,
char separator,
XMLFormatting fmt,
int nrElementsPerLine)
public static final StringBuilder appendInts(StringBuilder buf,
int[] ints,
char separator,
XMLFormatting fmt,
int nrElementsPerLine)
public static final StringBuilder appendAttribute(StringBuilder buf,
String attrName,
float[] floats,
char separator)
public static final StringBuilder appendAttribute(StringBuilder buf,
String attrName,
float[] floats,
char separator,
XMLFormatting fmt,
int nrElementsPerLine)
public static final StringBuilder appendFloats(StringBuilder buf,
float[] floats,
char separator,
XMLFormatting fmt,
int nrElementsPerLine)
public static final StringBuilder appendAttribute(StringBuilder buf,
String attrName,
String[] strings,
char separator,
XMLFormatting fmt,
int nrElementsPerLine)
public static final StringBuilder appendStrings(StringBuilder buf,
String[] strings,
char separator,
XMLFormatting fmt,
int nrElementsPerLine)
public static final StringBuilder appendAttribute(StringBuilder buf,
String attrName,
boolean[] bools,
char separator,
XMLFormatting fmt,
int nrElementsPerLine)
public static final StringBuilder appendBooleans(StringBuilder buf,
boolean[] bools,
char separator,
XMLFormatting fmt,
int nrElementsPerLine)
public static final StringBuilder appendAttribute(StringBuilder buf,
String attrName,
double[] doubles,
char separator)
public static final StringBuilder appendAttributes(StringBuilder buf,
HashMap attributes)
public static final StringBuilder appendETag(StringBuilder buf,
String tagName)
public static final StringBuilder appendETag(StringBuilder buf,
String tagName,
XMLFormatting fmt)
public static final StringBuilder appendSystemNewLine(StringBuilder buf)
public static final StringBuilder appendNewLine(StringBuilder buf)
public static final StringBuilder appendNewLine(StringBuilder buf,
int tab)
public static final StringBuilder appendNewLine(StringBuilder buf,
XMLFormatting fmt)
public static final StringBuilder appendTextElement(StringBuilder buf,
String tagName,
String value,
XMLFormatting fmt)
public static final StringBuilder appendIntElement(StringBuilder buf,
String tagName,
int value,
XMLFormatting fmt)
public static final StringBuilder appendOptionalIntElement(StringBuilder buf,
String tagName,
int value,
int unspecified,
XMLFormatting fmt)
public static final StringBuilder appendLongElement(StringBuilder buf,
String tagName,
long value,
XMLFormatting fmt)
public static final StringBuilder appendOptionalLongElement(StringBuilder buf,
String tagName,
long value,
long unspecified,
XMLFormatting fmt)
public static final StringBuilder appendFloatElement(StringBuilder buf,
String tagName,
float value,
XMLFormatting fmt)
public static final StringBuilder appendOptionalFloatElement(StringBuilder buf,
String tagName,
float value,
float unspecified,
XMLFormatting fmt)
public static final StringBuilder appendDoubleElement(StringBuilder buf,
String tagName,
double value,
XMLFormatting fmt)
public static final StringBuilder appendOptionalDoubleElement(StringBuilder buf,
String tagName,
double value,
double unspecified,
XMLFormatting fmt)
public static final StringBuilder appendIntArrayElement(StringBuilder buf,
String tagName,
int[] values,
char separator,
XMLFormatting fmt,
int nrElementsPerLine)
public static final StringBuilder appendFloatArrayElement(StringBuilder buf,
String tagName,
float[] values,
char separator,
XMLFormatting fmt,
int nrElementsPerLine)
public static final StringBuilder appendStringArrayElement(StringBuilder buf,
String tagName,
String[] values,
char separator,
XMLFormatting fmt,
int nrElementsPerLine)
public static final String decodeXMLValueElement(String tagName,
XMLTokenizer tokenizer)
throws IOException
IOExceptionpublic static final int decodeInt(String encoding)
public static final long decodeLong(String encoding)
public static final float decodeFloat(String encoding)
public static final double decodeDouble(String encoding)
public static final boolean decodeBoolean(String encoding)
public static final int countTokens(String encoding,
String delimiters)
public static final int countTokens(String encoding)
public static final boolean[] decodeBooleanArray(String encoding)
public static final boolean[] decodeBooleanArray(String encoding,
String delimiters)
public static final boolean[] decodeBooleanArray(String encoding,
boolean[] bools)
public static final boolean[] decodeBooleanArray(String encoding,
boolean[] bools,
String delimiters)
public static final int[] decodeIntArray(String encoding)
public static final int[] decodeIntArray(String encoding,
String delimiters)
public static final int[] decodeIntArray(String encoding,
int[] ints)
public static final int[] decodeIntArray(String encoding,
int[] ints,
String delimiters)
public static final float[] decodeFloatArray(String encoding)
public static final float[] decodeFloatArray(String encoding,
String delimiters)
public static final float[] decodeFloatArray(String encoding,
float[] floats)
public static final float[] decodeFloatArray(String encoding,
float[] floats,
String delimiters)
public static final double[] decodeDoubleArray(String encoding)
public static final double[] decodeDoubleArray(String encoding,
String delimiters)
public static final double[] decodeDoubleArray(String encoding,
double[] doubles)
public static final double[] decodeDoubleArray(String encoding,
double[] doubles,
String delimiters)
public static final String[] decodeStringArray(String encoding)
public static final String[] decodeStringArray(String encoding,
String delimiters)
public static final String[] decodeStringArray(String encoding,
String[] strings)
public static final String[] decodeStringArray(String encoding,
String[] strings,
String delimiters)
public static void setConsoleAttributeEnabled(boolean b)
public static <T extends XMLStructureAdapter> T parseXMLElement(Class<T> tClass,
XMLTokenizer tokenizer)
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||