Package spoon.reflect.declaration
Interface CtField<T>
- All Superinterfaces:
Cloneable
,CtElement
,CtModifiable
,CtNamedElement
,CtQueryable
,CtRHSReceiver<T>
,CtShadowable
,CtTypedElement<T>
,CtTypeMember
,CtVariable<T>
,CtVisitable
,FactoryAccessor
,Serializable
,SourcePositionHolder
- All Known Subinterfaces:
CtEnumValue<T>
- All Known Implementing Classes:
CtEnumValueImpl
,CtFieldImpl
This element defines a field declaration.
-
Field Summary
Modifier and TypeFieldDescriptionstatic String
The separator for a string representation of a field. -
Method Summary
Modifier and TypeMethodDescriptionclone()
Clone the element which calls this method in a new object.Useful proxy toCtVariable.getDefaultExpression()
.Returns the corresponding reference.<U extends CtRHSReceiver<T>>
UsetAssignment(CtExpression<T> assignment)
Sets the right-hand side expression (RHS) of the "=" operator.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
getSimpleName, setSimpleName
Methods inherited from interface spoon.reflect.visitor.chain.CtQueryable
filterChildren, map, map
Methods inherited from interface spoon.reflect.declaration.CtShadowable
isShadow, setShadow
Methods inherited from interface spoon.reflect.declaration.CtTypedElement
getType, setType
Methods inherited from interface spoon.reflect.declaration.CtTypeMember
getDeclaringType, getTopLevelType
Methods inherited from interface spoon.reflect.declaration.CtVariable
getDefaultExpression, isPartOfJointDeclaration, setDefaultExpression
Methods inherited from interface spoon.reflect.visitor.CtVisitable
accept
Methods inherited from interface spoon.processing.FactoryAccessor
getFactory, setFactory
-
Field Details
-
FIELD_SEPARATOR
The separator for a string representation of a field.- See Also:
- Constant Field Values
-
-
Method Details
-
getReference
CtFieldReference<T> getReference()Description copied from interface:CtNamedElement
Returns the corresponding reference.- Specified by:
getReference
in interfaceCtNamedElement
- Specified by:
getReference
in interfaceCtVariable<T>
-
getAssignment
CtExpression<T> getAssignment()Useful proxy toCtVariable.getDefaultExpression()
.- Specified by:
getAssignment
in interfaceCtRHSReceiver<T>
-
setAssignment
Description copied from interface:CtRHSReceiver
Sets the right-hand side expression (RHS) of the "=" operator.- Specified by:
setAssignment
in interfaceCtRHSReceiver<T>
-
clone
Description copied from interface:CtElement
Clone the element which calls this method in a new object. Note that that references are kept as is, and thus, so if you clone whole classes or methods, some parts of the cloned element (eg executable references) may still point to the initial element. In this case, consider using methodsRefactoring.copyType(CtType)
andRefactoring.copyMethod(CtMethod)
instead which does additional work beyond cloning.- Specified by:
clone
in interfaceCtElement
- Specified by:
clone
in interfaceCtNamedElement
-