com.planet_ink.coffee_mud.Libraries
Class XMLManager

java.lang.Object
  extended by com.planet_ink.coffee_mud.Libraries.StdLibrary
      extended by com.planet_ink.coffee_mud.Libraries.XMLManager
All Implemented Interfaces:
CMObject, Tickable, CMLibrary, XMLLibrary, java.lang.Cloneable, java.lang.Comparable<CMObject>

public class XMLManager
extends StdLibrary
implements XMLLibrary


Nested Class Summary
protected static class XMLManager.State
           
 
Nested classes/interfaces inherited from interface com.planet_ink.coffee_mud.Libraries.interfaces.XMLLibrary
XMLLibrary.XMLTag
 
Field Summary
protected  int[] beginDex
           
protected  java.lang.StringBuffer buf
           
protected  int bufDex
           
protected  java.util.List<XMLLibrary.XMLTag> contents
           
protected  int[] endDex
           
protected static java.lang.String HEX_DIGITS
           
protected  java.lang.String[][] IGNORE_TAG_BOUNDS
           
protected  java.util.Set<java.lang.String> illegalTags
           
protected  com.planet_ink.coffee_mud.Libraries.XMLManager.XMLpiece piece
           
protected  XMLManager.State state
           
 
Fields inherited from class com.planet_ink.coffee_mud.Libraries.StdLibrary
isDebugging, name, serviceClient, tickStatus
 
Fields inherited from interface com.planet_ink.coffee_mud.Libraries.interfaces.XMLLibrary
FILE_XML_BOUNDARY
 
Fields inherited from interface com.planet_ink.coffee_mud.core.interfaces.Tickable
STATUS_AFFECT, STATUS_ALIVE, STATUS_BEHAVIOR, STATUS_CLASS, STATUS_DEAD, STATUS_END, STATUS_FIGHT, STATUS_MISC, STATUS_MISC2, STATUS_MISC3, STATUS_MISC4, STATUS_MISC5, STATUS_MISC6, STATUS_MISC7, STATUS_NOT, STATUS_OTHER, STATUS_RACE, STATUS_REBIRTH, STATUS_SCRIPT, STATUS_START, STATUS_WEATHER, TICKID_AREA, TICKID_BEAMWEAPON, TICKID_CLAN, TICKID_CLANITEM, TICKID_DEADBODY_DECAY, TICKID_ELECTRONICS, TICKID_EMAIL, TICKID_EXIT_BEHAVIOR, TICKID_EXIT_REOPEN, TICKID_ITEM_BEHAVIOR, TICKID_ITEM_BOUNCEBACK, TICKID_LIGHT_FLICKERS, TICKID_LIVEAUCTION, TICKID_LONGERMASK, TICKID_MISCELLANEOUS, TICKID_MOB, TICKID_PROPERTY_SPECIAL, TICKID_QUEST, TICKID_READYTOSTOP, TICKID_ROOM_BEHAVIOR, TICKID_ROOM_ITEM_REJUV, TICKID_SOLITARYMASK, TICKID_SPECIALCOMBAT, TICKID_SPECIALMANEUVER, TICKID_SPELL_AFFECT, TICKID_SUPPORT, TICKID_TIMEAUCTION, TICKID_TRAP_DESTRUCTION, TICKID_TRAP_RESET
 
Constructor Summary
XMLManager()
           
 
Method Summary
protected  void abandonTagState(XMLManager.State newState)
           
protected  void afterCloseTag(char c)
           
protected  void assignAttrib(int endOfValue)
           
protected  void beAttrib(char c)
           
protected  void beforeAttrib(char c)
           
protected  void beforeAttribValue(char c)
           
protected  void beforeCloseTag(char c)
           
protected  void beforeTag(char c)
           
protected  void beginTagSelfEnd(char c)
           
protected  boolean canStartPiece(int endOfTagName)
           
protected  void changedTagState(XMLManager.State newState)
           
protected  void changeTagState(XMLManager.State newState)
           
