Package org.sonar.java.resolve
Class UnknownType
- java.lang.Object
-
- org.sonar.java.resolve.JavaType
-
- org.sonar.java.resolve.ClassJavaType
-
- org.sonar.java.resolve.UnknownType
-
- All Implemented Interfaces:
Type
public class UnknownType extends ClassJavaType
-
-
Nested Class Summary
-
Nested classes/interfaces inherited from interface org.sonar.plugins.java.api.semantic.Type
Type.ArrayType, Type.Primitives
-
-
Constructor Summary
Constructors Constructor Description UnknownType(JavaSymbol.TypeJavaSymbol symbol)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description booleanisSubtypeOf(String fullyQualifiedName)Check whether a type is a subtype of the one designed by the fully qualified name.booleanisSubtypeOf(Type superType)Check whether a type is a subtype of another.booleanisUnknown()Check if this type has been resolved.StringtoString()-
Methods inherited from class org.sonar.java.resolve.ClassJavaType
directSuperTypes, getSuperType, is, substitutedType, superTypes
-
Methods inherited from class org.sonar.java.resolve.JavaType
erasure, fullyQualifiedName, getSymbol, isArray, isClass, isNumerical, isParameterized, isPrimitive, isPrimitive, isPrimitiveWrapper, isTagged, isVoid, name, primitiveType, primitiveWrapperType, symbol
-
-
-
-
Constructor Detail
-
UnknownType
public UnknownType(JavaSymbol.TypeJavaSymbol symbol)
-
-
Method Detail
-
isSubtypeOf
public boolean isSubtypeOf(String fullyQualifiedName)
Description copied from interface:TypeCheck whether a type is a subtype of the one designed by the fully qualified name.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");- Specified by:
isSubtypeOfin interfaceType- Overrides:
isSubtypeOfin classClassJavaType- Parameters:
fullyQualifiedName- fully qualified name to check in the type hierarchy. Use "[]" for arrays.- Returns:
- true if the type is the one passed in parameter or have this type in its hierarchy. false otherwise.
-
isSubtypeOf
public boolean isSubtypeOf(Type superType)
Description copied from interface:TypeCheck whether a type is a subtype of another.This method will consider implemented interfaces as well as superclasses.
Type type, myOtherType; type.isSubtypeOf(myOtherType);
- Specified by:
isSubtypeOfin interfaceType- Overrides:
isSubtypeOfin classClassJavaType- Parameters:
superType- instance of a potential superType.- Returns:
- true if types are equivalent or if the one passed in parameter is in the hierarchy. false otherwise.
-
isUnknown
public boolean isUnknown()
Description copied from interface:TypeCheck if this type has been resolved. Type can be unknown in incomplete part of Semantic Analysis or when bytecode for a type is not provided and a method cannot be resolved.
-
-