TypeIntersectionType, ParametrizedTypeJavaType, UnknownTypepublic class ClassJavaType extends JavaType
Type.ArrayType, Type.Primitives| Modifier | Constructor | Description |
|---|---|---|
protected |
ClassJavaType(int tag,
JavaSymbol.TypeJavaSymbol symbol) |
|
|
ClassJavaType(JavaSymbol.TypeJavaSymbol symbol) |
| Modifier and Type | Method | Description |
|---|---|---|
Set<ClassJavaType> |
directSuperTypes() |
|
ClassJavaType |
getSuperType() |
|
boolean |
is(String fullyQualifiedName) |
Check whether a type is the one designed by the fully qualified name.
|
boolean |
isSubtypeOf(String fullyQualifiedName) |
Check whether a type is a subtype of the one designed by the fully qualified name.
|
boolean |
isSubtypeOf(Type superType) |
Check whether a type is a subtype of another.
|
protected ClassJavaType |
substitutedType(ClassJavaType type) |
|
Set<ClassJavaType> |
superTypes() |
erasure, fullyQualifiedName, getSymbol, isArray, isClass, isNumerical, isParameterized, isPrimitive, isPrimitive, isPrimitiveWrapper, isTagged, isUnknown, isVoid, name, primitiveType, primitiveWrapperType, symbol, toStringpublic ClassJavaType(JavaSymbol.TypeJavaSymbol symbol)
protected ClassJavaType(int tag,
JavaSymbol.TypeJavaSymbol symbol)
public boolean is(String fullyQualifiedName)
Type
Type type;
type.is("int");
type.is("int[]");
type.is("java.lang.String[]");
type.is("java.lang.Object");
public boolean isSubtypeOf(String fullyQualifiedName)
Type
This method will consider implemented interfaces as well as superclasses.
Type type;
type.isSubtypeOf("Object[]");
type.isSubtypeOf("org.mypackage.MyClass");
type.isSubtypeOf("org.mypackage.MyInterface");
type.isSubtypeOf("java.lang.Object");
isSubtypeOf in interface TypeisSubtypeOf in class JavaTypefullyQualifiedName - fully qualified name to check in the type hierarchy. Use "[]" for arrays.public boolean isSubtypeOf(Type superType)
Type
This method will consider implemented interfaces as well as superclasses.
Type type, myOtherType;
type.isSubtypeOf(myOtherType);
isSubtypeOf in interface TypeisSubtypeOf in class JavaTypesuperType - instance of a potential superType.public Set<ClassJavaType> directSuperTypes()
directSuperTypes in class JavaType@CheckForNull public ClassJavaType getSuperType()
getSuperType in class JavaTypeprotected ClassJavaType substitutedType(ClassJavaType type)
public Set<ClassJavaType> superTypes()
Copyright © 2012–2018 SonarSource. All rights reserved.