org.apache.ecs
Class ElementAttributes

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

public abstract class ElementAttributes
extends Element
implements AttributeRegistry, java.lang.Cloneable

This class provides a common set of attributes set* methods for all classes. It is abstract to prevent direct instantiation.

Version:
$Id: ElementAttributes.java,v 1.13 1999/05/18 00:52:59 jonbolt Exp $
Author:
Stephan Nagy, Jon S. Stevens

Field Summary
private  Filter attribute_filter
          Filter to use to escape attribute input
private  java.lang.String end_modifier
          What the end modifier should be
private  boolean end_modifier_defined
          What the modifier should be...optimization variable
private  boolean filter_attribute_state
          Should we filter the value of the element attributes
static java.lang.String NO_ATTRIBUTE_VALUE
          Does this element attribute value need a =""?
private  java.lang.String start_modifier
          What the start modifier should be
private  boolean start_modifier_defined
          What the modifier should be...optimization variable
static java.lang.String TAG
          _tag
static java.lang.String TEXT
          _text
 
Fields inherited from class org.apache.ecs.Element
case_type, codeset, element, end_element, filter, filter_state, position, VERSION
 
Constructor Summary
ElementAttributes()
          Basic constructor.
 
Method Summary
 void addAttribute(java.lang.String attribute_name, java.lang.Object attribute_value)
          Add an attribute to the element.
 java.lang.Object clone()
          Allows all Elements the ability to be cloned.
 Filter getAttributeFilter()
          Get the filter for all element attributes.
protected  boolean getAttributeFilterState()
          Find out if we want to filter the elements attributes or not.
 java.lang.String getEndModifier()
          What is the element modifier for this tag.
protected  boolean getEndModifierDefined()
          Modifier optimization
 java.lang.String getStartModifier()
          What is the element modifier for this tag.
protected  boolean getStartModifierDefined()
          Modifier optimization
 boolean hasAttribute(java.lang.String attribute)
          does the element have a particular attribute?
 void output(java.io.OutputStream out)
          Add the element to the designated OutputStream.
 void output(java.io.PrintWriter pw)
          Add element to the designated PrintWriter.
 void removeAttribute(java.lang.String attribute_name)
          remove an attribute from the element
 Element removeEndModifier()
          Remove the element modifier for this tag.
 Element removeStartModifier()
          Remove the element modifier for this tag.
 Element setAttributeFilter(Filter attribute_filter)
          Set up a new filter for all element attributes.
 Element setAttributeFilterState(boolean filter_attribute_state)
          Tell the element if we want to filter its attriubtes.
 Element setClass(java.lang.String element_class)
          Set the element class for Cascading Style Sheets.
 Element setDir(java.lang.String dir)
          Sets the DIR="" attribute
 Element setEndModifier(java.lang.String modifier)
          Set the element modifier the default is no modifier.
private  void setEndModifierDefined(boolean val)
          Modifier optimization
 Element setID(java.lang.String id)
          Set the element id for Cascading Style Sheets.
 Element setLang(java.lang.String lang)
          Sets the LANG="" attribute
 Element setModifier(java.lang.String modifier)
          Set the element modifier the default is no modifier.
 Element setModifier(java.lang.String start_modifier, java.lang.String end_modifier)
          Set the element modifier the default is no modifier.
 Element setStartModifier(java.lang.String modifier)
          Set the element modifier the default is no modifier.
private  void setStartModifierDefined(boolean val)
          Modifier optimization
 Element setStyle(java.lang.String style)
          Sets the STYLE="" attribute
 Element setTitle(java.lang.String title)
          Sets the TITLE="" attribute
 
Methods inherited from class org.apache.ecs.Element
alterCase, getCase, getCodeSet, getElementHashEntry, getElementType, getFilter, getFilterState, getNeedClosingTag, getTagPosition, getVersion, setCase, setCodeSet, setElementType, setFilter, setFilterState, setNeedClosingTag, setTagPosition, toString, toString
 