protected  void closePiece(int outerEnd)
           
 java.lang.String convertXMLtoTag(java.lang.String TName, boolean Data)
          Return the outer wrapper and contents of an XML tag <TNAME>Data</TNAME> Usage: Data+=XMLoTag("MODELOBJECTONE",VA.ModelObjectOne);
 java.lang.String convertXMLtoTag(java.lang.String TName, int Data)
          Return the outer wrapper and contents of an XML tag <TNAME>Data</TNAME> Usage: Data+=XMLoTag("MODELOBJECTONE",VA.ModelObjectOne);
 java.lang.String convertXMLtoTag(java.lang.String TName, long Data)
          Return the outer wrapper and contents of an XML tag <TNAME>Data</TNAME> Usage: Data+=XMLoTag("MODELOBJECTONE",VA.ModelObjectOne);
 java.lang.String convertXMLtoTag(java.lang.String TName, short Data)
          Return the outer wrapper and contents of an XML tag <TNAME>Data</TNAME> Usage: Data+=XMLoTag("MODELOBJECTONE",VA.ModelObjectOne);
 java.lang.String convertXMLtoTag(java.lang.String TName, java.lang.String Data)
          Return the outer wrapper and contents of an XML tag <TNAME>Data</TNAME> Usage: Data+=XMLoTag("MODELOBJECTONE",VA.ModelObjectOne);
 XMLLibrary.XMLTag createNewTag(java.lang.String key, java.lang.String value)
          Create a new tag, just like the XML Manager does.
protected  void doneWithPiece(int outerEnd)
           
protected  void endEmptyAttrib(int endOfAttrib)
           
protected  java.lang.String fromPOJOFieldtoXML(java.lang.Class<?> type, java.lang.Object val)
          Converts a pojo field to a xml value.
 java.lang.String fromPOJOtoXML(java.lang.Object o)
          Converts a pojo object to a XML document.
 java.util.Map<java.lang.String,java.lang.String> fromXML(java.lang.String str)
          Converts a map into an xml document
 void fromXMLtoPOJO(java.util.List<XMLLibrary.XMLTag> xmlObj, java.lang.Object o)
          Converts a xml object to a pojo object.
 void fromXMLtoPOJO(java.lang.String XML, java.lang.Object o)
          Converts a JSON document to a XML object.
 boolean getBoolFromPieces(java.util.List<XMLLibrary.XMLTag> V, java.lang.String tag)
          Return the data value within a given XML block <TAG>Data</TAG> Usage: String ThisColHead=getBoolFromPieces(ThisRow,"TD");
 boolean getBoolFromPieces(java.util.List<XMLLibrary.XMLTag> V, java.lang.String tag, boolean defVal)
          Return the data value within a given XML block <TAG>Data</TAG> Usage: String ThisColHead=getBoolFromPieces(ThisRow,"TD");
 java.util.List<XMLLibrary.XMLTag> getContentsFromPieces(java.util.List<XMLLibrary.XMLTag> V, java.lang.String tag)
          Returns the contents of a container tag, searched for in another container tags contents
 double getDoubleFromPieces(java.util.List<XMLLibrary.XMLTag> V, java.lang.String tag)
          Return the data value within a given XML block <TAG>Data</TAG> Usage: String ThisColHead=getDoubleFromPieces(ThisRow,"TD");
 double getDoubleFromPieces(java.util.List<XMLLibrary.XMLTag> V, java.lang.String tag, double defVal)
          Return the data value within a given XML block <TAG>Data</TAG> Usage: String ThisColHead=getDoubleFromPieces(ThisRow,"TD");
 int getIntFromPieces(java.util.List<XMLLibrary.XMLTag> V, java.lang.String tag)
          Return the data value within a given XML block <TAG>Data</TAG> Usage: String ThisColHead=getIntFromPieces(ThisRow,"TD");
 int getIntFromPieces(java.util.List<XMLLibrary.XMLTag> V, java.lang.String tag, int defVal)
          Return the data value within a given XML block <TAG>Data</TAG> Usage: String ThisColHead=getIntFromPieces(ThisRow,"TD");
 long getLongFromPieces(java.util.List<XMLLibrary.XMLTag> V, java.lang.String tag)
          Return the data value within a given XML block <TAG>Data</TAG> Usage: String ThisColHead=getLongFromPieces(ThisRow,"TD");
 long getLongFromPieces(java.util.List<XMLLibrary.XMLTag> V, java.lang.String tag, long defVal)
          Return the data value within a given XML block <TAG>Data</TAG> Usage: String ThisColHead=getLongFromPieces(ThisRow,"TD");
 XMLLibrary.XMLTag getPieceFromPieces(java.util.List<XMLLibrary.XMLTag> V, java.lang.String tag)
          Returns the xml tag node for the given tag name, if found in the given tag container contents
 java.util.List<XMLLibrary.XMLTag> getPiecesFromPieces(java.util.List<XMLLibrary.XMLTag> V, java.lang.String tag)
          Returns all tags inside the gives set that match this tag name
 short getShortFromPieces(java.util.List<XMLLibrary.XMLTag> V, java.lang.String tag)
          Return the data value within a given XML block <TAG>Data</TAG> Usage: String ThisColHead=getShortFromPieces(ThisRow,"TD");
 short getShortFromPieces(java.util.List<XMLLibrary.XMLTag> V, java.lang.String tag, short defVal)
          Return the data value within a given XML block <TAG>Data</TAG> Usage: String ThisColHead=getShortFromPieces(ThisRow,"TD");
 java.lang.String getValFromPieces(java.util.List<XMLLibrary.XMLTag> V, java.lang.String tag)
          Returns the value of the tag, if it exists in the given tag collection
 java.lang.String getValFromPieces(java.util.List<XMLLibrary.XMLTag> V, java.lang.String tag, java.lang.String defVal)
          Returns the value of the tag, if it exists in the given tag collection
 java.lang.String getXMLList(java.util.List<java.lang.String> V)
          Converts the given list of strings into a set of top-level xml tags called simply <X>
