Package spoon.reflect.code
Interface CtLiteral<T>
-
- Type Parameters:
T
- type of literal's value
- All Superinterfaces:
Cloneable
,CtCodeElement
,CtElement
,CtExpression<T>
,CtQueryable
,CtTypedElement<T>
,CtVisitable
,FactoryAccessor
,Serializable
,SourcePositionHolder
,TemplateParameter<T>
- All Known Subinterfaces:
CtTextBlock
- All Known Implementing Classes:
CtLiteralImpl
,CtTextBlockImpl
public interface CtLiteral<T> extends CtExpression<T>
This code element defines a literal value (an int, a string, etc).int x = 4; // 4 is a literal
A null literal, as in s = null", is represented by a CtLiteral whose value is null.
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description CtLiteral<T>
clone()
Overriding return type, a clone of a CtLiteral returns a CtLiteralLiteralBase
getBase()
Gets the base of the numeric literal (2, 8, 10 or 16).T
getValue()
Gets the actual value of the literal (statically known).<C extends CtLiteral<T>>
CsetBase(LiteralBase base)
Sets the base of the numeric literal.<C extends CtLiteral<T>>
CsetValue(T value)
Sets the actual value of the literal.-
Methods inherited from interface spoon.reflect.code.CtCodeElement
partiallyEvaluate
-
Methods inherited from interface spoon.reflect.declaration.CtElement
addAnnotation, addComment, asIterable, delete, descendantIterator, getAllMetadata, getAnnotatedChildren, getAnnotation, getAnnotation, getAnnotations, getComments, getDirectChildren, getDocComment, getElements, getMetadata, getMetadataKeys, getOriginalSourceFragment, getParent, getParent, getParent, getPath, getPosition, getReferencedTypes, getRoleInParent, getShortRepresentation, getValueByRole, hasAnnotation, hasParent, isImplicit, isParentInitialized, prettyprint, putMetadata, removeAnnotation, removeComment, replace, replace, setAllMetadata, setAnnotations, setComments, setDocComment, setImplicit, setParent, setPosition, setPositions, setValueByRole, toString, toStringDebug, updateAllParentsBelow
-
Methods inherited from interface spoon.reflect.code.CtExpression
addTypeCast, getTypeCasts, setTypeCasts
-
Methods inherited from interface spoon.reflect.visitor.chain.CtQueryable
filterChildren, map, map
-
Methods inherited from interface spoon.reflect.declaration.CtTypedElement
getType, setType
-
Methods inherited from interface spoon.reflect.visitor.CtVisitable
accept
-
Methods inherited from interface spoon.processing.FactoryAccessor
getFactory, setFactory
-
Methods inherited from interface spoon.template.TemplateParameter
S
-
-
-
-
Method Detail
-
getValue
T getValue()
Gets the actual value of the literal (statically known).
-
getBase
LiteralBase getBase()
Gets the base of the numeric literal (2, 8, 10 or 16).
-
setBase
<C extends CtLiteral<T>> C setBase(LiteralBase base)
Sets the base of the numeric literal.
-
clone
CtLiteral<T> clone()
Overriding return type, a clone of a CtLiteral returns a CtLiteral- Specified by:
clone
in interfaceCtCodeElement
- Specified by:
clone
in interfaceCtElement
- Specified by:
clone
in interfaceCtExpression<T>
-
-