public class PsiPrimitiveType extends PsiType.Stub implements JvmPrimitiveType
PsiType.Stub
Constructor and Description |
---|
PsiPrimitiveType(JvmPrimitiveTypeKind kind,
PsiAnnotation [] annotations) |
PsiPrimitiveType(JvmPrimitiveTypeKind kind,
TypeAnnotationProvider provider) |
PsiPrimitiveType(java.lang.String name,
PsiAnnotation [] annotations)
Deprecated.
please don't use
PsiPrimitiveType to represent fake types |
PsiPrimitiveType(java.lang.String name,
TypeAnnotationProvider provider) |
Modifier and Type | Method and Description |
---|---|
<A> A |
accept(PsiTypeVisitor<A> visitor)
Passes the type to the specified visitor.
|
PsiPrimitiveType |
annotate(TypeAnnotationProvider provider) |
boolean |
equals(java.lang.Object obj) |
boolean |
equalsToText(java.lang.String text)
Checks if the specified string is equivalent to the canonical text of the type.
|
static java.util.Collection<java.lang.String> |
getAllBoxedTypeNames()
Deprecated.
please use
JvmPrimitiveTypeKind.getBoxedFqns() |
PsiClassType |
getBoxedType(PsiElement context)
Returns a boxed class type corresponding to the primitive type.
|
PsiClassType |
getBoxedType(PsiManager manager,
GlobalSearchScope resolveScope) |
java.lang.String |
getBoxedTypeName()
This method is nullable since
PsiType.NULL has no FQN.Consider using JvmPrimitiveTypeKind.getBoxedFqn() if you know the type you need to get FQN of,
e.g. |
java.lang.String |
getCanonicalText(boolean annotated)
Returns canonical representation of the type (all references fully-qualified).
|
java.lang.String |
getInternalCanonicalText()
Return canonical text of the type with some internal details added for presentational purposes.
|
JvmPrimitiveTypeKind |
getKind() |
java.lang.String |
getName() |
static PsiPrimitiveType |
getOptionallyUnboxedType(PsiType type) |
java.lang.String |
getPresentableText(boolean annotated)
Returns text of the type that can be presented to a user (references normally non-qualified).
|
GlobalSearchScope |
getResolveScope()
Returns the scope in which the reference to the underlying class of a class type is searched.
|
PsiType [] |
getSuperTypes()
Returns the list of superclass types for a class type.
|
static PsiPrimitiveType |
getUnboxedType(PsiType type)
Returns the primitive type corresponding to a boxed class type.
|
int |
hashCode() |
boolean |
isValid()
Always returns true.
|
getCanonicalText, getPresentableText
addAnnotation, createArray, createArrayType, createArrayType, findAnnotation, getAnnotationProvider, getAnnotations, getApplicableAnnotations, getArrayDimensions, getDeepComponentType, getJavaLangClass, getJavaLangError, getJavaLangObject, getJavaLangRuntimeException, getJavaLangString, getJavaLangThrowable, getTypeByName, isAssignableFrom, isConvertibleFrom, toString
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
accept
getAnnotations
hasAnnotation
public PsiPrimitiveType(JvmPrimitiveTypeKind kind, PsiAnnotation [] annotations)
public PsiPrimitiveType(JvmPrimitiveTypeKind kind, TypeAnnotationProvider provider)
public PsiPrimitiveType(java.lang.String name, TypeAnnotationProvider provider)
name
- valid primitive name
, or NoSuchElementException will be thrown@Deprecated public PsiPrimitiveType(java.lang.String name, PsiAnnotation [] annotations)
PsiPrimitiveType
to represent fake typespublic final JvmPrimitiveTypeKind getKind()
getKind
in interface JvmPrimitiveType
public java.lang.String getName()
public PsiPrimitiveType annotate(TypeAnnotationProvider provider)
public java.lang.String getPresentableText(boolean annotated)
PsiType
getPresentableText
in class PsiType.Stub
public java.lang.String getCanonicalText(boolean annotated)
PsiType
getCanonicalText
in class PsiType.Stub
public java.lang.String getInternalCanonicalText()
PsiType
getInternalCanonicalText
in class PsiType
public boolean isValid()
isValid
in class PsiType
PsiElement.isValid()
public boolean equalsToText(java.lang.String text)
PsiType
equalsToText
in class PsiType
text
- the text to compare with.public <A> A accept(PsiTypeVisitor<A> visitor)
PsiType
public GlobalSearchScope getResolveScope()
PsiType
getResolveScope
in class PsiType
public PsiType [] getSuperTypes()
PsiType
getSuperTypes
in class PsiType
public static PsiPrimitiveType getUnboxedType(PsiType type)
type
- the type to get the unboxed primitive type for.public static PsiPrimitiveType getOptionallyUnboxedType(PsiType type)
public java.lang.String getBoxedTypeName()
PsiType.NULL
has no FQN.JvmPrimitiveTypeKind.getBoxedFqn()
if you know the type you need to get FQN of,
e.g. instead of PsiType.INT.getBoxedTypeName()
use JvmPrimitiveTypeKind.INT.getBoxedFqn()
.JvmPrimitiveTypeKind.getBoxedFqn()
public PsiClassType getBoxedType(PsiElement context)
context
- where this boxed type is to be usedpublic PsiClassType getBoxedType(PsiManager manager, GlobalSearchScope resolveScope)
@Deprecated public static java.util.Collection<java.lang.String> getAllBoxedTypeNames()
JvmPrimitiveTypeKind.getBoxedFqns()
public int hashCode()
hashCode
in class java.lang.Object
public boolean equals(java.lang.Object obj)
equals
in class java.lang.Object