2004.04.29


com.jdc.xml.tag
Class Attribute

java.lang.Object
  |
  +--com.jdc.xml.tag.Attribute
All Implemented Interfaces:
Serializable
Direct Known Subclasses:
Attribute, Declaration.Encoding, Declaration.Standalone, Declaration.Version

public class Attribute
extends Object
implements Serializable

The Attribute class represents an attribute associated with an XML tag object. An XML tag attribute has the form: name="value". XML tag attribute values are always enclosed in double quotes.

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

Field Summary
protected static String DOUBLE_QUOTE
          A double quote character for constructing an attribute of the form: name="value".
protected static String EQUALS
          An equals sign for constructing an attribute of the form: name=value.
 
Constructor Summary
Attribute()
          Constructs a new XML tag Attribute object.
 
Method Summary
protected  String create()
          Creates and returns an XML tag attribute of the form name="value" for the current attribute name and value.
protected  String create(String name, int value)
          Creates and returns an XML 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 XML tag attribute of the form name="value+qualifier" for a value with a qualifier.
protected  String create(String name, String value)
          Creates and returns an XML tag attribute of the form: name="value".
protected  String create(String name, String value, boolean trim)
          Creates and returns an XML tag attribute of the form: name="value".
protected  String create(String name, String value, String qualifier)
          Creates and returns an XML tag attribute of the form name="value+qualifier" for a value with a qualifier.
protected  String create(String name, String value, String qualifier, boolean trim)
          Creates and returns an XML tag attribute of the form name="value+qualifier" for an value with a qualifier.
 String getName()
          Returns the XML tag attribute name.
 String getQualifier()
          Returns the XML tag attribute value qualifier.
 String getQuotedValue()
          Returns the XML tag attribute quoted value.
 String getValue()
          Returns the XML tag attribute value.
 Attribute setName(String name)
          Sets the XML tag attribute name.
 Attribute setQualifier(String qualifier)
          Sets the XML tag attribute value qualifier.
 Attribute setValue(String value)
          Sets the XML tag attribute value.
 String toString()
          Returns an XML tag attribute of the form: name="value".
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

DOUBLE_QUOTE

protected static final String DOUBLE_QUOTE
A double quote character for constructing an attribute of the form: name="value".

See Also:
Constant Field Values

EQUALS

protected static final String EQUALS
An equals sign for constructing an attribute of the form: name=value.

See Also:
Constant Field Values
Constructor Detail

Attribute

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

Method Detail

create

protected String create()
Creates and returns an XML tag attribute of the form name="value" for the current attribute name and value.

Returns:
An XML tag attribute String.

create

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

Returns:
An XML tag attribute String.

create

protected String create(String name,
                        int value,
                        String qualifier)
Creates and returns an XML tag attribute of the form name="value+qualifier" for a value with a qualifier.

Returns:
An XML tag attribute String.

create

protected String create(String name,
                        String value)
Creates and returns an XML tag attribute of the form: name="value".

Returns:
An XML tag attribute String.

create

protected String create(String name,
                        String value,
                        boolean trim)
Creates and returns an XML tag attribute of the form: name="value".

Returns:
An XML tag attribute String.

create

protected String create(String name,
                        String value,
                        String qualifier)
Creates and returns an XML tag attribute of the form name="value+qualifier" for a value with a qualifier.

Returns:
An XML tag attribute String.

create

protected String create(String name,
                        String value,
                        String qualifier,
                        boolean trim)
Creates and returns an XML tag attribute of the form name="value+qualifier" for an value with a qualifier.

Returns:
An XML tag attribute String.

getName

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


getQualifier

public String getQualifier()
Returns the XML tag attribute value qualifier.


getQuotedValue

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


getValue

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


setName

public Attribute setName(String name)
Sets the XML tag attribute name.

Returns:
This XML tag attribute.

setQualifier

public Attribute setQualifier(String qualifier)
Sets the XML tag attribute value qualifier.

Returns:
This XML tag attribute.

setValue

public Attribute setValue(String value)
Sets the XML tag attribute value.

Returns:
This XML tag attribute.

toString

public String toString()
Returns an XML tag attribute of the form: name="value".

Overrides:
toString in class Object
Returns:
An XML tag attribute String.

2004.04.29



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