spase.parser200
Class XMLParser

java.lang.Object
  extended by spase.parser200.XMLParser
Direct Known Subclasses:
AccessInformation, AccessURL, Association, AzimuthalAngleRange, Bin, Checksum, Contact, CoordinateSystem, DataExtent, Element, EnergyRange, Field, FrequencyRange, InformationURL, Location, Mixed, ObservationExtent, Parameter, Particle, PolarAngleRange, RenderingHints, Resource, ResourceHeader, Source, Structure, Support, TemporalDescription, TimeSpan, Wave, WavelengthRange

public class XMLParser
extends java.lang.Object

An example XML parser.

Since:
1.0.0

Constructor Summary
XMLParser()
          Creates an instance of a XML
 
Method Summary
 void addRequired(java.lang.String value)
           
 void dump()
          Prints the XML document to the currently define System.out.
 void dumpData(java.io.PrintStream out)
          Dump the CData sections of the XML
 void dumpNode(java.io.PrintStream out, org.w3c.dom.Node node)
          Dump the nodes of the XML
static java.lang.String entityEncode(java.lang.String text)
          Convert special characters in a string for use in an HTML document.
 org.w3c.dom.Node findNode(org.w3c.dom.Node node, java.lang.String name)
          Find the next node with the given name.
 java.util.ArrayList<java.lang.String> getAllValues(java.lang.String path)
          Return the list of values of a member given the XPath like reference to the member.
static java.lang.String getBranchText(org.w3c.dom.Node node)
          Concatenate all the text under a node.
 java.lang.String getClassName()
           
static javax.xml.transform.stream.StreamSource getDefaultStyleSheet()
          Obtain a StreamSource to the default XML Style Sheet.
 org.w3c.dom.Document getDocument()
          Obtain the Document containing the representation of the parsed XML files.
 java.lang.String getElementPath(java.lang.String base, int key)
          Construct an abbreviated XPath for a a class node.
 java.lang.String getMemberName(java.lang.String name)
          Extract the member name from an XPath string.
 XMLParser getMemberNode(java.lang.String name)
          Locates a node in a structure based on the the "name" associated with the member.
 int getMemberNodeIndex(java.lang.String name)
          Extracts the index portion of node reference.
 java.lang.String getMemberNodeName(java.lang.String name)
          Extracts the name portion of node reference.
 XMLParser getMemberParent(java.lang.String name)
          Find the parent class for a member.
 java.lang.String getMemberPath(java.lang.String name)
          Extract the path to a member from an XPath string.
 java.util.ArrayList<XMLParser> getNodes(java.lang.String path)
          Return the list of nodes of a member given the XPath like reference to the member.
 java.util.ArrayList<XMLParser> getNodes(java.lang.String path, boolean alwaysOne)
          Return the list of nodes of a member given the XPath like reference to the member.
 java.util.ArrayList<XMLParser> getNodes(XMLParser parent, java.lang.String name)
          Return the list of nodes given the name of the member.
static java.lang.String getNodeText(org.w3c.dom.Node node)
          Concatenate all the text under a node.
 java.lang.String getPath()
          Return the path to the parsed document
 java.lang.String getPathName()
          Return the pathname of the parsed document
 java.util.ArrayList getRequired()
           
 java.io.StringReader getStringReader()
          Return a StringReader for an XML representation of the document.
 java.lang.String getTagClose(int level, java.lang.String tagName)
          Return an close tag with the proper indentation.
 java.lang.String getTaggedList(int level, java.lang.String tagName, java.util.ArrayList<java.lang.String> list)
          Return a list of tagged values, properly indented.
 java.lang.String getTaggedList(int level, java.lang.String tagName, java.util.ArrayList<java.lang.String> list, boolean inUseOnly)
          Return a list of tagged values, properly indented.
 java.lang.String getTaggedValue(int level, java.lang.String tagName, java.lang.String value)
          Return a value enclosed in a tag and properly indented.
 java.lang.String getTaggedValue(int level, java.lang.String tagName, java.lang.String value, boolean inUseOnly)
          Return a value enclosed in a tag and properly indented.
 java.lang.String getTagOpen(int level, java.lang.String tagName)
          Return an open tag with the proper indentation.
 XMLParser getTopParent(java.lang.String name)
          Find the top level parent class for a member.
 java.util.ArrayList<java.lang.String> getValues(java.lang.String path)
          Return the list of values of a member given the XPath like reference to the member.
 java.util.ArrayList<java.lang.String> getValues(java.lang.String path, boolean alwaysOne)
          Return the list of values of a member given the XPath like reference to the member.
 java.util.ArrayList<java.lang.String> getWords()
          Walk the internals of a class and collect a unique list of words from all String fields.
 java.lang.String getXMLDocument(int n)
          Return a string containing an XML representation of this instance.
 java.lang.String getXMLDocument(int n, boolean inUseOnly)
          Return a string containing an XML representation of this instance.
 java.lang.String getXMLDocument(int n, java.lang.String path, int key)
          Return a string containing an XML representation of this isntance.
 java.lang.String getXMLDocument(int n, java.lang.String path, int key, boolean inUseOnly)
          Return a string containing an XML representation of this isntance.
