class compilerJava::JavaType

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

Source

JavaType is the implementation of CType for a Java class.

arrayOf

JavaType? arrayOf { private set }

Source

If this an array, this is the component type.

arrayRank

const Int arrayRank := 0

Source

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

base

virtual override CType? base

Source

classLiteral

static CMethod classLiteral(JavaBridge bridge, CType base)

Source

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

classfile

const File? classfile

Source

Classfile to use for loading

doc

virtual override CDoc? doc()

Source

facet

virtual override CFacet? facet(Str qname)

Source

fits

virtual override Bool fits(CType t)

Source

flags

virtual override Int flags

Source

inferredArrayOf

CType? inferredArrayOf()

Source

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.

inferredAs

virtual override CType inferredAs()

Source

isArray

Bool isArray()

Source

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

isForeign

virtual override Bool isForeign()

Source

isGeneric

virtual override Bool isGeneric()

Source

isGenericParameter

virtual override Bool isGenericParameter()

Source

isInteropArray

Bool isInteropArray()

Source

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

isNullable

virtual override Bool isNullable()

Source

isParameterized

virtual override Bool isParameterized()

Source

isPrimitive

Bool isPrimitive()

Source

isPrimitiveFloat

Bool isPrimitiveFloat()

Source

isPrimitiveIntLike

Bool isPrimitiveIntLike()

Source

isSupported

virtual override Bool isSupported()

Source

isVal

virtual override Bool isVal()

Source

makeArray

new makeArray(JavaType of)

Source

makeDasm

new makeDasm(JavaPod pod, Str name, File classfile)

Source

makePrimitive

new makePrimitive(JavaPod pod, Str name, CType primitiveNullable)

Source

method

virtual override CMethod? method(Str name)

Source

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

mixins

virtual override CType[] mixins

Source

name

virtual const override Str name

Source

newMethod

CMethod newMethod()

Source

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
ns

virtual override CNamespace ns()

Source

operators

virtual override COperators operators()

Source

pod

virtual override JavaPod pod

Source

qname

virtual const override Str qname

Source

signature

virtual override Str signature()

Source

slot

virtual override CSlot? slot(Str name)

Source

slots

virtual override Str:CSlot slots := [Str:CSlot][:] { private set }

Source

toArrayOf

JavaType toArrayOf()

Source

Get the type which is an array of this type.

toJavaClassName

Str toJavaClassName()

Source

Get this type's Java class name:

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

virtual override CType toListOf()

Source

toNullable

virtual override CType toNullable()

Source

useReflection

const static Bool useReflection := false

Source

TODO: hook to fallback to old reflection loader in case we run into trouble with disassembler loader