org.apache.ecs
Class ElementAttributes

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

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.15 1999/06/08 21:29:10 stephan Exp $
Author:
Stephan Nagy, Jon S. Stevens

Field Summary
private  Filter attribute_filter
          Filter to use to escape attribute input
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 =""?
 
Fields inherited from class org.apache.ecs.Element
__text, case_type, codeset, element, element_type, end_element, end_modifier, end_modifier_defined, end_tag, filter, filter_state, position, resource, start_modifier, start_modifier_defined, start_tag, VERSION
 
Constructor Summary
protected ElementAttributes()
          Basic constructor.
 
Method Summary
 void addAttribute(java.lang.String attribute_name, java.lang.Object attribute_value)
          Add an attribute to the element.
protected  java.lang.String createStartTag()
           
 Filter getAttributeFilter()
          Get the filter for all element attributes.
protected  boolean getAttributeFilterState()
          Find out if we want to filter the elements attributes or not.
 boolean hasAttribute(java.lang.String attribute)
          does the element have a particular attribute?
 void removeAttribute(java.lang.String attribute_name)
          remove an attribute from the element
 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 setID(java.lang.String id)
          Set the element id for Cascading Style Sheets.
 Element setLang(java.lang.String lang)
          Sets the LANG="" attribute
 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, createEndTag, getCase, getCodeSet, getElementHashEntry, getElementType, getEndModifier, getEndModifierDefined, getEndTagChar, getFilter, getFilterState, getNeedClosingTag, getStartModifier, getStartModifierDefined, getStartTagChar, getTagPosition, getTagText, getVersion, output, output, removeEndModifier, removeStartModifier, setCase, setCodeSet, setElementType, setEndModifier, setEndModifierDefined, setEndTagChar, setFilter, setFilterState, setModifier, setModifier, setNeedClosingTag, setStartModifier, setStartModifierDefined, setStartTagChar, setTagPosition, setTagText, toString, toString
 
Methods inherited from class java.lang.Object
clone, 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 =""?
Constructor Detail

ElementAttributes

protected 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.

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

createStartTag

protected java.lang.String createStartTag()
Overrides:
createStartTag in class Element