protected  void handleTagBounds()
           
 java.lang.String ID()
          The CoffeeMud Java Class ID shared by all instances of this object.
protected  void inAttrib(char c)
           
protected  void inAttribValue(char c)
           
protected  void inCloseTag(char c)
           
protected  void inPostAttrib(char c)
           
protected  void inQuotedAttribValue(char c)
           
protected  void inTag(char c)
           
 boolean isTagInPieces(java.util.List<XMLLibrary.XMLTag> V, java.lang.String tag)
          Return where the value is within a given XML block <TAG>Data</TAG> Usage: boolean ThisColHead=isTagInPieces(ThisRow,"TD");
 java.util.List<XMLLibrary.XMLTag> parseAllXML(java.lang.String buf)
          Parses all xml inside the given string buffer and returns the root tags as a container collection.
 java.util.List<XMLLibrary.XMLTag> parseAllXML(java.lang.StringBuffer buf)
          Parses all xml inside the given stringbuffer and returns the root tags as a container collection.
 java.lang.String parseOutAngleBrackets(java.lang.String s)
          parse a tag value for safety Usage: String val=parseOutAngleBrackets(ThisValue);
 java.lang.String parseOutAngleBracketsAndQuotes(java.lang.String s)
          parse a tag value for safety Usage: String val=parseOutAngleBracketsAndQuotes(ThisValue);
protected  XMLLibrary.XMLTag parseXML()
           
 java.util.List<java.lang.String> parseXMLList(java.lang.String numberedList)
          Parses a list of single-level xml tags, together in string.
 java.lang.String restoreAngleBrackets(java.lang.String s)
          restore a tag value parsed for safety Usage: String val=restoreAngleBrackets(ThisValue);
 java.lang.String returnXMLBlock(java.lang.String Blob, java.lang.String Tag)
          Return the contents of an XML tag, given the tag to search for Usage: String XML=returnXMLBlock(Response,"PDIModelErrors");
 boolean returnXMLBoolean(java.lang.String Blob, java.lang.String Tag)
          Return the data value within a given XML block <TAG>Data</TAG> Usage: String ThisColHead=returnXMLValue(ThisRow,"TD");
 java.lang.String returnXMLValue(java.lang.String Blob)
          Return the data value within the first XML block <TAG>Data</TAG> Usage: String ThisColHead=returnXMLValue(ThisRow);
 java.lang.String returnXMLValue(java.lang.String Blob, java.lang.String Tag)
          Return the data value within a given XML block <TAG>Data</TAG> Usage: String ThisColHead=returnXMLValue(ThisRow,"TD");
protected static double s_double(java.lang.String DOUBLE)
          Returns the double value of a string without crashing Usage: dSize = WebIQBase.s_double(WebIQBase.getRes(AttStatsRes,"BlobSize"));
protected static int s_int(java.lang.String INT)
          Returns the integer value of a string without crashing Usage: int num=s_int(CMD.substring(14));
