Class CtAnonymousExecutableImpl
java.lang.Object
spoon.support.reflect.declaration.CtElementImpl
spoon.support.reflect.declaration.CtNamedElementImpl
spoon.support.reflect.declaration.CtExecutableImpl<Void>
spoon.support.reflect.declaration.CtAnonymousExecutableImpl
- All Implemented Interfaces:
Serializable
,Cloneable
,FactoryAccessor
,CtBodyHolder
,SourcePositionHolder
,CtAnonymousExecutable
,CtElement
,CtExecutable<Void>
,CtModifiable
,CtNamedElement
,CtTypedElement<Void>
,CtTypeMember
,CtQueryable
,CtVisitable
public class CtAnonymousExecutableImpl
extends CtExecutableImpl<Void>
implements CtAnonymousExecutable
- 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.CtExecutable
EXECUTABLE_SEPARATOR
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionvoid
Accepts a visitor<T extends CtModifiable>
TaddModifier(ModifierKind modifier)
add a modifieraddParameter(CtParameter parameter)
Add a parameter for this executableaddParameterAt(int position, CtParameter parameter)
Add a parameter at a specific position in the executable.addThrownType(CtTypeReference throwType)
add a thrown type.clone()
Clone the element which calls this method in a new object.Returns the modifiers of this element, excluding annotations.List<CtParameter<?>>
Gets the parameters list.Returns the simple (unqualified) name of this element.Set<CtTypeReference<? extends Throwable>>
Returns the exceptions and other throwables listed in this method or constructor's throws clause.getType()
Gets this element's type.Gets the visibility of this modifiable element.boolean
hasModifier(ModifierKind modifier)
Tells if this element contains the given modifier.boolean
Returns true if it contains an abstract modifier (seeCtModifiable.hasModifier(ModifierKind)
)boolean
isFinal()
Returns true if it contains a final modifier (seeCtModifiable.hasModifier(ModifierKind)
)boolean
isNative()
Returns true if it contains a native modifier (seeCtModifiable.hasModifier(ModifierKind)
)boolean
Returns true if it contains a private modifier (seeCtModifiable.hasModifier(ModifierKind)
)boolean
Returns true if it contains a protected modifier (seeCtModifiable.hasModifier(ModifierKind)
)boolean
isPublic()
Returns true if it contains a public modifier (seeCtModifiable.hasModifier(ModifierKind)
)boolean
isStatic()
Returns true if it contains a static modifier (seeCtModifiable.hasModifier(ModifierKind)
)boolean
Returns true if it contains a strictfp modifier (seeCtModifiable.hasModifier(ModifierKind)
)boolean
Returns true if it contains a synchronized modifier (seeCtModifiable.hasModifier(ModifierKind)
)boolean
Returns true if it contains a transient modifier (seeCtModifiable.hasModifier(ModifierKind)
)boolean
Returns true if it contains a volatile modifier (seeCtModifiable.hasModifier(ModifierKind)
)<T extends CtModifiable>
TremoveModifier(ModifierKind modifier)
remove a modifierboolean
removeParameter(CtParameter parameter)
Remove a parameter for this executableboolean
removeThrownType(CtTypeReference throwType)
remove a thrown type.<T extends CtModifiable>
TsetExtendedModifiers(Set<CtExtendedModifier> extendedModifiers)
<T extends CtModifiable>
TsetModifiers(Set<ModifierKind> modifiers)
Sets the modifiers.setParameters(List list)
Sets the parameters.<T extends CtNamedElement>
TsetSimpleName(String simpleName)
Sets the simple (unqualified) name of this element.setThrownTypes(Set thrownTypes)
Sets the thrown types.<C extends CtTypedElement>
CsetType(CtTypeReference type)
Sets this element's type.<T extends CtModifiable>
TsetVisibility(ModifierKind visibility)
Sets the visibility of this modifiable element (replaces old visibility).Methods inherited from class spoon.support.reflect.declaration.CtExecutableImpl
getBody, getDeclaringType, getReference, getSignature, getTopLevelType, setBody
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.code.CtBodyHolder
setBody
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.CtExecutable
getBody, getReference, getSignature
Methods inherited from interface spoon.reflect.visitor.chain.CtQueryable
filterChildren, map, map
Methods inherited from interface spoon.reflect.declaration.CtTypeMember
getDeclaringType, getTopLevelType
Methods inherited from interface spoon.processing.FactoryAccessor
getFactory, setFactory
-
Constructor Details
-
CtAnonymousExecutableImpl
public CtAnonymousExecutableImpl()
-
-
Method Details
-
accept
Description copied from interface:CtVisitable
Accepts a visitor- Specified by:
accept
in interfaceCtVisitable
-
addModifier
Description copied from interface:CtModifiable
add a modifier- Specified by:
addModifier
in interfaceCtModifiable
-
removeModifier
Description copied from interface:CtModifiable
remove a modifier- Specified by:
removeModifier
in interfaceCtModifiable
-
getModifiers
Description copied from interface:CtModifiable
Returns the modifiers of this element, excluding annotations. Implicit modifiers, such as thepublic
andstatic
modifiers of interface members, are included.- Specified by:
getModifiers
in interfaceCtModifiable
- Returns:
- the modifiers of this declaration in undefined order; an empty set if there are none
-
getVisibility
Description copied from interface:CtModifiable
Gets the visibility of this modifiable element.- Specified by:
getVisibility
in interfaceCtModifiable
-
hasModifier
Description copied from interface:CtModifiable
Tells if this element contains the given modifier.- Specified by:
hasModifier
in interfaceCtModifiable
- Parameters:
modifier
- to search- Returns:
true
if this element contain the modifier
-
setModifiers
Description copied from interface:CtModifiable
Sets the modifiers.- Specified by:
setModifiers
in interfaceCtModifiable
-
setVisibility
Description copied from interface:CtModifiable
Sets the visibility of this modifiable element (replaces old visibility).- Specified by:
setVisibility
in interfaceCtModifiable
-
getExtendedModifiers
- Specified by:
getExtendedModifiers
in interfaceCtModifiable
- Returns:
- the set of extended modifiers (those incl. implicit).
-
setExtendedModifiers
- Specified by:
setExtendedModifiers
in interfaceCtModifiable
-
getParameters
Description copied from interface:CtExecutable
Gets the parameters list.- Specified by:
getParameters
in interfaceCtExecutable<Void>
- Overrides:
getParameters
in classCtExecutableImpl<Void>
-
setParameters
Description copied from interface:CtExecutable
Sets the parameters.- Specified by:
setParameters
in interfaceCtAnonymousExecutable
- Specified by:
setParameters
in interfaceCtExecutable<Void>
- Overrides:
setParameters
in classCtExecutableImpl<Void>
-
addParameter
Description copied from interface:CtExecutable
Add a parameter for this executable- Specified by:
addParameter
in interfaceCtAnonymousExecutable
- Specified by:
addParameter
in interfaceCtExecutable<Void>
- Overrides:
addParameter
in classCtExecutableImpl<Void>
- Returns:
- true if this element changed as a result of the call
-
addParameterAt
Description copied from interface:CtExecutable
Add a parameter at a specific position in the executable.- Specified by:
addParameterAt
in interfaceCtAnonymousExecutable
- Specified by:
addParameterAt
in interfaceCtExecutable<Void>
- Overrides:
addParameterAt
in classCtExecutableImpl<Void>
- Parameters:
position
- index where the `parameter` needs to be insertedparameter
- parameter to be inserted- Returns:
- an object or sub-type of
CtExecutable
-
removeParameter
Description copied from interface:CtExecutable
Remove a parameter for this executable- Specified by:
removeParameter
in interfaceCtExecutable<Void>
- Overrides:
removeParameter
in classCtExecutableImpl<Void>
- Returns:
- true if this element changed as a result of the call
-
getThrownTypes
Description copied from interface:CtExecutable
Returns the exceptions and other throwables listed in this method or constructor's throws clause.- Specified by:
getThrownTypes
in interfaceCtExecutable<Void>
- Overrides:
getThrownTypes
in classCtExecutableImpl<Void>
-
setThrownTypes
Description copied from interface:CtExecutable
Sets the thrown types.- Specified by:
setThrownTypes
in interfaceCtAnonymousExecutable
- Specified by:
setThrownTypes
in interfaceCtExecutable<Void>
- Overrides:
setThrownTypes
in classCtExecutableImpl<Void>
-
addThrownType
Description copied from interface:CtExecutable
add a thrown type.- Specified by:
addThrownType
in interfaceCtAnonymousExecutable
- Specified by:
addThrownType
in interfaceCtExecutable<Void>
- Overrides:
addThrownType
in classCtExecutableImpl<Void>
- Returns:
- true if this element changed as a result of the call
-
removeThrownType
Description copied from interface:CtExecutable
remove a thrown type.- Specified by:
removeThrownType
in interfaceCtExecutable<Void>
- Overrides:
removeThrownType
in classCtExecutableImpl<Void>
- Returns:
- true if this element changed as a result of the call
-
getSimpleName
Description copied from interface:CtNamedElement
Returns the simple (unqualified) name of this element.- Specified by:
getSimpleName
in interfaceCtNamedElement
- Overrides:
getSimpleName
in classCtNamedElementImpl
-
setSimpleName
Description copied from interface:CtNamedElement
Sets the simple (unqualified) name of this element.- Specified by:
setSimpleName
in interfaceCtAnonymousExecutable
- Specified by:
setSimpleName
in interfaceCtNamedElement
- Overrides:
setSimpleName
in classCtNamedElementImpl
-
getType
Description copied from interface:CtTypedElement
Gets this element's type.- Specified by:
getType
in interfaceCtTypedElement<Void>
-
setType
Description copied from interface:CtTypedElement
Sets this element's type.- Specified by:
setType
in interfaceCtAnonymousExecutable
- Specified by:
setType
in interfaceCtTypedElement<Void>
-
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 interfaceCtAnonymousExecutable
- Specified by:
clone
in interfaceCtElement
- Specified by:
clone
in interfaceCtExecutable<Void>
- Specified by:
clone
in interfaceCtNamedElement
- Overrides:
clone
in classCtExecutableImpl<Void>
-
isPublic
public boolean isPublic()Description copied from interface:CtModifiable
Returns true if it contains a public modifier (seeCtModifiable.hasModifier(ModifierKind)
)- Specified by:
isPublic
in interfaceCtModifiable
-
isPrivate
public boolean isPrivate()Description copied from interface:CtModifiable
Returns true if it contains a private modifier (seeCtModifiable.hasModifier(ModifierKind)
)- Specified by:
isPrivate
in interfaceCtModifiable
-
isProtected
public boolean isProtected()Description copied from interface:CtModifiable
Returns true if it contains a protected modifier (seeCtModifiable.hasModifier(ModifierKind)
)- Specified by:
isProtected
in interfaceCtModifiable
-
isFinal
public boolean isFinal()Description copied from interface:CtModifiable
Returns true if it contains a final modifier (seeCtModifiable.hasModifier(ModifierKind)
)- Specified by:
isFinal
in interfaceCtModifiable
-
isStatic
public boolean isStatic()Description copied from interface:CtModifiable
Returns true if it contains a static modifier (seeCtModifiable.hasModifier(ModifierKind)
)- Specified by:
isStatic
in interfaceCtModifiable
-
isAbstract
public boolean isAbstract()Description copied from interface:CtModifiable
Returns true if it contains an abstract modifier (seeCtModifiable.hasModifier(ModifierKind)
)- Specified by:
isAbstract
in interfaceCtModifiable
-
isTransient
public boolean isTransient()Description copied from interface:CtModifiable
Returns true if it contains a transient modifier (seeCtModifiable.hasModifier(ModifierKind)
)- Specified by:
isTransient
in interfaceCtModifiable
-
isVolatile
public boolean isVolatile()Description copied from interface:CtModifiable
Returns true if it contains a volatile modifier (seeCtModifiable.hasModifier(ModifierKind)
)- Specified by:
isVolatile
in interfaceCtModifiable
-
isSynchronized
public boolean isSynchronized()Description copied from interface:CtModifiable
Returns true if it contains a synchronized modifier (seeCtModifiable.hasModifier(ModifierKind)
)- Specified by:
isSynchronized
in interfaceCtModifiable
-
isNative
public boolean isNative()Description copied from interface:CtModifiable
Returns true if it contains a native modifier (seeCtModifiable.hasModifier(ModifierKind)
)- Specified by:
isNative
in interfaceCtModifiable
-
isStrictfp
public boolean isStrictfp()Description copied from interface:CtModifiable
Returns true if it contains a strictfp modifier (seeCtModifiable.hasModifier(ModifierKind)
)- Specified by:
isStrictfp
in interfaceCtModifiable
-