Class ElementAccess<T extends com.hello2morrow.sonargraph.core.model.element.Element>
- java.lang.Object
-
- com.hello2morrow.sonargraph.core.api.model.ElementAccess<T>
-
- All Implemented Interfaces:
IElementAccess,INamedElementAccess
- Direct Known Subclasses:
AggregatedDependencyAccess,CppCompilationUnitFragmentAccess,CppComponentAccess,CppDirectoryFragmentAccess,DependencyAccess,DirectoryAccess,DirectoryFragmentAccess,ExternalAccess,ExternalElementContainerAccess,JavaClassFileAccess,JavaSyntheticTypeAccess,LogicalExternalAccess,LogicalModuleAccess,LogicalNamespaceAccess,LogicalProgrammingElementAccess,LogicalSystemAccess,ModuleAccess,NamespaceFragmentAccess,ProgrammingElementAccess,RootAccess,SourceFileAccess
public abstract class ElementAccess<T extends com.hello2morrow.sonargraph.core.model.element.Element> extends java.lang.Object implements INamedElementAccess
Base class of all access classes providing common functionality.
Implements INamedElementAccess since this class represents Elements and NamedElements.
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static interfaceElementAccess.IAccessFactoryThis is an internal interface and should no be used.-
Nested classes/interfaces inherited from interface com.hello2morrow.sonargraph.api.model.INamedElementAccess
INamedElementAccess.INamedElementAccessVisitor
-
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidaccept(INamedElementAccess.INamedElementAccessVisitor visitor)Visit this element.booleanequals(java.lang.Object obj)java.util.List<? extends INamedElementAccess>getChildren()Provides access to the children.TgetElement()Internal use onlyjava.lang.StringgetFullyQualifiedName()java.util.List<IAggregatedDependencyAccess>getIncomingDependenciesRecursively(Aggregator aggr, boolean excludeSelf, boolean excludeExcluded, IDependencyKind... types)Compute the incoming aggregated dependencies of this element and all its children.java.util.List<IAggregatedDependencyAccess>getIncomingDependenciesRecursively(Aggregator aggr, boolean excludeSelf, IDependencyKind... types)Compute the incoming aggregated dependencies of this element and all its children, excluding excluded elements.intgetIssueCount(java.util.List<java.lang.String> categories, java.util.List<java.lang.String> issueIds, java.util.List<java.lang.String> providers, java.util.List<java.lang.String> severities, boolean recursive)Counts total number of issues for this element for the given filter parameters.java.lang.ObjectgetMetricLevel()Internal use onlyjava.lang.StringgetName()The (full) name without (potential) signature parts.java.lang.StringgetNameWithSignature()The (full) name with (potential) signature parts.java.util.List<IAggregatedDependencyAccess>getOutgoingDependenciesRecursively(Aggregator aggr, boolean excludeSelf, boolean excludeExternals, boolean excludeExcluded, IDependencyKind... types)Compute the outgoing aggregated dependencies of this element and all its children.java.util.List<IAggregatedDependencyAccess>getOutgoingDependenciesRecursively(Aggregator aggr, boolean excludeSelf, boolean excludeExternals, IDependencyKind... types)Compute the outgoing aggregated dependencies of this element and all its children.java.util.List<IAggregatedDependencyAccess>getOutgoingDependenciesRecursively(Aggregator aggr, boolean excludeSelf, IDependencyKind... types)Compute the outgoing aggregated dependencies of this element and all its children.INamedElementAccessgetParent()Provides access to the parent.<P extends INamedElementAccess>
PgetParent(java.lang.Class<P> clazz)java.util.List<INamedElementAccess>getReferencedElementsRecursively(Aggregator aggr, boolean excludeSelf, boolean excludeExternals, boolean excludeExcluded, IDependencyKind... types)Compute the list of referenced elements of this element and all its children.java.util.List<INamedElementAccess>getReferencedElementsRecursively(Aggregator aggr, boolean excludeSelf, boolean excludeExternals, IDependencyKind... types)Compute the list of referenced elements of this element and all its children, excluding excluded elements.java.util.List<INamedElementAccess>getReferencedElementsRecursively(Aggregator aggr, boolean excludeSelf, IDependencyKind... types)Compute the list of referenced elements of this element and all its children, including external elements, excluding excluded elements.java.util.List<INamedElementAccess>getReferencingElementsRecursively(Aggregator aggr, boolean excludeSelf, boolean excludeExcluded, IDependencyKind... types)Get a list of all elements referencing this element and its children.java.util.List<INamedElementAccess>getReferencingElementsRecursively(Aggregator aggr, boolean excludeSelf, IDependencyKind... types)Get a list of all elements referencing this element and its children, excluding excluded elements.java.lang.StringgetShortName()The short name without (potential) signature parts.java.lang.StringgetShortNameWithSignature()The short name with potential signature parts.inthashCode()booleanignoreIssues()Issues of elements matched by the issue filter (workspace setup) should be ignored.booleanisExcluded()The exclusion state.booleanisExternal()The external state.voidsetFactory(ElementAccess.IAccessFactory factory)Internal use onlyjava.lang.StringtoString()-
Methods inherited from interface com.hello2morrow.sonargraph.api.model.INamedElementAccess
getIssueCount
-
-
-
-
Method Detail
-
getElement
public T getElement()
Internal use only- Returns:
- n/a
-
getMetricLevel
public java.lang.Object getMetricLevel()
Internal use only
-
setFactory
public void setFactory(ElementAccess.IAccessFactory factory)
Internal use only
-
getParent
public INamedElementAccess getParent()
Provides access to the parent.- Specified by:
getParentin interfaceINamedElementAccess- Returns:
- the parent or 'null' if there is no parent.
-
getChildren
public final java.util.List<? extends INamedElementAccess> getChildren()
Provides access to the children.- Specified by:
getChildrenin interfaceINamedElementAccess- Returns:
- List of children (might be empty).
-
getName
public final java.lang.String getName()
The (full) name without (potential) signature parts.- Specified by:
getNamein interfaceIElementAccess- Returns:
- the (full) name without signature parts.
-
getShortName
public final java.lang.String getShortName()
The short name without (potential) signature parts.- Specified by:
getShortNamein interfaceIElementAccess- Returns:
- the short name without signature parts.
-
getNameWithSignature
public final java.lang.String getNameWithSignature()
The (full) name with (potential) signature parts.- Specified by:
getNameWithSignaturein interfaceIElementAccess- Returns:
- the (full) name with signature parts.
-
getShortNameWithSignature
public final java.lang.String getShortNameWithSignature()
The short name with potential signature parts.- Specified by:
getShortNameWithSignaturein interfaceIElementAccess- Returns:
- the short name with signature parts.
-
isExternal
public boolean isExternal()
The external state.- Specified by:
isExternalin interfaceIElementAccess- Returns:
- 'true' if external.
-
isExcluded
public final boolean isExcluded()
The exclusion state.- Specified by:
isExcludedin interfaceIElementAccess- Returns:
- 'true' if excluded.
-
ignoreIssues
public final boolean ignoreIssues()
Issues of elements matched by the issue filter (workspace setup) should be ignored.- Specified by:
ignoreIssuesin interfaceIElementAccess- Returns:
- 'true' if this element's issues are to be ignored.
-
getOutgoingDependenciesRecursively
public java.util.List<IAggregatedDependencyAccess> getOutgoingDependenciesRecursively(Aggregator aggr, boolean excludeSelf, boolean excludeExternals, boolean excludeExcluded, IDependencyKind... types)
Compute the outgoing aggregated dependencies of this element and all its children.- Specified by:
getOutgoingDependenciesRecursivelyin interfaceINamedElementAccess- Parameters:
aggr- The desired level of aggregationexcludeSelf- If true, exclude all dependencies targeting this object or its childrenexcludeExternals- If true, exclude all dependencies targeting external objects.excludeExcluded- If true, exclude all dependencies targeting excluded objects.types- List of dependency types (if empty, all dependencies will be returned)- Returns:
- List of dependencies aggregated to the desired level
-
getOutgoingDependenciesRecursively
public java.util.List<IAggregatedDependencyAccess> getOutgoingDependenciesRecursively(Aggregator aggr, boolean excludeSelf, boolean excludeExternals, IDependencyKind... types)
Compute the outgoing aggregated dependencies of this element and all its children.- Specified by:
getOutgoingDependenciesRecursivelyin interfaceINamedElementAccess- Parameters:
aggr- The desired level of aggregationexcludeSelf- If true, exclude all dependencies targeting this object or its childrenexcludeExternals- If true, exclude all dependencies targeting external objects.types- List of dependency types (if empty, all dependencies will be returned)- Returns:
- List of dependencies aggregated to the desired level
-
getOutgoingDependenciesRecursively
public java.util.List<IAggregatedDependencyAccess> getOutgoingDependenciesRecursively(Aggregator aggr, boolean excludeSelf, IDependencyKind... types)
Compute the outgoing aggregated dependencies of this element and all its children.- Specified by:
getOutgoingDependenciesRecursivelyin interfaceINamedElementAccess- Parameters:
aggr- The desired level of aggregationexcludeSelf- If true, exclude all dependencies targeting this object or its childrentypes- List of dependency types (if empty, all dependencies will be returned)- Returns:
- List of dependencies aggregated to the desired level
-
getIncomingDependenciesRecursively
public java.util.List<IAggregatedDependencyAccess> getIncomingDependenciesRecursively(Aggregator aggr, boolean excludeSelf, boolean excludeExcluded, IDependencyKind... types)
Compute the incoming aggregated dependencies of this element and all its children.- Specified by:
getIncomingDependenciesRecursivelyin interfaceINamedElementAccess- Parameters:
aggr- The desired level of aggregationexcludeSelf- If true, exclude all dependencies coming from this object or its childrenexcludeExcluded- If true, exclude all dependencies coming from excluded elementstypes- List of dependency types (if empty, all dependencies will be returned)- Returns:
- List of incoming dependencies aggregated to the desired level
-
getIncomingDependenciesRecursively
public java.util.List<IAggregatedDependencyAccess> getIncomingDependenciesRecursively(Aggregator aggr, boolean excludeSelf, IDependencyKind... types)
Compute the incoming aggregated dependencies of this element and all its children, excluding excluded elements.- Specified by:
getIncomingDependenciesRecursivelyin interfaceINamedElementAccess- Parameters:
aggr- The desired level of aggregationexcludeSelf- If true, exclude all dependencies coming from this object or its childrentypes- List of dependency types (if empty, all dependencies will be returned)- Returns:
- List of incoming dependencies aggregated to the desired level
-
getReferencedElementsRecursively
public java.util.List<INamedElementAccess> getReferencedElementsRecursively(Aggregator aggr, boolean excludeSelf, boolean excludeExternals, boolean excludeExcluded, IDependencyKind... types)
Compute the list of referenced elements of this element and all its children.- Specified by:
getReferencedElementsRecursivelyin interfaceINamedElementAccess- Parameters:
aggr- The desired level of aggregationexcludeSelf- If true, exclude this object and its children from the resulting listexcludeExternals- If true, exclude all external objects.excludeExcluded- If true, exclude all excluded objects.types- List of dependency types (if empty, all dependencies will be returned)- Returns:
- List of referenced objects according to the aggregation level
-
getReferencedElementsRecursively
public java.util.List<INamedElementAccess> getReferencedElementsRecursively(Aggregator aggr, boolean excludeSelf, boolean excludeExternals, IDependencyKind... types)
Compute the list of referenced elements of this element and all its children, excluding excluded elements.- Specified by:
getReferencedElementsRecursivelyin interfaceINamedElementAccess- Parameters:
aggr- The desired level of aggregationexcludeSelf- If true, exclude this object and its children from the resulting listexcludeExternals- If true, exclude all external objects.types- List of dependency types (if empty, all dependencies will be returned)- Returns:
- List of referenced objects according to the aggregation level
-
getReferencedElementsRecursively
public java.util.List<INamedElementAccess> getReferencedElementsRecursively(Aggregator aggr, boolean excludeSelf, IDependencyKind... types)
Compute the list of referenced elements of this element and all its children, including external elements, excluding excluded elements.- Specified by:
getReferencedElementsRecursivelyin interfaceINamedElementAccess- Parameters:
aggr- The desired level of aggregationexcludeSelf- If true, exclude this object and its children from the resulting listtypes- List of dependency types (if empty, all dependencies will be returned)- Returns:
- List of referenced objects according to the aggregation level
-
getReferencingElementsRecursively
public java.util.List<INamedElementAccess> getReferencingElementsRecursively(Aggregator aggr, boolean excludeSelf, boolean excludeExcluded, IDependencyKind... types)
Get a list of all elements referencing this element and its children.- Specified by:
getReferencingElementsRecursivelyin interfaceINamedElementAccess- Parameters:
aggr- The desired level of aggregationexcludeSelf- If true, exclude this object and its children from the resulting listexcludeExcluded- If true, exclude all excluded objects.types- List of dependency types (if empty, all dependencies will be returned)- Returns:
- List of referencing objects according to the aggregation level.
-
getReferencingElementsRecursively
public java.util.List<INamedElementAccess> getReferencingElementsRecursively(Aggregator aggr, boolean excludeSelf, IDependencyKind... types)
Get a list of all elements referencing this element and its children, excluding excluded elements.- Specified by:
getReferencingElementsRecursivelyin interfaceINamedElementAccess- Parameters:
aggr- The desired level of aggregationexcludeSelf- If true, exclude this object and its children from the resulting listtypes- List of dependency types (if empty, all dependencies will be returned)- Returns:
- List of referencing objects according to the aggregation level.
-
accept
public void accept(INamedElementAccess.INamedElementAccessVisitor visitor)
Description copied from interface:INamedElementAccessVisit this element.- Specified by:
acceptin interfaceINamedElementAccess- Parameters:
visitor- The visitor implementation
-
getIssueCount
public int getIssueCount(java.util.List<java.lang.String> categories, java.util.List<java.lang.String> issueIds, java.util.List<java.lang.String> providers, java.util.List<java.lang.String> severities, boolean recursive)Description copied from interface:INamedElementAccessCounts total number of issues for this element for the given filter parameters.- Specified by:
getIssueCountin interfaceINamedElementAccess- Parameters:
categories- Issue categories (empty list means 'all")issueIds- Issue Id's (empty list mean all, listed under issue type in properties vieww)providers- Issue providers (empty list means 'all")severities- Issue severities (empty list means 'all")recursive- Add direct and indirect children's issues to count- Returns:
- Total number of issues matching the filter criteria
-
getParent
public final <P extends INamedElementAccess> P getParent(java.lang.Class<P> clazz)
- Specified by:
getParentin interfaceINamedElementAccess- Parameters:
clazz- class of the parent.- Returns:
- the first matching parent of this element matching the given class or null if no parent exists or no parent of the specified class exists.
-
toString
public java.lang.String toString()
- Overrides:
toStringin classjava.lang.Object
-
hashCode
public int hashCode()
- Overrides:
hashCodein classjava.lang.Object
-
equals
public boolean equals(java.lang.Object obj)
- Overrides:
equalsin classjava.lang.Object
-
getFullyQualifiedName
public java.lang.String getFullyQualifiedName()
- Specified by:
getFullyQualifiedNamein interfaceINamedElementAccess- Returns:
- the fully qualified name as shown in the Sonargraph properties view
-
-