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 voidaccept(INamedElementAccess.INamedElementAccessVisitor visitor)Internaljava.lang.NumbergetAverageComplexityMetric()java.lang.NumbergetAverageNestingMetric()java.util.List<? extends IFieldAccess>getFields()java.lang.NumbergetLCOM4Metric()java.lang.NumbergetMaxNestingMetric()java.util.List<? extends IMethodAccess>getMethods()Get a list of all methods in this type.java.lang.ObjectgetMetricLevel()Internal use onlyjava.lang.NumbergetNumberOfStatementsMetric()java.lang.NumbergetSourceElementCountMetric()booleanisAbstract()booleanisAnonymous()booleanisClass()booleanisInterface()booleanisNested()booleantypeOf(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:ElementAccessInternal use only- Overrides:
getMetricLevelin classProgrammingElementAccess
-
isAbstract
public boolean isAbstract()
- Specified by:
isAbstractin interfaceITypeAccess- Returns:
- true, if this is an abstract type.
-
isAnonymous
public boolean isAnonymous()
- Specified by:
isAnonymousin interfaceITypeAccess- Returns:
- true, if this is an anonymous type.
-
isNested
public boolean isNested()
- Specified by:
isNestedin interfaceITypeAccess- Returns:
- true, if this is a nested type.
-
isInterface
public boolean isInterface()
- Specified by:
isInterfacein interfaceITypeAccess- Returns:
- true, if this is an interface.
-
isClass
public boolean isClass()
- Specified by:
isClassin interfaceITypeAccess- Returns:
- true, if this is a class.
-
getNumberOfStatementsMetric
public java.lang.Number getNumberOfStatementsMetric()
- Specified by:
getNumberOfStatementsMetricin interfaceITypeAccess- Returns:
- the metric or 'null' if not available
-
getSourceElementCountMetric
public java.lang.Number getSourceElementCountMetric()
- Specified by:
getSourceElementCountMetricin interfaceITypeAccess- Returns:
- the metric or 'null' if not available
-
getLCOM4Metric
public java.lang.Number getLCOM4Metric()
- Specified by:
getLCOM4Metricin interfaceITypeAccess- Returns:
- the metric or 'null' if not available
-
getMaxNestingMetric
public java.lang.Number getMaxNestingMetric()
- Specified by:
getMaxNestingMetricin interfaceITypeAccess- Returns:
- the metric or 'null' if not available
-
getAverageComplexityMetric
public java.lang.Number getAverageComplexityMetric()
- Specified by:
getAverageComplexityMetricin interfaceITypeAccess- Returns:
- the metric or 'null' if not available
-
getAverageNestingMetric
public java.lang.Number getAverageNestingMetric()
- Specified by:
getAverageNestingMetricin interfaceITypeAccess
-
getMethods
public java.util.List<? extends IMethodAccess> getMethods()
Get a list of all methods in this type.- Specified by:
getMethodsin interfaceITypeAccess- Returns:
- see above
-
getFields
public java.util.List<? extends IFieldAccess> getFields()
- Specified by:
getFieldsin 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:
typeOfin 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:
acceptin interfaceINamedElementAccess- Overrides:
acceptin classProgrammingElementAccess- Parameters:
visitor- The visitor implementation
-
-