Fantom

 

class

compilerJava::JavaType

sys::Obj
  compilerJava::JavaType : compiler::CType

JavaType is the implementation of CType for a Java class.

Slots

arrayOfSource

JavaType? arrayOf

If this an array, this is the component type.

arrayRankSource

Int arrayRank := 0

The rank of the array where 0 is not an array, 1 is one dimension, 2 is two dimensional, etc.

baseSource

override CType? base { override internal set }

classLiteralSource

static CMethod classLiteral(JavaBridge bridge, CType base)

We use an implicit method called "<class>" on each type as the protocol for telling the Java runtime to load a class literal

facetSource

override Obj? facet(Str qname, Obj? def)

fitsSource

override Bool fits(CType t)

flagsSource

override Int flags { override internal set }

inferredArrayOfSource

CType? inferredArrayOf()

The arrayOf field always stores a JavaType so that we can correctly resolve the FFI qname. This means that that an array of java.lang.Object will have an arrayOf value of [java]java.lang::Object. This method correctly maps the arrayOf map to its canonical Fantom type.

inferredAsSource

override CType inferredAs()

isArraySource

Bool isArray()

Is this a array type such as [java]foo.bar::[Baz

isForeignSource

override Bool isForeign()

isGenericSource

override Bool isGeneric()

isGenericParameterSource

override Bool isGenericParameter()

isInteropArraySource

Bool isInteropArray()

Return if this is an interop array like fanx.interop.IntArray which models int[].

isNullableSource

override Bool isNullable()

isParameterizedSource

override Bool isParameterized()

isPrimitiveSource

Bool isPrimitive()

isPrimitiveFloatSource

Bool isPrimitiveFloat()

isPrimitiveIntLikeSource

Bool isPrimitiveIntLike()

isSupportedSource

override Bool isSupported()

isValSource

override Bool isVal()

makeSource

new make(JavaPod pod, Str name)

Construct with loaded Type.

methodSource

override CMethod? method(Str name)

Handle the case where a field and method have the same name; in this case the field will always be first with a linked list to the overloaded methods

mixinsSource

override CType[] mixins { override internal set }

nameSource

override readonly Str name

newMethodSource

CMethod newMethod()

We use an implicit constructor called "<new>" on each type as the protocol for telling the Java runtime to perform a new opcode for object allocation:

CallNew Type.<new>  // allocate object
args...             // arguments are pushed onto stack
CallCtor <init>     // call to java constructor
nsSource

override CNamespace ns()

Overrides compiler::CType.ns

podSource

override readonly JavaPod pod

qnameSource

override readonly Str qname

signatureSource

override Str signature()

slotSource

override CSlot? slot(Str name)

slotsSource

override readonly Str:CSlot slots

toArrayOfSource

JavaType toArrayOf()

Get the type which is an array of this type.

toJavaClassNameSource

Str toJavaClassName()

Get this type's Java class name:

[java]java.lang::Class  => java.lang.Class
[java]java.lang::[Class => [Ljava.lang.Class;
toListOfSource

override CType toListOf()

toNullableSource

override CType toNullable()