Class TypeAccess
- java.lang.Object
-
- com.hello2morrow.sonargraph.core.api.model.ElementAccess<com.hello2morrow.sonargraph.core.model.programming.ProgrammingElement>
-
- com.hello2morrow.sonargraph.core.api.model.ProgrammingElementAccess
-
- com.hello2morrow.sonargraph.core.api.model.TypeAccess
-
- All Implemented Interfaces:
IElementAccess
,INamedElementAccess
,IProgrammingElementAccess
,ITypeAccess
- Direct Known Subclasses:
CppTypeAccess
,CSharpTypeAccess
,GenericClassAccess
,JavaTypeAccess
public class TypeAccess extends ProgrammingElementAccess implements ITypeAccess
An access object for structured types.
-
-
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
-
Nested classes/interfaces inherited from interface com.hello2morrow.sonargraph.api.model.ITypeAccess
ITypeAccess.IVisitor
-
-
Constructor Summary
Constructors Constructor Description TypeAccess(com.hello2morrow.sonargraph.core.model.programming.IType element)
Internal use only
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
accept(INamedElementAccess.INamedElementAccessVisitor visitor)
Internaljava.lang.Number
getAverageComplexityMetric()
java.lang.Number
getAverageNestingMetric()
java.util.List<? extends IFieldAccess>
getFields()
java.lang.Number
getLCOM4Metric()
java.lang.Number
getMaxNestingMetric()
java.util.List<? extends IMethodAccess>
getMethods()
Get a list of all methods in this type.java.lang.Object
getMetricLevel()
Internal use onlyjava.lang.Number
getNumberOfStatementsMetric()
java.lang.Number
getSourceElementCountMetric()
boolean
isAbstract()
boolean
isAnonymous()
boolean
isClass()
boolean
isInterface()
boolean
isNested()
boolean
typeOf(java.lang.String fqName)
Checks if the type is the same or a subclass of the given fully qualified name.-
Methods inherited from class com.hello2morrow.sonargraph.core.api.model.ProgrammingElementAccess
getDirectory, getIncomingDependencies, getIncomingDependencies, getIncomingDependenciesRecursively, getIncomingDependenciesRecursively, getLineNumber, getModule, getModuleNamespace, getOutgoingDependencies, getOutgoingDependencies, getOutgoingDependencies, getOutgoingDependenciesRecursively, getOutgoingDependenciesRecursively, getOutgoingDependenciesRecursively, getReferencedElements, getReferencedElements, getReferencedElements, getReferencedElementsRecursively, getReferencedElementsRecursively, getReferencedElementsRecursively, getReferencingElements, getReferencingElements, getReferencingElementsRecursively, getReferencingElementsRecursively, getRootDirectory, getSourceFile, getSystemNamespace, isDefinedInEnclosingElement
-
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, getIncomingDependenciesRecursively, getIncomingDependenciesRecursively, getIssueCount, getIssueCount, getOutgoingDependenciesRecursively, getOutgoingDependenciesRecursively, getOutgoingDependenciesRecursively, getParent, getParent, getReferencedElementsRecursively, getReferencedElementsRecursively, getReferencedElementsRecursively, getReferencingElementsRecursively, getReferencingElementsRecursively
-
Methods inherited from interface com.hello2morrow.sonargraph.api.model.IProgrammingElementAccess
getDirectory, getIncomingDependencies, getIncomingDependencies, getLineNumber, getModule, getModuleNamespace, getOutgoingDependencies, getOutgoingDependencies, getOutgoingDependencies, getReferencedElements, getReferencedElements, getReferencedElements, getReferencingElements, getReferencingElements, getRootDirectory, getSourceFile, getSystemNamespace, isDefinedInEnclosingElement
-
-
-
-
Method Detail
-
getMetricLevel
public java.lang.Object getMetricLevel()
Description copied from class:ElementAccess
Internal use only- Overrides:
getMetricLevel
in classProgrammingElementAccess
-
isAbstract
public boolean isAbstract()
- Specified by:
isAbstract
in interfaceITypeAccess
- Returns:
- true, if this is an abstract type.
-
isAnonymous
public boolean isAnonymous()
- Specified by:
isAnonymous
in interfaceITypeAccess
- Returns:
- true, if this is an anonymous type.
-
isNested
public boolean isNested()
- Specified by:
isNested
in interfaceITypeAccess
- Returns:
- true, if this is a nested type.
-
isInterface
public boolean isInterface()
- Specified by:
isInterface
in interfaceITypeAccess
- Returns:
- true, if this is an interface.
-
isClass
public boolean isClass()
- Specified by:
isClass
in interfaceITypeAccess
- Returns:
- true, if this is a class.
-
getNumberOfStatementsMetric
public java.lang.Number getNumberOfStatementsMetric()
- Specified by:
getNumberOfStatementsMetric
in interfaceITypeAccess
- Returns:
- the metric or 'null' if not available
-
getSourceElementCountMetric
public java.lang.Number getSourceElementCountMetric()
- Specified by:
getSourceElementCountMetric
in interfaceITypeAccess
- Returns:
- the metric or 'null' if not available
-
getLCOM4Metric
public java.lang.Number getLCOM4Metric()
- Specified by:
getLCOM4Metric
in interfaceITypeAccess
- Returns:
- the metric or 'null' if not available
-
getMaxNestingMetric
public java.lang.Number getMaxNestingMetric()
- Specified by:
getMaxNestingMetric
in interfaceITypeAccess
- Returns:
- the metric or 'null' if not available
-
getAverageComplexityMetric
public java.lang.Number getAverageComplexityMetric()
- Specified by:
getAverageComplexityMetric
in interfaceITypeAccess
- Returns:
- the metric or 'null' if not available
-
getAverageNestingMetric
public java.lang.Number getAverageNestingMetric()
- Specified by:
getAverageNestingMetric
in interfaceITypeAccess
-
getMethods
public java.util.List<? extends IMethodAccess> getMethods()
Get a list of all methods in this type.- Specified by:
getMethods
in interfaceITypeAccess
- Returns:
- see above
-
getFields
public java.util.List<? extends IFieldAccess> getFields()
- Specified by:
getFields
in interfaceITypeAccess
- Returns:
- a list of all fields in this type.
-
typeOf
public boolean typeOf(java.lang.String fqName)
Checks if the type is the same or a subclass of the given fully qualified name.- Specified by:
typeOf
in interfaceITypeAccess
- Parameters:
fqName
- fully qualified name- Returns:
- true if this type is a subclass of the given fq name, false if not.
-
accept
public void accept(INamedElementAccess.INamedElementAccessVisitor visitor)
Internal- Specified by:
accept
in interfaceINamedElementAccess
- Overrides:
accept
in classProgrammingElementAccess
- Parameters:
visitor
- The visitor implementation
-
-