static java.util.ArrayList<Pair> getXPathList(java.lang.String prefix, java.util.ArrayList<java.lang.String> list)
          Get a list of values labeled with an XPath.
 java.util.ArrayList<Pair> getXPathPairs()
          Return an ArrayList of string Pairs which contains for each node in the XML document an XPath as the "left" value of the pair and the value as the "right" value of pair.
 java.util.ArrayList<Pair> getXPathPairs(java.lang.String prefix, int index)
          Return an ArrayList of string Pairs which contains for each node in the XML document an XPath as the "left" value of the pair and the value as the "right" value of pair.
static java.lang.String indent(int level)
          Return a string with spaces to format to indicated indentation level.
 boolean isCommonWord(java.lang.String value)
          Determine if a word is a common word.
 boolean isInList(java.util.ArrayList<java.lang.String> value, java.util.ArrayList<java.lang.String> list, boolean all)
          Determine if any or all items in a String ArrayList is in a string ArrayList.
 boolean isInList(java.lang.String value, java.util.ArrayList<java.lang.String> list)
          Determine if an item is in a string ArrayList.
 boolean isInList(java.lang.String base, java.lang.String value, java.util.ArrayList list, int index)
          Determine if a list is of the proper type and the index is within the range of the list.
 boolean isInUse(java.lang.String name, java.lang.String value)
          Determine if an element is in use.
 boolean isMatch(java.lang.String base, java.lang.String value)
          Return a list of tagged values, properly indented.
 boolean isRequired(java.lang.String name)
          Determine if an element is required.
 void load(org.w3c.dom.Document document, java.lang.String root)
          Parses a Document which contains a parsed XML file and set internal variables with the contents of the file.
 void load(java.lang.String pathName)
          Parses a file containing XML into its constitute elments and sets internal variables with the contents of the file.
 void load(java.lang.String pathName, java.lang.String root)
          Parses a file containing XML into its constitute elments and sets internal variables with the contents of the file.
static void main(java.lang.String[] args)
          Entry point for testing
 void makeEditNodes()
          Create an instance of all nodes for use when editing.
 void makeNewMember(java.lang.String name)
          Create a new member.
 void makeSkeletonNodes()
          Create all nodes for use when editing which currently do not exist.
 java.lang.String makeTagContent(java.lang.String tag, java.lang.String content)
          Return a string with content enclosed in tags with the passed name.
 java.util.ArrayList<java.lang.String> parseWords(java.lang.String text)
          Parse a string into words and return a list of unique words.
 boolean parseXML(java.io.InputStream stream)
          Parses a file containing XML into its constitute elments.
 boolean parseXML(java.lang.String pathName)
          Parses a file containing XML into its constitute elments.
 boolean parseXMLString(java.lang.String text)
          Parses a string containing XML into its constitute elments.
 void printXML(java.io.PrintStream out)
          Generates an XML representation of the label and stream it to the print stream.
 void processNode(org.w3c.dom.Node node)
          Walk the nodes of the Document and populate the resource classes.
 void removeMember(java.lang.String name, int index)
          Remove an elment of a member.
 void setClassName(java.lang.String name)
           
 void setMember(java.lang.String name, org.w3c.dom.Node value)
          Call the set() method with a given name suffix and a DOM Node as an argument.
 java.lang.String setMember(java.lang.String name, java.lang.String value)
          Call the set() method with a given name suffix and a String as an argument.
 void setMember(java.lang.String name, java.lang.String[] value)
          Call the set() method with a given name suffix and an array of String values as an argument.
 java.lang.String[] splitMixed(java.lang.String text)
          Divide a string on capital letters that follow lowercase letters