protected static long s_long(java.lang.String LONG)
          Returns the long value of a string without crashing Usage: int num=s_long(CMD.substring(14));
protected static short s_short(java.lang.String SHORT)
          Returns the short value of a string without crashing Usage: int num=s_short(CMD.substring(14));
protected  void startPiece(int endOfTagName)
           
protected  void startState(char c)
           
 java.lang.String toXML(java.util.Map<java.lang.String,java.lang.String> map)
          Converts a map into an xml document
 
Methods inherited from class com.planet_ink.coffee_mud.Libraries.StdLibrary
activate, checkDatabase, compareTo, copyOf, getServiceClient, getTickStatus, initializeClass, L, name, newInstance, propertiesLoaded, setThreadStatus, shutdown, tick
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface com.planet_ink.coffee_mud.Libraries.interfaces.CMLibrary
activate, getServiceClient, L, propertiesLoaded, shutdown
 
Methods inherited from interface com.planet_ink.coffee_mud.core.interfaces.CMObject
copyOf, initializeClass, name, newInstance
 
Methods inherited from interface java.lang.Comparable
compareTo
 

Field Detail

HEX_DIGITS

protected static final java.lang.String HEX_DIGITS
See Also:
Constant Field Values

IGNORE_TAG_BOUNDS

protected final java.lang.String[][] IGNORE_TAG_BOUNDS

bufDex

protected int bufDex

piece

protected com.planet_ink.coffee_mud.Libraries.XMLManager.XMLpiece piece

state

protected XMLManager.State state

beginDex

protected int[] beginDex

endDex

protected int[] endDex

buf

protected java.lang.StringBuffer buf

contents

protected java.util.List<XMLLibrary.XMLTag> contents

illegalTags

protected java.util.Set<java.lang.String> illegalTags
Constructor Detail

XMLManager

public XMLManager()
Method Detail

ID

public java.lang.String ID()
Description copied from interface: CMObject
The CoffeeMud Java Class ID shared by all instances of this object. Unlike the Java Class name, this method does not include package information. However, it must return a String value unique to its class category in the ClassLoader. Class categories include Libraries, Common, Areas, Abilities, Behaviors, CharClasses, Commands, Exits Locales, MOBS, Races, WebMacros, Basic Items, Armor, Weapons, ClanItems, Tech. The name is typically identical to the class name.

Specified by:
ID in interface CMObject
Overrides:
ID in class StdLibrary
Returns:
the name of this class

createNewTag

public XMLLibrary.XMLTag createNewTag(java.lang.String key,
                                      java.lang.String value)
Description copied from interface: XMLLibrary
Create a new tag, just like the XML Manager does.

Specified by:
createNewTag in interface XMLLibrary
Parameters:
key - the tag name/key
value - the value of the inside of the tag, if any.
Returns:
the new tag object

parseOutAngleBrackets

public java.lang.String parseOutAngleBrackets(java.lang.String s)
Description copied from interface: XMLLibrary
parse a tag value for safety Usage: String val=parseOutAngleBrackets(ThisValue);

Specified by:
parseOutAngleBrackets in interface XMLLibrary
Parameters:
s - String to parse
Returns:
String parsed value

parseOutAngleBracketsAndQuotes

public java.lang.String parseOutAngleBracketsAndQuotes(java.lang.String s)
Description copied from interface: XMLLibrary
parse a tag value for safety Usage: String val=parseOutAngleBracketsAndQuotes(ThisValue);

Specified by:
parseOutAngleBracketsAndQuotes in interface XMLLibrary
Parameters:
s - String to parse
Returns:
String parsed value

restoreAngleBrackets

public java.lang.String restoreAngleBrackets(java.lang.String s)
Description copied from interface: XMLLibrary
restore a tag value parsed for safety Usage: String val=restoreAngleBrackets(ThisValue);

Specified by:
restoreAngleBrackets in interface XMLLibrary
Parameters:
s - String to parse
Returns:
String unparsed value

s_double

protected static double s_double(java.lang.String DOUBLE)
Returns the double value of a string without crashing Usage: dSize = WebIQBase.s_double(WebIQBase.getRes(AttStatsRes,"BlobSize"));

Parameters:
DOUBLE - String to convert
Returns:
double Double value of the string

s_int

