Package com.sun.mirror.declaration
Interface FieldDeclaration
- All Superinterfaces:
Declaration
,MemberDeclaration
- All Known Subinterfaces:
EnumConstantDeclaration
Represents a field of a type declaration.
- Since:
- 1.5
- Version:
- 1.2 04/04/20
- Author:
- Joseph D. Darcy, Scott Seligman
-
Method Summary
Modifier and TypeMethodDescriptionReturns the text of a constant expression representing the value of this field if this field is a compile-time constant.Returns the value of this field if this field is a compile-time constant.getType()
Returns the type of this field.Methods inherited from interface com.sun.mirror.declaration.Declaration
accept, equals, getAnnotation, getAnnotationMirrors, getDocComment, getModifiers, getPosition, getSimpleName
Methods inherited from interface com.sun.mirror.declaration.MemberDeclaration
getDeclaringType
-
Method Details
-
getType
TypeMirror getType()Returns the type of this field.- Returns:
- the type of this field
-
getConstantValue
Object getConstantValue()Returns the value of this field if this field is a compile-time constant. Returnsnull
otherwise. The value will be of a primitive type orString
. If the value is of a primitive type, it is wrapped in the appropriate wrapper class (such asInteger
).- Returns:
- the value of this field if this field is a compile-time
constant, or
null
otherwise
-
getConstantExpression
String getConstantExpression()Returns the text of a constant expression representing the value of this field if this field is a compile-time constant. Returnsnull
otherwise. The value will be of a primitive type orString
. The text returned is in a form suitable for representing the value in source code.- Returns:
- the text of a constant expression if this field is a
compile-time constant, or
null
otherwise
-