2004.04.29


com.jdc.gui.html.tag
Class Attribute

java.lang.Object
  |
  +--com.jdc.xml.tag.Attribute
        |
        +--com.jdc.gui.html.tag.Attribute
All Implemented Interfaces:
MarkupLanguage, Serializable
Direct Known Subclasses:
Align, Class, Color, Cols, ColumnSpan, Event, FontSize, Form.Action, Form.Method, Form.Target, Frame, Height, Id, MaxLength, Multiple, Name, Readonly, Rows, Selected, Size, Source, Style, Title, Type, URL, Value, VerticalAlign, Width

public class Attribute
extends Attribute
implements MarkupLanguage

The Attribute class represents an attribute associated with an HTML tag object. An HTML tag attribute has the form: name="value". HTML tag attribute values may be enclosed in double quotes, single quotes, or no quotes at all. The default is double quotes as specified by the XHTML attribute in the MarkupLanguage interface.

Version:
1.0
Author:
Jay Damon
See Also:
Attribute, Serialized Form

Field Summary
protected static String SINGLE_QUOTE
          A single quote character for constructing an attribute of the form: name='value'.
 
Fields inherited from class com.jdc.xml.tag.Attribute
DOUBLE_QUOTE, EQUALS
 
Fields inherited from interface com.jdc.gui.html.MarkupLanguage
XHTML
 
Constructor Summary
  Attribute()
          Constructs a new HTML tag Attribute object.
protected Attribute(boolean useSingleQuotes)
          Constructs a new HTML tag Attribute object for constructing an attribute of the form: name='value' or name=value.
 
Method Summary
protected  String create(String name, int value)
          Creates and returns an HTML tag attribute of the form name="value" for a numeric attribute value.
protected  String create(String name, int value, String qualifier)
          Creates and returns an HTML tag attribute of the form name="value+qualifier" for a value with a qualifier.
 String getName()
          Returns the HTML tag attribute name.
protected  String getQuoteCharacter()
          Returns the HTML tag attribute quote character.
 String getQuotedValue()
          Returns the HTML tag attribute quoted value.
 String getValue()
          Returns the HTML tag attribute value.
 
Methods inherited from class com.jdc.xml.tag.Attribute
create, create, create, create, create, getQualifier, setName, setQualifier, setValue, toString
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

SINGLE_QUOTE

protected static final String SINGLE_QUOTE
A single quote character for constructing an attribute of the form: name='value'.

See Also:
Constant Field Values
Constructor Detail

Attribute

public Attribute()
Constructs a new HTML tag Attribute object.


Attribute

protected Attribute(boolean useSingleQuotes)
Constructs a new HTML tag Attribute object for constructing an attribute of the form: name='value' or name=value.

Method Detail

create

protected String create(String name,
                        int value)
Creates and returns an HTML tag attribute of the form name="value" for a numeric attribute value. The numeric attribute value must a positive integer value.

Overrides:
create in class Attribute
Returns:
An HTML tag attribute String.

create

protected String create(String name,
                        int value,
                        String qualifier)
Creates and returns an HTML tag attribute of the form name="value+qualifier" for a value with a qualifier. The numeric attribute value must a positive integer value.

Overrides:
create in class Attribute
Returns:
An HTML tag attribute String.

getName

public String getName()
Returns the HTML tag attribute name.

Overrides:
getName in class Attribute

getQuoteCharacter

protected String getQuoteCharacter()
Returns the HTML tag attribute quote character.


getQuotedValue

public String getQuotedValue()
Returns the HTML tag attribute quoted value.

Overrides:
getQuotedValue in class Attribute

getValue

public String getValue()
Returns the HTML tag attribute value.

Overrides:
getValue in class Attribute

2004.04.29



Copyright © 2004 J. Damon & Co.; All Rights Reserved WorldWide.