public class ElementParser
extends java.lang.Object
Element to or from a String.| Constructor and Description |
|---|
ElementParser()
Creates a new instance of ElementParser
|
| Modifier and Type | Method and Description |
|---|---|
static java.lang.Object |
convertToElementClass(org.licas_xml.abs.Element elemObj,
java.lang.String className)
Convert an xml element into the format as specified by the class name.
|
static java.lang.String |
getAttributeValue(java.lang.String attributeName,
org.licas_xml.abs.Element elemObj)
Get an attribute value from the element with the specified name.
|
static java.lang.String |
getParameterValue(org.licas_xml.abs.Element elemObj)
|
static java.lang.Object |
parse(java.lang.String xmlStr)
Parse the xml String to return the xml element.
|
static java.lang.String |
replaceElementSpecs(java.lang.String xmlStr)
Remove the element prefixes and return.
|
static java.lang.String |
serialize(org.licas_xml.abs.Element nextObj)
Convert the object into an XML-based String.
|
protected static java.lang.String |
serializeNextElement(org.licas_xml.abs.Node rootElem)
Convert an xml element and its subelements into String format.
|
static void |
setAttribute(java.lang.String attributeName,
java.lang.String attributeValue,
org.licas_xml.abs.Element elemObj)
Add an attribute to the element with the specified values.
|
public static java.lang.String replaceElementSpecs(java.lang.String xmlStr)
xmlStr - the string to remove prefixes from.public static void setAttribute(java.lang.String attributeName,
java.lang.String attributeValue,
org.licas_xml.abs.Element elemObj)
attributeName - the attribute name.attributeValue - the attribute value.elemObj - the xml element.public static java.lang.String getAttributeValue(java.lang.String attributeName,
org.licas_xml.abs.Element elemObj)
attributeName - the attribute name.elemObj - the xml element.public static java.lang.String getParameterValue(org.licas_xml.abs.Element elemObj)
throws java.lang.Exception
Const.PARAMETER
name and a VALUE element inside of that. If this is missing, then
return null.elemObj - the xml element with the nested parameter element.java.lang.Exception - any error.public static java.lang.Object convertToElementClass(org.licas_xml.abs.Element elemObj,
java.lang.String className)
throws java.lang.Exception
elemObj - an xml element to parse.className - the class name of the object to create.java.lang.Exception - any error.public static java.lang.Object parse(java.lang.String xmlStr)
throws java.lang.Exception
xmlStr - a description of the data.java.lang.Exception - any error.public static java.lang.String serialize(org.licas_xml.abs.Element nextObj)
throws java.lang.Exception
nextObj - the xml element to convert.java.lang.Exception - any error.protected static java.lang.String serializeNextElement(org.licas_xml.abs.Node rootElem)
throws java.lang.Exception
rootElem - the root element.java.lang.Exception - any error.