Class ModifyableJavaClass
- java.lang.Object
-
- com.thoughtworks.qdox.model.impl.AbstractJavaModel
-
- com.thoughtworks.qdox.model.impl.AbstractBaseJavaEntity
-
- com.thoughtworks.qdox.model.impl.AbstractJavaEntity
-
- com.thoughtworks.qdox.model.impl.AbstractInheritableJavaEntity
-
- com.devonfw.cobigen.javaplugin.merger.libextension.ModifyableJavaClass
-
- All Implemented Interfaces:
com.thoughtworks.qdox.model.JavaAnnotatedElement,com.thoughtworks.qdox.model.JavaClass,com.thoughtworks.qdox.model.JavaGenericDeclaration,com.thoughtworks.qdox.model.JavaModel,com.thoughtworks.qdox.model.JavaType,Serializable
public class ModifyableJavaClass extends com.thoughtworks.qdox.model.impl.AbstractInheritableJavaEntity implements com.thoughtworks.qdox.model.JavaClassCustom implementation derived fromDefaultJavaClassto enable modification of AST.- See Also:
- Serialized Form
-
-
Constructor Summary
Constructors Modifier Constructor Description protectedModifyableJavaClass()ModifyableJavaClass(com.thoughtworks.qdox.model.JavaSource source)ModifyableJavaClass(String name)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidaddAllInitializer(List<com.thoughtworks.qdox.model.JavaInitializer> initializersList)voidaddClass(com.thoughtworks.qdox.model.JavaClass cls)voidaddConstructor(com.thoughtworks.qdox.model.JavaConstructor constructor)voidaddField(com.thoughtworks.qdox.model.JavaField javaField)voidaddInitializer(com.thoughtworks.qdox.model.JavaInitializer initializer)voidaddMethod(com.thoughtworks.qdox.model.JavaMethod meth)booleanequals(Object obj)List<com.thoughtworks.qdox.model.BeanProperty>getBeanProperties()List<com.thoughtworks.qdox.model.BeanProperty>getBeanProperties(boolean superclasses)com.thoughtworks.qdox.model.BeanPropertygetBeanProperty(String propertyName)com.thoughtworks.qdox.model.BeanPropertygetBeanProperty(String propertyName, boolean superclasses)StringgetBinaryName()StringgetCanonicalName()StringgetCodeBlock()com.thoughtworks.qdox.model.JavaClassgetComponentType()com.thoughtworks.qdox.model.JavaConstructorgetConstructor(List<com.thoughtworks.qdox.model.JavaType> parameterTypes)com.thoughtworks.qdox.model.JavaConstructorgetConstructor(List<com.thoughtworks.qdox.model.JavaType> parameterTypes, boolean varArgs)List<com.thoughtworks.qdox.model.JavaConstructor>getConstructors()List<com.thoughtworks.qdox.model.JavaClass>getDerivedClasses()intgetDimensions()com.thoughtworks.qdox.model.JavaFieldgetEnumConstantByName(String name)List<com.thoughtworks.qdox.model.JavaField>getEnumConstants()com.thoughtworks.qdox.model.JavaFieldgetFieldByName(String name)List<com.thoughtworks.qdox.model.JavaField>getFields()StringgetFullyQualifiedName()StringgetGenericCanonicalName()StringgetGenericFullyQualifiedName()StringgetGenericValue()List<com.thoughtworks.qdox.model.JavaType>getImplements()List<com.thoughtworks.qdox.model.JavaInitializer>getInitializers()List<com.thoughtworks.qdox.model.JavaClass>getInterfaces()com.thoughtworks.qdox.library.ClassLibrarygetJavaClassLibrary()com.thoughtworks.qdox.model.JavaMethodgetMethod(String name, List<com.thoughtworks.qdox.model.JavaType> parameterTypes, boolean varArgs)com.thoughtworks.qdox.model.JavaMethodgetMethodBySignature(String name, List<com.thoughtworks.qdox.model.JavaType> parameterTypes)com.thoughtworks.qdox.model.JavaMethodgetMethodBySignature(String name, List<com.thoughtworks.qdox.model.JavaType> parameterTypes, boolean superclasses)com.thoughtworks.qdox.model.JavaMethodgetMethodBySignature(String name, List<com.thoughtworks.qdox.model.JavaType> parameterTypes, boolean superclasses, boolean varArg)List<com.thoughtworks.qdox.model.JavaMethod>getMethods()List<com.thoughtworks.qdox.model.JavaMethod>getMethods(boolean superclasses)List<com.thoughtworks.qdox.model.JavaMethod>getMethodsBySignature(String name, List<com.thoughtworks.qdox.model.JavaType> parameterTypes, boolean superclasses)List<com.thoughtworks.qdox.model.JavaMethod>getMethodsBySignature(String name, List<com.thoughtworks.qdox.model.JavaType> parameterTypes, boolean superclasses, boolean varArg)com.thoughtworks.qdox.model.JavaClassgetNestedClassByName(String name)List<com.thoughtworks.qdox.model.JavaClass>getNestedClasses()com.thoughtworks.qdox.model.JavaPackagegetPackage()StringgetPackageName()com.thoughtworks.qdox.model.JavaSourcegetParentSource()StringgetSimpleName()com.thoughtworks.qdox.model.JavaSourcegetSource()com.thoughtworks.qdox.model.JavaTypegetSuperClass()com.thoughtworks.qdox.model.JavaClassgetSuperJavaClass()Shorthand for getSuperClass().getJavaClass() with null checking.List<com.thoughtworks.qdox.model.DocletTag>getTagsByName(String name, boolean superclasses)List<ModifyableJavaTypeVariable<com.thoughtworks.qdox.model.JavaClass>>getTypeParameters()StringgetValue()inthashCode()booleanisA(com.thoughtworks.qdox.model.JavaClass javaClass)booleanisA(String fullClassName)booleanisAnnotation()booleanisArray()booleanisEnum()booleanisInner()booleanisInterface()booleanisPrimitive()booleanisVoid()voidremoveInitializer(com.thoughtworks.qdox.model.JavaInitializer initializer)voidreplace(com.thoughtworks.qdox.model.JavaConstructor baseConstructor, com.thoughtworks.qdox.model.JavaConstructor patchConstructor)Replaces the given baseConstructor with the given patchConstructor.voidreplace(com.thoughtworks.qdox.model.JavaField baseField, com.thoughtworks.qdox.model.JavaField patchField)Replaces the given baseField with the given patchField.voidreplace(com.thoughtworks.qdox.model.JavaInitializer baseInitializerBlock, com.thoughtworks.qdox.model.JavaInitializer patchInitializerBlock)Replaces the given baseInitializer with the given patchInitializer.voidreplace(com.thoughtworks.qdox.model.JavaMethod baseMethod, com.thoughtworks.qdox.model.JavaMethod patchMethod)Replaces the given baseMethod with the given patchMethod.voidsetAnnotation(boolean anAnnotation)voidsetEnum(boolean anEnum)voidsetImplementz(List<com.thoughtworks.qdox.model.JavaClass> implementz)voidsetInterface(boolean anInterface)voidsetJavaPackage(com.thoughtworks.qdox.model.JavaPackage javaPackage)Only used when constructing the model by hand / without sourcevoidsetSuperClass(com.thoughtworks.qdox.model.JavaType type)voidsetTypeParameters(List<ModifyableJavaTypeVariable<com.thoughtworks.qdox.model.JavaClass>> typeParameters)StringtoGenericString()StringtoString()-
Methods inherited from class com.thoughtworks.qdox.model.impl.AbstractInheritableJavaEntity
getTagByName
-
Methods inherited from class com.thoughtworks.qdox.model.impl.AbstractJavaEntity
getDeclaringClass, getModifiers, getName, isAbstract, isFinal, isNative, isPrivate, isProtected, isPublic, isStatic, isStrictfp, isSynchronized, isTransient, isVolatile, setDeclaringClass, setModifiers, setName
-
Methods inherited from class com.thoughtworks.qdox.model.impl.AbstractBaseJavaEntity
getAnnotations, getComment, getNamedParameter, getTagByName, getTags, getTagsByName, setAnnotations, setComment, setSource, setTags
-
Methods inherited from class com.thoughtworks.qdox.model.impl.AbstractJavaModel
getLineNumber, getModelWriter, setLineNumber, setModelWriterFactory
-
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
-
Methods inherited from interface com.thoughtworks.qdox.model.JavaAnnotatedElement
getAnnotations, getComment, getNamedParameter, getTagByName, getTags, getTagsByName
-
-
-
-
Constructor Detail
-
ModifyableJavaClass
protected ModifyableJavaClass()
-
ModifyableJavaClass
public ModifyableJavaClass(String name)
-
ModifyableJavaClass
public ModifyableJavaClass(com.thoughtworks.qdox.model.JavaSource source)
-
-
Method Detail
-
isInterface
public boolean isInterface()
- Specified by:
isInterfacein interfacecom.thoughtworks.qdox.model.JavaClass
-
isPrimitive
public boolean isPrimitive()
- Specified by:
isPrimitivein interfacecom.thoughtworks.qdox.model.JavaClass
-
isVoid
public boolean isVoid()
- Specified by:
isVoidin interfacecom.thoughtworks.qdox.model.JavaClass
-
isEnum
public boolean isEnum()
- Specified by:
isEnumin interfacecom.thoughtworks.qdox.model.JavaClass
-
isAnnotation
public boolean isAnnotation()
- Specified by:
isAnnotationin interfacecom.thoughtworks.qdox.model.JavaClass
-
isArray
public boolean isArray()
- Specified by:
isArrayin interfacecom.thoughtworks.qdox.model.JavaClass
-
getComponentType
public com.thoughtworks.qdox.model.JavaClass getComponentType()
- Specified by:
getComponentTypein interfacecom.thoughtworks.qdox.model.JavaClass
-
getDimensions
public int getDimensions()
- Specified by:
getDimensionsin interfacecom.thoughtworks.qdox.model.JavaClass
-
getSuperClass
public com.thoughtworks.qdox.model.JavaType getSuperClass()
- Specified by:
getSuperClassin interfacecom.thoughtworks.qdox.model.JavaClass
-
getSuperJavaClass
public com.thoughtworks.qdox.model.JavaClass getSuperJavaClass()
Shorthand for getSuperClass().getJavaClass() with null checking.- Specified by:
getSuperJavaClassin interfacecom.thoughtworks.qdox.model.JavaClass
-
getImplements
public List<com.thoughtworks.qdox.model.JavaType> getImplements()
- Specified by:
getImplementsin interfacecom.thoughtworks.qdox.model.JavaClass
-
getInterfaces
public List<com.thoughtworks.qdox.model.JavaClass> getInterfaces()
- Specified by:
getInterfacesin interfacecom.thoughtworks.qdox.model.JavaClass
-
getCodeBlock
public String getCodeBlock()
- Specified by:
getCodeBlockin interfacecom.thoughtworks.qdox.model.JavaClass- Specified by:
getCodeBlockin interfacecom.thoughtworks.qdox.model.JavaModel
-
setInterface
public void setInterface(boolean anInterface)
-
setEnum
public void setEnum(boolean anEnum)
-
setAnnotation
public void setAnnotation(boolean anAnnotation)
-
addConstructor
public void addConstructor(com.thoughtworks.qdox.model.JavaConstructor constructor)
-
addMethod
public void addMethod(com.thoughtworks.qdox.model.JavaMethod meth)
-
setSuperClass
public void setSuperClass(com.thoughtworks.qdox.model.JavaType type)
-
setImplementz
public void setImplementz(List<com.thoughtworks.qdox.model.JavaClass> implementz)
-
getTypeParameters
public List<ModifyableJavaTypeVariable<com.thoughtworks.qdox.model.JavaClass>> getTypeParameters()
- Specified by:
getTypeParametersin interfacecom.thoughtworks.qdox.model.JavaGenericDeclaration
-
setTypeParameters
public void setTypeParameters(List<ModifyableJavaTypeVariable<com.thoughtworks.qdox.model.JavaClass>> typeParameters)
-
addField
public void addField(com.thoughtworks.qdox.model.JavaField javaField)
-
setJavaPackage
public void setJavaPackage(com.thoughtworks.qdox.model.JavaPackage javaPackage)
Only used when constructing the model by hand / without source- Parameters:
javaPackage-JavaPackagefor this class
-
getSource
public com.thoughtworks.qdox.model.JavaSource getSource()
- Specified by:
getSourcein interfacecom.thoughtworks.qdox.model.JavaClass- Overrides:
getSourcein classcom.thoughtworks.qdox.model.impl.AbstractBaseJavaEntity
-
getPackage
public com.thoughtworks.qdox.model.JavaPackage getPackage()
- Specified by:
getPackagein interfacecom.thoughtworks.qdox.model.JavaClass
-
getPackageName
public String getPackageName()
- Specified by:
getPackageNamein interfacecom.thoughtworks.qdox.model.JavaClass
-
getFullyQualifiedName
public String getFullyQualifiedName()
- Specified by:
getFullyQualifiedNamein interfacecom.thoughtworks.qdox.model.JavaType
-
getGenericFullyQualifiedName
public String getGenericFullyQualifiedName()
- Specified by:
getGenericFullyQualifiedNamein interfacecom.thoughtworks.qdox.model.JavaType
-
getCanonicalName
public String getCanonicalName()
- Specified by:
getCanonicalNamein interfacecom.thoughtworks.qdox.model.JavaType
-
getGenericCanonicalName
public String getGenericCanonicalName()
- Specified by:
getGenericCanonicalNamein interfacecom.thoughtworks.qdox.model.JavaType
-
getValue
public String getValue()
- Specified by:
getValuein interfacecom.thoughtworks.qdox.model.JavaType
-
getGenericValue
public String getGenericValue()
- Specified by:
getGenericValuein interfacecom.thoughtworks.qdox.model.JavaType
-
isInner
public boolean isInner()
- Specified by:
isInnerin interfacecom.thoughtworks.qdox.model.JavaClass
-
getInitializers
public List<com.thoughtworks.qdox.model.JavaInitializer> getInitializers()
- Specified by:
getInitializersin interfacecom.thoughtworks.qdox.model.JavaClass
-
getConstructors
public List<com.thoughtworks.qdox.model.JavaConstructor> getConstructors()
- Specified by:
getConstructorsin interfacecom.thoughtworks.qdox.model.JavaClass
-
getConstructor
public com.thoughtworks.qdox.model.JavaConstructor getConstructor(List<com.thoughtworks.qdox.model.JavaType> parameterTypes)
- Specified by:
getConstructorin interfacecom.thoughtworks.qdox.model.JavaClass
-
getConstructor
public com.thoughtworks.qdox.model.JavaConstructor getConstructor(List<com.thoughtworks.qdox.model.JavaType> parameterTypes, boolean varArgs)
- Specified by:
getConstructorin interfacecom.thoughtworks.qdox.model.JavaClass
-
getMethods
public List<com.thoughtworks.qdox.model.JavaMethod> getMethods()
- Specified by:
getMethodsin interfacecom.thoughtworks.qdox.model.JavaClass
-
getMethods
public List<com.thoughtworks.qdox.model.JavaMethod> getMethods(boolean superclasses)
- Specified by:
getMethodsin interfacecom.thoughtworks.qdox.model.JavaClass
-
getMethodBySignature
public com.thoughtworks.qdox.model.JavaMethod getMethodBySignature(String name, List<com.thoughtworks.qdox.model.JavaType> parameterTypes)
- Specified by:
getMethodBySignaturein interfacecom.thoughtworks.qdox.model.JavaClass
-
getMethod
public com.thoughtworks.qdox.model.JavaMethod getMethod(String name, List<com.thoughtworks.qdox.model.JavaType> parameterTypes, boolean varArgs)
- Specified by:
getMethodin interfacecom.thoughtworks.qdox.model.JavaClass
-
getMethodBySignature
public com.thoughtworks.qdox.model.JavaMethod getMethodBySignature(String name, List<com.thoughtworks.qdox.model.JavaType> parameterTypes, boolean superclasses)
- Specified by:
getMethodBySignaturein interfacecom.thoughtworks.qdox.model.JavaClass
-
getMethodBySignature
public com.thoughtworks.qdox.model.JavaMethod getMethodBySignature(String name, List<com.thoughtworks.qdox.model.JavaType> parameterTypes, boolean superclasses, boolean varArg)
- Specified by:
getMethodBySignaturein interfacecom.thoughtworks.qdox.model.JavaClass
-
getMethodsBySignature
public List<com.thoughtworks.qdox.model.JavaMethod> getMethodsBySignature(String name, List<com.thoughtworks.qdox.model.JavaType> parameterTypes, boolean superclasses)
- Specified by:
getMethodsBySignaturein interfacecom.thoughtworks.qdox.model.JavaClass
-
getMethodsBySignature
public List<com.thoughtworks.qdox.model.JavaMethod> getMethodsBySignature(String name, List<com.thoughtworks.qdox.model.JavaType> parameterTypes, boolean superclasses, boolean varArg)
- Specified by:
getMethodsBySignaturein interfacecom.thoughtworks.qdox.model.JavaClass
-
getFields
public List<com.thoughtworks.qdox.model.JavaField> getFields()
- Specified by:
getFieldsin interfacecom.thoughtworks.qdox.model.JavaClass
-
getFieldByName
public com.thoughtworks.qdox.model.JavaField getFieldByName(String name)
- Specified by:
getFieldByNamein interfacecom.thoughtworks.qdox.model.JavaClass
-
getEnumConstants
public List<com.thoughtworks.qdox.model.JavaField> getEnumConstants()
- Specified by:
getEnumConstantsin interfacecom.thoughtworks.qdox.model.JavaClass
-
getEnumConstantByName
public com.thoughtworks.qdox.model.JavaField getEnumConstantByName(String name)
- Specified by:
getEnumConstantByNamein interfacecom.thoughtworks.qdox.model.JavaClass
-
addInitializer
public void addInitializer(com.thoughtworks.qdox.model.JavaInitializer initializer)
-
addAllInitializer
public void addAllInitializer(List<com.thoughtworks.qdox.model.JavaInitializer> initializersList)
-
removeInitializer
public void removeInitializer(com.thoughtworks.qdox.model.JavaInitializer initializer)
-
addClass
public void addClass(com.thoughtworks.qdox.model.JavaClass cls)
-
getNestedClasses
public List<com.thoughtworks.qdox.model.JavaClass> getNestedClasses()
- Specified by:
getNestedClassesin interfacecom.thoughtworks.qdox.model.JavaClass
-
getNestedClassByName
public com.thoughtworks.qdox.model.JavaClass getNestedClassByName(String name)
- Specified by:
getNestedClassByNamein interfacecom.thoughtworks.qdox.model.JavaClass
-
isA
public boolean isA(String fullClassName)
- Specified by:
isAin interfacecom.thoughtworks.qdox.model.JavaClass
-
isA
public boolean isA(com.thoughtworks.qdox.model.JavaClass javaClass)
- Specified by:
isAin interfacecom.thoughtworks.qdox.model.JavaClass
-
getBeanProperties
public List<com.thoughtworks.qdox.model.BeanProperty> getBeanProperties()
- Specified by:
getBeanPropertiesin interfacecom.thoughtworks.qdox.model.JavaClass
-
getBeanProperties
public List<com.thoughtworks.qdox.model.BeanProperty> getBeanProperties(boolean superclasses)
- Specified by:
getBeanPropertiesin interfacecom.thoughtworks.qdox.model.JavaClass
-
getBeanProperty
public com.thoughtworks.qdox.model.BeanProperty getBeanProperty(String propertyName)
- Specified by:
getBeanPropertyin interfacecom.thoughtworks.qdox.model.JavaClass
-
getBeanProperty
public com.thoughtworks.qdox.model.BeanProperty getBeanProperty(String propertyName, boolean superclasses)
- Specified by:
getBeanPropertyin interfacecom.thoughtworks.qdox.model.JavaClass
-
getDerivedClasses
public List<com.thoughtworks.qdox.model.JavaClass> getDerivedClasses()
- Specified by:
getDerivedClassesin interfacecom.thoughtworks.qdox.model.JavaClass
-
getTagsByName
public List<com.thoughtworks.qdox.model.DocletTag> getTagsByName(String name, boolean superclasses)
- Specified by:
getTagsByNamein interfacecom.thoughtworks.qdox.model.JavaClass- Specified by:
getTagsByNamein classcom.thoughtworks.qdox.model.impl.AbstractInheritableJavaEntity
-
toString
public String toString()
- Specified by:
toStringin interfacecom.thoughtworks.qdox.model.JavaClass- Overrides:
toStringin classObject- See Also:
Class.toString()
-
toGenericString
public String toGenericString()
- Specified by:
toGenericStringin interfacecom.thoughtworks.qdox.model.JavaType
-
getJavaClassLibrary
public com.thoughtworks.qdox.library.ClassLibrary getJavaClassLibrary()
- Specified by:
getJavaClassLibraryin interfacecom.thoughtworks.qdox.model.JavaClass
-
replace
public void replace(com.thoughtworks.qdox.model.JavaField baseField, com.thoughtworks.qdox.model.JavaField patchField)Replaces the given baseField with the given patchField. If the baseField does not exist, this method will do nothing- Parameters:
baseField- to be replacedpatchField- to replace the baseField
-
replace
public void replace(com.thoughtworks.qdox.model.JavaMethod baseMethod, com.thoughtworks.qdox.model.JavaMethod patchMethod)Replaces the given baseMethod with the given patchMethod. If the baseMethod does not exist, this method will do nothing- Parameters:
baseMethod- to be replacedpatchMethod- to replace the baseMethod
-
replace
public void replace(com.thoughtworks.qdox.model.JavaConstructor baseConstructor, com.thoughtworks.qdox.model.JavaConstructor patchConstructor)Replaces the given baseConstructor with the given patchConstructor. If the baseConstructor does not exist, this method will do nothing- Parameters:
baseConstructor- to be replacedpatchConstructor- to replace the baseMethod
-
replace
public void replace(com.thoughtworks.qdox.model.JavaInitializer baseInitializerBlock, com.thoughtworks.qdox.model.JavaInitializer patchInitializerBlock)Replaces the given baseInitializer with the given patchInitializer.- Parameters:
baseInitializerBlock-patchInitializerBlock-
-
getBinaryName
public String getBinaryName()
- Specified by:
getBinaryNamein interfacecom.thoughtworks.qdox.model.JavaType
-
getParentSource
public com.thoughtworks.qdox.model.JavaSource getParentSource()
- Specified by:
getParentSourcein interfacecom.thoughtworks.qdox.model.JavaClass
-
getSimpleName
public String getSimpleName()
- Specified by:
getSimpleNamein interfacecom.thoughtworks.qdox.model.JavaClass
-
-