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 |
canBeNull()
Returns
true if it's possible for this type to be
null . |
String[] |
getCompoundName()
Returns the compound name.
|
abstract JLiteral |
getDefaultValue() |
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.
|
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.
|
getSourceInfo, setSourceInfo, toSource, toString
isFinal
traverse
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
.JNonNullType
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 JType getUnderlyingType()
public String getPackageName()
public JEnumType isEnumOrSubclass()
this
if this
is a JEnumType} and null
otherwise.public String getName()
public boolean isExternal()
Copyright © 2018. All rights reserved.