Class ProgrammingElementAccess
- java.lang.Object
-
- com.hello2morrow.sonargraph.core.api.model.ElementAccess<com.hello2morrow.sonargraph.core.model.programming.ProgrammingElement>
-
- com.hello2morrow.sonargraph.core.api.model.ProgrammingElementAccess
-
- All Implemented Interfaces:
IElementAccess
,INamedElementAccess
,IProgrammingElementAccess
- Direct Known Subclasses:
CppEnumConstantAccess
,CppMacroAccess
,CppMacroInvocationAccess
,CppVariableAccess
,CSharpEnumConstantAccess
,FieldAccess
,PluginProgrammingElementAccess
,PythonVariableAccess
,RoutineAccess
,TypeAccess
public class ProgrammingElementAccess extends ElementAccess<com.hello2morrow.sonargraph.core.model.programming.ProgrammingElement> implements IProgrammingElementAccess
Access object for programming elements.
-
-
Nested Class Summary
-
Nested classes/interfaces inherited from class com.hello2morrow.sonargraph.core.api.model.ElementAccess
ElementAccess.IAccessFactory
-
Nested classes/interfaces inherited from interface com.hello2morrow.sonargraph.api.model.INamedElementAccess
INamedElementAccess.INamedElementAccessVisitor
-
Nested classes/interfaces inherited from interface com.hello2morrow.sonargraph.api.model.IProgrammingElementAccess
IProgrammingElementAccess.IVisitor
-
-
Constructor Summary
Constructors Constructor Description ProgrammingElementAccess(com.hello2morrow.sonargraph.core.model.programming.ProgrammingElement element)
Internal use only
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
accept(INamedElementAccess.INamedElementAccessVisitor visitor)
InternalIDirectoryAccess
getDirectory()
Get the directory of this programming element.java.util.List<IAggregatedDependencyAccess>
getIncomingDependencies(Aggregator aggr, boolean excludeSelf, boolean excludeExcluded, IDependencyKind... types)
Get a list of aggregated incoming dependencies to this programming element.java.util.List<IAggregatedDependencyAccess>
getIncomingDependencies(Aggregator aggr, boolean excludeSelf, IDependencyKind... types)
Get a list of aggregated incoming dependencies to this programming element, excluding excluded elements.java.util.List<IAggregatedDependencyAccess>
getIncomingDependenciesRecursively(Aggregator aggr, boolean excludeSelf, boolean excludeExcluded, IDependencyKind... types)
Get a list of aggregated incoming dependencies to this programming element and its direct and indirect children.java.util.List<IAggregatedDependencyAccess>
getIncomingDependenciesRecursively(Aggregator aggr, boolean excludeSelf, IDependencyKind... types)
Get a list of aggregated incoming dependencies to this programming element and its direct and indirect children, excluding excluded elements.int
getLineNumber()
Get the line number of this programming element.java.lang.Object
getMetricLevel()
Internal use onlyIModuleAccess
getModule()
Get the module of this programming element.ILogicalNamespaceAccess
getModuleNamespace()
Get the module scope logical namespace for this element.java.util.List<IAggregatedDependencyAccess>
getOutgoingDependencies(Aggregator aggr, boolean excludeSelf, boolean excludeExternals, boolean excludeExcluded, IDependencyKind... types)
Get a list of aggregated outgoing dependencies from this programming element.java.util.List<IAggregatedDependencyAccess>
getOutgoingDependencies(Aggregator aggr, boolean excludeSelf, boolean excludeExternals, IDependencyKind... types)
Get a list of aggregated outgoing dependencies from this programming element, excluding excluded elements.java.util.List<IAggregatedDependencyAccess>
getOutgoingDependencies(Aggregator aggr, boolean excludeSelf, IDependencyKind... types)
Get a list of aggregated outgoing dependencies from this programming element, including external elements, excluding excluded elements.java.util.List<IAggregatedDependencyAccess>
getOutgoingDependenciesRecursively(Aggregator aggr, boolean excludeSelf, boolean excludeExternals, boolean excludeExcluded, IDependencyKind... types)
Get a list of aggregated outgoing dependencies from this programming element and its direct and indirect children.java.util.List<IAggregatedDependencyAccess>
getOutgoingDependenciesRecursively(Aggregator aggr, boolean excludeSelf, boolean excludeExternals, IDependencyKind... types)
Get a list of aggregated outgoing dependencies from this programming element and its direct and indirect children, excluding excluded elements.java.util.List<IAggregatedDependencyAccess>
getOutgoingDependenciesRecursively(Aggregator aggr, boolean excludeSelf, IDependencyKind... types)
Get a list of aggregated outgoing dependencies from this programming element and its direct and indirect children, including external elements, excluding excluded elements.java.util.List<INamedElementAccess>
getReferencedElements(Aggregator aggr, boolean excludeSelf, boolean excludeExternals, boolean excludeExcluded, IDependencyKind... types)
Get a list of elements referenced from this programming element via dependencies.java.util.List<INamedElementAccess>
getReferencedElements(Aggregator aggr, boolean excludeSelf, boolean excludeExternals, IDependencyKind... types)
Get a list of elements referenced from this programming element via dependencies, excluding excluded elements.java.util.List<INamedElementAccess>
getReferencedElements(Aggregator aggr, boolean excludeSelf, IDependencyKind... types)
Get a list of elements referenced from this programming element via dependencies, including external elements, excluding excluded elements.java.util.List<INamedElementAccess>
getReferencedElementsRecursively(Aggregator aggr, boolean excludeSelf, boolean excludeExternals, boolean excludeExcluded, IDependencyKind... types)
Get a list of elements referenced from this programming element and its direct and indirect children via dependencies.java.util.List<INamedElementAccess>
getReferencedElementsRecursively(Aggregator aggr, boolean excludeSelf, boolean excludeExternals, IDependencyKind... types)
Get a list of elements referenced from this programming element and its direct and indirect children via dependencies, excluding excluded elements.java.util.List<INamedElementAccess>
getReferencedElementsRecursively(Aggregator aggr, boolean excludeSelf, IDependencyKind... types)
Get a list of elements referenced from this programming element and its direct and indirect children via dependencies, including external elements, excluding excluded elements.java.util.List<INamedElementAccess>
getReferencingElements(Aggregator aggr, boolean excludeSelf, boolean excludeExcluded, IDependencyKind... types)
Get a list of elements referencing this programming element via dependencies.java.util.List<INamedElementAccess>
getReferencingElements(Aggregator aggr, boolean excludeSelf, IDependencyKind... types)
Get a list of elements referencing this programming element via dependencies, excluding excluded elements.java.util.List<INamedElementAccess>
getReferencingElementsRecursively(Aggregator aggr, boolean excludeSelf, boolean excludeExcluded, IDependencyKind... types)
Get a list of elements referencing this programming element and its direct and indirect children via dependencies.java.util.List<INamedElementAccess>
getReferencingElementsRecursively(Aggregator aggr, boolean excludeSelf, IDependencyKind... types)
Get a list of elements referencing this programming element and its direct and indirect children via dependencies, excluding excluded elements.IDirectoryAccess
getRootDirectory()
Get the root directory of this programming element.ISourceFileAccess
getSourceFile()
Get the source file of this programming element.ILogicalNamespaceAccess
getSystemNamespace()
Get the system scope logical namespace for this element.boolean
isDefinedInEnclosingElement()
Return false for methods, that are called on the class, but are defined in a base class or base interface.-
Methods inherited from class com.hello2morrow.sonargraph.core.api.model.ElementAccess
equals, getChildren, getElement, getFullyQualifiedName, getIssueCount, getName, getNameWithSignature, getParent, getParent, getShortName, getShortNameWithSignature, hashCode, ignoreIssues, isExcluded, isExternal, setFactory, toString
-
Methods inherited from interface com.hello2morrow.sonargraph.api.model.IElementAccess
getName, getNameWithSignature, getShortName, getShortNameWithSignature, ignoreIssues, isExcluded, isExternal
-
Methods inherited from interface com.hello2morrow.sonargraph.api.model.INamedElementAccess
getChildren, getFullyQualifiedName, getIssueCount, getIssueCount, getParent, getParent
-
-
-
-
Method Detail
-
isDefinedInEnclosingElement
public final boolean isDefinedInEnclosingElement()
Return false for methods, that are called on the class, but are defined in a base class or base interface.- Specified by:
isDefinedInEnclosingElement
in interfaceIProgrammingElementAccess
- Returns:
- see above
-
getMetricLevel
public java.lang.Object getMetricLevel()
Description copied from class:ElementAccess
Internal use only- Overrides:
getMetricLevel
in classElementAccess<com.hello2morrow.sonargraph.core.model.programming.ProgrammingElement>
-
getModule
public final IModuleAccess getModule()
Get the module of this programming element.- Specified by:
getModule
in interfaceIProgrammingElementAccess
- Returns:
- see above
-
getSystemNamespace
public final ILogicalNamespaceAccess getSystemNamespace()
Get the system scope logical namespace for this element.- Specified by:
getSystemNamespace
in interfaceIProgrammingElementAccess
- Returns:
- see above or
null
if element is "external"
-
getModuleNamespace
public final ILogicalNamespaceAccess getModuleNamespace()
Get the module scope logical namespace for this element.- Specified by:
getModuleNamespace
in interfaceIProgrammingElementAccess
- Returns:
- see above or
null
if element is "external"
-
getRootDirectory
public final IDirectoryAccess getRootDirectory()
Get the root directory of this programming element.- Specified by:
getRootDirectory
in interfaceIProgrammingElementAccess
- Returns:
- see above
-
getDirectory
public final IDirectoryAccess getDirectory()
Get the directory of this programming element.- Specified by:
getDirectory
in interfaceIProgrammingElementAccess
- Returns:
- see above
-
getSourceFile
public final ISourceFileAccess getSourceFile()
Get the source file of this programming element.- Specified by:
getSourceFile
in interfaceIProgrammingElementAccess
- Returns:
- see above
-
getLineNumber
public final int getLineNumber()
Get the line number of this programming element.- Specified by:
getLineNumber
in interfaceIProgrammingElementAccess
- Returns:
- see above
-
getOutgoingDependencies
public final java.util.List<IAggregatedDependencyAccess> getOutgoingDependencies(Aggregator aggr, boolean excludeSelf, boolean excludeExternals, boolean excludeExcluded, IDependencyKind... types)
Get a list of aggregated outgoing dependencies from this programming element.- Specified by:
getOutgoingDependencies
in interfaceIProgrammingElementAccess
- Parameters:
aggr
- The desired aggregation levelexcludeSelf
- If true, dependencies to this element and its children are excludedexcludeExternals
- If true, dependencies to external objects are excludedexcludeExcluded
- If true, dependencies to excluded objects are excludedtypes
- List of dependency types, if empty return all dependencies- Returns:
- A list of aggregated outgoing dependencies
-
getOutgoingDependencies
public final java.util.List<IAggregatedDependencyAccess> getOutgoingDependencies(Aggregator aggr, boolean excludeSelf, boolean excludeExternals, IDependencyKind... types)
Get a list of aggregated outgoing dependencies from this programming element, excluding excluded elements.- Specified by:
getOutgoingDependencies
in interfaceIProgrammingElementAccess
- Parameters:
aggr
- The desired aggregation levelexcludeSelf
- If true, dependencies to this element and its children are excludedexcludeExternals
- If true, dependencies to external objects are excludedtypes
- List of dependency types, if empty return all dependencies- Returns:
- A list of aggregated outgoing dependencies
-
getOutgoingDependencies
public final java.util.List<IAggregatedDependencyAccess> getOutgoingDependencies(Aggregator aggr, boolean excludeSelf, IDependencyKind... types)
Get a list of aggregated outgoing dependencies from this programming element, including external elements, excluding excluded elements.- Specified by:
getOutgoingDependencies
in interfaceIProgrammingElementAccess
- Parameters:
aggr
- The desired aggregation levelexcludeSelf
- If true, dependencies to this element and its children are excludedtypes
- List of dependency types, if empty return all dependencies- Returns:
- A list of aggregated outgoing dependencies
-
getIncomingDependencies
public final java.util.List<IAggregatedDependencyAccess> getIncomingDependencies(Aggregator aggr, boolean excludeSelf, boolean excludeExcluded, IDependencyKind... types)
Get a list of aggregated incoming dependencies to this programming element.- Specified by:
getIncomingDependencies
in interfaceIProgrammingElementAccess
- Parameters:
aggr
- The desired aggregation levelexcludeSelf
- If true, dependencies from this element and its children are excludedexcludeExcluded
- If true, dependencies from excluded objects are excludedtypes
- List of dependency types, if empty return all dependencies- Returns:
- A list of aggregated incoming dependencies
-
getIncomingDependencies
public final java.util.List<IAggregatedDependencyAccess> getIncomingDependencies(Aggregator aggr, boolean excludeSelf, IDependencyKind... types)
Get a list of aggregated incoming dependencies to this programming element, excluding excluded elements.- Specified by:
getIncomingDependencies
in interfaceIProgrammingElementAccess
- Parameters:
aggr
- The desired aggregation levelexcludeSelf
- If true, dependencies from this element and its children are excludedtypes
- List of dependency types, if empty return all dependencies- Returns:
- A list of aggregated incoming dependencies
-
getOutgoingDependenciesRecursively
public final java.util.List<IAggregatedDependencyAccess> getOutgoingDependenciesRecursively(Aggregator aggr, boolean excludeSelf, boolean excludeExternals, boolean excludeExcluded, IDependencyKind... types)
Get a list of aggregated outgoing dependencies from this programming element and its direct and indirect children.- Specified by:
getOutgoingDependenciesRecursively
in interfaceINamedElementAccess
- Overrides:
getOutgoingDependenciesRecursively
in classElementAccess<com.hello2morrow.sonargraph.core.model.programming.ProgrammingElement>
- Parameters:
aggr
- The desired aggregation levelexcludeSelf
- If true, dependencies to this element and its children are excludedexcludeExternals
- If true, dependencies to external objects are excludedexcludeExcluded
- If true, dependencies to excluded objects are excludedtypes
- List of dependency types, if empty return all dependencies- Returns:
- A list of aggregated outgoing dependencies
-
getOutgoingDependenciesRecursively
public final java.util.List<IAggregatedDependencyAccess> getOutgoingDependenciesRecursively(Aggregator aggr, boolean excludeSelf, boolean excludeExternals, IDependencyKind... types)
Get a list of aggregated outgoing dependencies from this programming element and its direct and indirect children, excluding excluded elements.- Specified by:
getOutgoingDependenciesRecursively
in interfaceINamedElementAccess
- Overrides:
getOutgoingDependenciesRecursively
in classElementAccess<com.hello2morrow.sonargraph.core.model.programming.ProgrammingElement>
- Parameters:
aggr
- The desired aggregation levelexcludeSelf
- If true, dependencies to this element and its children are excludedexcludeExternals
- If true, dependencies to external objects are excludedtypes
- List of dependency types, if empty return all dependencies- Returns:
- A list of aggregated outgoing dependencies
-
getOutgoingDependenciesRecursively
public final java.util.List<IAggregatedDependencyAccess> getOutgoingDependenciesRecursively(Aggregator aggr, boolean excludeSelf, IDependencyKind... types)
Get a list of aggregated outgoing dependencies from this programming element and its direct and indirect children, including external elements, excluding excluded elements.- Specified by:
getOutgoingDependenciesRecursively
in interfaceINamedElementAccess
- Overrides:
getOutgoingDependenciesRecursively
in classElementAccess<com.hello2morrow.sonargraph.core.model.programming.ProgrammingElement>
- Parameters:
aggr
- The desired aggregation levelexcludeSelf
- If true, dependencies to this element and its children are excludedtypes
- List of dependency types, if empty return all dependencies- Returns:
- A list of aggregated outgoing dependencies
-
getIncomingDependenciesRecursively
public final java.util.List<IAggregatedDependencyAccess> getIncomingDependenciesRecursively(Aggregator aggr, boolean excludeSelf, boolean excludeExcluded, IDependencyKind... types)
Get a list of aggregated incoming dependencies to this programming element and its direct and indirect children.- Specified by:
getIncomingDependenciesRecursively
in interfaceINamedElementAccess
- Overrides:
getIncomingDependenciesRecursively
in classElementAccess<com.hello2morrow.sonargraph.core.model.programming.ProgrammingElement>
- Parameters:
aggr
- The desired aggregation levelexcludeSelf
- If true, dependencies from this element and its children are excludedexcludeExcluded
- If true, dependencies from excluded objects are excludedtypes
- List of dependency types, if empty return all dependencies- Returns:
- A list of aggregated outgoing dependencies
-
getIncomingDependenciesRecursively
public final java.util.List<IAggregatedDependencyAccess> getIncomingDependenciesRecursively(Aggregator aggr, boolean excludeSelf, IDependencyKind... types)
Get a list of aggregated incoming dependencies to this programming element and its direct and indirect children, excluding excluded elements.- Specified by:
getIncomingDependenciesRecursively
in interfaceINamedElementAccess
- Overrides:
getIncomingDependenciesRecursively
in classElementAccess<com.hello2morrow.sonargraph.core.model.programming.ProgrammingElement>
- Parameters:
aggr
- The desired aggregation levelexcludeSelf
- If true, dependencies from this element and its children are excludedtypes
- List of dependency types, if empty return all dependencies- Returns:
- A list of aggregated outgoing dependencies
-
getReferencedElements
public final java.util.List<INamedElementAccess> getReferencedElements(Aggregator aggr, boolean excludeSelf, boolean excludeExternals, boolean excludeExcluded, IDependencyKind... types)
Get a list of elements referenced from this programming element via dependencies.- Specified by:
getReferencedElements
in interfaceIProgrammingElementAccess
- Parameters:
aggr
- The desired aggregation levelexcludeSelf
- If true, this element and its children are excluded from the resultexcludeExternals
- If true, external elements are excludedexcludeExcluded
- If true, excluded elements are excludedtypes
- List of dependency types, if empty return all dependencies- Returns:
- A list of elements referenced from this element
-
getReferencedElements
public final java.util.List<INamedElementAccess> getReferencedElements(Aggregator aggr, boolean excludeSelf, boolean excludeExternals, IDependencyKind... types)
Get a list of elements referenced from this programming element via dependencies, excluding excluded elements.- Specified by:
getReferencedElements
in interfaceIProgrammingElementAccess
- Parameters:
aggr
- The desired aggregation levelexcludeSelf
- If true, this element and its children are excluded from the resultexcludeExternals
- If true, external elements are excludedtypes
- List of dependency types, if empty return all dependencies- Returns:
- A list of elements referenced from this element
-
getReferencedElements
public final java.util.List<INamedElementAccess> getReferencedElements(Aggregator aggr, boolean excludeSelf, IDependencyKind... types)
Get a list of elements referenced from this programming element via dependencies, including external elements, excluding excluded elements.- Specified by:
getReferencedElements
in interfaceIProgrammingElementAccess
- Parameters:
aggr
- The desired aggregation levelexcludeSelf
- If true, this element and its children are excluded from the resulttypes
- List of dependency types, if empty return all dependencies- Returns:
- A list of elements referenced from this element
-
getReferencingElements
public final java.util.List<INamedElementAccess> getReferencingElements(Aggregator aggr, boolean excludeSelf, boolean excludeExcluded, IDependencyKind... types)
Get a list of elements referencing this programming element via dependencies.- Specified by:
getReferencingElements
in interfaceIProgrammingElementAccess
- Parameters:
aggr
- The desired aggregation levelexcludeSelf
- If true, this element and its children are excluded from the resultexcludeExcluded
- If true, excluded elements are excludedtypes
- List of dependency types, if empty return all dependencies- Returns:
- A list of elements referencing this element
-
getReferencingElements
public final java.util.List<INamedElementAccess> getReferencingElements(Aggregator aggr, boolean excludeSelf, IDependencyKind... types)
Get a list of elements referencing this programming element via dependencies, excluding excluded elements.- Specified by:
getReferencingElements
in interfaceIProgrammingElementAccess
- Parameters:
aggr
- The desired aggregation levelexcludeSelf
- If true, this element and its children are excluded from the resulttypes
- List of dependency types, if empty return all dependencies- Returns:
- A list of elements referencing this element
-
getReferencedElementsRecursively
public final java.util.List<INamedElementAccess> getReferencedElementsRecursively(Aggregator aggr, boolean excludeSelf, boolean excludeExternals, boolean excludeExcluded, IDependencyKind... types)
Get a list of elements referenced from this programming element and its direct and indirect children via dependencies.- Specified by:
getReferencedElementsRecursively
in interfaceINamedElementAccess
- Overrides:
getReferencedElementsRecursively
in classElementAccess<com.hello2morrow.sonargraph.core.model.programming.ProgrammingElement>
- Parameters:
aggr
- The desired aggregation levelexcludeSelf
- If true, this element and its children are excluded from the resultexcludeExternals
- If true, external elements are excludedexcludeExcluded
- If true, excluded elements are excludedtypes
- List of dependency types, if empty return all dependencies- Returns:
- A list of elements referenced from this element
-
getReferencedElementsRecursively
public final java.util.List<INamedElementAccess> getReferencedElementsRecursively(Aggregator aggr, boolean excludeSelf, boolean excludeExternals, IDependencyKind... types)
Get a list of elements referenced from this programming element and its direct and indirect children via dependencies, excluding excluded elements.- Specified by:
getReferencedElementsRecursively
in interfaceINamedElementAccess
- Overrides:
getReferencedElementsRecursively
in classElementAccess<com.hello2morrow.sonargraph.core.model.programming.ProgrammingElement>
- Parameters:
aggr
- The desired aggregation levelexcludeSelf
- If true, this element and its children are excluded from the resultexcludeExternals
- If true, external elements are excludedtypes
- List of dependency types, if empty return all dependencies- Returns:
- A list of elements referenced from this element
-
getReferencedElementsRecursively
public final java.util.List<INamedElementAccess> getReferencedElementsRecursively(Aggregator aggr, boolean excludeSelf, IDependencyKind... types)
Get a list of elements referenced from this programming element and its direct and indirect children via dependencies, including external elements, excluding excluded elements.- Specified by:
getReferencedElementsRecursively
in interfaceINamedElementAccess
- Overrides:
getReferencedElementsRecursively
in classElementAccess<com.hello2morrow.sonargraph.core.model.programming.ProgrammingElement>
- Parameters:
aggr
- The desired aggregation levelexcludeSelf
- If true, this element and its children are excluded from the resulttypes
- List of dependency types, if empty return all dependencies- Returns:
- A list of elements referenced from this element
-
getReferencingElementsRecursively
public final java.util.List<INamedElementAccess> getReferencingElementsRecursively(Aggregator aggr, boolean excludeSelf, boolean excludeExcluded, IDependencyKind... types)
Get a list of elements referencing this programming element and its direct and indirect children via dependencies.- Specified by:
getReferencingElementsRecursively
in interfaceINamedElementAccess
- Overrides:
getReferencingElementsRecursively
in classElementAccess<com.hello2morrow.sonargraph.core.model.programming.ProgrammingElement>
- Parameters:
aggr
- The desired aggregation levelexcludeSelf
- If true, this element and its children are excluded from the resultexcludeExcluded
- If true, excluded elements are excludedtypes
- List of dependency types, if empty return all dependencies- Returns:
- A list of elements referencing this element
-
getReferencingElementsRecursively
public final java.util.List<INamedElementAccess> getReferencingElementsRecursively(Aggregator aggr, boolean excludeSelf, IDependencyKind... types)
Get a list of elements referencing this programming element and its direct and indirect children via dependencies, excluding excluded elements.- Specified by:
getReferencingElementsRecursively
in interfaceINamedElementAccess
- Overrides:
getReferencingElementsRecursively
in classElementAccess<com.hello2morrow.sonargraph.core.model.programming.ProgrammingElement>
- Parameters:
aggr
- The desired aggregation levelexcludeSelf
- If true, this element and its children are excluded from the resulttypes
- List of dependency types, if empty return all dependencies- Returns:
- A list of elements referencing this element
-
accept
public void accept(INamedElementAccess.INamedElementAccessVisitor visitor)
Internal- Specified by:
accept
in interfaceINamedElementAccess
- Overrides:
accept
in classElementAccess<com.hello2morrow.sonargraph.core.model.programming.ProgrammingElement>
- Parameters:
visitor
- The visitor implementation
-
-