Package spoon.support.reflect.reference
Class CtIntersectionTypeReferenceImpl<T>
java.lang.Object
spoon.support.reflect.declaration.CtElementImpl
spoon.support.reflect.reference.CtReferenceImpl
spoon.support.reflect.reference.CtTypeReferenceImpl<T>
spoon.support.reflect.reference.CtIntersectionTypeReferenceImpl<T>
- All Implemented Interfaces:
Serializable
,Cloneable
,FactoryAccessor
,SourcePositionHolder
,CtElement
,CtShadowable
,CtTypeInformation
,CtActualTypeContainer
,CtIntersectionTypeReference<T>
,CtReference
,CtTypeReference<T>
,CtQueryable
,CtVisitable
public class CtIntersectionTypeReferenceImpl<T>
extends CtTypeReferenceImpl<T>
implements CtIntersectionTypeReference<T>
- See Also:
- Serialized Form
-
Field Summary
Fields inherited from class spoon.support.reflect.reference.CtReferenceImpl
simplename
Fields inherited from class spoon.support.reflect.declaration.CtElementImpl
ERROR_MESSAGE_TO_STRING, factory, LOGGER, parent
Fields inherited from interface spoon.reflect.reference.CtTypeReference
NULL_TYPE_NAME, OMITTED_TYPE_ARG_NAME
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionvoid
Accepts a visitor<C extends CtIntersectionTypeReference>
CaddBound(CtTypeReference<?> bound)
Adds a bound.clone()
Clone the element which calls this method in a new object.List<CtTypeReference<?>>
Gets the bounds of the intersection type.This method returns a reference to the erased type.boolean
boolean
removeBound(CtTypeReference<?> bound)
Removes a bound.<C extends CtIntersectionTypeReference>
CsetBounds(List<CtTypeReference<?>> bounds)
Sets the bounds of the intersection type.setSimplyQualified(boolean isSimplyQualified)
Methods inherited from class spoon.support.reflect.reference.CtTypeReferenceImpl
addActualTypeArgument, asCtIntersectionTypeReference, box, canAccess, canAccess, findClass, getAccessType, getActualAnnotatedElement, getActualClass, getActualTypeArguments, getAllExecutables, getAllFields, getDeclaration, getDeclaredExecutables, getDeclaredField, getDeclaredFields, getDeclaredOrInheritedField, getDeclaringType, getModifiers, getPackage, getQualifiedName, getSuperclass, getSuperInterfaces, getTopLevelType, getTypeDeclaration, getTypeParameterDeclaration, isAnnotationType, isAnonymous, isArray, isClass, isEnum, isGenerics, isInterface, isLocalType, isParameterized, isPrimitive, isShadow, isSubtypeOf, removeActualTypeArgument, setActualTypeArguments, setDeclaringType, setPackage, setShadow, unbox
Methods inherited from class spoon.support.reflect.reference.CtReferenceImpl
equals, getSimpleName, setComments, setSimpleName
Methods inherited from class spoon.support.reflect.declaration.CtElementImpl
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
Methods inherited from class java.lang.Object
finalize, getClass, notify, notifyAll, wait, wait, wait
Methods inherited from interface spoon.reflect.reference.CtActualTypeContainer
addActualTypeArgument, getActualTypeArguments, removeActualTypeArgument, setActualTypeArguments
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, setDocComment, setImplicit, setParent, setPosition, setPositions, setValueByRole, toString, toStringDebug, updateAllParentsBelow
Methods inherited from interface spoon.reflect.visitor.chain.CtQueryable
filterChildren, map, map
Methods inherited from interface spoon.reflect.reference.CtReference
setComments, setSimpleName
Methods inherited from interface spoon.reflect.declaration.CtShadowable
isShadow, setShadow
Methods inherited from interface spoon.reflect.declaration.CtTypeInformation
getAllExecutables, getAllFields, getDeclaredExecutables, getDeclaredField, getDeclaredFields, getDeclaredOrInheritedField, getQualifiedName, isAnnotationType, isAnonymous, isArray, isClass, isEnum, isGenerics, isInterface, isLocalType, isParameterized, isPrimitive, isSubtypeOf
Methods inherited from interface spoon.reflect.reference.CtTypeReference
asCtIntersectionTypeReference, box, canAccess, canAccess, getAccessType, getActualClass, getDeclaration, getDeclaringType, getModifiers, getPackage, getSimpleName, getSuperclass, getSuperInterfaces, getTopLevelType, getTypeDeclaration, getTypeParameterDeclaration, setDeclaringType, setPackage, unbox
Methods inherited from interface spoon.processing.FactoryAccessor
getFactory, setFactory
-
Constructor Details
-
CtIntersectionTypeReferenceImpl
public CtIntersectionTypeReferenceImpl()
-
-
Method Details
-
accept
Description copied from interface:CtVisitable
Accepts a visitor- Specified by:
accept
in interfaceCtVisitable
- Overrides:
accept
in classCtTypeReferenceImpl<T>
-
getBounds
Description copied from interface:CtIntersectionTypeReference
Gets the bounds of the intersection type. Note that the first bound correspond to the current intersection type.T extends Interface1 & Interface2 // CtTypeParameterReference#getBoundingType == Interface1 and getBounds().get(0) == Interface1
- Specified by:
getBounds
in interfaceCtIntersectionTypeReference<T>
-
setBounds
Description copied from interface:CtIntersectionTypeReference
Sets the bounds of the intersection type.- Specified by:
setBounds
in interfaceCtIntersectionTypeReference<T>
-
addBound
Description copied from interface:CtIntersectionTypeReference
Adds a bound.- Specified by:
addBound
in interfaceCtIntersectionTypeReference<T>
-
removeBound
Description copied from interface:CtIntersectionTypeReference
Removes a bound.- Specified by:
removeBound
in interfaceCtIntersectionTypeReference<T>
-
getTypeErasure
Description copied from interface:CtTypeInformation
This method returns a reference to the erased type.For example, this will return
List
forList<String>
, orEnum
for the type parameterE
in the enum declaration.- Specified by:
getTypeErasure
in interfaceCtTypeInformation
- Overrides:
getTypeErasure
in classCtTypeReferenceImpl<T>
- Returns:
- a reference to the erased type
- See Also:
- Type Erasure
-
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 interfaceCtIntersectionTypeReference<T>
- Specified by:
clone
in interfaceCtReference
- Specified by:
clone
in interfaceCtTypeReference<T>
- Overrides:
clone
in classCtTypeReferenceImpl<T>
-
isSimplyQualified
public boolean isSimplyQualified()- Specified by:
isSimplyQualified
in interfaceCtTypeReference<T>
- Overrides:
isSimplyQualified
in classCtTypeReferenceImpl<T>
- Returns:
- false then fully qualified name is printed. true then type simple name is printed.
-
setSimplyQualified
- Specified by:
setSimplyQualified
in interfaceCtTypeReference<T>
- Overrides:
setSimplyQualified
in classCtTypeReferenceImpl<T>
- Parameters:
isSimplyQualified
- false then the reference is printed fully qualified name. true then only the type name is printed.
-