protected static int s_int(java.lang.String INT)
Returns the integer value of a string without crashing Usage: int num=s_int(CMD.substring(14));

Parameters:
INT - Integer value of string
Returns:
int Integer value of the string

s_short

protected static short s_short(java.lang.String SHORT)
Returns the short value of a string without crashing Usage: int num=s_short(CMD.substring(14));

Parameters:
SHORT - Short value of string
Returns:
short Short value of the string

s_long

protected static long s_long(java.lang.String LONG)
Returns the long value of a string without crashing Usage: int num=s_long(CMD.substring(14));

Parameters:
LONG - Long value of string
Returns:
long Long value of the string

convertXMLtoTag

public java.lang.String convertXMLtoTag(java.lang.String TName,
                                        java.lang.String Data)
Return the outer wrapper and contents of an XML tag <TNAME>Data</TNAME> Usage: Data+=XMLoTag("MODELOBJECTONE",VA.ModelObjectOne);

Specified by:
convertXMLtoTag in interface XMLLibrary
Parameters:
TName - Tag name to use
Data - the data to embed
Returns:
String Information corresponding to the tname

convertXMLtoTag

public java.lang.String convertXMLtoTag(java.lang.String TName,
                                        int Data)
Return the outer wrapper and contents of an XML tag <TNAME>Data</TNAME> Usage: Data+=XMLoTag("MODELOBJECTONE",VA.ModelObjectOne);

Specified by:
convertXMLtoTag in interface XMLLibrary
Parameters:
TName - Tag name to use
Data - the data to embed
Returns:
String Information corresponding to the tname

convertXMLtoTag

public java.lang.String convertXMLtoTag(java.lang.String TName,
                                        short Data)
Return the outer wrapper and contents of an XML tag <TNAME>Data</TNAME> Usage: Data+=XMLoTag("MODELOBJECTONE",VA.ModelObjectOne);

Specified by:
convertXMLtoTag in interface XMLLibrary
Parameters:
TName - Tag name to use
Data - the data to embed
Returns:
String Information corresponding to the tname

convertXMLtoTag

public java.lang.String convertXMLtoTag(java.lang.String TName,
                                        boolean Data)
Return the outer wrapper and contents of an XML tag <TNAME>Data</TNAME> Usage: Data+=XMLoTag("MODELOBJECTONE",VA.ModelObjectOne);

Specified by:
convertXMLtoTag in interface XMLLibrary
Parameters:
TName - Tag name to use
Data - the data to embed
Returns:
String Information corresponding to the tname

convertXMLtoTag

public java.lang.String convertXMLtoTag(java.lang.String TName,
                                        long Data)
Return the outer wrapper and contents of an XML tag <TNAME>Data</TNAME> Usage: Data+=XMLoTag("MODELOBJECTONE",VA.ModelObjectOne);

Specified by:
convertXMLtoTag in interface XMLLibrary
Parameters:
TName - Tag name to use
Data - the data to embed
Returns:
String Information corresponding to the tname

returnXMLBlock

public java.lang.String returnXMLBlock(java.lang.String Blob,
                                       java.lang.String Tag)
Return the contents of an XML tag, given the tag to search for Usage: String XML=returnXMLBlock(Response,"PDIModelErrors");

Specified by:
returnXMLBlock in interface XMLLibrary
Parameters:
Blob - String to searh
Tag - Tag name to search for
Returns:
String Information corresponding to the tname

getValFromPieces

public java.lang.String getValFromPieces(java.util.List<XMLLibrary.XMLTag> V,
                                         java.lang.String tag)
Description copied from interface: XMLLibrary
Returns the value of the tag, if it exists in the given tag collection

Specified by:
getValFromPieces in interface XMLLibrary
Parameters:
V - the tag collection (container tag)
tag - the tag to look for
Returns:
its value, or null

getValFromPieces

public java.lang.String getValFromPieces(java.util.List<XMLLibrary.XMLTag> V,
                                         java.lang.String tag,
                                         java.lang.String defVal)
Description copied from interface: XMLLibrary
Returns the value of the tag, if it exists in the given tag collection

Specified by:
getValFromPieces in interface XMLLibrary
Parameters:
V - the tag collection (container tag)
tag - the tag to look for
defVal - the value to return if the tag doesn't exist
Returns:
the tags value, or defValue

getContentsFromPieces

