|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Object | +--com.softcorporation.xmllight.XMLLight
XML Light Utilities.
| Field Summary | |
static boolean |
debug
Debug flag. |
static java.lang.String |
XML_DEFINITION
|
| Method Summary | |
static java.lang.String |
clearComments(java.lang.String doc)
Removes the comments in XML document. |
static java.lang.String |
decode(java.lang.String s)
Decodes the entities in string. |
static java.lang.String |
encode(java.lang.String value)
Encodes (escapes) XML entities in string. |
static java.lang.String |
encode(java.lang.String value,
boolean canonical)
Encodes (escapes) XML entities in string. |
static int |
findClosingTag(java.lang.String doc,
java.lang.String tag,
int[] pos,
boolean validate)
Sets Element from input string representing XML Element with shift to the beginning of the element in the string. |
static int |
findOpeningTag(java.lang.String doc,
java.lang.String tag,
int[] pos,
boolean validate)
Sets Element from input string representing XML Element with shift to the beginning of the element in the string. |
static Element |
getElem(java.lang.String doc)
Creates the XMLLight Element from the root element of XML document. |
static Element |
getElem(java.lang.String doc,
boolean validate)
Creates the XMLLight Element from the root element of XML document. |
static Element |
getElem(java.lang.String doc,
int start,
boolean validate)
Creates XMLLight Element from XML document starting from position defined in pos[0]. |
static Element |
getElem(java.lang.String doc,
java.lang.String elemName)
Searches in XML Document for Element with name elemName and creates new XMLLight Element from XML document. |
static Element |
getElem(java.lang.String doc,
java.lang.String elemName,
boolean validate)
Searches in XML Document for Element with name elemName and creates new XMLLight Element from XML document. |
static Element |
getElem(java.lang.String doc,
java.lang.String tag,
int start,
boolean validate)
Sets Element from input string representing XML Element with shift to the beginning of the element in the string. |
static java.lang.String |
getXMLDocument(Element elem)
Creates XML Document from XMLLight Element elem. |
static java.lang.String |
replace(java.lang.String source,
char chr,
java.lang.String str)
Replaces a character with string in source string. |
static void |
setLogWriter(java.io.PrintStream output)
Sets log output. |
static int |
skipSpaces(java.lang.String doc,
int start)
Skips spaces |
static void |
writeLog(java.lang.Exception ex)
Prints log to the standard output (console) if debug = true. |
static void |
writeLog(java.lang.String log)
Prints log to the standard output (console) if debug = true. |
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
public static boolean debug
public static java.lang.String XML_DEFINITION
| Method Detail |
public static void setLogWriter(java.io.PrintStream output)
output - handles debug messagespublic static void writeLog(java.lang.String log)
log - the debug messagepublic static void writeLog(java.lang.Exception ex)
ex - the Exception to log.
public static java.lang.String replace(java.lang.String source,
char chr,
java.lang.String str)
source - the source stringchr - the characterstr - the string
public static java.lang.String encode(java.lang.String value)
value - the string
public static java.lang.String encode(java.lang.String value,
boolean canonical)
value - the string to encodecanonical - if true then to normalize \n, \r
public static java.lang.String decode(java.lang.String s)
public static java.lang.String clearComments(java.lang.String doc)
public static java.lang.String getXMLDocument(Element elem)
elem - the XMLLight Element
public static Element getElem(java.lang.String doc)
throws XMLLightException
doc - the XML document as a string
XMLLightException
public static Element getElem(java.lang.String doc,
boolean validate)
throws XMLLightException
doc - the XML document as a string
XMLLightException
public static Element getElem(java.lang.String doc,
int start,
boolean validate)
throws XMLLightException
doc - the XML document as a string
XMLLightException
public static Element getElem(java.lang.String doc,
java.lang.String elemName)
throws XMLLightException
doc - the XML document as a stringelemName - searched Element name
XMLLightException
public static Element getElem(java.lang.String doc,
java.lang.String elemName,
boolean validate)
throws XMLLightException
doc - the XML document as a stringelemName - searched Element name
XMLLightException
public static Element getElem(java.lang.String doc,
java.lang.String tag,
int start,
boolean validate)
throws XMLLightException
tag - tag name
XMLLightException
public static int findOpeningTag(java.lang.String doc,
java.lang.String tag,
int[] pos,
boolean validate)
throws XMLLightException
tag - tag namepos - [0] - from position
[1] - found start of the tag
[2] - found end of the tag
XMLLightException
public static int findClosingTag(java.lang.String doc,
java.lang.String tag,
int[] pos,
boolean validate)
throws XMLLightException
tag - tag namepos - [0] - from position
[1] - found start of the tag
[2] - found end of the tag
XMLLightException
public static int skipSpaces(java.lang.String doc,
int start)
start -
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||