public interface CtClass<T> extends CtType<T>, CtStatement
// a class definition class Foo { int x; }
INNERTTYPE_SEPARATOR, NAME_UNKNOWN
Modifier and Type | Method and Description |
---|---|
<C extends CtClass<T>> |
addAnonymousExecutable(CtAnonymousExecutable e)
Add an anonymous block to this class.
|
<C extends CtClass<T>> |
addConstructor(CtConstructor<T> constructor)
Adds a constructor to this class.
|
CtClass<T> |
clone()
Clone the element which calls this method in a new object.
|
java.util.List<CtAnonymousExecutable> |
getAnonymousExecutables()
Returns the anonymous blocks of this class.
|
CtConstructor<T> |
getConstructor(CtTypeReference<?>... parameterTypes)
Returns the constructor of the class that takes the given argument types.
|
java.util.Set<CtConstructor<T>> |
getConstructors()
Returns the constructors of this class.
|
boolean |
isAnonymous()
Return
true if the referenced type is a anonymous type |
T |
newInstance()
Creates an instance of this class.
|
boolean |
removeAnonymousExecutable(CtAnonymousExecutable e)
Remove an anonymous block to this class.
|
void |
removeConstructor(CtConstructor<T> constructor)
Removes a constructor from this class.
|
<C extends CtClass<T>> |
setAnonymousExecutables(java.util.List<CtAnonymousExecutable> e)
Sets the anonymous blocks of this class.
|
<C extends CtClass<T>> |
setConstructors(java.util.Set<CtConstructor<T>> constructors)
Sets the constructors for this class.
|
<C extends CtStatement> |
setLabel(java.lang.String label)
Sets the label of this statement.
|
addField, addField, addFieldAtTop, addMethod, addNestedType, 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, removeNestedType, removeSuperInterface, removeTypeMember, setFields, setMethods, setNestedTypes, setSuperclass, setSuperInterfaces, setTypeMembers, toStringWithImports
getAllExecutables, getAllFields, getDeclaredExecutables, getDeclaredField, getDeclaredFields, getDeclaredOrInheritedField, getModifiers, getQualifiedName, getSuperclass, getSuperInterfaces, getTypeErasure, isAnnotationType, isArray, isClass, isEnum, isGenerics, isInterface, isLocalType, isParameterized, isPrimitive, isSubtypeOf
addFormalCtTypeParameter, getFormalCtTypeParameters, removeFormalCtTypeParameter, setFormalCtTypeParameters
getDeclaringType, getTopLevelType
addModifier, getExtendedModifiers, getModifiers, getVisibility, hasModifier, isAbstract, isFinal, isNative, isPrivate, isProtected, isPublic, isStatic, isStrictfp, isSynchronized, isTransient, isVolatile, removeModifier, setExtendedModifiers, setModifiers, setVisibility
setSimpleName
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
getFactory, setFactory
accept
filterChildren, map, map
isShadow, setShadow
comment, getLabel, insertAfter, insertAfter, insertBefore, insertBefore
partiallyEvaluate
java.util.List<CtAnonymousExecutable> getAnonymousExecutables()
CtType.getTypeMembers()
CtConstructor<T> getConstructor(CtTypeReference<?>... parameterTypes)
CtType.getTypeMembers()
java.util.Set<CtConstructor<T>> getConstructors()
CtType.getTypeMembers()
<C extends CtClass<T>> C setAnonymousExecutables(java.util.List<CtAnonymousExecutable> e)
<C extends CtClass<T>> C addAnonymousExecutable(CtAnonymousExecutable e)
e
- boolean removeAnonymousExecutable(CtAnonymousExecutable e)
e
- <C extends CtClass<T>> C setConstructors(java.util.Set<CtConstructor<T>> constructors)
<C extends CtClass<T>> C addConstructor(CtConstructor<T> constructor)
void removeConstructor(CtConstructor<T> constructor)
boolean isAnonymous()
true
if the referenced type is a anonymous typeisAnonymous
in interface CtTypeInformation
CtClass<T> clone()
CtElement
Refactoring.copyType(CtType)
and Refactoring.copyMethod(CtMethod)
instead which does additional work beyond cloning.clone
in interface CtCodeElement
clone
in interface CtElement
clone
in interface CtNamedElement
clone
in interface CtStatement
clone
in interface CtType<T>
T newInstance()
<C extends CtStatement> C setLabel(java.lang.String label)
CtStatement
setLabel
in interface CtStatement
Copyright © 2007–2021 Inria. All rights reserved.