Methods inherited from class java.lang.Object
, equals, finalize, getClass, hashCode, notify, notifyAll, registerNatives, wait, wait, wait
 

Field Detail

attribute_filter

private Filter attribute_filter
Filter to use to escape attribute input

filter_attribute_state

private boolean filter_attribute_state
Should we filter the value of the element attributes

NO_ATTRIBUTE_VALUE

public static final java.lang.String NO_ATTRIBUTE_VALUE
Does this element attribute value need a =""?

TAG

public static final java.lang.String TAG
_tag

TEXT

public static final java.lang.String TEXT
_text

start_modifier

private java.lang.String start_modifier
What the start modifier should be

end_modifier

private java.lang.String end_modifier
What the end modifier should be

start_modifier_defined

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

end_modifier_defined

private boolean end_modifier_defined
What the modifier should be...optimization variable
Constructor Detail

ElementAttributes

public ElementAttributes()
Basic constructor. This class is abstract to prevent direct instantiation.
Method Detail

setID

public Element setID(java.lang.String id)
Set the element id for Cascading Style Sheets.

setClass

public Element setClass(java.lang.String element_class)
Set the element class for Cascading Style Sheets.

setLang

public Element setLang(java.lang.String lang)
Sets the LANG="" attribute
Parameters:
lang - the LANG="" attribute

setStyle

public Element setStyle(java.lang.String style)
Sets the STYLE="" attribute
Parameters:
style - the STYLE="" attribute

setDir

public Element setDir(java.lang.String dir)
Sets the DIR="" attribute
Parameters:
dir - the DIR="" attribute

setTitle

public Element setTitle(java.lang.String title)
Sets the TITLE="" attribute
Parameters:
title - the TITLE="" attribute

getAttributeFilterState

protected boolean getAttributeFilterState()
Find out if we want to filter the elements attributes or not.

setAttributeFilterState

public Element setAttributeFilterState(boolean filter_attribute_state)
Tell the element if we want to filter its attriubtes.
Parameters:
filter_attribute_state - do we want to filter the attributes of this element?

setAttributeFilter

public Element setAttributeFilter(Filter attribute_filter)
Set up a new filter for all element attributes.
Parameters:
Filter - the filter we want to use for element attributes. By
default it is the same as is used for the value of the tag. It is assumed
that if you create a new filter you must want to use it.

getAttributeFilter

public Filter getAttributeFilter()
Get the filter for all element attributes.
Parameters:
Filter - the filter we want to use for element attributes. By
default it is the same as is used for the value of the tag. It is assumed
that if you create a new filter you must want to use it.

setModifier

public Element setModifier(java.lang.String 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(java.lang.String modifier)
Set the element modifier the default is no modifier.
Parameters:
modifier - the modifier for the element a ? would result
in <? >

setEndModifier

public Element setEndModifier(java.lang.String modifier)
Set the element modifier the default is no modifier.
Parameters:
modifier - the modifier for the element a ? would result
in < ?>

setModifier

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

getStartModifier

public java.lang.String getStartModifier()
What is the element modifier for this tag.

getEndModifier

public java.lang.String getEndModifier()
What is the element modifier for this tag.

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

addAttribute

public void addAttribute(java.lang.String attribute_name,
                         java.lang.Object attribute_value)
Add an attribute to the element.
Specified by:
addAttribute in interface AttributeRegistry

removeAttribute

public void removeAttribute(java.lang.String attribute_name)
remove an attribute from the element
Specified by:
removeAttribute in interface AttributeRegistry

hasAttribute

public boolean hasAttribute(java.lang.String attribute)
does the element have a particular attribute?
Specified by:
hasAttribute in interface AttributeRegistry

output

public void output(java.io.OutputStream out)
Add the element to the designated OutputStream.
Overrides:
output in class Element

output

public void output(java.io.PrintWriter pw)
Add element to the designated PrintWriter.
Overrides:
output in class Element

clone

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