public java.util.List<XMLLibrary.XMLTag> getContentsFromPieces(java.util.List<XMLLibrary.XMLTag> V,
                                                               java.lang.String tag)
Description copied from interface: XMLLibrary
Returns the contents of a container tag, searched for in another container tags contents

Specified by:
getContentsFromPieces in interface XMLLibrary
Parameters:
V - the container tags contents
tag - the tag to look for
Returns:
the tags contained in tag, or null

getPieceFromPieces

public XMLLibrary.XMLTag getPieceFromPieces(java.util.List<XMLLibrary.XMLTag> V,
                                            java.lang.String tag)
Description copied from interface: XMLLibrary
Returns the xml tag node for the given tag name, if found in the given tag container contents

Specified by:
getPieceFromPieces in interface XMLLibrary
Parameters:
V - the tag container contents
tag - the tag name
Returns:
the xml tag node for the given tag name

isTagInPieces

public boolean isTagInPieces(java.util.List<XMLLibrary.XMLTag> V,
                             java.lang.String tag)
Description copied from interface: XMLLibrary
Return where the value is within a given XML block <TAG>Data</TAG> Usage: boolean ThisColHead=isTagInPieces(ThisRow,"TD");

Specified by:
isTagInPieces in interface XMLLibrary
Parameters:
V - Pieces to search
tag - Tag to search for
Returns:
boolean Information from XML block

getPiecesFromPieces

public java.util.List<XMLLibrary.XMLTag> getPiecesFromPieces(java.util.List<XMLLibrary.XMLTag> V,
                                                             java.lang.String tag)
Description copied from interface: XMLLibrary
Returns all tags inside the gives set that match this tag name

Specified by:
getPiecesFromPieces in interface XMLLibrary
Parameters:
V - the container tags contents
tag - the tag to look for
Returns:
all the tags contained in tag

getBoolFromPieces

public boolean getBoolFromPieces(java.util.List<XMLLibrary.XMLTag> V,
                                 java.lang.String tag)
Description copied from interface: XMLLibrary
Return the data value within a given XML block <TAG>Data</TAG> Usage: String ThisColHead=getBoolFromPieces(ThisRow,"TD");

Specified by:
getBoolFromPieces in interface XMLLibrary
Parameters:
V - Pieces to search
tag - Tag to search for
Returns:
boolean Information from XML block

getIntFromPieces

public int getIntFromPieces(java.util.List<XMLLibrary.XMLTag> V,
                            java.lang.String tag)
Description copied from interface: XMLLibrary
Return the data value within a given XML block <TAG>Data</TAG> Usage: String ThisColHead=getIntFromPieces(ThisRow,"TD");

Specified by:
getIntFromPieces in interface XMLLibrary
Parameters:
V - Pieces to search
tag - Tag to search for
Returns:
int Information from XML block

getShortFromPieces

public short getShortFromPieces(java.util.List<XMLLibrary.XMLTag> V,
                                java.lang.String tag)
Description copied from interface: XMLLibrary
Return the data value within a given XML block <TAG>Data</TAG> Usage: String ThisColHead=getShortFromPieces(ThisRow,"TD");

Specified by:
getShortFromPieces in interface XMLLibrary
Parameters:
V - Pieces to search
tag - Tag to search for
Returns:
short Information from XML block

getLongFromPieces

public long getLongFromPieces(java.util.List<XMLLibrary.XMLTag> V,
                              java.lang.String tag)
Description copied from interface: XMLLibrary
Return the data value within a given XML block <TAG>Data</TAG> Usage: String ThisColHead=getLongFromPieces(ThisRow,"TD");

Specified by:
getLongFromPieces in interface XMLLibrary
Parameters:
V - Pieces to search
tag - Tag to search for
Returns:
long Information from XML block

getDoubleFromPieces

public double getDoubleFromPieces(java.util.List<XMLLibrary.XMLTag> V,
                                  java.lang.String tag)
Description copied from interface: XMLLibrary
Return the data value within a given XML block <TAG>Data</TAG> Usage: String ThisColHead=getDoubleFromPieces(ThisRow,"TD");

Specified by:
getDoubleFromPieces in interface XMLLibrary
Parameters:
V - Pieces to search
tag - Tag to search for
Returns:
double Information from XML block

getBoolFromPieces

public boolean getBoolFromPieces(java.util.List<XMLLibrary.XMLTag> V,
                                 java.lang.String tag,
                                 boolean defVal)
