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


Field Summary
 java.lang.String localName
           
 java.lang.String nsURI
           
 java.lang.String prefix
           
 
Constructor Summary
Element(java.lang.String newNsURI, java.lang.String newLocalName)
           
Element(java.lang.String newNsURI, java.lang.String newLocalName, java.lang.String newPrefix)
           
 
Method Summary
 java.lang.String getKey()
           
 boolean matchElement(java.lang.String match)
           
 void print()
           
 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
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)
Method Detail

matchElement

public boolean matchElement(java.lang.String match)

getKey

public java.lang.String getKey()

print

public void print()

toString

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