org.openide.src
Interface JavaDoc

All Known Subinterfaces:
JavaDoc.Class, JavaDoc.Field, JavaDoc.Method

public interface JavaDoc

Represents a JavaDoc comment block. The representation object is mutable, if it represents a portion of a source text, any changes made to the object are reflected in the source code and vice versa.
There are a few inerclasses, which subclass JavaDoc class, and add accessors for tags specific to individual source text elements.


Nested Class Summary
static interface JavaDoc.Class
          The JavaDoc of a class.
static interface JavaDoc.Field
          The JavaDoc of a field.
static interface JavaDoc.Method
          The JavaDoc of a method.
 
Field Summary
static int ADD
          Serves as second parameter in method changeTags(org.openide.src.JavaDocTag[], int).
static int REMOVE
          Serves as second parameter in method changeTags(org.openide.src.JavaDocTag[], int).
static int SET
          Serves as second parameter in method changeTags(org.openide.src.JavaDocTag[], int).
 
Method Summary
 void changeTags(JavaDocTag[] tags, int action)
          Adds removes or sets tags used in this comment
 void clearJavaDoc()
          Clears the javadoc from the source.
 String getRawText()
          Get the entire text of the comment.
 JavaDocTag.See[] getSeeTags()
          Gets all @see tags
 JavaDocTag[] getTags()
          Gets all tags from comment.
 JavaDocTag[] getTags(String name)
          Gets all tags of given name
 String getText()
          Get the actual text, cleared of all (non-inline) tags.
 boolean isEmpty()
          Test if this javadoc is empty.
 void setRawText(String s)
          Set the raw text of the comment.
 void setText(String s)
          Set the actual text.
 

Field Detail

ADD

public static final int ADD
Serves as second parameter in method changeTags(org.openide.src.JavaDocTag[], int).

See Also:
Constant Field Values

REMOVE

public static final int REMOVE
Serves as second parameter in method changeTags(org.openide.src.JavaDocTag[], int).

See Also:
Constant Field Values

SET

public static final int SET
Serves as second parameter in method changeTags(org.openide.src.JavaDocTag[], int).

See Also:
Constant Field Values
Method Detail

getRawText

public String getRawText()
Get the entire text of the comment. If the javadoc comment is empty (except the boxing stars), it returns an empty string. If the comment is missing at all, the method returns null (isEmpty() returns true at the same time).

Returns:
the whole text, or null, if the comment is missing at all on the Element.

setRawText

public void setRawText(String s)
                throws SourceException
Set the raw text of the comment.

Parameters:
s - the whole text to set
Throws:
SourceException - if the modification cannot be performed

getText

public String getText()
Get the actual text, cleared of all (non-inline) tags.

Returns:
the plain text

setText

public void setText(String s)
             throws SourceException
Set the actual text.

Parameters:
s - the actual text, without any (non-inline) tags
Throws:
SourceException - if the modification cannot be performed

clearJavaDoc

public void clearJavaDoc()
                  throws SourceException
Clears the javadoc from the source.

Throws:
SourceException

isEmpty

public boolean isEmpty()
Test if this javadoc is empty.

Returns:
true if it is not generated to the source.

getTags

public JavaDocTag[] getTags()
Gets all tags from comment.


getTags

public JavaDocTag[] getTags(String name)
Gets all tags of given name


changeTags

public void changeTags(JavaDocTag[] tags,
                       int action)
                throws SourceException
Adds removes or sets tags used in this comment

Parameters:
tags - the new initializers
action - ADD, REMOVE, or SET
Throws:
SourceException - if impossible

getSeeTags

public JavaDocTag.See[] getSeeTags()
Gets all @see tags


 

Built on May 3 2007.  |  Portions Copyright 1997-2005 Sun Microsystems, Inc. All rights reserved.