Description copied from interface: XMLLibrary
Return the data value within a given XML block <TAG>Data</TAG> Usage: String ThisColHead=getBoolFromPieces(ThisRow,"TD");

Specified by:
getBoolFromPieces in interface XMLLibrary
Parameters:
V - Pieces to search
tag - Tag to search for
defVal - the value to return if the tag doesn't exist
Returns:
the tags value, or defValue

getIntFromPieces

public int getIntFromPieces(java.util.List<XMLLibrary.XMLTag> V,
                            java.lang.String tag,
                            int defVal)
Description copied from interface: XMLLibrary
Return the data value within a given XML block <TAG>Data</TAG> Usage: String ThisColHead=getIntFromPieces(ThisRow,"TD");

Specified by:
getIntFromPieces in interface XMLLibrary
Parameters:
V - Pieces to search
tag - Tag to search for
defVal - the value to return if the tag doesn't exist
Returns:
the tags value, or defValue

getShortFromPieces

public short getShortFromPieces(java.util.List<XMLLibrary.XMLTag> V,
                                java.lang.String tag,
                                short defVal)
Description copied from interface: XMLLibrary
Return the data value within a given XML block <TAG>Data</TAG> Usage: String ThisColHead=getShortFromPieces(ThisRow,"TD");

Specified by:
getShortFromPieces in interface XMLLibrary
Parameters:
V - Pieces to search
tag - Tag to search for
defVal - the value to return if the tag doesn't exist
Returns:
the tags value, or defValue

getLongFromPieces

public long getLongFromPieces(java.util.List<XMLLibrary.XMLTag> V,
                              java.lang.String tag,
                              long defVal)
Description copied from interface: XMLLibrary
Return the data value within a given XML block <TAG>Data</TAG> Usage: String ThisColHead=getLongFromPieces(ThisRow,"TD");

Specified by:
getLongFromPieces in interface XMLLibrary
Parameters:
V - Pieces to search
tag - Tag to search for
defVal - the value to return if the tag doesn't exist
Returns:
the tags value, or defValue

getDoubleFromPieces

public double getDoubleFromPieces(java.util.List<XMLLibrary.XMLTag> V,
                                  java.lang.String tag,
                                  double defVal)
Description copied from interface: XMLLibrary
Return the data value within a given XML block <TAG>Data</TAG> Usage: String ThisColHead=getDoubleFromPieces(ThisRow,"TD");

Specified by:
getDoubleFromPieces in interface XMLLibrary
Parameters:
V - Pieces to search
tag - Tag to search for
defVal - the value to return if the tag doesn't exist
Returns:
the tags value, or defValue

changeTagState

protected void changeTagState(XMLManager.State newState)

changedTagState

protected void changedTagState(XMLManager.State newState)

abandonTagState

protected void abandonTagState(XMLManager.State newState)

handleTagBounds

protected void handleTagBounds()

startState

protected void startState(char c)

beforeTag

protected void beforeTag(char c)

canStartPiece

protected boolean canStartPiece(int endOfTagName)

startPiece

protected void startPiece(int endOfTagName)

doneWithPiece

protected void doneWithPiece(int outerEnd)

closePiece

protected void closePiece(int outerEnd)

inTag

protected void inTag(char c)

beginTagSelfEnd

protected void beginTagSelfEnd(char c)

beforeCloseTag

protected void beforeCloseTag(char c)

inCloseTag

protected void inCloseTag(char c)

afterCloseTag

protected void afterCloseTag(char c)

beforeAttrib

protected void beforeAttrib(char c)

beAttrib

protected void beAttrib(char c)

endEmptyAttrib

protected void endEmptyAttrib(int endOfAttrib)

inAttrib

protected void inAttrib(char c)

inPostAttrib

protected void inPostAttrib(char c)

assignAttrib

protected void assignAttrib(int endOfValue)

beforeAttribValue

protected void beforeAttribValue(char c)

inAttribValue

protected void inAttribValue(char c)

inQuotedAttribValue

protected void inQuotedAttribValue(char c)

parseXML

protected XMLLibrary.XMLTag parseXML()

parseAllXML

public java.util.List<XMLLibrary.XMLTag> parseAllXML(java.lang.String buf)
Description copied from interface: XMLLibrary
Parses all xml inside the given string buffer and returns the root tags as a container collection.

