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.booleanReturns 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, updateAllParentsBelowMethods 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, setVisibilityMethods inherited from interface spoon.reflect.declaration.CtNamedElement
clone, getSimpleName, setSimpleNameMethods inherited from interface spoon.reflect.visitor.chain.CtQueryable
filterChildren, map, mapMethods inherited from interface spoon.reflect.declaration.CtTypedElement
getType, setTypeMethods inherited from interface spoon.reflect.visitor.CtVisitable
acceptMethods 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:CtNamedElementReturns the corresponding reference.- Specified by:
getReferencein 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
-