|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--com.simonstl.fragment.DocComponent | +--com.simonstl.fragment.Element
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.06 extends DocComponent rather than trying to handle all cases itself.
Version 0.05 adds support for beforeInside
and afterInside
attributes,
allowing rules to add content inside of the element they create.
Version 0.04 changed support for skipping, allowing for the chars
element to operate when character output is desired. It also now calls the startChars()
and endChars() methods of FragmentFilter
to
give these characters their own place in the stack. Finally, it now supports
before
and after
content.
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.)
Fields inherited from class com.simonstl.fragment.DocComponent |
after, before, content, localName, nsURI, prefix |
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)
|
Method Summary | |
void |
eventComponent(FragmentFilter handler)
Describes the content for this component as a series of SAX events. |
java.lang.String |
getAfterInside()
|
org.xml.sax.helpers.AttributesImpl |
getAtts()
|
java.lang.String |
getBeforeInside()
|
java.lang.String |
getKey()
Returns a key which can be used as a unique identifier for this component. |
boolean |
matchComponent(java.lang.String match)
Takes a string representing a component description and returns true or false to indicate whether or not it matches this component. |
void |
print()
Prints a representation of the component to STDOUT |
void |
setAfterInside(java.lang.String newAfterInside)
|
void |
setAtts(org.xml.sax.helpers.AttributesImpl newAtts)
|
void |
setBeforeInside(java.lang.String newBeforeInside)
|
java.lang.String |
toString()
Returns a representation of the component as a String. |
Methods inherited from class com.simonstl.fragment.DocComponent |
clone, getAfter, getBefore, getContent, getLocalName, getNsURI, getPrefix, setAfter, setBefore, setContent, setLocalName, setNsURI, setPrefix |
Methods inherited from class java.lang.Object |
equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Constructor Detail |
public Element(java.lang.String newNsURI, java.lang.String newLocalName)
public Element(java.lang.String newNsURI, java.lang.String newLocalName, java.lang.String newPrefix)
public Element(java.lang.String newNsURI, java.lang.String newLocalName, java.lang.String newPrefix, java.lang.String newContent)
public Element(Element oldElement)
Method Detail |
public boolean matchComponent(java.lang.String match)
DocComponent
matchComponent
in class DocComponent
public java.lang.String getKey()
DocComponent
getKey
in class DocComponent
public void setAtts(org.xml.sax.helpers.AttributesImpl newAtts)
public org.xml.sax.helpers.AttributesImpl getAtts()
public void setBeforeInside(java.lang.String newBeforeInside)
public java.lang.String getBeforeInside()
public void setAfterInside(java.lang.String newAfterInside)
public java.lang.String getAfterInside()
public void eventComponent(FragmentFilter handler) throws org.xml.sax.SAXException
DocComponent
FragmentFilter
supports some events (startChars and endChars) which
are extensions to the existing SAX models and which serve to keep the stacks under control.eventComponent
in class DocComponent
public void print()
DocComponent
print
in class DocComponent
public java.lang.String toString()
DocComponent
toString
in class DocComponent
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |