org.apache.ecs
Class Element

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

class Element
extends java.lang.Object
implements ElementFactory

This class implements the ElementFactory.

Version:
$Id: Element.java,v 1.12 1999/06/09 00:31:59 jonbolt Exp $
Author:
Stephan Nagy, Jon S. Stevens

Field Summary
private  java.lang.String __text
           
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  java.lang.String element_type
          Location to store element_type at.
private  boolean end_element
          Does this element need a closing tag?
private  char end_modifier
          What the end modifier should be
protected  boolean end_modifier_defined
          What the modifier should be...optimization variable
private  char end_tag
           
private static 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.
protected static java.util.ResourceBundle resource
           
private  char start_modifier
          What the start modifier should be
protected  boolean start_modifier_defined
          What the modifier should be...optimization variable
private  char start_tag
           
private static java.lang.String VERSION
          Version number for codebase
 
Constructor Summary
protected Element()
          Base class for defining all elements.
 
Method Summary
(package private)  void ()
           
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.
protected  java.lang.String createEndTag()
           
protected  java.lang.String createStartTag()
           
 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.
 char getEndModifier()
          What is the element modifier for this tag.
protected  boolean getEndModifierDefined()
          Modifier optimization
 char getEndTagChar()
          Get the end tag character.
 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.
 char getStartModifier()
          What is the element modifier for this tag.
protected  boolean getStartModifierDefined()
          Modifier optimization
 char getStartTagChar()
          Get the start tag character.
 int getTagPosition()
          Get the position the tag is to be rendered at.
 java.lang.String getTagText()
           
 java.lang.String getVersion()
          What version of htmlGen is this?
 void output(java.io.OutputStream out)
          Add the element to the designated OutputStream.
 void output(java.io.PrintWriter out)
          Add element to the designated PrintWriter.
 Element removeEndModifier()
          Remove the element modifier for this tag.
 Element removeStartModifier()
          Remove the element modifier for this tag.
 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
 Element setEndModifier(char modifier)
          Set the element modifier the default is no modifier.
private  void setEndModifierDefined(boolean val)
          Modifier optimization
 void setEndTagChar(char end_tag)
          Set the end tag character.
 void setFilter(Filter filter)
          Override the default filter with a user supplied filter.
 Element setFilterState(boolean filter_state)
          set the filter state of the element.
 Element setModifier(char modifier)
          Set the element modifier the default is no modifier.
 Element setModifier(char start_modifier, char end_modifier)
          Set the element modifier the default is no modifier.
 void setNeedClosingTag(boolean close)
          Does this element need a closing tag.
 Element setStartModifier(char modifier)
          Set the element modifier the default is no modifier.
private  void setStartModifierDefined(boolean val)
          Modifier optimization
 void setStartTagChar(char start_tag)
          Set the start tag character.
 void setTagPosition(int position)
          Set the position of the tag to be rendered at in relation to start_element_char
 void setTagText(java.lang.String text)
           
 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

resource

protected static java.util.ResourceBundle resource

filter

private static 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

start_modifier

private char start_modifier
What the start modifier should be

end_modifier

private char end_modifier
What the end modifier should be

start_modifier_defined

protected boolean start_modifier_defined
What the modifier should be...optimization variable

end_modifier_defined

protected boolean end_modifier_defined
What the modifier should be...optimization variable

start_tag

private char start_tag

end_tag

private char end_tag

__text

private java.lang.String __text

element_type

private java.lang.String element_type
Location to store element_type at.
Constructor Detail

Element

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

void ()
Overrides:
in class java.lang.Object

getElementHashEntry

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

setFilterState

public Element 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)
Set the position of the tag to be rendered at in relation to start_element_char
Specified by:
setTagPosition in interface ElementFactory

getTagPosition

public int getTagPosition()
Get the position the tag is to be rendered at.
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

setModifier

public Element setModifier(char modifier)
Set the element modifier the default is no modifier.
Parameters:
modifier - the modifier for the element a ? would result
in <? ?>

setStartModifier

public Element setStartModifier(char modifier)
Set the element modifier the default is no modifier.
Specified by:
setStartModifier in interface ElementFactory
Parameters:
modifier - the modifier for the element a ? would result
in <? >

setEndModifier

public Element setEndModifier(char modifier)
Set the element modifier the default is no modifier.
Specified by:
setEndModifier in interface ElementFactory
Parameters:
modifier - the modifier for the element a ? would result
in < ?>

setModifier

public Element setModifier(char start_modifier,
                           char end_modifier)
Set the element modifier the default is no modifier.
Parameters:
modifier - the modifier for the element a ? would result
in <? ?>

getStartModifier

public char getStartModifier()
What is the element modifier for this tag.
Specified by:
getStartModifier in interface ElementFactory

getEndModifier

public char getEndModifier()
What is the element modifier for this tag.
Specified by:
getEndModifier in interface ElementFactory

removeStartModifier

public Element removeStartModifier()
Remove the element modifier for this tag.

removeEndModifier

public Element removeEndModifier()
Remove the element modifier for this tag.

setStartModifierDefined

private void setStartModifierDefined(boolean val)
Modifier optimization

setEndModifierDefined

private void setEndModifierDefined(boolean val)
Modifier optimization

getStartModifierDefined

protected boolean getStartModifierDefined()
Modifier optimization

getEndModifierDefined

protected boolean getEndModifierDefined()
Modifier optimization

setStartTagChar

public void setStartTagChar(char start_tag)
Set the start tag character.
Specified by:
setStartTagChar in interface ElementFactory

getStartTagChar

public char getStartTagChar()
Get the start tag character.
Specified by:
getStartTagChar in interface ElementFactory

setEndTagChar

public void setEndTagChar(char end_tag)
Set the end tag character.
Specified by:
setEndTagChar in interface ElementFactory

getEndTagChar

public char getEndTagChar()
Get the end tag character.
Specified by:
getEndTagChar in interface ElementFactory

getTagText

public java.lang.String getTagText()

setTagText

public void setTagText(java.lang.String text)

createStartTag

protected java.lang.String createStartTag()

createEndTag

protected java.lang.String createEndTag()

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 void output(java.io.OutputStream out)
Add the element to the designated OutputStream.
Specified by:
output in interface ElementFactory

output

public void output(java.io.PrintWriter out)
Add element to the designated PrintWriter.
Specified by:
output in interface ElementFactory