xjavadoc
Class DefaultXTag

java.lang.Object
  extended byxjavadoc.DefaultXTag
All Implemented Interfaces:
XTag

public class DefaultXTag
extends java.lang.Object
implements XTag

Author:
Aslak Hellesøy

Field Summary
static int instanceCount
           
 
Constructor Summary
DefaultXTag()
           
 
Method Summary
 void addTagListener(XTagListener tagListener)
          add doc listener interested in chages
 boolean equals(java.lang.Object o)
           
protected  void fail(java.lang.String message)
          Utility method that should be called from validate() in case ov a validation failure.
 java.util.Collection getAttributeNames()
          Returns all tag parameters with the given name, or an empty List if none exist;
 java.lang.String getAttributeValue(java.lang.String attributeName)
          Returns the first tag parameter with the given name, or null if none exist;
 XDoc getDoc()
          Returns the XDoc object we belong to.
 java.lang.String getInfo()
           
 int getLineNumber()
           
 java.lang.String getName()
          Returns the full name of the tag, excluding the @
 java.lang.String getValue()
          Returns the full value of the tag.
 int hashCode()
           
 java.lang.String removeAttribute(java.lang.String attributeName)
          Removes an attribute
 void removeTagListener(XTagListener tagListener)
          remove doc listener
 void setAttribute(java.lang.String attributeName, java.lang.String attributeValue)
          Adds a parameter
 void validate()
          Validates the tag
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

instanceCount

public static int instanceCount
Constructor Detail

DefaultXTag

public DefaultXTag()
Method Detail

getDoc

public final XDoc getDoc()
Description copied from interface: XTag
Returns the XDoc object we belong to.

Specified by:
getDoc in interface XTag
Returns:
the XDoc object we belong to.

getAttributeValue

public final java.lang.String getAttributeValue(java.lang.String attributeName)
Returns the first tag parameter with the given name, or null if none exist;

Specified by:
getAttributeValue in interface XTag
Parameters:
attributeName - Describe what the parameter does
Returns:
The Parameter value

getAttributeNames

public final java.util.Collection getAttributeNames()
Returns all tag parameters with the given name, or an empty List if none exist;

Specified by:
getAttributeNames in interface XTag
Returns:
The Parameters value

getName

public final java.lang.String getName()
Returns the full name of the tag, excluding the @

Specified by:
getName in interface XTag
Returns:
tag name

getValue

public final java.lang.String getValue()
Returns the full value of the tag.

Specified by:
getValue in interface XTag
Returns:
full value of the tag

getLineNumber

public final int getLineNumber()
Specified by:
getLineNumber in interface XTag

getInfo

public final java.lang.String getInfo()
Specified by:
getInfo in interface XTag

setAttribute

public final void setAttribute(java.lang.String attributeName,
                               java.lang.String attributeValue)
Adds a parameter

Specified by:
setAttribute in interface XTag
Parameters:
attributeName - The new Attribute value
attributeValue - The new Attribute value

addTagListener

public final void addTagListener(XTagListener tagListener)
add doc listener interested in chages

Specified by:
addTagListener in interface XTag
Parameters:
tagListener - The feature to be added to the TagListener attribute

removeTagListener

public final void removeTagListener(XTagListener tagListener)
remove doc listener

Specified by:
removeTagListener in interface XTag
Parameters:
tagListener -

removeAttribute

public final java.lang.String removeAttribute(java.lang.String attributeName)
Removes an attribute

Specified by:
removeAttribute in interface XTag
Parameters:
attributeName - atribute to remove
Returns:
the removed attribute value or null if it didn't exist

equals

public final boolean equals(java.lang.Object o)
Specified by:
equals in interface XTag

hashCode

public final int hashCode()
Specified by:
hashCode in interface XTag

validate

public void validate()
              throws TagValidationException
Validates the tag

Specified by:
validate in interface XTag
Throws:
TagValidationException

fail

protected final void fail(java.lang.String message)
                   throws TagValidationException
Utility method that should be called from validate() in case ov a validation failure. Throws a new TagValidationException with

Parameters:
message - the message to include
Throws:
TagValidationException - always thrown.


Copyright © 2002-2004 XDoclet Team. All Rights Reserved.