Package spoon.reflect.declaration
Interface CtVariable<T>
- All Superinterfaces:
Cloneable
,CtElement
,CtModifiable
,CtNamedElement
,CtQueryable
,CtTypedElement<T>
,CtVisitable
,FactoryAccessor
,Serializable
,SourcePositionHolder
- All Known Subinterfaces:
CtCatchVariable<T>
,CtEnumValue<T>
,CtField<T>
,CtLocalVariable<T>
,CtParameter<T>
,CtResource<T>
- All Known Implementing Classes:
CtCatchVariableImpl
,CtEnumValueImpl
,CtFieldImpl
,CtLocalVariableImpl
,CtParameterImpl
This abstract element defines a variable declaration.
-
Method Summary
Modifier and TypeMethodDescriptionGets the initialization expression assigned to the variable (also known as the initializer), when declared.Returns the corresponding reference.boolean
Returns true it the variable (field, localvariable) is jointly declared with a share type Eg int a,b; Warning: is computed on demand<C extends CtVariable<T>>
CsetDefaultExpression(CtExpression<T> assignedExpression)
Sets the initialization expression assigned to the variable, when declared.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.declaration.CtModifiable
addModifier, getExtendedModifiers, getModifiers, getVisibility, hasModifier, isAbstract, isFinal, isNative, isPrivate, isProtected, isPublic, isStatic, isStrictfp, isSynchronized, isTransient, isVolatile, removeModifier, setExtendedModifiers, setModifiers, setVisibility
Methods inherited from interface spoon.reflect.declaration.CtNamedElement
clone, getSimpleName, setSimpleName
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
-
Method Details
-
getDefaultExpression
CtExpression<T> getDefaultExpression()Gets the initialization expression assigned to the variable (also known as the initializer), when declared. -
getReference
CtVariableReference<T> getReference()Description copied from interface:CtNamedElement
Returns the corresponding reference.- Specified by:
getReference
in interfaceCtNamedElement
-
setDefaultExpression
Sets the initialization expression assigned to the variable, when declared. -
isPartOfJointDeclaration
boolean isPartOfJointDeclaration()Returns true it the variable (field, localvariable) is jointly declared with a share type Eg int a,b; Warning: is computed on demand
-