org.apache.ecs
Class Element

java.lang.Object
  |
  +--org.apache.ecs.Element
Direct Known Subclasses:
ElementAttributes, ElementContainer, StringElement

public abstract class Element
extends java.lang.Object
implements ElementFactory

This class implements the ElementFactory.

Version:
$Id: Element.java,v 1.6 1999/05/06 21:55:01 jonbolt Exp $
Author:
Stephan Nagy, Jon S. Stevens

Field Summary
private  int case_type
          Default value to set case type
private  java.lang.String codeset
          What codeset are we going to use the default is 8859_1
private  java.util.Hashtable element
          Where to get the element definition from
private  boolean end_element
          Does this element need a closing tag?
private  Filter filter
          Filter to use to escape input
private  boolean filter_state
          Should we filter the value of <>VALUE</>
private  int position
          position of tag relative to start and end.
private static java.lang.String VERSION
          Version number for codebase
 
Constructor Summary
Element()
          Base class for defining all elements.
 
Method Summary
protected  java.lang.String alterCase(java.lang.String value)
          Alter the case of this element so that it is rendered according to whatever the value of case_type is.
 int getCase()
          Find out what case the element is supposed to be rendered in.
 java.lang.String getCodeSet()
          Find out what the current codeset is.
protected  java.util.Hashtable getElementHashEntry()
          Get the Hashtable representation of an element.
 java.lang.String getElementType()
          Find out what type of element this is.
 Filter getFilter()
          Get the filter that is currently in use.
 boolean getFilterState()
          get the filter state of the element.
 boolean getNeedClosingTag()
          Determine if this element needs to be closed.
 int getTagPosition()
           
 java.lang.String getVersion()
          What version of htmlGen is this?
abstract  void output(java.io.OutputStream out)
           
abstract  void output(java.io.PrintWriter out)
           
 void setCase(int case_type)
          Determine what case the html element should be rendered.
 void setCodeSet(java.lang.String codeset)
          Determine what codeset should be used.
 void setElementType(java.lang.String element_type)
          Determine what type of element this is A,BR,EM,ACRONYM
 void setFilter(Filter filter)
          Override the default filter with a user supplied filter.
 void setFilterState(boolean filter_state)
          set the filter state of the element.
 void setNeedClosingTag(boolean close)
          Does this element need a closing tag.
 void setTagPosition(int position)
           
 java.lang.String toString()
          Override toString() method to print something meaningful
 java.lang.String toString(java.lang.String codeset)
          Override toString(encode) method to print something meaningful
 
Methods inherited from class java.lang.Object
, clone, equals, finalize, getClass, hashCode, notify, notifyAll, registerNatives, wait, wait, wait
 

Field Detail

filter

private Filter filter
Filter to use to escape input

position

private int position
position of tag relative to start and end.

filter_state

private boolean filter_state
Should we filter the value of <>VALUE</>

VERSION

private static final java.lang.String VERSION
Version number for codebase

case_type

private int case_type
Default value to set case type

element

private java.util.Hashtable element
Where to get the element definition from

end_element

private boolean end_element
Does this element need a closing tag?

codeset

private java.lang.String codeset
What codeset are we going to use the default is 8859_1
Constructor Detail

Element

public Element()
Base class for defining all elements.
Method Detail

getElementHashEntry

protected java.util.Hashtable getElementHashEntry()
Get the Hashtable representation of an element.

setFilterState

public void setFilterState(boolean filter_state)
set the filter state of the element.
Parameters:
filter_state - (true|false) do we want to use a filter? default true;

getFilterState

public boolean getFilterState()
get the filter state of the element.

getFilter

public Filter getFilter()
Get the filter that is currently in use.

setFilter

public void setFilter(Filter filter)
Override the default filter with a user supplied filter.

getVersion

public java.lang.String getVersion()
What version of htmlGen is this?
Specified by:
getVersion in interface ElementFactory

setCase

public void setCase(int case_type)
Determine what case the html element should be rendered. Default is MIXEDCASE
Specified by:
setCase in interface ElementFactory

getCase

public int getCase()
Find out what case the element is supposed to be rendered in.
Specified by:
getCase in interface ElementFactory

setElementType

public void setElementType(java.lang.String element_type)
Determine what type of element this is A,BR,EM,ACRONYM
Specified by:
setElementType in interface ElementFactory

getElementType

public java.lang.String getElementType()
Find out what type of element this is.
Specified by:
getElementType in interface ElementFactory

setCodeSet

public void setCodeSet(java.lang.String codeset)
Determine what codeset should be used.

getCodeSet

public java.lang.String getCodeSet()
Find out what the current codeset is.

setNeedClosingTag

public void setNeedClosingTag(boolean close)
Does this element need a closing tag. Default is true
Specified by:
setNeedClosingTag in interface ElementFactory

getNeedClosingTag

public boolean getNeedClosingTag()
Determine if this element needs to be closed.
Specified by:
getNeedClosingTag in interface ElementFactory

setTagPosition

public void setTagPosition(int position)
Specified by:
setTagPosition in interface ElementFactory

getTagPosition

public int getTagPosition()
Specified by:
getTagPosition in interface ElementFactory

alterCase

protected java.lang.String alterCase(java.lang.String value)
Alter the case of this element so that it is rendered according to whatever the value of case_type is. Default is MIXEDCASE

toString

public final java.lang.String toString()
Override toString() method to print something meaningful
Overrides:
toString in class java.lang.Object

toString

public final java.lang.String toString(java.lang.String codeset)
Override toString(encode) method to print something meaningful

output

public abstract void output(java.io.OutputStream out)

output

public abstract void output(java.io.PrintWriter out)