Specified by:
parseAllXML in interface XMLLibrary
Parameters:
buf - the string to parse
Returns:
the parsed xml

parseAllXML

public java.util.List<XMLLibrary.XMLTag> parseAllXML(java.lang.StringBuffer buf)
Description copied from interface: XMLLibrary
Parses all xml inside the given stringbuffer and returns the root tags as a container collection.

Specified by:
parseAllXML in interface XMLLibrary
Parameters:
buf - the string to parse
Returns:
the parsed xml

returnXMLValue

public java.lang.String returnXMLValue(java.lang.String Blob)
Description copied from interface: XMLLibrary
Return the data value within the first XML block <TAG>Data</TAG> Usage: String ThisColHead=returnXMLValue(ThisRow);

Specified by:
returnXMLValue in interface XMLLibrary
Parameters:
Blob - String to searh
Returns:
String Information from first XML block

returnXMLValue

public java.lang.String returnXMLValue(java.lang.String Blob,
                                       java.lang.String Tag)
Description copied from interface: XMLLibrary
Return the data value within a given XML block <TAG>Data</TAG> Usage: String ThisColHead=returnXMLValue(ThisRow,"TD");

Specified by:
returnXMLValue in interface XMLLibrary
Parameters:
Blob - String to search
Tag - Tag to search for
Returns:
String Information from XML block

returnXMLBoolean

public boolean returnXMLBoolean(java.lang.String Blob,
                                java.lang.String Tag)
Description copied from interface: XMLLibrary
Return the data value within a given XML block <TAG>Data</TAG> Usage: String ThisColHead=returnXMLValue(ThisRow,"TD");

Specified by:
returnXMLBoolean in interface XMLLibrary
Parameters:
Blob - String to search
Tag - Tag to search for
Returns:
String Information from XML block

getXMLList

public java.lang.String getXMLList(java.util.List<java.lang.String> V)
Description copied from interface: XMLLibrary
Converts the given list of strings into a set of top-level xml tags called simply <X>

Specified by:
getXMLList in interface XMLLibrary
Parameters:
V - the list of strings
Returns:
the top level xml tags

parseXMLList

public java.util.List<java.lang.String> parseXMLList(java.lang.String numberedList)
Description copied from interface: XMLLibrary
Parses a list of single-level xml tags, together in string. This method assumes that the given string is a series of top level tags, with no child tags, and no attributes. It will parse the tags, and return their values (only) as a list of strings. Any deconversions for compatibility are also performed

Specified by:
parseXMLList in interface XMLLibrary
Parameters:
numberedList - the top level xml tags
Returns:
the list of strings with the values of those tags

fromPOJOFieldtoXML

protected java.lang.String fromPOJOFieldtoXML(java.lang.Class<?> type,
                                              java.lang.Object val)
Converts a pojo field to a xml value.

Parameters:
type - the class type
val - the value
Returns:
the xml value

fromPOJOtoXML

public java.lang.String fromPOJOtoXML(java.lang.Object o)
Converts a pojo object to a XML document.

Specified by:
fromPOJOtoXML in interface XMLLibrary
Parameters:
o - the object to convert
Returns:
the XML document

toXML

public java.lang.String toXML(java.util.Map<java.lang.String,java.lang.String> map)
Description copied from interface: XMLLibrary
Converts a map into an xml document

Specified by:
toXML in interface XMLLibrary
Returns:
an xml document

fromXML

public java.util.Map<java.lang.String,java.lang.String> fromXML(java.lang.String str)
Description copied from interface: XMLLibrary
Converts a map into an xml document

Specified by:
fromXML in interface XMLLibrary
Returns:
an xml document

fromXMLtoPOJO

public void fromXMLtoPOJO(java.lang.String XML,
                          java.lang.Object o)
Converts a JSON document to a XML object.

Specified by:
fromXMLtoPOJO in interface XMLLibrary
Parameters:
XML - the XML document
o - the object to convert

fromXMLtoPOJO

public void fromXMLtoPOJO(java.util.List<XMLLibrary.XMLTag> xmlObj,
                          java.lang.Object o)
Converts a xml object to a pojo object.

Specified by:
fromXMLtoPOJO in interface XMLLibrary
Parameters:
xmlObj - the json object
o - the object to convert