com.simonstl.fragment
Class Element
java.lang.Object
|
+--com.simonstl.fragment.Element
- public class Element
- extends java.lang.Object
The Element class stores information about elements (and perhaps someday attributes)
in a format that supports namespaces, allows the preservation of prefix information,
and supports matching on namespace URIs and localNames.
I may eventually add support for attributes, and also for wildcard matching on nsURI
and/or localName.
Version 0.03 added properties for content and attributes. It also added the eventElement()
method, which allows Element objects to write out their own SAX events. This should make
it easier to manage configuration in the future.
version 0.02 added the getKey() method, so that Elements could define their own keys.
This should permit future versions to support more complex matching than just nsURI>localName.
(Making that work will involve revisions to matchElement (String match) as well.)
Constructor Summary |
Element(Element oldElement)
|
Element(java.lang.String newNsURI,
java.lang.String newLocalName)
|
Element(java.lang.String newNsURI,
java.lang.String newLocalName,
java.lang.String newPrefix)
|
Element(java.lang.String newNsURI,
java.lang.String newLocalName,
java.lang.String newPrefix,
java.lang.String newContent)
|
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
nsURI
public java.lang.String nsURI
localName
public java.lang.String localName
prefix
public java.lang.String prefix
atts
public org.xml.sax.helpers.AttributesImpl atts
content
public java.lang.String content
Element
public Element(java.lang.String newNsURI,
java.lang.String newLocalName)
Element
public Element(java.lang.String newNsURI,
java.lang.String newLocalName,
java.lang.String newPrefix)
Element
public Element(java.lang.String newNsURI,
java.lang.String newLocalName,
java.lang.String newPrefix,
java.lang.String newContent)
Element
public Element(Element oldElement)
matchElement
public boolean matchElement(java.lang.String match)
getKey
public java.lang.String getKey()
setAtts
public void setAtts(org.xml.sax.helpers.AttributesImpl newAtts)
getAtts
public org.xml.sax.helpers.AttributesImpl getAtts()
setContent
public void setContent(java.lang.String newContent)
getContent
public java.lang.String getContent()
eventElement
public void eventElement(org.xml.sax.helpers.XMLFilterImpl handler)
throws org.xml.sax.SAXException
print
public void print()
toString
public java.lang.String toString()
- Overrides:
toString
in class java.lang.Object