public abstract class Constant extends Object implements AnnotationValue
| Modifier and Type | Method and Description |
|---|---|
Object |
accept(ExpressionVisitor visitor)
Accept a visitor for this value.
|
protected static String |
convertString(String str) |
String |
getImage() |
String |
getParameterValue()
Get a parameter value for
JavaAnnotation.getNamedParameter(String). |
abstract Object |
getValue() |
static Constant |
newBooleanLiteral(String value) |
static Constant |
newCharacterLiteral(String value) |
static Constant |
newFloatingPointLiteral(String value) |
static Constant |
newIntegerLiteral(String value) |
static Constant |
newStringLiteral(String value) |
protected static Boolean |
toBoolean(String value) |
protected static Character |
toChar(String value)
Convert a character literal into a character.
|
protected static Number |
toFloatingPointLiteral(String value) |
protected static Number |
toIntegerLiteral(String value) |
String |
toString() |
protected static String |
toString(String value)
Convert a string literal into a string.
|
public abstract Object getValue()
public String getImage()
public Object accept(ExpressionVisitor visitor)
accept in interface AnnotationValuevisitor - Visitorpublic String getParameterValue()
JavaAnnotation.getNamedParameter(String).getParameterValue in interface Expressionprotected static Character toChar(String value) throws IllegalArgumentException
value - the single quoted valueIllegalArgumentException - if value is not a character literalprotected static String toString(String value) throws IllegalArgumentException
value - the double quoted valueIllegalArgumentException - if value is not a String literalCopyright © 2002–2025. All rights reserved.