public class ClassPackage extends AAnalyzableElement implements org.pfsw.odem.INamespace, IClassContainingElement, IStringRepresentation
| Modifier and Type | Field and Description |
|---|---|
static ClassPackage[] |
EMPTY_ARRAY |
EMPTY_MODEL_OBJECT_ARRAYEMPTY_BASE_ARRAY| Constructor and Description |
|---|
ClassPackage(java.lang.String packageName,
GenericClassContainer packageContainer)
Initialize the new instance with a name.
|
| Modifier and Type | Method and Description |
|---|---|
boolean |
accept(org.pfsw.odem.IExplorableElementVisitor visitor)
Implementation of the visitor pattern (GOF) for all derived interfaces
if IExplorableElement.
|
boolean |
acceptNamespaces(org.pfsw.odem.INamespacesVisitor visitor)
Implementation of the visitor pattern (GOF).
|
boolean |
acceptTypes(org.pfsw.odem.ITypesVisitor visitor)
Iterates over all contained IType objects and invokes the visitor's
callback method using the types as parameter.
|
void |
addClass(ClassInformation classInfo)
Add the given class information to the package.
|
boolean |
canHaveDependencies()
Returns if this object potentially has dependencies to other objects.
|
ClassInformation |
createClassInfo(java.lang.String className)
Creates a new class info with the given fully qualified class name
and adds it to the package.
|
boolean |
equals(java.lang.Object obj)
Returns true if the given object equals this object
|
ClassInformation |
findClassInfo(java.lang.String className)
Returns the classInfo with the given name if it is member or this package.
|
ClassInformation |
findOrCreateClassInfo(java.lang.String className)
Searches for the class info in this container and returns it if found.
|
ClassInformation[] |
getAllContainedClasses()
Returns all classes that are contained in this element or any of its
structural sub-elements.
|
AnalyzableElementType |
getAnalyzableElementType()
Returns the type of the analyzable element.
|
int |
getChildCount()
Returns the current number of children.
|
AModelObject[] |
getChildren()
Returns the children
|
protected java.util.List<ClassInformation> |
getClasses() |
protected IClassInformationFactory |
getClassInformationFactory() |
ClassInformation[] |
getClassInfos()
Returns the class information of all classes found in this package.
|
GenericClassContainer |
getContainer()
Returns the container this package resides in
|
java.lang.String |
getContainerName()
Returns the name of the container the package was found in
|
org.pfsw.odem.IExplorationContext |
getContext()
Returns the context of this object
|
ClassPackage[] |
getDirectReferredPackages()
Returns all packages this package directly depends on
|
protected ClassFileVersion |
getHighestClassFileVersion() |
java.lang.String |
getName()
Returns the name.
|
int |
getNumberOfContainedClasses()
Returns the number of classes in this package
|
int |
getNumberOfDirectReferredPackages()
Returns the number of packages this package directly depends on.
|
protected AModelObject |
getParent()
Returns the parent model object, which is always a GenericClassContainer.
|
protected ClassPackage[] |
getReferredPackages() |
ClassFileVersion |
getRequiredClassFileVersion()
Returns the highest class file version that one of the contained classes
is based on.
|
java.lang.String |
getStringRepresentation()
Returns the package name
|
java.util.Collection<org.pfsw.odem.IType> |
getTypes()
Returns all types in this namespace.
|
Workset |
getWorkset()
Returns the workset this element is included in
|
int |
hashCode()
Returns the hash code of this object
|
protected boolean |
hasParent()
Returns true if this object has a parent model object.
|
protected void |
initHighestClassFileVersion() |
protected java.lang.String |
inspectString()
Returns a string representation that is more convenient for object
inspection with JOI.
|
boolean |
isDefaultPackage()
Returns true if this package represents the default package (i.e "")
|
boolean |
knowsContainer()
Returns true, if the package "knows" in which container it was found
|
boolean |
notFound()
Returns true, if the package has not been found in any container
|
boolean |
processClassInformationObjects(java.util.Collection<ClassInformation> collection,
IClassInformationProcessor<?> processor)
Calls the given processor for each contained class info object and
adds all class info objects that the processor wants (i.e.
|
boolean |
refersTo(IAnalyzableElement analyzableElement)
Returns true if any of the directly referred packages is identical to
the given one.
|
void |
release() |
protected void |
reset() |
protected void |
setClasses(java.util.List<ClassInformation> newValue) |
protected void |
setContainer(GenericClassContainer newValue) |
protected void |
setHighestClassFileVersion(ClassFileVersion newValue) |
protected void |
setName(java.lang.String newValue) |
protected void |
setReferredPackages(ClassPackage[] newValue) |
java.lang.String |
toString() |
canBeAnalyzedForDependenciesapply, applyOnChildren, applyOnStack, applySelf, coll, compareTo, countAllElementsRecursivly, getNumberOfAncestors, getOtherProperties, getProperty, getPropertyNames, setOtherProperties, setProperty, str, visitStackObjectspublic static final ClassPackage[] EMPTY_ARRAY
public ClassPackage(java.lang.String packageName,
GenericClassContainer packageContainer)
packageName - A valid Java package name (must not be null)packageContainer - The classpath element that contains the package (must not be null)java.lang.IllegalArgumentException - If any of the arguments is nullpublic java.lang.String getStringRepresentation()
getStringRepresentation in interface IStringRepresentationpublic boolean canHaveDependencies()
canHaveDependencies in class AModelObjectpublic void addClass(ClassInformation classInfo)
public ClassInformation[] getClassInfos()
public java.util.Collection<org.pfsw.odem.IType> getTypes()
getTypes in interface org.pfsw.odem.INamespacepublic java.lang.String getContainerName()
public ClassPackage[] getDirectReferredPackages()
public int getNumberOfDirectReferredPackages()
public boolean refersTo(IAnalyzableElement analyzableElement)
refersTo in interface IAnalyzableElementanalyzableElement - The package to check if this package refers to itpublic boolean equals(java.lang.Object obj)
equals in class java.lang.Objectpublic int hashCode()
hashCode in class java.lang.Objectpublic boolean isDefaultPackage()
public boolean knowsContainer()
public boolean notFound()
public ClassInformation findClassInfo(java.lang.String className)
public ClassInformation findOrCreateClassInfo(java.lang.String className)
public ClassInformation createClassInfo(java.lang.String className)
public int getNumberOfContainedClasses()
getNumberOfContainedClasses in interface IClassContainingElementpublic ClassInformation[] getAllContainedClasses()
getAllContainedClasses in interface IAnalyzableElementpublic boolean processClassInformationObjects(java.util.Collection<ClassInformation> collection, IClassInformationProcessor<?> processor)
collection - The collection to which the matching objects will be added (might be null).processor - The processor that decides whether or not an object must be added.public ClassFileVersion getRequiredClassFileVersion()
getRequiredClassFileVersion in interface IClassContainingElementpublic boolean accept(org.pfsw.odem.IExplorableElementVisitor visitor)
accept in interface org.pfsw.odem.IExplorableElementVisitingvisitor - The implementor of the vistor interface to be called by this methodpublic boolean acceptNamespaces(org.pfsw.odem.INamespacesVisitor visitor)
acceptNamespaces in interface org.pfsw.odem.INamespacevisitor - The implementor of the vistor interface to be called by this methodpublic boolean acceptTypes(org.pfsw.odem.ITypesVisitor visitor)
acceptTypes in interface org.pfsw.odem.IExplorableElementVisitingvisitor - The implementor of the vistor interface to be called by this methodpublic AnalyzableElementType getAnalyzableElementType()
getAnalyzableElementType in interface IAnalyzableElementpublic java.lang.String getName()
AModelObjectgetName in interface org.pfsw.odem.IExplorationModelObjectgetName in class AModelObjectpublic GenericClassContainer getContainer()
public java.lang.String toString()
toString in class java.lang.Objectpublic void release()
release in interface org.pfsw.bif.lifecycle.IReleasableprotected boolean hasParent()
hasParent in class AModelObjectprotected AModelObject getParent()
getParent in class AModelObjectpublic Workset getWorkset()
getWorkset in interface IAnalyzableElementgetWorkset in class AModelObjectpublic int getChildCount()
getChildCount in class AModelObjectpublic AModelObject[] getChildren()
getChildren in class AModelObjectpublic org.pfsw.odem.IExplorationContext getContext()
getContext in interface org.pfsw.odem.IExplorationModelObjectprotected void reset()
protected void initHighestClassFileVersion()
protected IClassInformationFactory getClassInformationFactory()
protected void setName(java.lang.String newValue)
protected void setContainer(GenericClassContainer newValue)
protected java.util.List<ClassInformation> getClasses()
protected void setClasses(java.util.List<ClassInformation> newValue)
protected ClassPackage[] getReferredPackages()
protected void setReferredPackages(ClassPackage[] newValue)
protected ClassFileVersion getHighestClassFileVersion()
protected void setHighestClassFileVersion(ClassFileVersion newValue)
protected java.lang.String inspectString()