static java.lang.String toImproperCase(java.lang.String value)
          Convert a string to "improper" case (make first letter lower case).
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

XMLParser

public XMLParser()
Creates an instance of a XML

Since:
1.0
Method Detail

main

public static void main(java.lang.String[] args)
Entry point for testing

Since:
1.0

load

public void load(java.lang.String pathName)
          throws java.lang.Exception
Parses a file containing XML into its constitute elments and sets internal variables with the contents of the file. The path and name of the file are passed to the method which is opened and parsed.

Parameters:
pathName - the fully qualified path and name of the file to parse.
Throws:
java.lang.Exception
Since:
1.0

load

public void load(java.lang.String pathName,
                 java.lang.String root)
          throws java.lang.Exception
Parses a file containing XML into its constitute elments and sets internal variables with the contents of the file. The path and name of the file are passed to the method which is opened and parsed.

Parameters:
pathName - the fully qualified path and name of the file to parse.
root - the name of the tag containg elements to process.
Throws:
java.lang.Exception
Since:
1.0

load

public void load(org.w3c.dom.Document document,
                 java.lang.String root)
          throws java.lang.Exception
Parses a Document which contains a parsed XML file and set internal variables with the contents of the file.

Parameters:
document - the Document representation of a parsed XML file.
root - the name of the tag containg elements to process.
Throws:
java.lang.Exception
Since:
1.0

parseXML

public boolean parseXML(java.lang.String pathName)
                 throws java.lang.Exception
Parses a file containing XML into its constitute elments. The path and name of the file are passed to the method which is opened and parsed.

Parameters:
pathName - the fully qualified path and name of the file to parse.
Returns:
true if the file could be opened; false otherwise.
Throws:
java.lang.Exception
Since:
1.0

parseXMLString

public boolean parseXMLString(java.lang.String text)
                       throws java.lang.Exception
Parses a string containing XML into its constitute elments.

Parameters:
text - the String conting the XML text.
Returns:
true if the file could be opened; false otherwise.
Throws:
java.lang.Exception
Since:
1.0

parseXML

public boolean parseXML(java.io.InputStream stream)
                 throws java.lang.Exception
Parses a file containing XML into its constitute elments. The file to parse must be previously opened and a InputStream pointing to the file is passed.

Parameters:
stream - a connection to a pre-opened file.
Returns:
true if the file could be read; false otherwise.
Throws:
java.lang.Exception
Since:
1.0

printXML

public void printXML(java.io.PrintStream out)
              throws java.lang.Exception
Generates an XML representation of the label and stream it to the print stream.

Parameters:
out - the stream to print the element to.
Throws:
java.lang.Exception
Since:
1.0

dumpData

public void dumpData(java.io.PrintStream out)
              throws java.lang.Exception
Dump the CData sections of the XML

Parameters:
out - the stream to print the element to.
Throws:
java.lang.Exception
Since:
1.0

dumpNode

public void dumpNode(java.io.PrintStream out,
                     org.w3c.dom.Node node)
Dump the nodes of the XML

Parameters:
out - the stream to print the element to.
Since:
1.0

findNode

public org.w3c.dom.Node findNode(org.w3c.dom.Node node,
                                 java.lang.String name)
                          throws java.lang.Exception
Find the next node with the given name.

Parameters:
node - the Node to start at.
name - the name of the node to look for.
Throws:
java.lang.Exception
Since:
1.0

getDefaultStyleSheet

public static javax.xml.transform.stream.StreamSource getDefaultStyleSheet()
Obtain a StreamSource to the default XML Style Sheet.

Returns:
a StreamSource which can be used to read the default style sheet.
Since:
1.0

getDocument

public org.w3c.dom.Document getDocument()
Obtain the Document containing the representation of the parsed XML files.

Returns:
a Document containing the representation of the parsed XML file.
Since:
1.0

processNode

public void processNode(org.w3c.dom.Node node)
                 throws java.lang.Exception
Walk the nodes of the Document and populate the resource classes. The name of each element encountered is used to find a method to store the value. The method search for has the element name with the prefix "set" and an parameter of type "String". If such a method is found the text contained by the element tags is passed to the method. Then a method with the prefix of "set" is with a parameter of of type "Node" is attempted. If such a method is found then method is called with the Node representing the element is passed as the argument.

Parameters:
node - the Node.
Throws:
java.lang.Exception
Since:
1.0

setMember

public java.lang.String setMember(java.lang.String name,
                                  java.lang.String value)
