org.apache.ecs
Class ConcreteElement

java.lang.Object
  extended byorg.apache.ecs.GenericElement
      extended byorg.apache.ecs.ElementAttributes
          extended byorg.apache.ecs.ConcreteElement
All Implemented Interfaces:
Attributes, java.lang.Cloneable, Element, ElementRegistry, java.io.Serializable
Direct Known Subclasses:
ElementContainer, MultiPartElement, PI, RTFElement, SinglePartElement, StringElement

public class ConcreteElement
extends ElementAttributes
implements java.lang.Cloneable

This class is to be subclassed by those elements that are made up of other elements. i.e. BODY,HEAD,etc.

Version:
$Id: ConcreteElement.java,v 1.31 2003/05/13 12:23:18 rdonkin Exp $
Author:
Stephan Nagy, Jon S. Stevens
See Also:
Serialized Form

Field Summary
private static java.lang.String lineSeparator
          The line separator to use for pretty printing
private  java.util.Hashtable registry
           
private  java.util.Vector registryList
          Maintain an ordered list of elements
 
Fields inherited from class org.apache.ecs.ElementAttributes
 
Fields inherited from class org.apache.ecs.GenericElement
tabLevel
 
Fields inherited from interface org.apache.ecs.Attributes
NO_ATTRIBUTE_VALUE
 
Fields inherited from interface org.apache.ecs.Element
CENTER, LEFT, LOWERCASE, MIXEDCASE, RIGHT, UPPERCASE
 
Constructor Summary
ConcreteElement()
           
 
Method Summary
 Element addElementToRegistry(Element element)
          Registers an element in the head element list
 Element addElementToRegistry(Element element, boolean filter)
          Registers an element in the head element list
 Element addElementToRegistry(java.lang.String value)
          Registers an element in the head element list
 Element addElementToRegistry(java.lang.String value, boolean filter)
          Registers an element in the head element list
 Element addElementToRegistry(java.lang.String hashcode, Element element)
          Registers an element in the head element list
 Element addElementToRegistry(java.lang.String hashcode, Element element, boolean filter)
          Registers an element in the head element list
 Element addElementToRegistry(java.lang.String hashcode, java.lang.String value)
          Registers an element in the head element list
 Element addElementToRegistry(java.lang.String hashcode, java.lang.String value, boolean filter)
          Registers an element in the head element list
 java.lang.Object clone()
          Allows all Elements the ability to be cloned.
 java.util.Enumeration elements()
          Get an enumeration of the elements that this element contains.
 ConcreteElement getElement(java.lang.String element)
          If the object is in the registry return otherwise return null.
 boolean isEmpty()
           
 java.util.Enumeration keys()
          Get the keys of this element.
 void output(java.io.OutputStream out)
          Override output(OutputStream) incase any elements are in the registry.
static void output(java.io.OutputStream out, ConcreteElement ce)
          Overload output(OutputStream).
 void output(java.io.PrintWriter out)
          Override output(BufferedWriter) incase any elements are in the registry.
 void output(java.io.Writer out)
          Writer version of this method.
 boolean registryHasElement(Element element)
          Find out if this element is in the element registry.
 boolean registryHasElement(java.lang.String hashcode)
          Find out if this element is in the element registry.
 Element removeElementFromRegistry(Element element)
          Removes an element from the element registry
 Element removeElementFromRegistry(java.lang.String hashcode)
          Removes an element from the head element registry
 
Methods inherited from class org.apache.ecs.ElementAttributes
addAttribute, addAttribute, addAttribute, addAttribute, attributes, createStartTag, getAttribute, getAttributeEqualitySign, getAttributeFilter, getAttributeFilterState, getAttributeQuote, getAttributeQuoteChar, hasAttribute, removeAttribute, setAttributeEqualitySign, setAttributeFilter, setAttributeFilterState, setAttributeQuote, setAttributeQuoteChar, setClass, setDir, setID, setLang, setStyle, setTitle
 
