com.simonstl.fragment
Class DocComponent

java.lang.Object
  |
  +--com.simonstl.fragment.DocComponent
All Implemented Interfaces:
java.lang.Cloneable
Direct Known Subclasses:
Characters, Element, Skip

public abstract class DocComponent
extends java.lang.Object
implements java.lang.Cloneable

The DocComponent abstract class stores information about XML document components in a way which makes it easy use them in a streaming SAX environment.

version 0.01 is the initial release, based on version 0.05 of the Element class.

Version:
0.01 1 July 2001
Author:
Simon St.Laurent

Field Summary
protected  java.lang.String after
           
protected  java.lang.String before
           
protected  java.lang.String content
           
protected  java.lang.String localName
           
protected  java.lang.String nsURI
           
protected  java.lang.String prefix
           
 
Constructor Summary
DocComponent()
           
 
Method Summary
 java.lang.Object clone()
          This method is here to provide clone-ability.
abstract  void eventComponent(FragmentFilter handler)
          Describes the content for this component as a series of SAX events.
 java.lang.String getAfter()
          Returns a string of content which may appear after the component
 java.lang.String getBefore()
          Returns a string of content which may appear before the component
 java.lang.String getContent()
          Returns the content for this component.
abstract  java.lang.String getKey()
          Returns a key which can be used as a unique identifier for this component.
 java.lang.String getLocalName()
          Returns the local name for the component
 java.lang.String getNsURI()
          Returns the URI reference value for the namespace.
 java.lang.String getPrefix()
          Returns the prefix used to represent the namespace URI reference for this component.
abstract  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.
abstract  void print()
          Prints a representation of the component to STDOUT
 void setAfter(java.lang.String newAfter)
          Sets a string of content which may appear after the component
 void setBefore(java.lang.String newBefore)
          Sets a string of content which may appear before the component
 void setContent(java.lang.String newContent)
          Sets the content for this component.
 void setLocalName(java.lang.String newLocalName)
          Accepts a string which will serve as the local name for this component.
 void setNsURI(java.lang.String newNsURI)
          Accepts a URI reference value which is used as the namespace for the component.
 void setPrefix(java.lang.String newPrefix)
          Accepts a string which serves as the prefix for this component.
abstract  java.lang.String toString()
          Returns a representation of the component as a String.
 
Methods inherited from class java.lang.Object
equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

nsURI

protected java.lang.String nsURI

localName

protected java.lang.String localName

prefix

protected java.lang.String prefix

content

protected java.lang.String content

before

protected java.lang.String before

after

protected java.lang.String after
Constructor Detail

DocComponent

public DocComponent()
Method Detail

matchComponent

public abstract 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.

getKey

public abstract java.lang.String getKey()
Returns a key which can be used as a unique identifier for this component.

setNsURI

public void setNsURI(java.lang.String newNsURI)
Accepts a URI reference value which is used as the namespace for the component.

getNsURI

public java.lang.String getNsURI()
Returns the URI reference value for the namespace.

setLocalName

public void setLocalName(java.lang.String newLocalName)
Accepts a string which will serve as the local name for this component.

getLocalName

public java.lang.String getLocalName()
Returns the local name for the component

setPrefix

public void setPrefix(java.lang.String newPrefix)
Accepts a string which serves as the prefix for this component.

getPrefix

public java.lang.String getPrefix()
Returns the prefix used to represent the namespace URI reference for this component.

setContent

public void setContent(java.lang.String newContent)
Sets the content for this component.

getContent

public java.lang.String getContent()
Returns the content for this component.

setBefore

public void setBefore(java.lang.String newBefore)
Sets a string of content which may appear before the component

getBefore

public java.lang.String getBefore()
Returns a string of content which may appear before the component

setAfter

public void setAfter(java.lang.String newAfter)
Sets a string of content which may appear after the component

getAfter

public java.lang.String getAfter()
Returns a string of content which may appear after the component

eventComponent

public abstract void eventComponent(FragmentFilter handler)
                             throws org.xml.sax.SAXException
Describes the content for this component as a series of SAX events. Note that FragmentFilter supports some events (startChars and endChars) which are extensions to the existing SAX models and which serve to keep the stacks under control.

print

public abstract void print()
Prints a representation of the component to STDOUT

toString

public abstract java.lang.String toString()
Returns a representation of the component as a String.
Overrides:
toString in class java.lang.Object

clone

public java.lang.Object clone()
This method is here to provide clone-ability.
Overrides:
clone in class java.lang.Object