Call the set() method with a given name suffix and a String as an argument.

Parameters:
value - the String value to set.
Since:
1.0

setMember

public void setMember(java.lang.String name,
                      java.lang.String[] value)
Call the set() method with a given name suffix and an array of String values as an argument.

Parameters:
value - the String value to set.
Since:
1.0

setMember

public void setMember(java.lang.String name,
                      org.w3c.dom.Node value)
Call the set() method with a given name suffix and a DOM Node as an argument.

Parameters:
name - the name of the member (suffix for setXXX() method).
value - the String value to set.
Since:
1.0

getMemberParent

public XMLParser getMemberParent(java.lang.String name)
Find the parent class for a member. The syntax is [parent/]member where "parent/" can have multiple levels. If "parent" is blank, then its self-referential.

Parameters:
node - the Node.
Since:
1.0

getTopParent

public XMLParser getTopParent(java.lang.String name)
Find the top level parent class for a member. The syntax is [parent/]member where "parent/" can have multiple levels. If "parent" is blank, then its self-referential.

Parameters:
name - the XPath name for for the member.
Since:
1.0

getMemberPath

public java.lang.String getMemberPath(java.lang.String name)
Extract the path to a member from an XPath string. The path is the text preceeding the last node delimiter. The syntax is [parent/]member

Parameters:
name - The full path name of the node.
Since:
1.0

getMemberName

public java.lang.String getMemberName(java.lang.String name)
Extract the member name from an XPath string. The member name is the text following the last node delimiter. The syntax is [parent.]member

Parameters:
node - the Node.
Since:
1.0

getMemberNode

public XMLParser getMemberNode(java.lang.String name)
Locates a node in a structure based on the the "name" associated with the member. A "node" is a member of a class which also has members. To be implemented in each derived class. A name may have an option index. The full syntax is: "name[index]"

Parameters:
name - the name associated with a member.
Since:
1.0

getMemberNodeName

public java.lang.String getMemberNodeName(java.lang.String name)
Extracts the name portion of node reference. A node reference has the syntax "name[index]". The index ("[index]") is optional.

Parameters:
name - the name associated with a member.
Since:
1.0

getMemberNodeIndex

public int getMemberNodeIndex(java.lang.String name)
Extracts the index portion of node reference. A node reference has the syntax "name[index]". The index ("[index]") is optional. The default index is zero.

Parameters:
name - the name associated with a member.
Since:
1.0

getNodeText

public static java.lang.String getNodeText(org.w3c.dom.Node node)
Concatenate all the text under a node.

Parameters:
node - the Node.
Since:
1.0

getBranchText

public static java.lang.String getBranchText(org.w3c.dom.Node node)
                                      throws java.lang.Exception
Concatenate all the text under a node.

Parameters:
node - the Node.
Throws:
java.lang.Exception
Since:
1.0

getPathName

public java.lang.String getPathName()
Return the pathname of the parsed document

Since:
1.0

getPath

public java.lang.String getPath()
Return the path to the parsed document

Since:
1.0

makeTagContent

public java.lang.String makeTagContent(java.lang.String tag,
                                       java.lang.String content)
Return a string with content enclosed in tags with the passed name.

Since:
1.0

indent

public static java.lang.String indent(int level)
Return a string with spaces to format to indicated indentation level.

Since:
1.0

dump

public void dump()
Prints the XML document to the currently define System.out. Each node is labeled with its XPath.

Since:
1.0

getXPathPairs

public java.util.ArrayList<Pair> getXPathPairs()
Return an ArrayList of string Pairs which contains for each node in the XML document an XPath as the "left" value of the pair and the value as the "right" value of pair.

Since:
1.0

getXPathPairs

public java.util.ArrayList<Pair> getXPathPairs(java.lang.String prefix,
                                               int index)
Return an ArrayList of string Pairs which contains for each node in the XML document an XPath as the "left" value of the pair and the value as the "right" value of pair. The Prefix will be added to each path. If index is other than zero then the prefix will be modified to include the index.

Parameters:
prefix - the leading path to add to each XPath.
index - the index of the item if part of an array. Indexes start a 1, a value of 0 indicates it is not part of an array.
Since:
1.0

getXMLDocument

public java.lang.String getXMLDocument(int n)
Return a string containing an XML representation of this instance. To be implemented in each derived class.

Parameters:
n - the number of levels to indent the document.
Since:
1.0

getXMLDocument

