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 voidaccept(INamedElementAccess.INamedElementAccessVisitor visitor)InternalIDirectoryAccessgetDirectory()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.intgetLineNumber()Get the line number of this programming element.java.lang.ObjectgetMetricLevel()Internal use onlyIModuleAccessgetModule()Get the module of this programming element.ILogicalNamespaceAccessgetModuleNamespace()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.IDirectoryAccessgetRootDirectory()Get the root directory of this programming element.ISourceFileAccessgetSourceFile()Get the source file of this programming element.ILogicalNamespaceAccessgetSystemNamespace()Get the system scope logical namespace for this element.booleanisDefinedInEnclosingElement()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:
isDefinedInEnclosingElementin interfaceIProgrammingElementAccess- Returns:
- see above
-
getMetricLevel
public java.lang.Object getMetricLevel()
Description copied from class:ElementAccessInternal use only- Overrides:
getMetricLevelin classElementAccess<com.hello2morrow.sonargraph.core.model.programming.ProgrammingElement>
-
getModule
public final IModuleAccess getModule()
Get the module of this programming element.- Specified by:
getModulein interfaceIProgrammingElementAccess- Returns:
- see above
-
getSystemNamespace
public final ILogicalNamespaceAccess getSystemNamespace()
Get the system scope logical namespace for this element.- Specified by:
getSystemNamespacein interfaceIProgrammingElementAccess- Returns:
- see above or
nullif element is "external"
-
getModuleNamespace
public final ILogicalNamespaceAccess getModuleNamespace()
Get the module scope logical namespace for this element.- Specified by:
getModuleNamespacein interfaceIProgrammingElementAccess- Returns:
- see above or
nullif element is "external"
-
getRootDirectory
public final IDirectoryAccess getRootDirectory()
Get the root directory of this programming element.- Specified by:
getRootDirectoryin interfaceIProgrammingElementAccess- Returns:
- see above
-
getDirectory
public final IDirectoryAccess getDirectory()
Get the directory of this programming element.- Specified by:
getDirectoryin interfaceIProgrammingElementAccess- Returns:
- see above
-
getSourceFile
public final ISourceFileAccess getSourceFile()
Get the source file of this programming element.- Specified by:
getSourceFilein interfaceIProgrammingElementAccess- Returns:
- see above
-
getLineNumber
public final int getLineNumber()
Get the line number of this programming element.- Specified by:
getLineNumberin 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:
getOutgoingDependenciesin 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:
getOutgoingDependenciesin 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:
getOutgoingDependenciesin 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:
getIncomingDependenciesin 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:
getIncomingDependenciesin 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:
getOutgoingDependenciesRecursivelyin interfaceINamedElementAccess- Overrides:
getOutgoingDependenciesRecursivelyin 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:
getOutgoingDependenciesRecursivelyin interfaceINamedElementAccess- Overrides:
getOutgoingDependenciesRecursivelyin 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:
getOutgoingDependenciesRecursivelyin interfaceINamedElementAccess- Overrides:
getOutgoingDependenciesRecursivelyin 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:
getIncomingDependenciesRecursivelyin interfaceINamedElementAccess- Overrides:
getIncomingDependenciesRecursivelyin 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:
getIncomingDependenciesRecursivelyin interfaceINamedElementAccess- Overrides:
getIncomingDependenciesRecursivelyin 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:
getReferencedElementsin 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:
getReferencedElementsin 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:
getReferencedElementsin 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:
getReferencingElementsin 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:
getReferencingElementsin 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:
getReferencedElementsRecursivelyin interfaceINamedElementAccess- Overrides:
getReferencedElementsRecursivelyin 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:
getReferencedElementsRecursivelyin interfaceINamedElementAccess- Overrides:
getReferencedElementsRecursivelyin 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:
getReferencedElementsRecursivelyin interfaceINamedElementAccess- Overrides:
getReferencedElementsRecursivelyin 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:
getReferencingElementsRecursivelyin interfaceINamedElementAccess- Overrides:
getReferencingElementsRecursivelyin 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:
getReferencingElementsRecursivelyin interfaceINamedElementAccess- Overrides:
getReferencingElementsRecursivelyin 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:
acceptin interfaceINamedElementAccess- Overrides:
acceptin classElementAccess<com.hello2morrow.sonargraph.core.model.programming.ProgrammingElement>- Parameters:
visitor- The visitor implementation
-
-