xjavadoc

Class DefaultXTag

public class DefaultXTag extends Object implements XTag

Author: Aslak Hellesxy

UNKNOWN: 11. januar 2002

Field Summary
static intinstanceCount
List_attributeNames
Ordered List of attribute names
Map_attributes
attribute map
XDoc_doc
int_hash
boolean_isDirty
indicate dirty state
boolean_isParsed
tag parse status
int_lineNumber
String_name
tag name
Set_tagListeners
tag listeners interested in changes.
String_value
string representation of tag
XJavaDoc_xJavaDoc
Constructor Summary
DefaultXTag()
Method Summary
voidaddTagListener(XTagListener tagListener)
add doc listener interested in chages
voidensureTagListenersInitialised()
booleanequals(Object o)
protected voidfail(String message)
Utility method that should be called from validate in case ov a validation failure.
voidfireTagChanged()
fire tagChanged event
CollectiongetAttributeNames()
Returns all tag parameters with the given name, or an empty List if none exist;
StringgetAttributeValue(String attributeName)
Returns the first tag parameter with the given name, or null if none exist;
XDocgetDoc()
StringgetInfo()
intgetLineNumber()
StringgetName()
Returns the full name of the tag, excluding the @
StringgetValue()
Returns the full value of the tag.
inthashCode()
voidinit(String name, String value, XDoc doc, int lineNumber)
Sets the name and value.
voidparse()
Given the raw javadoc tag content as the value parameter parses it and sets the parameter.
StringremoveAttribute(String attributeName)
Removes an attribute
voidremoveTagListener(XTagListener tagListener)
remove doc listener
voidresetValue()
voidsetAttribute(String attributeName, String attributeValue)
Adds a parameter
voidsetAttribute_Impl(String attributeName, String attributeValue)
static intskipWhitespace(String s, int i)
Skips whitespaces, starting from index i till the first non-whitespace character or end of s and returns the new index.
voidvalidate()
Validates the tag

Field Detail

instanceCount

public static int instanceCount

_attributeNames

private List _attributeNames
Ordered List of attribute names

_attributes

private Map _attributes
attribute map

_doc

private XDoc _doc

_hash

private int _hash

_isDirty

private boolean _isDirty
indicate dirty state

_isParsed

private boolean _isParsed
tag parse status

_lineNumber

private int _lineNumber

_name

private String _name
tag name

_tagListeners

private Set _tagListeners
tag listeners interested in changes. This would be parent xdoc

_value

private String _value
string representation of tag

_xJavaDoc

private XJavaDoc _xJavaDoc

Constructor Detail

DefaultXTag

public DefaultXTag()

Method Detail

addTagListener

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

Parameters: tagListener The feature to be added to the TagListener attribute

ensureTagListenersInitialised

private final void ensureTagListenersInitialised()

equals

public final boolean equals(Object o)

fail

protected final void fail(String message)
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.

fireTagChanged

private void fireTagChanged()
fire tagChanged event

getAttributeNames

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

Returns: The Parameters value

getAttributeValue

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

Parameters: attributeName Describe what the parameter does

Returns: The Parameter value

getDoc

public final XDoc getDoc()

getInfo

public final String getInfo()

getLineNumber

public final int getLineNumber()

getName

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

Returns: tag name

getValue

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

Returns: full value of the tag

hashCode

public final int hashCode()

init

final void init(String name, String value, XDoc doc, int lineNumber)
Sets the name and value. Called immediately after initialisation by XTagFactory. Don't call this method from anywhere else.

Parameters: name value doc lineNumber

parse

private final void parse()
Given the raw javadoc tag content as the value parameter parses it and sets the parameter. If anything is malformed (not (foo="xxx")+), then nothing is set.

removeAttribute

public final String removeAttribute(String attributeName)
Removes an attribute

Parameters: attributeName atribute to remove

Returns: the removed attribute value or null if it didn't exist

removeTagListener

public final void removeTagListener(XTagListener tagListener)
remove doc listener

Parameters: tagListener

resetValue

private final void resetValue()

setAttribute

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

Parameters: attributeName The new Attribute value attributeValue The new Attribute value

setAttribute_Impl

private final void setAttribute_Impl(String attributeName, String attributeValue)

skipWhitespace

private static int skipWhitespace(String s, int i)
Skips whitespaces, starting from index i till the first non-whitespace character or end of s and returns the new index.

Parameters: s Describe what the parameter does i Describe what the parameter does

Returns: Describe the return value

validate

public void validate()
Validates the tag

Throws: TagValidationException