|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectxjavadoc.XDoc
Represents documentation
Field Summary | |
private java.lang.String |
_commentText
description of program element |
private boolean |
_dirty
|
private java.util.Set |
_docListeners
|
private java.lang.String |
_firstSentence
first sentence of comment text |
private Token |
_javadocToken
Token (which is linked in the AST) that holds the string representation of the doc. |
private XProgramElement |
_owner
|
private XTagFactory |
_tagFactory
|
private java.util.Map |
_tagMap
Maps tag name to List. |
private java.util.List |
_tags
Contains all the tags in the doc, in order of occurrence. |
private static java.lang.String |
EMPTY_COMMENT
Default comment |
static int |
instanceCount
|
private static java.lang.String |
NEWLINE
Platform specific NEWLINE. |
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. |
private XTag |
addTag_Impl(java.lang.String tagName,
java.lang.String text,
int lineNumber)
Creates and adds a tag |
XTag |
addTag(java.lang.String tagName,
java.lang.String text)
Add a tag to the doc item. |
private java.lang.StringBuffer |
appendWhiteSpaces(java.lang.StringBuffer sb)
Add some white space to the string being built up in toString(). |
static java.lang.String |
dotted(java.lang.String tagName)
Convert a tag name from the old colon-separated form to the new preferred dot-separated form. |
private void |
ensureTagMapInitialised()
|
private void |
fireDocChanged()
fire docChange event |
private java.util.List |
getAllSuperDocs()
Returns the doc in all the superclasses. |
java.lang.String |
getCommentText()
return description of program element |
java.lang.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 |
private XDoc |
getSuperDoc()
Returns the doc in the superclass. |
XTag |
getTag(java.lang.String tagName)
Get the first tag of name tagName from this doc. |
XTag |
getTag(java.lang.String tagName,
boolean superclasses)
Get the first tag of name tagName. |
java.lang.String |
getTagAttributeValue(java.lang.String tagName,
java.lang.String attributeName)
Returns the tag attribute value. |
java.lang.String |
getTagAttributeValue(java.lang.String tagName,
java.lang.String attributeName,
boolean superclasses)
Returns the tag attribute value. |
java.util.List |
getTags()
Returns all the tags in this doc (not superclasses). |
java.util.List |
getTags(boolean superclasses)
Returns all the tags. |
java.util.List |
getTags(java.lang.String tagName)
Returns all the tags in this doc with the specified tagName (not superclasses). |
java.util.List |
getTags(java.lang.String tagName,
boolean superclasses)
Returns all the tags with the specified tagName. |
boolean |
hasTag(java.lang.String tagName)
Returns true if the tag exists. |
boolean |
hasTag(java.lang.String tagName,
boolean superclasses)
Returns true if the tag exists. |
private 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(java.lang.String commentText)
Set the text of the comment for this doc item. |
void |
tagChanged(XTagEvent event)
receive change notification from xtag |
private static java.lang.String |
tokenizeAndTrim(java.lang.String s)
|
java.lang.String |
toString()
Returns a String representation of this doc. |
XTag |
updateTagValue(java.lang.String tagName,
java.lang.String attributeName,
java.lang.String attributeValue,
int tagIndex)
Utility method to set the value of a tag attribute. |
void |
updateToken()
update token |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Field Detail |
public static int instanceCount
private static final java.lang.String NEWLINE
private static final java.lang.String EMPTY_COMMENT
private java.util.Map _tagMap
private Token _javadocToken
private XProgramElement _owner
private java.util.List _tags
private java.lang.String _commentText
private java.lang.String _firstSentence
private boolean _dirty
private java.util.Set _docListeners
private final XTagFactory _tagFactory
Constructor Detail |
public XDoc(Token javadocToken, XProgramElement owner, XTagFactory tagFactory)
javadocToken
- Describe what the parameter doesowner
- Describe what the parameter doestagFactory
- Describe what the parameter doesMethod Detail |
public static java.lang.String dotted(java.lang.String tagName)
tagName
- The name of the tag
private static final java.lang.String tokenizeAndTrim(java.lang.String s)
public XProgramElement getOwner()
public java.util.List getTags(java.lang.String tagName)
tagName
- the name of the tags to return (without the 'at')
public java.util.List getTags(java.lang.String tagName, boolean superclasses)
tagName
- the name of the tags to return (without the 'at')superclasses
- if this is true, return tags from superclasses too.
public java.util.List getTags()
public java.util.List getTags(boolean superclasses)
superclasses
- if this is true, return tags from superclasses too.
public XTag getTag(java.lang.String tagName)
tagName
- the name of the tag
public XTag getTag(java.lang.String tagName, boolean superclasses)
tagName
- the name of the tag to get (without the 'at')superclasses
- if this is true, return tags from superclasses too.
public java.lang.String getTagAttributeValue(java.lang.String tagName, java.lang.String attributeName)
tagName
- The name of the tag to look for (without the 'at')attributeName
- The name of the attribute to look for within the tag.
public java.lang.String getTagAttributeValue(java.lang.String tagName, java.lang.String attributeName, boolean superclasses)
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.
public java.lang.String getCommentText()
public java.lang.String getFirstSentence()
public void setCommentText(java.lang.String commentText)
commentText
- The new comment textpublic boolean hasTag(java.lang.String tagName)
tagName
- The name of the tag to look for (without the 'at')
public boolean hasTag(java.lang.String tagName, boolean superclasses)
tagName
- The name of the tag to look for (without the 'at')superclasses
- If true, look in superclasses too.
public XTag updateTagValue(java.lang.String tagName, java.lang.String attributeName, java.lang.String attributeValue, int tagIndex) throws XJavaDocException
tagName
- The new name of the tag to update (without thetagIndex
- The index of the tag to update, in case there
are several tags with the same name.attributeName
- The attribute nameattributeValue
- The new attribute value
XJavaDocException
public void addDocListener(XDocListener docListener)
docListener
- doc listener to registerpublic void removeDocListener(XDocListener docListener)
docListener
- public java.lang.String toString()
public void updateToken()
public boolean removeTag(XTag tag)
tag
- tag to be removed
public XTag addTag(java.lang.String tagName, java.lang.String text)
tagName
- The name of the tag to addtext
- The value of the tag
TagValidationException
- if validation is activated (in XTagFactory)
and tagName is not among the registered tags.public void tagChanged(XTagEvent event)
tagChanged
in interface XTagListener
event
- private XDoc getSuperDoc()
private java.util.List getAllSuperDocs()
private final void ensureTagMapInitialised()
private XTag addTag_Impl(java.lang.String tagName, java.lang.String text, int lineNumber) throws TagValidationException
tagName
- The name of the tag (without the 'at')text
- The raw content of the taglineNumber
- The feature to be added to the Tag_Impl
attribute
TagValidationException
private void fireDocChanged()
private java.lang.StringBuffer appendWhiteSpaces(java.lang.StringBuffer sb)
sb
- StringBuffer that the text is being built in
private void parse() throws TagValidationException
TagValidationException
|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |