Package spoon.support.reflect.code
Class CtTypeAccessImpl<A>
java.lang.Object
- All Implemented Interfaces:
Serializable
,Cloneable
,FactoryAccessor
,CtCodeElement
,CtExpression<Void>
,CtTypeAccess<A>
,SourcePositionHolder
,CtElement
,CtTypedElement<Void>
,CtQueryable
,CtVisitable
,TemplateParameter<Void>
- See Also:
- Serialized Form
-
Field Summary
Fields inherited from class spoon.support.reflect.declaration.CtElementImpl
ERROR_MESSAGE_TO_STRING, factory, LOGGER, parent
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionvoid
Accepts a visitorclone()
Clone the element which calls this method in a new object.Returns type represented and contained in the type access.getType()
Gets this element's type.boolean
Returns true if this element is not present in the code (automatically added by the Java compiler or inferred when the model is built).<C extends CtTypeAccess<A>>
CsetAccessedType(CtTypeReference<A> accessedType)
Set the accessed type.<E extends CtElement>
EsetImplicit(boolean implicit)
Sets this element to be implicit.<C extends CtTypedElement>
CsetType(CtTypeReference type)
Sets this element's type.Methods inherited from class spoon.support.reflect.code.CtExpressionImpl
addTypeCast, getTypeCasts, S, setTypeCasts
Methods inherited from class spoon.support.reflect.code.CtCodeElementImpl
partiallyEvaluate
Methods inherited from class spoon.support.reflect.declaration.CtElementImpl
addAnnotation, addComment, asIterable, comment, delete, descendantIterator, emptyList, emptySet, equals, 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, isParentInitialized, map, map, prettyprint, putMetadata, removeAnnotation, removeComment, replace, replace, setAllMetadata, setAnnotations, setComments, setDocComment, setFactory, setParent, setPosition, setPositions, setValueByRole, toString, toStringDebug, unmodifiableList, updateAllParentsBelow
Methods inherited from class java.lang.Object
finalize, getClass, notify, notifyAll, wait, wait, wait
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, isParentInitialized, prettyprint, putMetadata, removeAnnotation, removeComment, replace, replace, setAllMetadata, setAnnotations, setComments, setDocComment, 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.processing.FactoryAccessor
getFactory, setFactory
Methods inherited from interface spoon.template.TemplateParameter
S
-
Constructor Details
-
CtTypeAccessImpl
public CtTypeAccessImpl()
-
-
Method Details
-
accept
Description copied from interface:CtVisitable
Accepts a visitor- Specified by:
accept
in interfaceCtVisitable
-
getAccessedType
Description copied from interface:CtTypeAccess
Returns type represented and contained in the type access.- Specified by:
getAccessedType
in interfaceCtTypeAccess<A>
- Returns:
- CtTypeReference.
-
setAccessedType
Description copied from interface:CtTypeAccess
Set the accessed type.- Specified by:
setAccessedType
in interfaceCtTypeAccess<A>
- Parameters:
accessedType
- CtTypeReference.
-
getType
Description copied from interface:CtTypedElement
Gets this element's type.- Specified by:
getType
in interfaceCtTypeAccess<A>
- Specified by:
getType
in interfaceCtTypedElement<A>
- Overrides:
getType
in classCtExpressionImpl<Void>
- See Also:
to get the accessed type.
-
setType
Description copied from interface:CtTypedElement
Sets this element's type.- Specified by:
setType
in interfaceCtTypeAccess<A>
- Specified by:
setType
in interfaceCtTypedElement<A>
- Overrides:
setType
in classCtExpressionImpl<Void>
-
isImplicit
public boolean isImplicit()Description copied from interface:CtElement
Returns true if this element is not present in the code (automatically added by the Java compiler or inferred when the model is built). Consequently, implicit elements are not pretty-printed and have no position.- Specified by:
isImplicit
in interfaceCtElement
- Specified by:
isImplicit
in interfaceCtTypeAccess<A>
- Overrides:
isImplicit
in classCtElementImpl
- Returns:
CtTypeAccess.getAccessedType()
.isImplicit()
-
setImplicit
Description copied from interface:CtElement
Sets this element to be implicit.- Specified by:
setImplicit
in interfaceCtElement
- Specified by:
setImplicit
in interfaceCtTypeAccess<A>
- Overrides:
setImplicit
in classCtElementImpl
-
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 interfaceCtCodeElement
- Specified by:
clone
in interfaceCtElement
- Specified by:
clone
in interfaceCtExpression<A>
- Specified by:
clone
in interfaceCtTypeAccess<A>
- Overrides:
clone
in classCtExpressionImpl<Void>
-