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 interface
ElementAccess.IAccessFactory
This 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 void
accept(INamedElementAccess.INamedElementAccessVisitor visitor)
Visit this element.boolean
equals(java.lang.Object obj)
java.util.List<? extends INamedElementAccess>
getChildren()
Provides access to the children.T
getElement()
Internal use onlyjava.lang.String
getFullyQualifiedName()
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.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)
Counts total number of issues for this element for the given filter parameters.java.lang.Object
getMetricLevel()
Internal use onlyjava.lang.String
getName()
The (full) name without (potential) signature parts.java.lang.String
getNameWithSignature()
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.INamedElementAccess
getParent()
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.String
getShortName()
The short name without (potential) signature parts.java.lang.String
getShortNameWithSignature()
The short name with potential signature parts.int
hashCode()
boolean
ignoreIssues()
Issues of elements matched by the issue filter (workspace setup) should be ignored.boolean
isExcluded()
The exclusion state.boolean
isExternal()
The external state.void
setFactory(ElementAccess.IAccessFactory factory)
Internal use onlyjava.lang.String
toString()
-
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:
getParent
in 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:
getChildren
in interfaceINamedElementAccess
- Returns:
- List of children (might be empty).
-
getName
public final java.lang.String getName()
The (full) name without (potential) signature parts.- Specified by:
getName
in interfaceIElementAccess
- Returns:
- the (full) name without signature parts.
-
getShortName
public final java.lang.String getShortName()
The short name without (potential) signature parts.- Specified by:
getShortName
in interfaceIElementAccess
- Returns:
- the short name without signature parts.
-
getNameWithSignature
public final java.lang.String getNameWithSignature()
The (full) name with (potential) signature parts.- Specified by:
getNameWithSignature
in interfaceIElementAccess
- Returns:
- the (full) name with signature parts.
-
getShortNameWithSignature
public final java.lang.String getShortNameWithSignature()
The short name with potential signature parts.- Specified by:
getShortNameWithSignature
in interfaceIElementAccess
- Returns:
- the short name with signature parts.
-
isExternal
public boolean isExternal()
The external state.- Specified by:
isExternal
in interfaceIElementAccess
- Returns:
- 'true' if external.
-
isExcluded
public final boolean isExcluded()
The exclusion state.- Specified by:
isExcluded
in 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:
ignoreIssues
in 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:
getOutgoingDependenciesRecursively
in 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:
getOutgoingDependenciesRecursively
in 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:
getOutgoingDependenciesRecursively
in 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:
getIncomingDependenciesRecursively
in 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:
getIncomingDependenciesRecursively
in 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:
getReferencedElementsRecursively
in 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:
getReferencedElementsRecursively
in 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:
getReferencedElementsRecursively
in 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:
getReferencingElementsRecursively
in 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:
getReferencingElementsRecursively
in 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:INamedElementAccess
Visit this element.- Specified by:
accept
in 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:INamedElementAccess
Counts total number of issues for this element for the given filter parameters.- Specified by:
getIssueCount
in 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:
getParent
in 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:
toString
in classjava.lang.Object
-
hashCode
public int hashCode()
- Overrides:
hashCode
in classjava.lang.Object
-
equals
public boolean equals(java.lang.Object obj)
- Overrides:
equals
in classjava.lang.Object
-
getFullyQualifiedName
public java.lang.String getFullyQualifiedName()
- Specified by:
getFullyQualifiedName
in interfaceINamedElementAccess
- Returns:
- the fully qualified name as shown in the Sonargraph properties view
-
-