org.apache.ecs
Class ElementAttributes

java.lang.Object
  |
  +--org.apache.ecs.GenericElement
        |
        +--org.apache.ecs.ElementAttributes
All Implemented Interfaces:
Attributes, Element, ElementRegistry, java.io.Serializable
Direct Known Subclasses:
ConcreteElement

public abstract class ElementAttributes
extends GenericElement
implements Attributes

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 2003/05/02 09:53:58 rdonkin Exp $
Author:
Stephan Nagy, Jon S. Stevens
See Also:
Serialized Form

Field Summary
private  char attribute_equality_sign
          What is the equality character for an attribute.
private  Filter attribute_filter
          Filter to use to escape attribute input
private  boolean attribute_quote
          Should we wrap quotes around an attribute?
private  char attribute_quote_char
          What character should we use for quoting attributes.
private  boolean filter_attribute_state
          Should we filter the value of the element attributes
 
Fields inherited from class org.apache.ecs.GenericElement
__text, _defaultFilter, begin_end_modifier, begin_end_modifier_defined, begin_start_modifier, begin_start_modifier_defined, case_type, codeset, element, element_type, end_element, end_end_modifier, end_end_modifier_defined, end_modifier_defined, end_start_modifier, end_start_modifier_defined, end_tag, filter, filter_state, position, pretty_print, start_modifier_defined, start_tag, tabLevel, VERSION
 
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
ElementAttributes()
          Basic Constructor.
 
Method Summary
 Element addAttribute(java.lang.String attribute_name, int attribute_value)
          Add an attribute to the element.
 Element addAttribute(java.lang.String attribute_name, java.lang.Integer attribute_value)
          Add an attribute to the element.
 Element addAttribute(java.lang.String attribute_name, java.lang.Object attribute_value)
          Add an attribute to the element.
 Element addAttribute(java.lang.String attribute_name, java.lang.String attribute_value)
          Add an attribute to the element.
 java.util.Enumeration attributes()
          Return a list of the attributes associated with this element.
 java.lang.String createStartTag()
          This method overrides createStartTag() in Generic Element.
 java.lang.String getAttribute(java.lang.String attribute)
          Return the specified attribute.
 char getAttributeEqualitySign()
          Get the equality sign for an attribute.
 Filter getAttributeFilter()
          Get the filter for all element attributes.
 boolean getAttributeFilterState()
          Find out if we want to filter the elements attributes or not.
 boolean getAttributeQuote()
          Do we surround attributes with qoutes?
 char getAttributeQuoteChar()
          Get the character used to quote attributes.
 boolean hasAttribute(java.lang.String attribute)
          does the element have a particular attribute?
 Element removeAttribute(java.lang.String attribute_name)
          remove an attribute from the element
 Element setAttributeEqualitySign(char equality_sign)
          Set the equality sign for an attribute.
 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 setAttributeQuote(boolean attribute_quote)
          Set wether or not we surround the attributes with quotes.
 Element setAttributeQuoteChar(char quote_char)
          Set the character used to quote attributes.
 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.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, output, output, output, putTabs, putTabs, removeBeginEndModifier, removeBeginStartModifier, removeEndEndModifier, removeEndStartModifier, setBeginEndModifier, setBeginEndModifierDefined, setBeginModifier, setBeginModifier, setBeginStartModifier, setBeginStartModifierDefined, setCase, setCodeSet, setElementType, setEndEndModifier, setEndEndModifierDefined, setEndModifier, setEndModifier, setEndStartModifier, setEndStartModifierDefined, setEndTagChar, setFilter, setFilterState, setNeedClosingTag, setPrettyPrint, setStartTagChar, setTabLevel, setTagPosition, setTagText, toString, toString
 
Methods inherited from class java.lang.Object
, clone, equals, finalize, getClass, hashCode, notify, notifyAll, registerNatives, wait, wait, wait
 
