2004.04.29


com.jdc.xml
Class Tag

java.lang.Object
  |
  +--com.jdc.xml.Tag
All Implemented Interfaces:
Serializable
Direct Known Subclasses:
SimpleTag, Tag

public abstract class Tag
extends Object
implements Serializable

The Tag class represents an XML tag object. An XML tag has the form: <tag>. The Tag class is a abstract class that contains methods common to all XML tag classes.

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

Field Summary
protected static String LEFT_BRACKET
          A left angle character for constructing a tag of the form: <tag>.
protected static String RIGHT_BRACKET
          A right angle character for constructing a tag of the form: <tag>.
protected static String SLASH
          A forward slash character for constructing an end tag of the form: </tag>.
protected static String SPACE
          A space character.
 
Constructor Summary
protected Tag()
          Constructs a new XML Tag object.
 
Method Summary
protected  Tag addAttribute(Attribute attribute)
          Adds an XML tag attribute of the form: name="value".
protected  String create()
          Creates and returns an XML tag of the form: <tag> for the current tag identifier and attributes.
protected  String getAttribute(int length, String attribute)
          Returns an XML tag attribute String.
protected  String getAttributes()
          Returns a String of XML tag attributes.
protected  String getIdentifier()
          Returns the XML tag identifier.
protected  Tag setIdentifier(String identifier)
          Sets the XML tag identifier.
protected  String tag()
          Returns a String of XML tag attributes.
 String toString()
          Returns an XML tag of the form: <tag>.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

LEFT_BRACKET

protected static final String LEFT_BRACKET
A left angle character for constructing a tag of the form: <tag>.

See Also:
Constant Field Values

RIGHT_BRACKET

protected static final String RIGHT_BRACKET
A right angle character for constructing a tag of the form: <tag>.

See Also:
Constant Field Values

SLASH

protected static final String SLASH
A forward slash character for constructing an end tag of the form: </tag>.

See Also:
Constant Field Values

SPACE

protected static final String SPACE
A space character.

See Also:
Constant Field Values
Constructor Detail

Tag

protected Tag()
Constructs a new XML Tag object.

Method Detail

addAttribute

protected Tag addAttribute(Attribute attribute)
Adds an XML tag attribute of the form: name="value".

Returns:
This XML tag.

create

protected String create()
Creates and returns an XML tag of the form: <tag> for the current tag identifier and attributes.

Returns:
An XML tag String.

getAttribute

protected String getAttribute(int length,
                              String attribute)
Returns an XML tag attribute String.

Returns:
An XML tag attribute String.

getAttributes

protected String getAttributes()
Returns a String of XML tag attributes.

Returns:
A String of XML tag attributes.

getIdentifier

protected String getIdentifier()
Returns the XML tag identifier.

Returns:
The XML tag identifier.

setIdentifier

protected Tag setIdentifier(String identifier)
Sets the XML tag identifier.

Returns:
This XML tag.

tag

protected String tag()
Returns a String of XML tag attributes.

Returns:
An XML tag String.

toString

public String toString()
Returns an XML tag of the form: <tag>.

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

2004.04.29



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