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.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.)

Version:
0.04 29 June 2001
Author:
Simon St.Laurent

Field Summary
 java.lang.String after
           
 org.xml.sax.helpers.AttributesImpl atts
           
 java.lang.String before
           
 java.lang.String content
           
 java.lang.String localName
           
 java.lang.String nsURI
           
 java.lang.String prefix
           
 boolean skip
           
 
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 eventElement(FragmentFilter handler)
           
 java.lang.String getAfter()
           
 org.xml.sax.helpers.AttributesImpl getAtts()
           
 java.lang.String getBefore()
           
 java.lang.String getContent()
           
 java.lang.String getKey()
           
 boolean getSkip()
           
 boolean matchElement(java.lang.String match)
           
 void print()
           
 void setAfter(java.lang.String newAfter)
           
 void setAtts(org.xml.sax.helpers.AttributesImpl newAtts)
           
 void setBefore(java.lang.String newBefore)
           
 void setContent(java.lang.String newContent)
           
 void setSkip(boolean newSkip)
           
 java.lang.String toString()
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

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

skip

public boolean skip

before

public java.lang.String before

after

public java.lang.String after
Constructor Detail

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)
Method Detail

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()

setSkip

public void setSkip(boolean newSkip)

getSkip

public boolean getSkip()

setContent

public void setContent(java.lang.String newContent)

getContent

public java.lang.String getContent()

setBefore

public void setBefore(java.lang.String newBefore)

getBefore

public java.lang.String getBefore()

setAfter

public void setAfter(java.lang.String newAfter)

getAfter

public java.lang.String getAfter()

eventElement

public void eventElement(FragmentFilter handler)
                  throws org.xml.sax.SAXException

print

public void print()

toString

public java.lang.String toString()
Overrides:
toString in class java.lang.Object