public java.lang.String getXMLDocument(int n,
                                       boolean inUseOnly)
Return a string containing an XML representation of this instance. To be implemented in each derived class.

Parameters:
n - the number of levels to indent the document.
inUseOnly - indicates whether to include only those elements currently in use.
Since:
1.0

getXMLDocument

public java.lang.String getXMLDocument(int n,
                                       java.lang.String path,
                                       int key)
Return a string containing an XML representation of this isntance. To be implemented in each derived class.

Parameters:
n - the number of levels to indent the document.
path - the path to the element.
key - the index (key) of the element at the path.
Since:
1.0

getXMLDocument

public java.lang.String getXMLDocument(int n,
                                       java.lang.String path,
                                       int key,
                                       boolean inUseOnly)
Return a string containing an XML representation of this isntance. To be implemented in each derived class.

Parameters:
n - the number of levels to indent the document.
path - the path to the element.
key - the index (key) of the element at the path.
Since:
1.0

makeNewMember

public void makeNewMember(java.lang.String name)
Create a new member. To be implemented in each derived class.

Parameters:
name - the name of the member to create.
Since:
1.0

makeEditNodes

public void makeEditNodes()
Create an instance of all nodes for use when editing. To be implemented in each derived class.

Since:
1.0

makeSkeletonNodes

public void makeSkeletonNodes()
Create all nodes for use when editing which currently do not exist. To be implemented in each derived class.

Since:
1.0

removeMember

public void removeMember(java.lang.String name,
                         int index)
Remove an elment of a member. To be implemented in each derived class.

Parameters:
name - the name of the member to create.
index - the index of the element to remove.
Since:
1.0

getNodes

public java.util.ArrayList<XMLParser> getNodes(java.lang.String path)
Return the list of nodes of a member given the XPath like reference to the member. For example, if you want a list of "AccessURL" nodes in the "ResourceHeader" then the path would be "ResourceHeader.AccessURL"

Only returns nodes for items that are nodes.

Always returns a list with at least one entry. If no nodes are found then the returned entry is blank.

Since:
1.0

getNodes

public java.util.ArrayList<XMLParser> getNodes(java.lang.String path,
                                               boolean alwaysOne)
Return the list of nodes of a member given the XPath like reference to the member. For example, if you want a list of "AccessURL" nodes in the "ResourceHeader" then the path would be "ResourceHeader.AccessURL"

Only returns nodes for items that are nodes.

If no nodes are found then the returned list is empty unless alwaysOne is set to true.

Since:
1.0

getNodes

public java.util.ArrayList<XMLParser> getNodes(XMLParser parent,
                                               java.lang.String name)
Return the list of nodes given the name of the member.

Only returns nodes for items that are nodes.

If no nodes are found then the returned list is empty.

Since:
1.0

getAllValues

public java.util.ArrayList<java.lang.String> getAllValues(java.lang.String path)
Return the list of values of a member given the XPath like reference to the member. The XPath is a canonical path which includes node names only (no array indexes) For example, if you want all instances of the "URL" in "AccessURL" under "ResourceHeader" then the path would be "ResourceHeader/AccessURL/URL"

Only returns values for items that return String values.

Always returns a list with at least one entry. If no nodes are found then the returned entry is blank.

Since:
1.0

getValues

public java.util.ArrayList<java.lang.String> getValues(java.lang.String path)
Return the list of values of a member given the XPath like reference to the member. For example, if you want the "URL" in the second "AccessURL" item in the "ResourceHeader" then the path would be "ResourceHeader/AccessURL[1]/URL"

Only returns values for items that return String values.

Always returns a list with at least one entry. If no nodes are found then the returned entry is blank.

Since:
1.0

getValues

public java.util.ArrayList<java.lang.String> getValues(java.lang.String path,
                                                       boolean alwaysOne)
Return the list of values of a member given the XPath like reference to the member. For example, if you want the "URL" in the second "AccessURL" item in the "ResourceHeader" then the path would be "ResourceHeader/AccessURL[1]/URL"

Only returns values for items that return String values.

If no nodes are found then the returned list is empty unless alwaysOne is set to true.

Since:
1.0

getStringReader

public java.io.StringReader getStringReader()
Return a StringReader for an XML representation of the document. Commonly used to pass the document through an XML stylesheet transformation using Transform.

Since:
1.0

getTaggedValue

public java.lang.String getTaggedValue(int level,
                                       java.lang.String tagName,
                                       java.lang.String value)
