public class SoftwareComponent extends GenericClassContainer implements IComponentHolder
Modifier and Type | Field and Description |
---|---|
static SoftwareComponent[] |
EMPTY_ARRAY |
EMPTY_GENERIC_CONTAINER_ARRAY
EMPTY_MODEL_OBJECT_ARRAY
EMPTY_BASE_ARRAY
Constructor and Description |
---|
SoftwareComponent(java.lang.String aName,
Workset aWorkset)
Initialize the new instance with a qualifying name and the workset it belongs to.
|
Modifier and Type | Method and Description |
---|---|
void |
addComponent(SoftwareComponent component)
Add the given component
|
void |
addContainerInfo(ContainerInfo info) |
boolean |
addPackageIfContainerMatches(ClassPackage pack)
Adds the given package to the components package list if the package
belongs to a container that is defined as part of this component.
|
boolean |
addPackageIfPatternMatches(ClassPackage pack)
Adds the given package to the components package list if the package
name matches any of the component's package name patterns.
|
void |
addPackagePattern(java.lang.String pattern)
Adds the given pattern.
|
void |
addPackagePatterns(java.util.Collection<java.lang.String> patterns)
Adds all patterns from the given collection.
|
boolean |
addPackageToThisOrSubComponentIfPatternMatches(ClassPackage pack)
Adds the given package to this component or one of its sub-components if
any package name pattern matches the name of the given package.
|
int |
compareTo(AModelObject obj) |
void |
detachParentComponentHolder()
Detaches this component from its current parent.
|
boolean |
equals(java.lang.Object obj) |
SoftwareComponent[] |
getComponents()
Returns all sub components this component contains
|
java.util.List<ContainerInfo> |
getContainerInfoList() |
java.lang.String |
getDescription() |
java.util.Collection<java.lang.String> |
getNamespacePatterns() |
org.pfsw.text.StringPatternCollection |
getPackagePatterns() |
IComponentHolder |
getParentComponentHolder()
Returns the parent holder that contains this object.
|
int |
hashCode() |
protected java.lang.String |
inspectString()
Returns a string representation that is more convenient for object
inspection with JOI.
|
boolean |
isSoftwareComponent()
Returns true because this container represents a modelled software component.
|
boolean |
isValid()
Returns true if this class container is valid.
|
boolean |
processSoftwareComponents(java.util.Collection<SoftwareComponent> collection,
ISoftwareComponentProcessor processor)
Calls the given processor for each contained component object and
adds all component objects that the processor wants
to the given collection.
|
void |
removeComponent(SoftwareComponent component)
Remove the given component
|
protected void |
reset()
Resets the internal state.
|
void |
resetPackagePatterns()
Removes all package patterns currently defined in this component.
|
void |
setContainerInfoList(java.util.List<ContainerInfo> newValue) |
void |
setDescription(java.lang.String newValue) |
void |
setName(java.lang.String name) |
void |
setPackagePatterns(org.pfsw.text.StringPatternCollection newValue) |
void |
setParentComponentHolder(IComponentHolder newValue) |
java.lang.String |
toString() |
accept, acceptContainers, acceptNamespaces, acceptTypes, addPackage, addSubContainer, calculateContentHash, canHaveDependencies, collectReferredContainers, contains, createPackage, displayString, filterCorrectType, filterCorrectType, findClassInfo, findOrCreateClassInfo, findOrCreatePackage, findPackage, findPackage, getAlias, getAllContainedClasses, getAnalyzableElementType, getChildCount, getChildren, getClassification, getClassPackages, getContainedIn, getContainerNames, getContentHash, getContext, getDirectReferredContainers, getDisplayName, getHighestClassFileVersion, getIncludedContainers, getName, getNamespaces, getNumberOfContainedClasses, getNumberOfContainedPackages, getPackageNamed, getPackages, getParent, getParentContainer, getQualifiedName, getReferredContainers, getRequiredClassFileVersion, getSimpleName, getSubContainers, getVersion, getWorkset, hasParent, hasVersion, initHighestClassFileVersion, isNotFoundContainer, isShortContainerNamesOn, isThirdPartyLibrary, packages, packages, packagesCollected, packagesCollected, processClassInformationObjects, processClassPackageObjects, refersTo, release, releaseExternalResources, removeSubContainer, setAlias, setClassification, setContainedIn, setContainerNames, setContentHash, setHighestClassFileVersion, setIncludedContainers, setReferredContainers, setWorkset
canBeAnalyzedForDependencies
apply, applyOnChildren, applyOnStack, applySelf, coll, countAllElementsRecursivly, getNumberOfAncestors, getOtherProperties, getProperty, getPropertyNames, setOtherProperties, setProperty, str, visitStackObjects
public static final SoftwareComponent[] EMPTY_ARRAY
public SoftwareComponent(java.lang.String aName, Workset aWorkset)
public void resetPackagePatterns()
public void addPackagePattern(java.lang.String pattern)
public void addPackagePatterns(java.util.Collection<java.lang.String> patterns)
public java.lang.String toString()
toString
in class GenericClassContainer
public boolean equals(java.lang.Object obj)
equals
in class GenericClassContainer
Object.equals(java.lang.Object)
public int hashCode()
hashCode
in class GenericClassContainer
Object.hashCode()
public int compareTo(AModelObject obj)
compareTo
in interface java.lang.Comparable<AModelObject>
compareTo
in class GenericClassContainer
Comparable.compareTo(java.lang.Object)
public void setName(java.lang.String name)
public boolean isValid()
isValid
in class GenericClassContainer
public boolean isSoftwareComponent()
isSoftwareComponent
in class GenericClassContainer
public java.util.Collection<java.lang.String> getNamespacePatterns()
public boolean addPackageToThisOrSubComponentIfPatternMatches(ClassPackage pack)
public boolean addPackageIfPatternMatches(ClassPackage pack)
public boolean addPackageIfContainerMatches(ClassPackage pack)
public void addContainerInfo(ContainerInfo info)
public boolean processSoftwareComponents(java.util.Collection<SoftwareComponent> collection, ISoftwareComponentProcessor 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 (must not be null)public void detachParentComponentHolder()
public java.lang.String getDescription()
public void setDescription(java.lang.String newValue)
public java.util.List<ContainerInfo> getContainerInfoList()
public void setContainerInfoList(java.util.List<ContainerInfo> newValue)
public org.pfsw.text.StringPatternCollection getPackagePatterns()
public void setPackagePatterns(org.pfsw.text.StringPatternCollection newValue)
public void setParentComponentHolder(IComponentHolder newValue)
public IComponentHolder getParentComponentHolder()
getParentComponentHolder
in interface IComponentHolder
public SoftwareComponent[] getComponents()
getComponents
in interface IComponentHolder
public void addComponent(SoftwareComponent component)
IComponentHolder
addComponent
in interface IComponentHolder
public void removeComponent(SoftwareComponent component)
removeComponent
in interface IComponentHolder
protected void reset()
protected java.lang.String inspectString()
inspectString
in class GenericClassContainer