Methods inherited from class org.apache.ecs.GenericElement
alterCase, createEndTag, getBeginEndModifier, getBeginEndModifierDefined, getBeginStartModifier, getBeginStartModifierDefined, getCase, getCodeSet, getElementHashEntry, getElementType, getEndEndModifier, getEndEndModifierDefined, getEndStartModifier, getEndStartModifierDefined, getEndTagChar, getFilter, getFilterState, getNeedClosingTag, getNeedLineBreak, getPrettyPrint, getStartTagChar, getTabLevel, getTagPosition, getTagText, getVersion, putTabs, putTabs, removeBeginEndModifier, removeBeginStartModifier, removeEndEndModifier, removeEndStartModifier, setBeginEndModifier, setBeginModifier, setBeginModifier, setBeginStartModifier, setCase, setCodeSet, setElementType, setEndEndModifier, setEndModifier, setEndModifier, setEndStartModifier, setEndTagChar, setFilter, setFilterState, setNeedClosingTag, setPrettyPrint, setStartTagChar, setTabLevel, setTagPosition, setTagText, toString, toString
 
Methods inherited from class java.lang.Object
equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

lineSeparator

private static java.lang.String lineSeparator
The line separator to use for pretty printing


registry

private java.util.Hashtable registry

registryList

private java.util.Vector registryList
Maintain an ordered list of elements

Constructor Detail

ConcreteElement

public ConcreteElement()
Method Detail

getElement

public ConcreteElement getElement(java.lang.String element)
If the object is in the registry return otherwise return null.

Parameters:
element - the name of the object to locate.

addElementToRegistry

public Element addElementToRegistry(Element element)
Registers an element in the head element list

Specified by:
addElementToRegistry in interface ElementRegistry
Parameters:
element - element to be added to the registry.

addElementToRegistry

public Element addElementToRegistry(java.lang.String hashcode,
                                    Element element)
Registers an element in the head element list

Parameters:
hashcode - internal name of element
element - element to be added to the registry.

addElementToRegistry

public Element addElementToRegistry(Element element,
                                    boolean filter)
Registers an element in the head element list

Parameters:
element - element to be added to the registry.
filter - does this need to be filtered?

addElementToRegistry

public Element addElementToRegistry(java.lang.String hashcode,
                                    Element element,
                                    boolean filter)
Registers an element in the head element list

Parameters:
element - element to be added to the registry.
filter - should we filter this element?

addElementToRegistry

public Element addElementToRegistry(java.lang.String value,
                                    boolean filter)
Registers an element in the head element list

Parameters:
filter - does this need to be filtered?

addElementToRegistry

public Element addElementToRegistry(java.lang.String hashcode,
                                    java.lang.String value,
                                    boolean filter)
Registers an element in the head element list

Parameters:
filter - does this need to be filtered?

addElementToRegistry

public Element addElementToRegistry(java.lang.String value)
Registers an element in the head element list

Specified by:
addElementToRegistry in interface ElementRegistry

addElementToRegistry

public Element addElementToRegistry(java.lang.String hashcode,
                                    java.lang.String value)
Registers an element in the head element list


removeElementFromRegistry

public Element removeElementFromRegistry(Element element)
Removes an element from the element registry

Specified by:
removeElementFromRegistry in interface ElementRegistry
Parameters:
element - element to be added to the registry.

removeElementFromRegistry

public Element removeElementFromRegistry(java.lang.String hashcode)
Removes an element from the head element registry

Specified by:
removeElementFromRegistry in interface ElementRegistry
Parameters:
hashcode - element to be added to the registry.

registryHasElement

public boolean registryHasElement(Element element)
Find out if this element is in the element registry.

Specified by:
registryHasElement in interface ElementRegistry
Parameters:
element - find out if this element is in the registry

keys

public java.util.Enumeration keys()
Get the keys of this element.


elements

public java.util.Enumeration elements()
Get an enumeration of the elements that this element contains.


registryHasElement

public boolean registryHasElement(java.lang.String hashcode)
Find out if this element is in the element registry.

Specified by:
registryHasElement in interface ElementRegistry

output

public static void output(java.io.OutputStream out,
                          ConcreteElement ce)
Overload output(OutputStream).


output

public void output(java.io.OutputStream out)
Override output(OutputStream) incase any elements are in the registry.

Specified by:
output in interface Element
Overrides:
output in class GenericElement

output

public void output(java.io.Writer out)
Writer version of this method.

Overrides:
output in class GenericElement

output

public void output(java.io.PrintWriter out)
Override output(BufferedWriter) incase any elements are in the registry.

Specified by:
output in interface Element
Overrides:
output in class GenericElement

clone

public java.lang.Object clone()
Allows all Elements the ability to be cloned.


isEmpty

public boolean isEmpty()


Copyright © 1999-2003 Apache Software Foundation. All Rights Reserved.