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, parentFields inherited from interface spoon.reflect.declaration.CtType
INNERTTYPE_SEPARATOR, NAME_UNKNOWN -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidAccepts 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.booleanReturns true if this type is an interface.booleanisSubtypeOf(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> booleanremoveNestedType(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, toStringWithImportsMethods inherited from class spoon.support.reflect.declaration.CtNamedElementImpl
getSimpleNameMethods 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, updateAllParentsBelowMethods inherited from class java.lang.Object
finalize, getClass, notify, notifyAll, wait, wait, waitMethods 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, updateAllParentsBelowMethods inherited from interface spoon.reflect.declaration.CtFormalTypeDeclarer
addFormalCtTypeParameter, addFormalCtTypeParameterAt, getFormalCtTypeParameters, removeFormalCtTypeParameter, setFormalCtTypeParametersMethods 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, setVisibilityMethods inherited from interface spoon.reflect.declaration.CtNamedElement
setSimpleNameMethods inherited from interface spoon.reflect.visitor.chain.CtQueryable
filterChildren, map, mapMethods inherited from interface spoon.reflect.declaration.CtShadowable
isShadow, setShadowMethods inherited from interface spoon.reflect.code.CtStatement
commentMethods 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, toStringWithImportsMethods 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, isPrimitiveMethods inherited from interface spoon.reflect.declaration.CtTypeMember
getDeclaringType, getTopLevelTypeMethods inherited from interface spoon.processing.FactoryAccessor
getFactory, setFactory
-
Constructor Details
-
CtInterfaceImpl
public CtInterfaceImpl()
-
-
Method Details
-
accept
Description copied from interface:CtVisitableAccepts a visitor- Specified by:
acceptin interfaceCtVisitable
-
isSubtypeOf
Description copied from interface:CtTypeInformationChecks if this type is a subtype of the given type.- Specified by:
isSubtypeOfin interfaceCtTypeInformation- Parameters:
type- the type that might be a parent of this type.- Returns:
trueif 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:CtTypeInformationReturns true if this type is an interface.- Specified by:
isInterfacein interfaceCtTypeInformation- Overrides:
isInterfacein classCtTypeImpl<T>
-
getDeclaredExecutables
Description copied from interface:CtTypeInformationGets the executables declared by this type if applicable.- Specified by:
getDeclaredExecutablesin interfaceCtTypeInformation- Overrides:
getDeclaredExecutablesin classCtTypeImpl<T>
-
partiallyEvaluate
Description copied from interface:CtCodeElementPartially evaluates an element and all its sub-elements.- Specified by:
partiallyEvaluatein 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:CtStatementInserts a statement after the current statement.- Specified by:
insertAfterin interfaceCtStatement- Throws:
ParentNotInitializedException
-
insertAfter
public <C extends CtStatement> C insertAfter(CtStatementList statements) throws ParentNotInitializedExceptionDescription copied from interface:CtStatementInserts a statement list before the current statement.- Specified by:
insertAfterin interfaceCtStatement- Throws:
ParentNotInitializedException
-
insertBefore
public <C extends CtStatement> C insertBefore(CtStatement statement) throws ParentNotInitializedExceptionDescription copied from interface:CtStatementInserts a statement given as parameter before the current statement (this).- Specified by:
insertBeforein interfaceCtStatement- Throws:
ParentNotInitializedException
-
insertBefore
public <C extends CtStatement> C insertBefore(CtStatementList statements) throws ParentNotInitializedExceptionDescription copied from interface:CtStatementInserts a statement list before the current statement.- Specified by:
insertBeforein interfaceCtStatement- Throws:
ParentNotInitializedException
-
setLabel
Description copied from interface:CtStatementSets the label of this statement.- Specified by:
setLabelin interfaceCtStatement
-
clone
Description copied from interface:CtElementClone 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:
clonein interfaceCtCodeElement- Specified by:
clonein interfaceCtElement- Specified by:
clonein interfaceCtInterface<T>- Specified by:
clonein interfaceCtNamedElement- Specified by:
clonein interfaceCtStatement- Specified by:
clonein interfaceCtType<T>- Overrides:
clonein classCtTypeImpl<T>
-
setSuperclass
Description copied from interface:CtTypeSets the superclass type.- Specified by:
setSuperclassin interfaceCtInterface<T>- Specified by:
setSuperclassin interfaceCtType<T>- Overrides:
setSuperclassin classCtTypeImpl<T>
-
getLabel
Description copied from interface:CtStatementGets the label of this statement if defined.- Specified by:
getLabelin interfaceCtInterface<T>- Specified by:
getLabelin interfaceCtStatement- Returns:
- the label's name (null if undefined)
-
getPermittedTypes
Description copied from interface:CtSealableReturns the permitted types for this type.- Specified by:
getPermittedTypesin interfaceCtSealable- Returns:
- an unmodifiable view of the permitted types.
-
setPermittedTypes
Description copied from interface:CtSealableSets the permitted types for this type. Calling this method does not change the state of theModifierKind.SEALEDfor this type. The previously permitted types will be removed.- Specified by:
setPermittedTypesin interfaceCtSealable- Parameters:
permittedTypes- the permitted types to set.- Returns:
- this.
-
addPermittedType
Description copied from interface:CtSealableAdds a permitted type to this type. Calling this method does not change the state of theModifierKind.SEALEDfor this type.- Specified by:
addPermittedTypein interfaceCtSealable- Parameters:
type- the type to add as permitted type.- Returns:
- this.
-
removePermittedType
Description copied from interface:CtSealableAdds a permitted type to this type. Calling this method does not change the state of theModifierKind.SEALEDfor this type.- Specified by:
removePermittedTypein interfaceCtSealable- Parameters:
type- the type to remove from this type's permitted types.- Returns:
- this.
-
addNestedType
Description copied from interface:CtTypeAdd a nested type.- Specified by:
addNestedTypein interfaceCtType<T>- Overrides:
addNestedTypein classCtTypeImpl<T>- Returns:
- true if this element changed as a result of the call
-
removeNestedType
Description copied from interface:CtTypeRemove a nested type.- Specified by:
removeNestedTypein interfaceCtType<T>- Overrides:
removeNestedTypein classCtTypeImpl<T>- Returns:
- true if this element changed as a result of the call
-