Methods inherited from interface org.apache.ecs.ElementRegistry
addElementToRegistry, addElementToRegistry, registryHasElement, registryHasElement, removeElementFromRegistry, removeElementFromRegistry
 

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

attribute_equality_sign

private char attribute_equality_sign
What is the equality character for an attribute.

attribute_quote_char

private char attribute_quote_char
What character should we use for quoting attributes.

attribute_quote

private boolean attribute_quote
Should we wrap quotes around an attribute?
Constructor Detail

ElementAttributes

public ElementAttributes()
Basic Constructor.
Method Detail

setAttributeQuoteChar

public Element setAttributeQuoteChar(char quote_char)
Set the character used to quote attributes.
Specified by:
setAttributeQuoteChar in interface Attributes
Parameters:
quote_char - character used to quote attributes

getAttributeQuoteChar

public char getAttributeQuoteChar()
Get the character used to quote attributes.
Specified by:
getAttributeQuoteChar in interface Attributes

setAttributeEqualitySign

public Element setAttributeEqualitySign(char equality_sign)
Set the equality sign for an attribute.
Specified by:
setAttributeEqualitySign in interface Attributes
Parameters:
equality_sign - The equality sign used for attributes.

getAttributeEqualitySign

public char getAttributeEqualitySign()
Get the equality sign for an attribute.
Specified by:
getAttributeEqualitySign in interface Attributes

getAttributeQuote

public boolean getAttributeQuote()
Description copied from interface: Attributes
Do we surround attributes with qoutes?
Specified by:
getAttributeQuote in interface Attributes

setAttributeQuote

public Element setAttributeQuote(boolean attribute_quote)
Set wether or not we surround the attributes with quotes.
Specified by:
setAttributeQuote in interface Attributes

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

public 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.
Specified by:
setAttributeFilterState in interface Attributes
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.
Specified by:
setAttributeFilter in interface 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.
Specified by:
getAttributeFilter in interface 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 Element addAttribute(java.lang.String attribute_name,
                            java.lang.Object attribute_value)
Add an attribute to the element.
Specified by:
addAttribute in interface Attributes
Following copied from interface: org.apache.ecs.Attributes
Parameters:
name - name of the attribute
element - value of the attribute.

addAttribute

public Element addAttribute(java.lang.String attribute_name,
                            int attribute_value)
Add an attribute to the element.
Specified by:
addAttribute in interface Attributes
Following copied from interface: org.apache.ecs.Attributes
Parameters:
name - name of the attribute
element - value of the attribute.

addAttribute

public Element addAttribute(java.lang.String attribute_name,
                            java.lang.String attribute_value)
Add an attribute to the element.
Specified by:
addAttribute in interface Attributes
Following copied from interface: org.apache.ecs.Attributes
Parameters:
name - name of the attribute
element - value of the attribute.

addAttribute

public Element addAttribute(java.lang.String attribute_name,
                            java.lang.Integer attribute_value)
Add an attribute to the element.
Specified by:
addAttribute in interface Attributes
Following copied from interface: org.apache.ecs.Attributes
Parameters:
name - name of the attribute
element - value of the attribute.

removeAttribute

public Element removeAttribute(java.lang.String attribute_name)
remove an attribute from the element
Specified by:
removeAttribute in interface Attributes
Following copied from interface: org.apache.ecs.Attributes
Parameters:
name - remove the attribute of this name

hasAttribute

public boolean hasAttribute(java.lang.String attribute)
does the element have a particular attribute?
Specified by:
hasAttribute in interface Attributes
Following copied from interface: org.apache.ecs.Attributes
Parameters:
name - of the attribute to ask the element for.

attributes

public java.util.Enumeration attributes()
Return a list of the attributes associated with this element.

getAttribute

public java.lang.String getAttribute(java.lang.String attribute)
Return the specified attribute.
Parameters:
attribute - The name of the attribute to fetch

createStartTag

public java.lang.String createStartTag()
This method overrides createStartTag() in Generic Element. It provides a way to print out the attributes of an element.
Overrides:
createStartTag in class GenericElement


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