Class CtRecordImpl
java.lang.Object
spoon.support.reflect.declaration.CtElementImpl
spoon.support.reflect.declaration.CtNamedElementImpl
spoon.support.reflect.declaration.CtTypeImpl<T>
spoon.support.reflect.declaration.CtClassImpl<Object>
spoon.support.reflect.declaration.CtRecordImpl
- All Implemented Interfaces:
Serializable
,Cloneable
,FactoryAccessor
,CtCodeElement
,CtStatement
,SourcePositionHolder
,CtClass<Object>
,CtElement
,CtFormalTypeDeclarer
,CtModifiable
,CtNamedElement
,CtRecord
,CtSealable
,CtShadowable
,CtType<Object>
,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 visitor<C extends CtModifiable>
CaddModifier(ModifierKind modifier)
add a modifieraddPermittedType(CtTypeReference<?> type)
Adds a permitted type to this type.addRecordComponent(CtRecordComponent component)
addTypeMemberAt(int position, CtTypeMember member)
Adds a type member at a given position.clone()
Clone the element which calls this method in a new object.Set<CtTypeReference<?>>
Returns the permitted types for this type.Returns a reference to the type directly extended by this type.removePermittedType(CtTypeReference<?> type)
Adds a permitted type to this type.removeRecordComponent(CtRecordComponent component)
<C extends CtModifiable>
CsetExtendedModifiers(Set<CtExtendedModifier> extendedModifiers)
Sets all fields in the type.setMethods(Set<CtMethod<?>> methods)
Sets the methods of this type.<C extends CtModifiable>
CsetModifiers(Set<ModifierKind> modifiers)
Sets the modifiers.<E extends CtElement>
EManually sets the parent element of the current element.setPermittedTypes(Collection<CtTypeReference<?>> permittedTypes)
Sets the permitted types for this type.setRecordComponents(Set<CtRecordComponent> components)
setSuperclass(CtTypeReference<?> superClass)
Sets the superclass type.setTypeMembers(List<CtTypeMember> members)
Removes all types members with these new members.Methods inherited from class spoon.support.reflect.declaration.CtClassImpl
addAnonymousExecutable, addConstructor, getAllExecutables, getAnonymousExecutables, getConstructor, getConstructors, getDeclaredExecutables, getLabel, insertAfter, insertAfter, insertBefore, insertBefore, isAnonymous, isClass, isSubtypeOf, newInstance, partiallyEvaluate, removeAnonymousExecutable, removeConstructor, setAnonymousExecutables, setConstructors, setLabel
Methods inherited from class spoon.support.reflect.declaration.CtTypeImpl
addField, addField, addFieldAtTop, addFormalCtTypeParameter, addFormalCtTypeParameterAt, addMethod, addNestedType, addSuperInterface, addTypeMember, compileAndReplaceSnippets, copyType, getActualClass, getAllFields, getAllMethods, getDeclaredField, getDeclaredFields, getDeclaredOrInheritedField, getDeclaringType, getExtendedModifiers, getField, getFields, getFormalCtTypeParameters, getMethod, getMethod, getMethods, getMethodsAnnotatedWith, getMethodsByName, getModifiers, getNestedType, getNestedTypes, getPackage, getQualifiedName, getReference, getSuperInterfaces, getTopLevelType, getTypeErasure, getTypeMembers, getUsedTypes, getVisibility, hasMethod, hasModifier, hasSameParameters, isAbstract, isAnnotationType, isArray, isEnum, isFinal, isGenerics, isInterface, isLocalType, isNative, isParameterized, isPrimitive, isPrivate, isProtected, isPublic, isShadow, isStatic, isStrictfp, isSynchronized, isTopLevel, isTransient, isVolatile, removeField, removeFormalCtTypeParameter, removeMethod, removeModifier, removeNestedType, removeSuperInterface, removeTypeMember, setFormalCtTypeParameters, setNestedTypes, setShadow, setSimpleName, setSuperInterfaces, 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, 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.CtClass
addAnonymousExecutable, addConstructor, getAnonymousExecutables, getConstructor, getConstructors, isAnonymous, newInstance, removeAnonymousExecutable, removeConstructor, setAnonymousExecutables, setConstructors, setLabel
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, isImplicit, isParentInitialized, prettyprint, putMetadata, removeAnnotation, removeComment, replace, replace, setAllMetadata, setAnnotations, setComments, setDocComment, setImplicit, 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
getExtendedModifiers, getModifiers, getVisibility, hasModifier, isAbstract, isFinal, isNative, isPrivate, isProtected, isPublic, isStatic, isStrictfp, isSynchronized, isTransient, isVolatile, removeModifier, 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, getLabel, insertAfter, insertAfter, insertBefore, insertBefore
Methods inherited from interface spoon.reflect.declaration.CtType
addField, addField, addFieldAtTop, addMethod, addNestedType, addSuperInterface, addTypeMember, compileAndReplaceSnippets, copyType, getActualClass, getAllMethods, getField, getFields, getMethod, getMethod, getMethods, getMethodsAnnotatedWith, getMethodsByName, getNestedType, getNestedTypes, getPackage, getReference, getSimpleName, getTypeMembers, getUsedTypes, hasMethod, isTopLevel, removeField, removeMethod, removeNestedType, removeSuperInterface, removeTypeMember, setNestedTypes, setSuperInterfaces, toStringWithImports
Methods inherited from interface spoon.reflect.declaration.CtTypeInformation
getAllExecutables, getAllFields, getDeclaredExecutables, getDeclaredField, getDeclaredFields, getDeclaredOrInheritedField, getModifiers, getQualifiedName, getSuperInterfaces, getTypeErasure, isAnnotationType, isArray, isClass, isEnum, isGenerics, isInterface, isLocalType, isParameterized, isPrimitive, isSubtypeOf
Methods inherited from interface spoon.reflect.declaration.CtTypeMember
getDeclaringType, getTopLevelType
Methods inherited from interface spoon.processing.FactoryAccessor
getFactory, setFactory
-
Constructor Details
-
CtRecordImpl
public CtRecordImpl()
-
-
Method Details
-
getSuperclass
Description copied from interface:CtTypeInformation
Returns a reference to the type directly extended by this type.To get the
CtType
of the super class, useCtTypeReference.getDeclaration()
orCtTypeReference.getTypeDeclaration()
on theCtTypeReference
returned by this method.- Specified by:
getSuperclass
in interfaceCtTypeInformation
- Overrides:
getSuperclass
in classCtClassImpl<Object>
- Returns:
- the type explicitly extended by this type, or
null
if there is none or if the super type is not in the classpath (in noclasspath mode). If a class does not explicitly extend another classnull
is returned (notObject
). For types like enums that implicitly extend a superclass likeEnum
, this method returns that class.
-
setSuperclass
Description copied from interface:CtType
Sets the superclass type.- Specified by:
setSuperclass
in interfaceCtRecord
- Specified by:
setSuperclass
in interfaceCtType<Object>
- Overrides:
setSuperclass
in classCtClassImpl<Object>
-
addRecordComponent
- Specified by:
addRecordComponent
in interfaceCtRecord
-
removeRecordComponent
- Specified by:
removeRecordComponent
in interfaceCtRecord
-
getRecordComponents
- Specified by:
getRecordComponents
in interfaceCtRecord
-
accept
Description copied from interface:CtVisitable
Accepts a visitor- Specified by:
accept
in interfaceCtVisitable
- Overrides:
accept
in classCtClassImpl<Object>
-
addTypeMemberAt
Description copied from interface:CtType
Adds a type member at a given position. Think to use this method if the order is important for you.- Specified by:
addTypeMemberAt
in interfaceCtType<Object>
- Overrides:
addTypeMemberAt
in classCtTypeImpl<Object>
-
setFields
Description copied from interface:CtType
Sets all fields in the type. -
setMethods
Description copied from interface:CtType
Sets the methods of this type.- Specified by:
setMethods
in interfaceCtType<Object>
- Overrides:
setMethods
in classCtTypeImpl<Object>
-
setTypeMembers
Description copied from interface:CtType
Removes all types members with these new members.- Specified by:
setTypeMembers
in interfaceCtType<Object>
- Overrides:
setTypeMembers
in classCtTypeImpl<Object>
-
addModifier
Description copied from interface:CtModifiable
add a modifier- Specified by:
addModifier
in interfaceCtModifiable
- Overrides:
addModifier
in classCtTypeImpl<Object>
-
setModifiers
Description copied from interface:CtModifiable
Sets the modifiers.- Specified by:
setModifiers
in interfaceCtModifiable
- Overrides:
setModifiers
in classCtTypeImpl<Object>
-
setExtendedModifiers
- Specified by:
setExtendedModifiers
in interfaceCtModifiable
- Overrides:
setExtendedModifiers
in classCtTypeImpl<Object>
-
setRecordComponents
- Specified by:
setRecordComponents
in interfaceCtRecord
-
setParent
Description copied from interface:CtElement
Manually sets the parent element of the current element.- Specified by:
setParent
in interfaceCtElement
- Overrides:
setParent
in classCtElementImpl
- Type Parameters:
E
- this element's type- Parameters:
parent
- parent reference.- Returns:
- this element
-
getPermittedTypes
Description copied from interface:CtSealable
Returns the permitted types for this type.- Specified by:
getPermittedTypes
in interfaceCtRecord
- Specified by:
getPermittedTypes
in interfaceCtSealable
- Overrides:
getPermittedTypes
in classCtClassImpl<Object>
- 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 interfaceCtRecord
- Specified by:
setPermittedTypes
in interfaceCtSealable
- Overrides:
setPermittedTypes
in classCtClassImpl<Object>
- 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 interfaceCtRecord
- Specified by:
addPermittedType
in interfaceCtSealable
- Overrides:
addPermittedType
in classCtClassImpl<Object>
- 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 interfaceCtRecord
- Specified by:
removePermittedType
in interfaceCtSealable
- Overrides:
removePermittedType
in classCtClassImpl<Object>
- Parameters:
type
- the type to remove from this type's permitted types.- Returns:
- this.
-
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 interfaceCtClass<Object>
- Specified by:
clone
in interfaceCtCodeElement
- Specified by:
clone
in interfaceCtElement
- Specified by:
clone
in interfaceCtNamedElement
- Specified by:
clone
in interfaceCtRecord
- Specified by:
clone
in interfaceCtStatement
- Specified by:
clone
in interfaceCtType<Object>
- Overrides:
clone
in classCtClassImpl<Object>
-