public abstract class JType extends JNode implements HasName, CanBeFinal
HasName.Util
Modifier and Type | Field and Description |
---|---|
protected String |
name |
BY_NAME_COMPARATOR
Constructor and Description |
---|
JType(SourceInfo info,
String name)
Base type for AST type definitions.
|
Modifier and Type | Method and Description |
---|---|
abstract boolean |
canBeImplementedExternally() |
abstract boolean |
canBeNull()
Returns
true if it's possible for this type to be
null . |
abstract boolean |
canBeReferencedExternally() |
abstract boolean |
canBeSubclass()
Returns
true if it's possible for this type to be
a subclass of the type denoted with this type. |
String[] |
getCompoundName()
Returns the compound name.
|
abstract JLiteral |
getDefaultValue() |
String |
getDescription()
Returns a customized description to be used by
ToStringGenerationVisitor . |
abstract String |
getJavahSignatureName() |
abstract String |
getJsniSignatureName() |
String |
getName()
Binary name of the type.
|
String |
getPackageName() |
String |
getShortName() |
JType |
getUnderlyingType()
If this type is a non-null type, returns the underlying (original) type.
|
abstract boolean |
isArrayType() |
abstract JEnumType |
isEnumOrSubclass()
Returns the (closest) enum supertype if the type is a subclass of an enum; it returns
this if this is a JEnumType and null otherwise. |
boolean |
isExternal()
True if this class is provided externally to the program by the program's
host execution environment.
|
abstract boolean |
isJavaLangObject() |
abstract boolean |
isJsFunction() |
abstract boolean |
isJsFunctionImplementation() |
abstract boolean |
isJsNative() |
abstract boolean |
isJsoType()
Returns
true if this is a JavaScriptObject type. |
abstract boolean |
isJsType() |
boolean |
isNullType()
Returns
true if this is JReferenceType.JNullType.INSTANCE . |
abstract boolean |
isPrimitiveType() |
boolean |
replaces(JType originalType)
Checks type replacement from an external type to a resolved canonical type.
|
abstract JType |
strengthenToNonNull()
Returns a non nullable version of this type if possible.
|
getSourceInfo, setSourceInfo, toSource, toString, traverse
isFinal
protected final String name
public JType(SourceInfo info, String name)
info
- tracks the source file origin of this type through compilation.name
- binary name of the type.public abstract boolean canBeNull()
true
if it's possible for this type to be
null
.JAnalysisDecoratedType
public abstract boolean isArrayType()
public abstract boolean isPrimitiveType()
public boolean isNullType()
true
if this is JReferenceType.JNullType.INSTANCE
.public abstract boolean isJsType()
public abstract boolean isJsFunction()
public abstract boolean isJsFunctionImplementation()
public abstract boolean isJsNative()
public abstract boolean canBeImplementedExternally()
public abstract boolean canBeReferencedExternally()
public abstract boolean isJavaLangObject()
public abstract boolean isJsoType()
true
if this is a JavaScriptObject type.public abstract boolean canBeSubclass()
true
if it's possible for this type to be
a subclass of the type denoted with this type.JAnalysisDecoratedType
public abstract JType strengthenToNonNull()
JAnalysisDecoratedType
public abstract JLiteral getDefaultValue()
public abstract String getJavahSignatureName()
public abstract String getJsniSignatureName()
public String getShortName()
public String[] getCompoundName()
The compound name of a class is an array that contains the simple names of all enclosing types followed by the simple name of this type (in outer to inner order).
A simple name is the name as it appears in the class declaration (e.g. Name in "class Name { .. }"), i.e. it is a name that does not include enclosing type names nor package.
public String getDescription()
ToStringGenerationVisitor
.public JType getUnderlyingType()
public String getPackageName()
public abstract JEnumType isEnumOrSubclass()
this
if this
is a JEnumType
and null
otherwise.public String getName()
public boolean isExternal()
public boolean replaces(JType originalType)
Copyright © 2018. All rights reserved.