Class CtInterfaceImpl<T>
java.lang.Object
spoon.support.reflect.declaration.CtElementImpl
spoon.support.reflect.declaration.CtNamedElementImpl
spoon.support.reflect.declaration.CtTypeImpl<T>
spoon.support.reflect.declaration.CtInterfaceImpl<T>
- All Implemented Interfaces:
Serializable
,Cloneable
,FactoryAccessor
,CtCodeElement
,CtStatement
,SourcePositionHolder
,CtElement
,CtFormalTypeDeclarer
,CtInterface<T>
,CtModifiable
,CtNamedElement
,CtSealable
,CtShadowable
,CtType<T>
,CtTypeInformation
,CtTypeMember
,CtQueryable
,CtVisitable
- See Also:
- Serialized Form
-
Field Summary
Fields inherited from class spoon.support.reflect.declaration.CtElementImpl
ERROR_MESSAGE_TO_STRING, factory, LOGGER, parent
Fields inherited from interface spoon.reflect.declaration.CtType
INNERTTYPE_SEPARATOR, NAME_UNKNOWN
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionvoid
Accepts a visitoraddNestedType(CtType<N> nestedType)
Add a nested type.addPermittedType(CtTypeReference<?> type)
Adds a permitted type to this type.clone()
Clone the element which calls this method in a new object.Gets the executables declared by this type if applicable.getLabel()
Gets the label of this statement if defined.Set<CtTypeReference<?>>
Returns the permitted types for this type.<C extends CtStatement>
CinsertAfter(CtStatement statement)
Inserts a statement after the current statement.<C extends CtStatement>
CinsertAfter(CtStatementList statements)
Inserts a statement list before the current statement.<C extends CtStatement>
CinsertBefore(CtStatement statement)
Inserts a statement given as parameter before the current statement (this).<C extends CtStatement>
CinsertBefore(CtStatementList statements)
Inserts a statement list before the current statement.boolean
Returns true if this type is an interface.boolean
isSubtypeOf(CtTypeReference<?> type)
Checks if this type is a subtype of the given type.<R extends CtCodeElement>
RPartially evaluates an element and all its sub-elements.<N> boolean
removeNestedType(CtType<N> nestedType)
Remove a nested type.removePermittedType(CtTypeReference<?> type)
Adds a permitted type to this type.<C extends CtStatement>
CSets the label of this statement.setPermittedTypes(Collection<CtTypeReference<?>> permittedTypes)
Sets the permitted types for this type.setSuperclass(CtTypeReference<?> superClass)
Sets the superclass type.Methods inherited from class spoon.support.reflect.declaration.CtTypeImpl
addField, addField, addFieldAtTop, addFormalCtTypeParameter, addFormalCtTypeParameterAt, addMethod, addModifier, addSuperInterface, addTypeMember, addTypeMemberAt, compileAndReplaceSnippets, copyType, getActualClass, getAllExecutables, getAllFields, getAllMethods, getDeclaredField, getDeclaredFields, getDeclaredOrInheritedField, getDeclaringType, getExtendedModifiers, getField, getFields, getFormalCtTypeParameters, getMethod, getMethod, getMethods, getMethodsAnnotatedWith, getMethodsByName, getModifiers, getNestedType, getNestedTypes, getPackage, getQualifiedName, getReference, getSuperclass, getSuperInterfaces, getTopLevelType, getTypeErasure, getTypeMembers, getUsedTypes, getVisibility, hasMethod, hasModifier, hasSameParameters, isAbstract, isAnnotationType, isAnonymous, isArray, isClass, isEnum, isFinal, isGenerics, isLocalType, isNative, isParameterized, isPrimitive, isPrivate, isProtected, isPublic, isShadow, isStatic, isStrictfp, isSynchronized, isTopLevel, isTransient, isVolatile, removeField, removeFormalCtTypeParameter, removeMethod, removeModifier, removeSuperInterface, removeTypeMember, setExtendedModifiers, setFields, setFormalCtTypeParameters, setMethods, setModifiers, setNestedTypes, setShadow, setSimpleName, setSuperInterfaces, setTypeMembers, setVisibility, toStringWithImports
Methods inherited from class spoon.support.reflect.declaration.CtNamedElementImpl
getSimpleName
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, isImplicit, isParentInitialized, map, map, prettyprint, putMetadata, removeAnnotation, removeComment, replace, replace, setAllMetadata, setAnnotations, setComments, 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.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.CtFormalTypeDeclarer
addFormalCtTypeParameter, addFormalCtTypeParameterAt, getFormalCtTypeParameters, removeFormalCtTypeParameter, setFormalCtTypeParameters
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
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.code.CtStatement
comment
Methods inherited from interface spoon.reflect.declaration.CtType
addField, addField, addFieldAtTop, addMethod, addSuperInterface, addTypeMember, addTypeMemberAt, compileAndReplaceSnippets, copyType, getActualClass, getAllMethods, getField, getFields, getMethod, getMethod, getMethods, getMethodsAnnotatedWith, getMethodsByName, getNestedType, getNestedTypes, getPackage, getReference, getSimpleName, getTypeMembers, getUsedTypes, hasMethod, isTopLevel, removeField, removeMethod, removeSuperInterface, removeTypeMember, setFields, setMethods, setNestedTypes, setSuperInterfaces, setTypeMembers, toStringWithImports
Methods inherited from interface spoon.reflect.declaration.CtTypeInformation
getAllExecutables, getAllFields, getDeclaredField, getDeclaredFields, getDeclaredOrInheritedField, getModifiers, getQualifiedName, getSuperclass, getSuperInterfaces, getTypeErasure, isAnnotationType, isAnonymous, isArray, isClass, isEnum, isGenerics, isLocalType, isParameterized, isPrimitive
Methods inherited from interface spoon.reflect.declaration.CtTypeMember
getDeclaringType, getTopLevelType
Methods inherited from interface spoon.processing.FactoryAccessor
getFactory, setFactory
-
Constructor Details
-
CtInterfaceImpl
public CtInterfaceImpl()
-
-
Method Details
-
accept
Description copied from interface:CtVisitable
Accepts a visitor- Specified by:
accept
in interfaceCtVisitable
-
isSubtypeOf
Description copied from interface:CtTypeInformation
Checks if this type is a subtype of the given type.- Specified by:
isSubtypeOf
in interfaceCtTypeInformation
- Parameters:
type
- the type that might be a parent of this type.- Returns:
true
if the referenced type is a subtype of the given type, otherwisefalse
. If this type is the same as the given type (typeX.isSubtypeOf(typeX)
), this method returnstrue
.
-
isInterface
public boolean isInterface()Description copied from interface:CtTypeInformation
Returns true if this type is an interface.- Specified by:
isInterface
in interfaceCtTypeInformation
- Overrides:
isInterface
in classCtTypeImpl<T>
-
getDeclaredExecutables
Description copied from interface:CtTypeInformation
Gets the executables declared by this type if applicable.- Specified by:
getDeclaredExecutables
in interfaceCtTypeInformation
- Overrides:
getDeclaredExecutables
in classCtTypeImpl<T>
-
partiallyEvaluate
Description copied from interface:CtCodeElement
Partially evaluates an element and all its sub-elements.- Specified by:
partiallyEvaluate
in interfaceCtCodeElement
- Type Parameters:
R
- the type of the returned element- Returns:
- the result of the partial evaluation. The element is always cloned, even if nothing has been evaluated.
- See Also:
VisitorPartialEvaluator
-
insertAfter
public <C extends CtStatement> C insertAfter(CtStatement statement) throws ParentNotInitializedExceptionDescription copied from interface:CtStatement
Inserts a statement after the current statement.- Specified by:
insertAfter
in interfaceCtStatement
- Throws:
ParentNotInitializedException
-
insertAfter
public <C extends CtStatement> C insertAfter(CtStatementList statements) throws ParentNotInitializedExceptionDescription copied from interface:CtStatement
Inserts a statement list before the current statement.- Specified by:
insertAfter
in interfaceCtStatement
- Throws:
ParentNotInitializedException
-
insertBefore
public <C extends CtStatement> C insertBefore(CtStatement statement) throws ParentNotInitializedExceptionDescription copied from interface:CtStatement
Inserts a statement given as parameter before the current statement (this).- Specified by:
insertBefore
in interfaceCtStatement
- Throws:
ParentNotInitializedException
-
insertBefore
public <C extends CtStatement> C insertBefore(CtStatementList statements) throws ParentNotInitializedExceptionDescription copied from interface:CtStatement
Inserts a statement list before the current statement.- Specified by:
insertBefore
in interfaceCtStatement
- Throws:
ParentNotInitializedException
-
setLabel
Description copied from interface:CtStatement
Sets the label of this statement.- Specified by:
setLabel
in interfaceCtStatement
-
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 interfaceCtInterface<T>
- Specified by:
clone
in interfaceCtNamedElement
- Specified by:
clone
in interfaceCtStatement
- Specified by:
clone
in interfaceCtType<T>
- Overrides:
clone
in classCtTypeImpl<T>
-
setSuperclass
Description copied from interface:CtType
Sets the superclass type.- Specified by:
setSuperclass
in interfaceCtInterface<T>
- Specified by:
setSuperclass
in interfaceCtType<T>
- Overrides:
setSuperclass
in classCtTypeImpl<T>
-
getLabel
Description copied from interface:CtStatement
Gets the label of this statement if defined.- Specified by:
getLabel
in interfaceCtInterface<T>
- Specified by:
getLabel
in interfaceCtStatement
- Returns:
- the label's name (null if undefined)
-
getPermittedTypes
Description copied from interface:CtSealable
Returns the permitted types for this type.- Specified by:
getPermittedTypes
in interfaceCtSealable
- Returns:
- an unmodifiable view of the permitted types.
-
setPermittedTypes
Description copied from interface:CtSealable
Sets the permitted types for this type. Calling this method does not change the state of theModifierKind.SEALED
for this type. The previously permitted types will be removed.- Specified by:
setPermittedTypes
in interfaceCtSealable
- Parameters:
permittedTypes
- the permitted types to set.- Returns:
- this.
-
addPermittedType
Description copied from interface:CtSealable
Adds a permitted type to this type. Calling this method does not change the state of theModifierKind.SEALED
for this type.- Specified by:
addPermittedType
in interfaceCtSealable
- Parameters:
type
- the type to add as permitted type.- Returns:
- this.
-
removePermittedType
Description copied from interface:CtSealable
Adds a permitted type to this type. Calling this method does not change the state of theModifierKind.SEALED
for this type.- Specified by:
removePermittedType
in interfaceCtSealable
- Parameters:
type
- the type to remove from this type's permitted types.- Returns:
- this.
-
addNestedType
Description copied from interface:CtType
Add a nested type.- Specified by:
addNestedType
in interfaceCtType<T>
- Overrides:
addNestedType
in classCtTypeImpl<T>
- Returns:
- true if this element changed as a result of the call
-
removeNestedType
Description copied from interface:CtType
Remove a nested type.- Specified by:
removeNestedType
in interfaceCtType<T>
- Overrides:
removeNestedType
in classCtTypeImpl<T>
- Returns:
- true if this element changed as a result of the call
-