Package org.jboss.jdeparser
Class SuccessorJVarDeclaration
- java.lang.Object
-
- org.jboss.jdeparser.SuccessorJVarDeclaration
-
- All Implemented Interfaces:
JAnnotatable
,JCommentable
,JDocCommentable
,JVarDeclaration
class SuccessorJVarDeclaration extends java.lang.Object implements JVarDeclaration
-
-
Field Summary
Fields Modifier and Type Field Description private FirstJVarDeclaration
first
private java.lang.String
name
private JExpr
value
-
Constructor Summary
Constructors Constructor Description SuccessorJVarDeclaration(FirstJVarDeclaration first, java.lang.String name, JExpr value)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description JVarDeclaration
add(java.lang.String name)
Add another item to this declaration.JVarDeclaration
add(java.lang.String name, JExpr init)
Add another item to this declaration.JAnnotation
annotate(java.lang.Class<? extends java.lang.annotation.Annotation> type)
Add an annotation.JAnnotation
annotate(java.lang.String type)
Add an annotation.JAnnotation
annotate(JType type)
Add an annotation.JComment
blockComment()
Add a block comment.JComment
deprecated()
Mark this program element as deprecated.JDocComment
docComment()
Get or create the doc comment for this element.(package private) JExpr
getValue()
JComment
lineComment()
Add a line comment.java.lang.String
name()
Get the variable name.JType
type()
Get the variable type.
-
-
-
Field Detail
-
first
private final FirstJVarDeclaration first
-
name
private final java.lang.String name
-
value
private final JExpr value
-
-
Constructor Detail
-
SuccessorJVarDeclaration
SuccessorJVarDeclaration(FirstJVarDeclaration first, java.lang.String name, JExpr value)
-
-
Method Detail
-
name
public java.lang.String name()
Description copied from interface:JVarDeclaration
Get the variable name.- Specified by:
name
in interfaceJVarDeclaration
- Returns:
- the variable name
-
getValue
JExpr getValue()
-
blockComment
public JComment blockComment()
Description copied from interface:JCommentable
Add a block comment.- Specified by:
blockComment
in interfaceJCommentable
- Returns:
- the block comment body
-
lineComment
public JComment lineComment()
Description copied from interface:JCommentable
Add a line comment.- Specified by:
lineComment
in interfaceJCommentable
- Returns:
- the line comment body
-
deprecated
public JComment deprecated()
Description copied from interface:JDocCommentable
Mark this program element as deprecated.- Specified by:
deprecated
in interfaceJDocCommentable
- Returns:
- the deprecation tag body
-
docComment
public JDocComment docComment()
Description copied from interface:JDocCommentable
Get or create the doc comment for this element.- Specified by:
docComment
in interfaceJDocCommentable
- Returns:
- the doc comment body
-
annotate
public JAnnotation annotate(java.lang.Class<? extends java.lang.annotation.Annotation> type)
Description copied from interface:JAnnotatable
Add an annotation.- Specified by:
annotate
in interfaceJAnnotatable
- Parameters:
type
- the type of the annotation to add- Returns:
- the new annotation
-
annotate
public JAnnotation annotate(JType type)
Description copied from interface:JAnnotatable
Add an annotation.- Specified by:
annotate
in interfaceJAnnotatable
- Parameters:
type
- the type of the annotation to add- Returns:
- the new annotation
-
annotate
public JAnnotation annotate(java.lang.String type)
Description copied from interface:JAnnotatable
Add an annotation.- Specified by:
annotate
in interfaceJAnnotatable
- Parameters:
type
- the type of the annotation to add- Returns:
- the new annotation
-
add
public JVarDeclaration add(java.lang.String name)
Description copied from interface:JVarDeclaration
Add another item to this declaration. Subsequent items always have the same type as this item.- Specified by:
add
in interfaceJVarDeclaration
- Parameters:
name
- the variable name- Returns:
- the subsequent declaration
-
add
public JVarDeclaration add(java.lang.String name, JExpr init)
Description copied from interface:JVarDeclaration
Add another item to this declaration. Subsequent items always have the same type as this item.- Specified by:
add
in interfaceJVarDeclaration
- Parameters:
name
- the variable nameinit
- the variable initializer- Returns:
- the subsequent declaration
-
type
public JType type()
Description copied from interface:JVarDeclaration
Get the variable type.- Specified by:
type
in interfaceJVarDeclaration
- Returns:
- the variable type
-
-