Return a value enclosed in a tag and properly indented.

Since:
1.0

getTaggedValue

public java.lang.String getTaggedValue(int level,
                                       java.lang.String tagName,
                                       java.lang.String value,
                                       boolean inUseOnly)
Return a value enclosed in a tag and properly indented. If inUseOnly is true then only those elements that are required or have values defined are returned.

Since:
1.0

getTagOpen

public java.lang.String getTagOpen(int level,
                                   java.lang.String tagName)
Return an open tag with the proper indentation.

Since:
1.0

getTagClose

public java.lang.String getTagClose(int level,
                                    java.lang.String tagName)
Return an close tag with the proper indentation.

Since:
1.0

getTaggedList

public java.lang.String getTaggedList(int level,
                                      java.lang.String tagName,
                                      java.util.ArrayList<java.lang.String> list)
Return a list of tagged values, properly indented.

Since:
1.0

getTaggedList

public java.lang.String getTaggedList(int level,
                                      java.lang.String tagName,
                                      java.util.ArrayList<java.lang.String> list,
                                      boolean inUseOnly)
Return a list of tagged values, properly indented. If inUseOnly is true then only those elements that are required or have values defined are returned.

Since:
1.0

isMatch

public boolean isMatch(java.lang.String base,
                       java.lang.String value)
Return a list of tagged values, properly indented.

Since:
1.0

getElementPath

public java.lang.String getElementPath(java.lang.String base,
                                       int key)
Construct an abbreviated XPath for a a class node. A path has the form:
parent/className[key]
where "parent/" and "[key]" is optional

Since:
1.0

isInList

public boolean isInList(java.lang.String base,
                        java.lang.String value,
                        java.util.ArrayList list,
                        int index)
Determine if a list is of the proper type and the index is within the range of the list.

Since:
1.0

isInList

public boolean isInList(java.lang.String value,
                        java.util.ArrayList<java.lang.String> list)
Determine if an item is in a string ArrayList.

Since:
1.0

isInList

public boolean isInList(java.util.ArrayList<java.lang.String> value,
                        java.util.ArrayList<java.lang.String> list,
                        boolean all)
Determine if any or all items in a String ArrayList is in a string ArrayList.

Parameters:
all - if true then all words in value must be in list. otherwise if any word is in list then true is returned.
Since:
1.0

isCommonWord

public boolean isCommonWord(java.lang.String value)
Determine if a word is a common word.

Since:
1.0

toImproperCase

public static java.lang.String toImproperCase(java.lang.String value)
Convert a string to "improper" case (make first letter lower case).


parseWords

public java.util.ArrayList<java.lang.String> parseWords(java.lang.String text)
Parse a string into words and return a list of unique words. Common words, such as "a", "the", etc., are not included in the list.

Since:
1.0

splitMixed

public java.lang.String[] splitMixed(java.lang.String text)
Divide a string on capital letters that follow lowercase letters

Since:
1.0

getWords

public java.util.ArrayList<java.lang.String> getWords()
Walk the internals of a class and collect a unique list of words from all String fields. By convention the first letter of each member field starts with "m" so we drop the first letter when using the get() utility methods (i.e., getValues()) We also exclude anything that ends with "ID" since there are identifiers and have no language relevance.

Since:
1.0

isInUse

public boolean isInUse(java.lang.String name,
                       java.lang.String value)
Determine if an element is in use. An element is in use if the value in not empty or the element is required.

Parameters:
name - the name of the element.
value - the value associated with the element.
Since:
1.0

isRequired

public boolean isRequired(java.lang.String name)
Determine if an element is required. An element is required is it is in the list of required elements (see setRequired())

Parameters:
name - the name of the element.
Since:
1.0

getXPathList

public static java.util.ArrayList<Pair> getXPathList(java.lang.String prefix,
                                                     java.util.ArrayList<java.lang.String> list)
Get a list of values labeled with an XPath. With XPath the first item has index of 1.

Parameters:
node - the Node.
Since:
1.0

entityEncode

public static java.lang.String entityEncode(java.lang.String text)
Convert special characters in a string for use in an HTML document. Converts only the special ASCII characters of &, ", ', < and > to the corresponding HTML entities .


setClassName

public void setClassName(java.lang.String name)

getClassName

public java.lang.String getClassName()

addRequired

public void addRequired(java.lang.String value)

getRequired

public java.util.ArrayList getRequired()