PAJES 3.0.21

org.pajes.html
Class TagAttribute

java.lang.Object
  extended by org.pajes.html.TagAttribute
All Implemented Interfaces:
java.io.Serializable, java.lang.Cloneable
Direct Known Subclasses:
TagTitleAttribute, TagURIAttribute

public class TagAttribute
extends java.lang.Object
implements java.lang.Cloneable, java.io.Serializable

Represents a single tag attribute.

See Also:
Tag, Serialized Form

Constructor Summary
  TagAttribute(java.lang.String name, boolean required)
          Creates a new unary attribute for a tag.
  TagAttribute(java.lang.String name, java.lang.String value, boolean quoted)
          Creates a new attribute for a tag.
protected TagAttribute(TagAttribute attribute)
          Creates a new attribute for a tag from an existing attribute.
 
Method Summary
 java.lang.Object clone()
          Allows the Attribute to be cloned.
 boolean equals(java.lang.Object obj)
          Determines if this attribute is the same as another object.
 java.lang.Integer getIntegerValue()
          Returns the value of this attribute as an Integer.
 java.lang.String getName()
          Returns the attribute name.
protected  Tag getTag()
          Returns the Tag instance to which this attribute belongs.
 java.lang.String getValue(Browser browser)
          Returns the value of this attribute.
 int hashCode()
          Returns the hash code value of this object.
 boolean isQuoted()
          Returns whether the attribute value will be quoted or not,
 boolean isUnary()
          Returns whether this attribute is a unary value or not,
 boolean isWritable()
          Determines whether this attribute will be used or not.
 void setName(java.lang.String name)
          Sets the attribute name.
 void setQuoted(boolean quoted)
          Determines if the attribute value will be quoted or not,
protected  void setTag(Tag tag)
          Sets the Tag instance to which this attribute belongs.
 void setUnary(boolean unary)
          Determines if this attribute is a unary value or not,
 void setValue(java.lang.String value)
          Sets the value of this attribute.
 void setWritable(boolean writable)
          Determines if this attribute will be used or not.
 java.lang.String toString()
          Returns the attribute name/value pair to be included in a tag.
 java.lang.String toString(Browser browser)
          Returns the attribute name/value pair to be included in a tag.
 
Methods inherited from class java.lang.Object
finalize, getClass, notify, notifyAll, wait, wait, wait
 

Constructor Detail

TagAttribute

public TagAttribute(java.lang.String name,
                    boolean required)
Creates a new unary attribute for a tag.

Parameters:
name - The attribute name.
required - true if the attribute is to be writable, or false if it is not.

TagAttribute

public TagAttribute(java.lang.String name,
                    java.lang.String value,
                    boolean quoted)
Creates a new attribute for a tag.

Parameters:
name - The attribute name.
value - The value of the attribute.
quoted - Places quotes around the attribute value.

TagAttribute

protected TagAttribute(TagAttribute attribute)
Creates a new attribute for a tag from an existing attribute.

Parameters:
attribute - The attribute.
Method Detail

clone

public java.lang.Object clone()
Allows the Attribute to be cloned.

Overrides:
clone in class java.lang.Object
Returns:
the cloned Attribute.
Throws:
TagException - if the clone fails.

equals

public boolean equals(java.lang.Object obj)
Determines if this attribute is the same as another object.

Overrides:
equals in class java.lang.Object
Parameters:
obj - The object to be compared to this attribute.
Returns:
true if the specified object is an Attribute and has the same name as this Attribute.

getIntegerValue

public java.lang.Integer getIntegerValue()
Returns the value of this attribute as an Integer.

Returns:
the value of this attribute as an Integer, or null if the value is null.

getName

public java.lang.String getName()
Returns the attribute name.

Returns:
the attribute name.

getValue

public java.lang.String getValue(Browser browser)
Returns the value of this attribute.

Parameters:
browser - the browser to which the results are to be output.
Returns:
the value of this attribute.

hashCode

public int hashCode()
Returns the hash code value of this object.

Overrides:
hashCode in class java.lang.Object
Returns:
the hash code value of this object.

isQuoted

public boolean isQuoted()
Returns whether the attribute value will be quoted or not,

Returns:
true if the attribute value will be quoted.

isUnary

public boolean isUnary()
Returns whether this attribute is a unary value or not,

Returns:
true if this attribute is a unary value.

isWritable

public boolean isWritable()
Determines whether this attribute will be used or not.

Returns:
true if this attribute will be used.

setName

public void setName(java.lang.String name)
Sets the attribute name.

Parameters:
name - the attribute name.
Throws:
java.lang.NullPointerException - if the specified name is null.

setQuoted

public void setQuoted(boolean quoted)
Determines if the attribute value will be quoted or not,

Parameters:
quoted - true if the attribute value will be quoted.

setUnary

public void setUnary(boolean unary)
Determines if this attribute is a unary value or not,

Parameters:
unary - true if this attribute is a unary value.

setValue

public void setValue(java.lang.String value)
Sets the value of this attribute. If the supplied value is null or an empty string (after trimming), the writable property will be set to false.

Parameters:
value - the value of this attribute.

setWritable

public void setWritable(boolean writable)
Determines if this attribute will be used or not.

Parameters:
writable - true if this attribute will be used.

toString

public java.lang.String toString()
Returns the attribute name/value pair to be included in a tag.

Overrides:
toString in class java.lang.Object
Returns:
the formatted attribute name/value pair, or an empty String if the attribute is not writable.

toString

public java.lang.String toString(Browser browser)
Returns the attribute name/value pair to be included in a tag.

Parameters:
browser - the browser to which the results are to be output.
Returns:
the formatted attribute name/value pair, or an empty String if the attribute is not writable.

getTag

protected Tag getTag()
Returns the Tag instance to which this attribute belongs.

Returns:
the Tag instance to which this attribute belongs.

setTag

protected void setTag(Tag tag)
Sets the Tag instance to which this attribute belongs.

Parameters:
tag - Tag instance to which this attribute belongs.

PAJES 3.0.21

Copyright © 1998-2007 Viridian Pty Limited. All Rights Reserved.