public class CtFieldReferenceImpl<T> extends CtVariableReferenceImpl<T> implements CtFieldReference<T>
simplename
ERROR_MESSAGE_TO_STRING, factory, LOGGER, parent
Constructor and Description |
---|
CtFieldReferenceImpl() |
Modifier and Type | Method and Description |
---|---|
void |
accept(CtVisitor visitor)
Accepts a visitor
|
CtFieldReference<T> |
clone()
Clone the element which calls this method in a new object.
|
protected java.lang.reflect.AnnotatedElement |
getActualAnnotatedElement() |
java.lang.reflect.Member |
getActualField()
Gets the runtime member that corresponds to a field reference if any.
|
CtField<T> |
getDeclaration()
Tries to get the declaration of the reference.
|
CtTypeReference<?> |
getDeclaringType()
Gets the type in which the field is declared.
|
CtField<T> |
getFieldDeclaration()
Returns the
CtField that corresponds to the reference
even if its declaring type isn't in the Spoon source path (in this case,
the Spoon elements are built with runtime reflection) |
java.util.Set<ModifierKind> |
getModifiers()
Gets modifiers of the reference.
|
java.lang.String |
getQualifiedName()
Gets the qualified name of the field.
|
boolean |
isFinal()
Tells if the referenced field is final.
|
boolean |
isStatic()
Tells if the referenced field is static.
|
<C extends CtFieldReference<T>> |
setDeclaringType(CtTypeReference<?> declaringType)
Sets the type in which the field is declared.
|
<C extends CtFieldReference<T>> |
setFinal(boolean fina)
Forces a reference to a final element.
|
<C extends CtFieldReference<T>> |
setStatic(boolean stat)
Forces a reference to a static element.
|
getType, setType
equals, getSimpleName, setComments, setSimpleName
addAnnotation, addComment, asIterable, comment, delete, descendantIterator, emptyList, emptySet, filterChildren, getAllMetadata, getAnnotatedChildren, getAnnotation, getAnnotation, getAnnotations, getComments, getDirectChildren, getDocComment, getElements, getFactory, getMetadata, getMetadataKeys, getOriginalSourceFragment, getParent, getParent, getParent, getPath, getPosition, getReferencedTypes, getRoleInParent, getShortRepresentation, getValueByRole, hasAnnotation, hashCode, hasParent, isImplicit, isParentInitialized, map, map, prettyprint, putMetadata, removeAnnotation, removeComment, replace, replace, setAllMetadata, setAnnotations, setDocComment, setFactory, setImplicit, setParent, setPosition, setPositions, setValueByRole, toString, toStringDebug, unmodifiableList, updateAllParentsBelow
finalize, getClass, notify, notifyAll, wait, wait, wait
getType, setType
getSimpleName, setComments, setSimpleName
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, setDocComment, setImplicit, setParent, setPosition, setPositions, setValueByRole, toString, toStringDebug, updateAllParentsBelow
getFactory, setFactory
filterChildren, map, map
public void accept(CtVisitor visitor)
CtVisitable
accept
in interface CtVisitable
accept
in class CtVariableReferenceImpl<T>
public java.lang.reflect.Member getActualField()
CtFieldReference
getActualField
in interface CtFieldReference<T>
protected java.lang.reflect.AnnotatedElement getActualAnnotatedElement()
getActualAnnotatedElement
in class CtVariableReferenceImpl<T>
public CtField<T> getDeclaration()
CtVariableReference
getDeclaration
in interface CtFieldReference<T>
getDeclaration
in interface CtReference
getDeclaration
in interface CtVariableReference<T>
getDeclaration
in class CtVariableReferenceImpl<T>
public CtField<T> getFieldDeclaration()
CtFieldReference
CtField
that corresponds to the reference
even if its declaring type isn't in the Spoon source path (in this case,
the Spoon elements are built with runtime reflection)getFieldDeclaration
in interface CtFieldReference<T>
public CtTypeReference<?> getDeclaringType()
CtFieldReference
getDeclaringType
in interface CtFieldReference<T>
public java.lang.String getQualifiedName()
CtFieldReference
getQualifiedName
in interface CtFieldReference<T>
public boolean isFinal()
CtFieldReference
isFinal
in interface CtFieldReference<T>
public boolean isStatic()
isStatic
in interface CtFieldReference<T>
public <C extends CtFieldReference<T>> C setDeclaringType(CtTypeReference<?> declaringType)
CtFieldReference
setDeclaringType
in interface CtFieldReference<T>
public <C extends CtFieldReference<T>> C setFinal(boolean fina)
CtFieldReference
setFinal
in interface CtFieldReference<T>
public <C extends CtFieldReference<T>> C setStatic(boolean stat)
CtFieldReference
setStatic
in interface CtFieldReference<T>
public java.util.Set<ModifierKind> getModifiers()
CtVariableReference
getModifiers
in interface CtVariableReference<T>
getModifiers
in class CtVariableReferenceImpl<T>
public CtFieldReference<T> clone()
CtElement
Refactoring.copyType(CtType)
and Refactoring.copyMethod(CtMethod)
instead which does additional work beyond cloning.clone
in interface CtElement
clone
in interface CtFieldReference<T>
clone
in interface CtReference
clone
in interface CtVariableReference<T>
clone
in class CtVariableReferenceImpl<T>
Copyright © 2007–2021 Inria. All rights reserved.