CMObject
, Tickable
, CMLibrary
, XMLLibrary
, java.lang.Cloneable
, java.lang.Comparable<CMObject>
public class XMLManager extends StdLibrary implements XMLLibrary
Modifier and Type | Class | Description |
---|---|---|
protected static class |
XMLManager.State |
XMLLibrary.XMLTag
Modifier and Type | Field | Description |
---|---|---|
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 |
idConverter
isDebugging, name, serviceClient, tickStatus
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_BALLISTICK, TICKID_CLAN, TICKID_CLANITEM, TICKID_DEADBODY_DECAY, TICKID_ELECTRONICS, TICKID_EMAIL, TICKID_EVENT, 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_SHORTERMASK, TICKID_SOLITARYMASK, TICKID_SPECIALCOMBAT, TICKID_SPECIALMANEUVER, TICKID_SPELL_AFFECT, TICKID_SUPPORT, TICKID_TIMEAUCTION, TICKID_TRAP_DESTRUCTION, TICKID_TRAP_RESET
FILE_XML_BOUNDARY
Constructor | Description |
---|---|
XMLManager() |
Modifier and Type | Method | Description |
---|---|---|
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 an xml document into a map.
|
void |
fromXMLtoPOJO(java.lang.String XML,
java.lang.Object o) |
Converts a JSON document to a XML object.
|
void |
fromXMLtoPOJO(java.util.List<XMLLibrary.XMLTag> xmlObj,
java.lang.Object o) |
Converts a xml object to a pojo 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.
|
activate, getServiceClient, L, propertiesLoaded, shutdown
copyOf, initializeClass, name, newInstance
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
activate, checkDatabase, compareTo, copyOf, getServiceClient, getTickStatus, initializeClass, L, name, newInstance, propertiesLoaded, setThreadStatus, shutdown, tick
protected static final java.lang.String HEX_DIGITS
protected final java.lang.String[][] IGNORE_TAG_BOUNDS
protected int bufDex
protected com.planet_ink.coffee_mud.Libraries.XMLManager.XMLpiece piece
protected XMLManager.State state
protected int[] beginDex
protected int[] endDex
protected java.lang.StringBuffer buf
protected java.util.List<XMLLibrary.XMLTag> contents
protected java.util.Set<java.lang.String> illegalTags
public java.lang.String ID()
CMObject
ID
in interface CMObject
ID
in class StdLibrary
public XMLLibrary.XMLTag createNewTag(java.lang.String key, java.lang.String value)
XMLLibrary
createNewTag
in interface XMLLibrary
key
- the tag name/keyvalue
- the value of the inside of the tag, if any.public java.lang.String parseOutAngleBrackets(java.lang.String s)
XMLLibrary
parseOutAngleBrackets
in interface XMLLibrary
s
- String to parsepublic java.lang.String parseOutAngleBracketsAndQuotes(java.lang.String s)
XMLLibrary
parseOutAngleBracketsAndQuotes
in interface XMLLibrary
s
- String to parsepublic java.lang.String restoreAngleBrackets(java.lang.String s)
XMLLibrary
restoreAngleBrackets
in interface XMLLibrary
s
- String to parseprotected static double s_double(java.lang.String DOUBLE)
DOUBLE
- String to convertprotected static int s_int(java.lang.String INT)
INT
- Integer value of stringprotected static short s_short(java.lang.String SHORT)
SHORT
- Short value of stringprotected static long s_long(java.lang.String LONG)
LONG
- Long value of stringpublic java.lang.String convertXMLtoTag(java.lang.String TName, java.lang.String Data)
convertXMLtoTag
in interface XMLLibrary
TName
- Tag name to useData
- the data to embedpublic java.lang.String convertXMLtoTag(java.lang.String TName, int Data)
convertXMLtoTag
in interface XMLLibrary
TName
- Tag name to useData
- the data to embedpublic java.lang.String convertXMLtoTag(java.lang.String TName, short Data)
convertXMLtoTag
in interface XMLLibrary
TName
- Tag name to useData
- the data to embedpublic java.lang.String convertXMLtoTag(java.lang.String TName, boolean Data)
convertXMLtoTag
in interface XMLLibrary
TName
- Tag name to useData
- the data to embedpublic java.lang.String convertXMLtoTag(java.lang.String TName, long Data)
convertXMLtoTag
in interface XMLLibrary
TName
- Tag name to useData
- the data to embedpublic java.lang.String returnXMLBlock(java.lang.String Blob, java.lang.String Tag)
returnXMLBlock
in interface XMLLibrary
Blob
- String to searhTag
- Tag name to search forpublic java.lang.String getValFromPieces(java.util.List<XMLLibrary.XMLTag> V, java.lang.String tag)
XMLLibrary
getValFromPieces
in interface XMLLibrary
V
- the tag collection (container tag)tag
- the tag to look forpublic java.lang.String getValFromPieces(java.util.List<XMLLibrary.XMLTag> V, java.lang.String tag, java.lang.String defVal)
XMLLibrary
getValFromPieces
in interface XMLLibrary
V
- the tag collection (container tag)tag
- the tag to look fordefVal
- the value to return if the tag doesn't existpublic java.util.List<XMLLibrary.XMLTag> getContentsFromPieces(java.util.List<XMLLibrary.XMLTag> V, java.lang.String tag)
XMLLibrary
getContentsFromPieces
in interface XMLLibrary
V
- the container tags contentstag
- the tag to look forpublic XMLLibrary.XMLTag getPieceFromPieces(java.util.List<XMLLibrary.XMLTag> V, java.lang.String tag)
XMLLibrary
getPieceFromPieces
in interface XMLLibrary
V
- the tag container contentstag
- the tag namepublic boolean isTagInPieces(java.util.List<XMLLibrary.XMLTag> V, java.lang.String tag)
XMLLibrary
isTagInPieces
in interface XMLLibrary
V
- Pieces to searchtag
- Tag to search forpublic java.util.List<XMLLibrary.XMLTag> getPiecesFromPieces(java.util.List<XMLLibrary.XMLTag> V, java.lang.String tag)
XMLLibrary
getPiecesFromPieces
in interface XMLLibrary
V
- the container tags contentstag
- the tag to look forpublic boolean getBoolFromPieces(java.util.List<XMLLibrary.XMLTag> V, java.lang.String tag)
XMLLibrary
getBoolFromPieces
in interface XMLLibrary
V
- Pieces to searchtag
- Tag to search forpublic int getIntFromPieces(java.util.List<XMLLibrary.XMLTag> V, java.lang.String tag)
XMLLibrary
getIntFromPieces
in interface XMLLibrary
V
- Pieces to searchtag
- Tag to search forpublic short getShortFromPieces(java.util.List<XMLLibrary.XMLTag> V, java.lang.String tag)
XMLLibrary
getShortFromPieces
in interface XMLLibrary
V
- Pieces to searchtag
- Tag to search forpublic long getLongFromPieces(java.util.List<XMLLibrary.XMLTag> V, java.lang.String tag)
XMLLibrary
getLongFromPieces
in interface XMLLibrary
V
- Pieces to searchtag
- Tag to search forpublic double getDoubleFromPieces(java.util.List<XMLLibrary.XMLTag> V, java.lang.String tag)
XMLLibrary
getDoubleFromPieces
in interface XMLLibrary
V
- Pieces to searchtag
- Tag to search forpublic boolean getBoolFromPieces(java.util.List<XMLLibrary.XMLTag> V, java.lang.String tag, boolean defVal)
XMLLibrary
getBoolFromPieces
in interface XMLLibrary
V
- Pieces to searchtag
- Tag to search fordefVal
- the value to return if the tag doesn't existpublic int getIntFromPieces(java.util.List<XMLLibrary.XMLTag> V, java.lang.String tag, int defVal)
XMLLibrary
getIntFromPieces
in interface XMLLibrary
V
- Pieces to searchtag
- Tag to search fordefVal
- the value to return if the tag doesn't existpublic short getShortFromPieces(java.util.List<XMLLibrary.XMLTag> V, java.lang.String tag, short defVal)
XMLLibrary
getShortFromPieces
in interface XMLLibrary
V
- Pieces to searchtag
- Tag to search fordefVal
- the value to return if the tag doesn't existpublic long getLongFromPieces(java.util.List<XMLLibrary.XMLTag> V, java.lang.String tag, long defVal)
XMLLibrary
getLongFromPieces
in interface XMLLibrary
V
- Pieces to searchtag
- Tag to search fordefVal
- the value to return if the tag doesn't existpublic double getDoubleFromPieces(java.util.List<XMLLibrary.XMLTag> V, java.lang.String tag, double defVal)
XMLLibrary
getDoubleFromPieces
in interface XMLLibrary
V
- Pieces to searchtag
- Tag to search fordefVal
- the value to return if the tag doesn't existprotected void changeTagState(XMLManager.State newState)
protected void changedTagState(XMLManager.State newState)
protected void abandonTagState(XMLManager.State newState)
protected void handleTagBounds()
protected void startState(char c)
protected void beforeTag(char c)
protected boolean canStartPiece(int endOfTagName)
protected void startPiece(int endOfTagName)
protected void doneWithPiece(int outerEnd)
protected void closePiece(int outerEnd)
protected void inTag(char c)
protected void beginTagSelfEnd(char c)
protected void beforeCloseTag(char c)
protected void inCloseTag(char c)
protected void afterCloseTag(char c)
protected void beforeAttrib(char c)
protected void beAttrib(char c)
protected void endEmptyAttrib(int endOfAttrib)
protected void inAttrib(char c)
protected void inPostAttrib(char c)
protected void assignAttrib(int endOfValue)
protected void beforeAttribValue(char c)
protected void inAttribValue(char c)
protected void inQuotedAttribValue(char c)
protected XMLLibrary.XMLTag parseXML()
public java.util.List<XMLLibrary.XMLTag> parseAllXML(java.lang.String buf)
XMLLibrary
parseAllXML
in interface XMLLibrary
buf
- the string to parsepublic java.util.List<XMLLibrary.XMLTag> parseAllXML(java.lang.StringBuffer buf)
XMLLibrary
parseAllXML
in interface XMLLibrary
buf
- the string to parsepublic java.lang.String returnXMLValue(java.lang.String Blob)
XMLLibrary
returnXMLValue
in interface XMLLibrary
Blob
- String to searhpublic java.lang.String returnXMLValue(java.lang.String Blob, java.lang.String Tag)
XMLLibrary
returnXMLValue
in interface XMLLibrary
Blob
- String to searchTag
- Tag to search forpublic boolean returnXMLBoolean(java.lang.String Blob, java.lang.String Tag)
XMLLibrary
returnXMLBoolean
in interface XMLLibrary
Blob
- String to searchTag
- Tag to search forpublic java.lang.String getXMLList(java.util.List<java.lang.String> V)
XMLLibrary
getXMLList
in interface XMLLibrary
V
- the list of stringspublic java.util.List<java.lang.String> parseXMLList(java.lang.String numberedList)
XMLLibrary
parseXMLList
in interface XMLLibrary
numberedList
- the top level xml tagsprotected java.lang.String fromPOJOFieldtoXML(java.lang.Class<?> type, java.lang.Object val)
type
- the class typeval
- the valuepublic java.lang.String fromPOJOtoXML(java.lang.Object o)
fromPOJOtoXML
in interface XMLLibrary
o
- the object to convertpublic java.lang.String toXML(java.util.Map<java.lang.String,java.lang.String> map)
XMLLibrary
toXML
in interface XMLLibrary
map
- the map to turn into an xml docpublic java.util.Map<java.lang.String,java.lang.String> fromXML(java.lang.String str)
XMLLibrary
fromXML
in interface XMLLibrary
str
- the xml documentpublic void fromXMLtoPOJO(java.lang.String XML, java.lang.Object o)
fromXMLtoPOJO
in interface XMLLibrary
XML
- the XML documento
- the object to convertpublic void fromXMLtoPOJO(java.util.List<XMLLibrary.XMLTag> xmlObj, java.lang.Object o)
fromXMLtoPOJO
in interface XMLLibrary
xmlObj
- the json objecto
- the object to convert