xjavadoc
public final class XDoc extends Object implements XTagListener
UNKNOWN: 20. mars 2003
Field Summary | |
---|---|
static String | EMPTY_COMMENT
Default comment |
static int | instanceCount |
static String | NEWLINE
Platform specific NEWLINE. |
String | _commentText
description of program element |
boolean | _dirty |
Set | _docListeners |
String | _firstSentence
first sentence of comment text |
Token | _javadocToken
Token (which is linked in the AST) that holds the string representation of
the doc. |
XProgramElement | _owner |
XTagFactory | _tagFactory |
Map | _tagMap
Maps tag name to List. |
List | _tags
Contains all the tags in the doc, in order of occurrence. |
Constructor Summary | |
---|---|
XDoc(Token javadocToken, XProgramElement owner, XTagFactory tagFactory)
Describe what the XDoc constructor does
|
Method Summary | |
---|---|
void | addDocListener(XDocListener docListener)
Add doc listener interested in changes.
|
XTag | addTag(String tagName, String text)
Add a tag to the doc item.
|
XTag | addTag_Impl(String tagName, String text, int lineNumber)
Creates and adds a tag
|
StringBuffer | appendWhiteSpaces(StringBuffer sb)
Add some white space to the string being built up in toString().
|
static String | dotted(String tagName)
Convert a tag name from the old colon-separated form to the new preferred dot-separated form.
|
void | ensureTagMapInitialised() |
void | fireDocChanged()
fire docChange event |
List | getAllSuperDocs()
Returns the doc in all the superclasses. |
String | getCommentText()
return description of program element
|
String | getFirstSentence()
Return the first sentence of the text of the comment for this doc item.
|
XProgramElement | getOwner()
Gets the Owner attribute of the XDoc object
|
XDoc | getSuperDoc()
Returns the doc in the superclass. |
XTag | getTag(String tagName)
Get the first tag of name tagName from this doc. |
XTag | getTag(String tagName, boolean superclasses)
Get the first tag of name tagName.
|
String | getTagAttributeValue(String tagName, String attributeName)
Returns the tag attribute value. |
String | getTagAttributeValue(String tagName, String attributeName, boolean superclasses)
Returns the tag attribute value. |
List | getTags(String tagName)
Returns all the tags in this doc with the specified tagName (not
superclasses). |
List | getTags(String tagName, boolean superclasses)
Returns all the tags with the specified tagName. |
List | getTags()
Returns all the tags in this doc (not superclasses). |
List | getTags(boolean superclasses)
Returns all the tags. |
boolean | hasTag(String tagName)
Returns true if the tag exists. |
boolean | hasTag(String tagName, boolean superclasses)
Returns true if the tag exists.
|
void | parse()
Parse token into comments, tags and tag attributes. |
void | removeDocListener(XDocListener docListener)
remove doc listener
|
boolean | removeTag(XTag tag)
Removes tag. |
void | setCommentText(String commentText)
Set the text of the comment for this doc item.
|
void | tagChanged(XTagEvent event)
receive change notification from xtag
|
static String | tokenizeAndTrim(String s) |
String | toString()
Returns a String representation of this doc.
|
XTag | updateTagValue(String tagName, String attributeName, String attributeValue, int tagIndex)
Utility method to set the value of a tag attribute. |
void | updateToken()
update token |
Parameters: javadocToken Describe what the parameter does owner Describe what the parameter does tagFactory Describe what the parameter does
Parameters: docListener doc listener to register
Parameters: tagName The name of the tag to add text The value of the tag
Returns: The created XTag
Throws: TagValidationException if validation is activated (in XTagFactory) and tagName is not among the registered tags.
Parameters: tagName The name of the tag (without the 'at') text The raw content of the tag lineNumber The feature to be added to the Tag_Impl attribute
Returns: An instance of XTag, created by the current XTagFactory
Throws: TagValidationException
Parameters: sb StringBuffer that the text is being built in
Returns: the StringBuffer
Parameters: tagName The name of the tag
Returns: Preferred form of the tag
Returns: A List of XDoc
Returns: description of program element
Returns: First sentence
Returns: The Owner value
Returns: the superclass' doc
Parameters: tagName the name of the tag
Returns: the tag
Parameters: tagName the name of the tag to get (without the 'at') superclasses if this is true, return tags from superclasses too.
Returns: the first XTag with name equal to tagName
Parameters: tagName The name of the tag to look for (without the 'at') attributeName The name of the attribute to look for within the tag.
Returns: The value of the tag attribute.
Parameters: tagName The name of the tag to look for (without the 'at') attributeName The name of the attribute to look for within the tag. superclasses Set it to true to look in superclasses too.
Returns: The value of the tag attribute.
Parameters: tagName the name of the tags to return (without the 'at')
Returns: A Collection of XTag
Parameters: tagName the name of the tags to return (without the 'at') superclasses if this is true, return tags from superclasses too.
Returns: A Collection of XTag
Returns: A Collection of XTag
Parameters: superclasses if this is true, return tags from superclasses too.
Returns: A List of XTag
Parameters: tagName The name of the tag to look for (without the 'at')
Returns: true if the tag exists
Parameters: tagName The name of the tag to look for (without the 'at') superclasses If true, look in superclasses too.
Returns: true if the tag exists
Throws: TagValidationException
Parameters: docListener
Parameters: tag tag to be removed
Returns: true if it was removed
Parameters: commentText The new comment text
Parameters: event
Returns: a String representation of this doc.
Parameters: tagName The new name of the tag to update (without the tagIndex The index of the tag to update, in case there are several tags with the same name. attributeName The attribute name attributeValue The new attribute value
Returns: the updated tag
Throws: XJavaDocException