com.purpletech.xml
Class XMLEntryListFactory
java.lang.Object
|
+--com.purpletech.xml.XMLEntryListFactory
- public class XMLEntryListFactory
- extends java.lang.Object
Note: an element can not have an element the same name as an
attribute
|
Field Summary |
boolean |
debug
|
boolean |
flattenText
take text nodes and flatten their XML contents into a string. |
boolean |
recurse
turn non-text elements into XMLEntryLists, recursively. |
static java.lang.String |
TEXT
type representing a text node |
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
TEXT
public static java.lang.String TEXT
- type representing a text node
recurse
public boolean recurse
- turn non-text elements into XMLEntryLists, recursively.
Default = true
flattenText
public boolean flattenText
- take text nodes and flatten their XML contents into a string.
E.g. <p>My <b>dog</b> has fleas</p>
turns into a node named "p" with contents
"My <b>dog</b> has fleas".
Note that if the type of the node is unknown, it'll make a best
guess, but may get confused by
"<p><b>My Dog</b></p>".
To identify a type, pass either a Class name or a Class object
into the setType() or setTypes() method
Default = true
debug
public boolean debug
XMLEntryListFactory
public XMLEntryListFactory()
XMLEntryListFactory
public XMLEntryListFactory(java.lang.Object[][] types)
debug
public void debug(java.lang.Object o)
setType
public void setType(java.lang.String name,
java.lang.Object type)
setTypes
public void setTypes(java.lang.Object[][] types)
parse
public XMLEntryList parse(org.w3c.dom.Node node)
throws XMLException
XMLException
parse
public XMLEntryList parse(org.w3c.dom.Node node,
XMLEntryList list)
throws XMLException
XMLException
makeChildList
protected XMLEntryList makeChildList(java.lang.String name)
parseList
protected XMLEntryList parseList(org.w3c.dom.Node node,
XMLEntryList list)
throws XMLException
XMLException
flattenEach
protected void flattenEach(XMLEntryList list)
throws XMLException
XMLException
main
public static void main(java.lang.String[] args)
throws XMLException,
javax.xml.parsers.ParserConfigurationException,
org.xml.sax.SAXException,
java.io.IOException
XMLException
javax.xml.parsers.ParserConfigurationException
org.xml.sax.SAXException
java.io.IOException
loadDocumentJAXP
public static org.w3c.dom.Document loadDocumentJAXP(java.lang.String filename)
throws javax.xml.parsers.ParserConfigurationException,
org.xml.sax.SAXException,
java.io.IOException
javax.xml.parsers.ParserConfigurationException
org.xml.sax.SAXException
java.io.IOException