nitc :: MClassType
MClassType
have properties (see has_mproperty
).
nitc :: MClassType :: _api_url
nitc :: MClassType :: _arguments
The formal arguments of the typenitc :: MClassType :: _ctype
nitc :: MClassType :: _is_c_primitive
nitc :: MClassType :: _java_type
nitc :: MClassType :: _web_url
nitc :: MClassType :: api_url=
nitc :: MClassType :: arguments=
The formal arguments of the typenitc :: MClassType :: collect_things
common implementation forcollect_mclassdefs
, collect_mclasses
, and collect_mtypes
.
nitc :: MClassType :: ctype=
nitc :: MClassType :: defaultinit
nitc :: MClassType :: is_c_primitive=
nitc :: MClassType :: java_type=
nitc :: MClassType :: web_url=
nitc $ MClassType :: SELF
Type of this instance, automatically specialized in every classnitc $ MClassType :: anchor_to
The base class type on which self is basednitc $ MClassType :: c_name
A fully-qualified C-like identifier of this model entity.nitc :: on_demand_compiler $ MClassType :: call_arg_field
Field to store this type in the C structurenit_call_arg
nitc $ MClassType :: can_resolve_for
Can the type be resolved?nitc :: nitni_base $ MClassType :: cname
Representation of this type in pure C on the FFI extern sidenitc :: nitni_base $ MClassType :: cname_blind
Representation of this type in C for the internal of the systemnitc :: light_only $ MClassType :: cname_normal_class
Name of this type in C for normal classes (not extern and not primitive)nitc $ MClassType :: collect_mclassdefs
Compute all the classdefs inherited/imported.nitc $ MClassType :: collect_mclasses
Compute all the super-classes.nitc $ MClassType :: collect_mtypes
Compute all the declared super-types.nitc :: java $ MClassType :: compile_callback_to_java
Compile C and Java code to implement this callbacknitc :: vim_autocomplete $ MClassType :: complete_mdoc
Doc to use in completionnitc :: term_model $ MClassType :: cs_signature
Returnsself
signature formatted for console.
nitc :: abstract_compiler $ MClassType :: ctype
Return the C type associated to a given Nit static typenitc :: abstract_compiler $ MClassType :: ctype_extern
C type outside of the compiler code and in boxesnitc :: abstract_compiler $ MClassType :: ctypename
Short name of thectype
to use in unions
nitc $ MClassType :: full_name
A fully-qualified name of this model entity.nitc :: html_model $ MClassType :: html_link
Link to the MEntity in the HTML outputnitc :: htmlight $ MClassType :: infobox
An new infobox documenting the entitynitc :: abstract_compiler $ MClassType :: is_c_primitive
Is the associated C type a primitive one?nitc :: nitni_base $ MClassType :: is_cprimitive
Does this type have a primitive representation?nitc :: java $ MClassType :: java_is_nit_object
Is this type opaque in Java? As so it is represented bynit.app.NitObject
.
nitc :: java_compiler $ MClassType :: java_type
Return the Java type associated to a given Nit static typenitc :: java $ MClassType :: jni_format
JNI short type name (for signatures)nitc :: java $ MClassType :: jni_methods_declaration
Returns the list of C functions to link with extern Java methods, as requirednitc :: java $ MClassType :: jni_signature_alt
Type name appearing within JNI function names.nitc :: htmlight $ MClassType :: linkto
A HTML version ofto_s
with hyper-links.
nitc :: nitni_base $ MClassType :: mangled_cname
Representation of this type in mangled Cnitc $ MClassType :: mdoc_or_fallback
The documentation associated to the entity or their main nested entity.nitc $ MClassType :: need_anchor
Doesself
contain a virtual type or a formal generic parameter type?
nitc $ MClassType :: resolve_for
Replace formals generic types in self with resolved values inmtype
nitc :: vim_autocomplete $ MClassType :: write_extra_doc
Extra auto documentation to append to thestream
nitc :: vim_autocomplete $ MClassType :: write_location
Location (file and line when available) of related declarationsnitc :: MClassType :: _api_url
nitc :: MClassType :: _arguments
The formal arguments of the typenitc :: MType :: _as_nullable_cache
nitc :: MEntity :: _const_color
nitc :: MEntity :: _css_classes
CSS classes used to decorateself
nitc :: MClassType :: _ctype
nitc :: MEntity :: _deprecation
Is the entity deprecated?nitc :: MEntity :: _html_full_name
The MEntityfull_name
escaped for HTML
nitc :: MEntity :: _is_broken
The indication that the entity did not pass some semantic verifications.nitc :: MClassType :: _is_c_primitive
nitc :: MType :: _is_java_primitive
Is the associated Java type a primitive one?nitc :: MClassType :: _java_type
nitc :: MClassType :: _web_url
serialization :: Serializable :: accept_inspect_serializer_core
serialization :: Serializable :: accept_json_serializer
Refinable service to customize the serialization of this class to JSONserialization :: Serializable :: accept_msgpack_attribute_counter
Hook to customize the behavior of theAttributeCounter
serialization :: Serializable :: accept_msgpack_serializer
Hook to customize the serialization of this class to MessagePacknitc :: MEntity :: add_doc_to_infobox
Append an entry for the doc in the given infoboxserialization :: Serializable :: add_to_bundle
Called by[]=
to dynamically choose the appropriate method according
nitc :: MClassType :: api_url=
nitc :: MClassType :: arguments=
The formal arguments of the typenitc :: MType :: as_nullable_cache
nitc :: MType :: as_nullable_cache=
nitc :: MType :: call_arg_field
Field to store this type in the C structurenit_call_arg
nitc :: MType :: can_resolve_for
Can the type be resolved?core :: Object :: class_factory
Implementation used byget_class
to create the specific class.
nitc :: MType :: cname_blind
Representation of this type in C for the internal of the systemnitc :: MType :: cname_normal_class
Name of this type in C for normal classes (not extern and not primitive)nitc :: MEntity :: collect_ancestors
Collectself
ancestors (direct and indirect)
nitc :: MEntity :: collect_children
Collectself
children (direct descendants)
nitc :: MEntity :: collect_descendants
Collectself
descendants (direct and direct)
nitc :: MEntity :: collect_linearization
Collectself
linearization anchored on mainmodule
nitc :: MType :: collect_mclassdefs
Compute all the classdefs inherited/imported.nitc :: MType :: collect_mclasses
Compute all the super-classes.nitc :: MEntity :: collect_metrics
nitc :: MEntity :: collect_modifiers
Collect modifier keywords likeredef
, private
etc
nitc :: MType :: collect_mtypes
Compute all the declared super-types.nitc :: MEntity :: collect_parents
Collectself
parents (direct ancestors)
nitc :: MClassType :: collect_things
common implementation forcollect_mclassdefs
, collect_mclasses
, and collect_mtypes
.
nitc :: NitniCallback :: compile_callback_to_java
Compile C and Java code to implement this callbacknitc :: NitniCallback :: compile_callback_to_objc
Compile this callback to be callable from Objective-Cnitc :: MType :: compile_extern_type
nitc :: MEntity :: const_color
nitc :: MEntity :: const_color=
nitc :: MEntity :: core_serialize_base
serialization :: Serializable :: core_serialize_to
Actual serialization ofself
to serializer
nitc :: MEntity :: create_ast_representation
Build a ANode fromself
nitc :: MEntity :: cs_comment
Returns the comment of this MEntity formatted for console.nitc :: MEntity :: cs_declaration
Returns the complete MEntity declaration (modifiers + name + signature).nitc :: MEntity :: cs_full_name
Returnsself.full_name
formatted for console
nitc :: MEntity :: cs_list_item
Returnsself
as a list element that can be displayed in console.
nitc :: MEntity :: cs_location
Source code location of this MEntity formatted for consolenitc :: MEntity :: cs_short_comment
Returns the comment of this MEntity formatted for console.nitc :: MEntity :: cs_signature
Returnsself
signature formatted for console.
nitc :: MEntity :: cs_source_code
Source code associated to this MEntity.nitc :: MEntity :: css_classes=
CSS classes used to decorateself
nitc :: MClassType :: ctype=
nitc :: MType :: ctype_extern
C type outside of the compiler code and in boxesnitc :: MClassType :: defaultinit
nitc :: HInfoBoxable :: defaultinit
core :: Object :: defaultinit
nitc :: MType :: defaultinit
nitc :: NitniCallback :: defaultinit
nitc :: MEntity :: defaultinit
nitc :: MEntity :: deprecation=
Is the entity deprecated?nitc :: MEntity :: field_separator
serialization :: Serializable :: from_deserializer
Create an instance of this class from thedeserializer
nitc :: MType :: gen_arg_convert
Write code intemplate
to parse the argument arg_name
to this parameter type
nitc :: MType :: has_mproperty
Is the property in self for a given modulenitc :: MEntity :: hierarchy_poset
Build a poset representingself
in it's own hierarchy
nitc :: MEntity :: html_declaration
Returns the complete MEntity declaration decorated with HTMLnitc :: MEntity :: html_full_name=
The MEntityfull_name
escaped for HTML
nitc :: MEntity :: html_name=
The MEntity name escaped for HTMLnitc :: MEntity :: html_namespace
Returnsfull_name
decorated with HTML links
nitc :: MEntity :: html_signature
Returns the MEntity signature decorated with HTMLnitc :: HInfoBoxable :: infobox
An new infobox documenting the entitynitc :: MEntity :: is_broken=
The indication that the entity did not pass some semantic verifications.nitc :: MClassType :: is_c_primitive=
nitc :: MType :: is_cprimitive
Does this type have a primitive representation?nitc :: MEntity :: is_fictive=
Isself
created for internal purpose?
nitc :: MType :: is_java_primitive
Is the associated Java type a primitive one?nitc :: MType :: is_java_primitive=
Is the associated Java type a primitive one?nitc :: MType :: is_legal_in
Is the type legal in a givenmmodule
(with an optional anchor
)?
core :: Object :: is_same_instance
Return true ifself
and other
are the same instance (i.e. same identity).
core :: Object :: is_same_serialized
Isself
the same as other
in a serialization context?
core :: Object :: is_same_type
Return true ifself
and other
have the same dynamic type.
nitc :: MType :: is_subtype
Return true ifself
is an subtype of sup
.
nitc :: MType :: is_subtype_invar
Return true ifself
is a invariant subtype of sup
.
nitc :: MType :: java_is_nit_object
Is this type opaque in Java? As so it is represented bynit.app.NitObject
.
nitc :: MClassType :: java_type=
nitc :: NitniCallback :: jni_methods_declaration
Returns the list of C functions to link with extern Java methods, as requirednitc :: MType :: jni_signature_alt
Type name appearing within JNI function names.nitc :: MEntity :: json_namespace
Returnself.full_name
as an object that can be serialized to json.
nitc :: MEntity :: line_separator
nitc :: MEntity :: linkto_text
Link to theself
with a specific text.
nitc :: MType :: lookup_bound
Resolve formal type to its verbatim bound.nitc :: MType :: lookup_fixed
Resolve the formal type to its simplest equivalent form.nitc :: MType :: mangled_cname
Representation of this type in mangled Cnitc :: MEntity :: mdoc_or_fallback
The documentation associated to the entity or their main nested entity.serialization :: Serializable :: msgpack_extra_array_items
Hook to request a larger than usual metadata arraycore :: Object :: native_class_name
The class name of the object in CString format.nitc :: MType :: need_anchor
Doesself
contain a virtual type or a formal generic parameter type?
nitc :: MType :: needs_type_check
Does this parameter type needs to be checked before calling the method?core :: Object :: output_class_name
Display class name on stdout (debug only).mentity
nitc :: MEntity :: ratings_by_dimension
Get the ratings of adimension
nitc :: MType :: resolve_for
Replace formals generic types in self with resolved values inmtype
serialization :: Serializable :: serialize_msgpack
Serializeself
to MessagePack bytes
serialization :: Serializable :: serialize_to
Serializeself
to serializer
serialization :: Serializable :: serialize_to_json
Serializeself
to JSON
serialization :: Serializable :: serialize_to_or_delay
Accept references or force direct serialization (usingserialize_to
)
nitc :: MType :: signature_depth
nitc :: MEntity :: source_url
Render a HTML link for the MEntity locationnitc :: MType :: supertype_to
Return the supertype when adapted to a class.serialization :: Serializable :: to_pretty_json
Serializeself
to plain pretty JSON
nitc :: MEntity :: tpl_module
Builds a dot UML package diagram entity fromself
v.enter_visit
on all nested entities.
nitc :: MClassType :: web_url=
nitc :: MEntity :: write_extra_doc
Extra auto documentation to append to thestream
nitc :: MEntity :: write_location
Location (file and line when available) of related declarations
# A type based on a class.
#
# `MClassType` have properties (see `has_mproperty`).
class MClassType
super MType
# The associated class
var mclass: MClass
redef fun model do return self.mclass.intro_mmodule.model
redef fun location do return mclass.location
# TODO: private init because strongly bounded to its mclass. see `mclass.mclass_type`
# The formal arguments of the type
# ENSURE: `result.length == self.mclass.arity`
var arguments = new Array[MType]
redef fun to_s do return mclass.to_s
redef fun full_name do return mclass.full_name
redef fun c_name do return mclass.c_name
redef fun need_anchor do return false
redef fun anchor_to(mmodule, anchor): MClassType
do
return super.as(MClassType)
end
redef fun resolve_for(mtype: MType, anchor: nullable MClassType, mmodule: MModule, cleanup_virtual: Bool): MClassType do return self
redef fun can_resolve_for(mtype, anchor, mmodule) do return true
redef fun collect_mclassdefs(mmodule)
do
assert not self.need_anchor
var cache = self.collect_mclassdefs_cache
if not cache.has_key(mmodule) then
self.collect_things(mmodule)
end
return cache[mmodule]
end
redef fun collect_mclasses(mmodule)
do
if collect_mclasses_last_module == mmodule then return collect_mclasses_last_module_cache
assert not self.need_anchor
var cache = self.collect_mclasses_cache
if not cache.has_key(mmodule) then
self.collect_things(mmodule)
end
var res = cache[mmodule]
collect_mclasses_last_module = mmodule
collect_mclasses_last_module_cache = res
return res
end
private var collect_mclasses_last_module: nullable MModule = null
private var collect_mclasses_last_module_cache: Set[MClass] is noinit
redef fun collect_mtypes(mmodule)
do
assert not self.need_anchor
var cache = self.collect_mtypes_cache
if not cache.has_key(mmodule) then
self.collect_things(mmodule)
end
return cache[mmodule]
end
# common implementation for `collect_mclassdefs`, `collect_mclasses`, and `collect_mtypes`.
private fun collect_things(mmodule: MModule)
do
var res = new HashSet[MClassDef]
var seen = new HashSet[MClass]
var types = new HashSet[MClassType]
seen.add(self.mclass)
var todo = [self.mclass]
while not todo.is_empty do
var mclass = todo.pop
#print "process {mclass}"
for mclassdef in mclass.mclassdefs do
if not mmodule.in_importation <= mclassdef.mmodule then continue
#print " process {mclassdef}"
res.add(mclassdef)
for supertype in mclassdef.supertypes do
types.add(supertype)
var superclass = supertype.mclass
if seen.has(superclass) then continue
#print " add {superclass}"
seen.add(superclass)
todo.add(superclass)
end
end
end
collect_mclassdefs_cache[mmodule] = res
collect_mclasses_cache[mmodule] = seen
collect_mtypes_cache[mmodule] = types
end
private var collect_mclassdefs_cache = new HashMap[MModule, Set[MClassDef]]
private var collect_mclasses_cache = new HashMap[MModule, Set[MClass]]
private var collect_mtypes_cache = new HashMap[MModule, Set[MClassType]]
redef fun mdoc_or_fallback do return mclass.mdoc_or_fallback
end
src/model/model.nit:1286,1--1394,3
redef class MClassType
redef fun cname
do
var name = mclass.name
if name == "Bool" then return "int"
if name == "Char" then return "uint32_t"
if name == "Float" then return "double"
if name == "Int" then return "long"
if name == "Byte" then return "unsigned char"
if name == "Int8" then return "int8_t"
if name == "Int16" then return "int16_t"
if name == "UInt16" then return "uint16_t"
if name == "Int32" then return "int32_t"
if name == "UInt32" then return "uint32_t"
if name == "CString" then return "char*"
if mclass.kind == extern_kind then
var ctype = mclass.ctype
assert ctype != null
return ctype
end
return cname_normal_class
end
redef fun cname_blind do
var name = mclass.name
if name == "Bool" then return "int"
if name == "Char" then return "uint32_t"
if name == "Float" then return "double"
if name == "Int" then return "long"
if name == "Byte" then return "unsigned char"
if name == "Int8" then return "int8_t"
if name == "Int16" then return "int16_t"
if name == "UInt16" then return "uint16_t"
if name == "Int32" then return "int32_t"
if name == "UInt32" then return "uint32_t"
if name == "CString" then return "char*"
if mclass.kind == extern_kind then return "void*"
return super
end
redef fun mangled_cname do return mclass.name
redef fun is_cprimitive do return mclass.kind == extern_kind or
(once ["Bool", "Char", "Float", "Int", "CString",
"Byte", "Int8", "Int16", "UInt16", "Int32", "UInt32"]).has(mclass.name)
end
src/nitni/nitni_base.nit:91,1--136,3
redef class MClassType
redef fun to_node(nodes: HashMap[MEntity, NeoNode], model_name: nullable String): NeoNode do
if nodes.has_key(self) then return nodes[self]
var node = super
node.labels.add "MClassType"
node.out_edges.add(new NeoEdge(node, "CLASS", mclass.to_node(nodes, model_name)))
for arg in arguments do
node.out_edges.add(new NeoEdge(node, "ARGUMENT", arg.to_node(nodes, model_name)))
end
return node
end
end
src/neo.nit:880,1--891,3
redef class MClassType
redef fun cs_signature(no_color) do return name
end
src/doc/templates/term_model.nit:217,1--219,3
redef class MClassType
redef fun write_extra_doc(model, mainmodule, stream)
do
# Super classes
stream.write line_separator*2
stream.write "## Class hierarchy"
var direct_supers = [for s in mclass.in_hierarchy(mainmodule).direct_greaters do s.name]
if not direct_supers.is_empty then
alpha_comparator.sort direct_supers
stream.write line_separator
stream.write "* Direct super classes: "
stream.write direct_supers.join(", ")
end
var supers = [for s in mclass.in_hierarchy(mainmodule).greaters do s.name]
supers.remove mclass.name
if not supers.is_empty then
alpha_comparator.sort supers
stream.write line_separator
stream.write "* All super classes: "
stream.write supers.join(", ")
end
var direct_subs = [for s in mclass.in_hierarchy(mainmodule).direct_smallers do s.name]
if not direct_subs.is_empty then
alpha_comparator.sort direct_subs
stream.write line_separator
stream.write "* Direct sub classes: "
stream.write direct_subs.join(", ")
end
var subs = [for s in mclass.in_hierarchy(mainmodule).smallers do s.name]
subs.remove mclass.name
if not subs.is_empty then
alpha_comparator.sort subs
stream.write line_separator
stream.write "* All sub classes: "
stream.write subs.join(", ")
end
# List other properties
stream.write line_separator*2
stream.write "## Properties"
stream.write line_separator
var props = mclass.collect_accessible_mproperties(mainmodule).to_a
alpha_comparator.sort props
for prop in props do
if mclass.name == "Object" or prop.intro.mclassdef.mclass.name != "Object" then
prop.write_synopsis(mainmodule, stream)
end
end
end
redef fun complete_mdoc do return mclass.intro.mdoc
redef fun write_location(mainmodule, stream)
do
for i in 2.times do stream.write line_separator
stream.write "## Location of introduction and refinements"
for c in mclass.mclassdefs do
stream.write line_separator
stream.write "* {c.location}"
end
end
end
src/doc/vim_autocomplete.nit:188,1--253,3
redef class MClassType
redef fun tpl_class(model) do
return name
end
end
src/uml/uml_class.nit:174,1--178,3
redef class MClassType
end
src/nitserial.nit:64,1--66,3
redef class MClassType
redef var java_type is lazy do
if mclass.name == "Int" then
return "int"
else if mclass.name == "Bool" then
return "boolean"
else if mclass.name == "Char" then
return "char"
else if mclass.name == "Float" then
return "double"
else if mclass.name == "Byte" then
return "byte"
else if mclass.name == "CString" then
return "String"
else if mclass.name == "NativeArray" then
return "Array"
end
return "RTVal"
end
end
src/compiler/java_compiler.nit:1308,1--1328,3
redef class MClassType
redef fun infobox(v)
do
var res = new HInfoBox(v, to_s)
res.href = v.hrefto(mclass.intro)
if not v.show_infobox then return res
res.new_field("class").add mclass.intro.linkto(v)
add_doc_to_infobox(res)
return res
end
redef fun linkto(v)
do
return mclass.intro.linkto(v)
end
end
src/htmlight.nit:575,1--589,3
redef class MClassType
redef var ctype is lazy do
if mclass.name == "Int" then
return "long"
else if mclass.name == "Bool" then
return "short int"
else if mclass.name == "Char" then
return "uint32_t"
else if mclass.name == "Float" then
return "double"
else if mclass.name == "Int8" then
return "int8_t"
else if mclass.name == "Byte" then
return "unsigned char"
else if mclass.name == "Int16" then
return "int16_t"
else if mclass.name == "UInt16" then
return "uint16_t"
else if mclass.name == "Int32" then
return "int32_t"
else if mclass.name == "UInt32" then
return "uint32_t"
else if mclass.name == "CString" then
return "char*"
else if mclass.name == "NativeArray" then
return "val*"
else
return "val*"
end
end
redef var is_c_primitive is lazy do return ctype != "val*"
redef fun ctype_extern: String
do
if mclass.kind == extern_kind then
return "void*"
else
return ctype
end
end
redef fun ctypename: String
do
if mclass.name == "Int" then
return "l"
else if mclass.name == "Bool" then
return "s"
else if mclass.name == "Char" then
return "c"
else if mclass.name == "Float" then
return "d"
else if mclass.name == "Int8" then
return "i8"
else if mclass.name == "Byte" then
return "b"
else if mclass.name == "Int16" then
return "i16"
else if mclass.name == "UInt16" then
return "u16"
else if mclass.name == "Int32" then
return "i32"
else if mclass.name == "UInt32" then
return "u32"
else if mclass.name == "CString" then
return "str"
else if mclass.name == "NativeArray" then
#return "{self.arguments.first.ctype}*"
return "val"
else
return "val"
end
end
end
src/compiler/abstract_compiler.nit:2448,1--2522,3
redef class MClassType
redef fun java_type
do
var ftype = mclass.ftype
if ftype isa ForeignJavaType then return ftype.java_type.
replace('/', ".").replace('$', ".").replace(' ', "").replace('\n',"")
if mclass.name == "Bool" then return "boolean"
if mclass.name == "Char" then return "int"
if mclass.name == "Int" then return "long"
if mclass.name == "Float" then return "double"
if mclass.name == "Byte" then return "byte"
if mclass.name == "Int8" then return "byte"
if mclass.name == "Int16" then return "short"
if mclass.name == "UInt16" then return "short"
if mclass.name == "Int32" then return "int"
if mclass.name == "UInt32" then return "int"
return super
end
redef fun java_is_nit_object
do
var ftype = mclass.ftype
if ftype isa ForeignJavaType then return false
var java_primitives = once new HashSet[String].from(
["Bool", "Char", "Int", "Float", "Byte", "Int8", "Int16", "UInt16", "Int32", "UInt32"])
return not java_primitives.has(mclass.name)
end
redef fun jni_type
do
var ftype = mclass.ftype
if ftype isa ForeignJavaType then return "jobject"
if mclass.name == "Bool" then return "jboolean"
if mclass.name == "Char" then return "jint"
if mclass.name == "Int" then return "jlong"
if mclass.name == "Float" then return "jdouble"
if mclass.name == "Byte" then return "jbyte"
if mclass.name == "Int8" then return "jbyte"
if mclass.name == "Int16" then return "jshort"
if mclass.name == "UInt16" then return "jshort"
if mclass.name == "Int32" then return "jint"
if mclass.name == "UInt32" then return "jint"
return super
end
redef fun jni_format
do
var ftype = mclass.ftype
if ftype isa ForeignJavaType then
var jni_type = ftype.java_type.
replace('.', "/").replace(' ', "").replace('\n', "")
# Remove parameters of generic types
loop
var i = jni_type.last_index_of('<')
if i >= 0 then
var j = jni_type.index_of_from('>', i)
if j == -1 then
print "Error: missing closing '>' in extern Java type of \"{mclass.name}\""
exit 1
end
jni_type = jni_type.substring(0, i) +
jni_type.substring(j+1, jni_type.length)
else break
end
# Change `float[]` to `[float`
if jni_type.has('[') then
var depth = jni_type.chars.count('[')
var java_type = jni_type.replace("[]", "")
var short
if java_type == "boolean" then
short = "Z"
else if java_type == "byte" then
short = "B"
else if java_type == "char" then
short = "C"
else if java_type == "short" then
short = "S"
else if java_type == "int" then
short = "I"
else if java_type == "long" then
short = "J"
else if java_type == "float" then
short = "F"
else if java_type == "double" then
short = "D"
else
short = "L{java_type};"
end
return "["*depth + short
end
return "L{jni_type};"
end
if mclass.name == "Bool" then return "Z"
if mclass.name == "Char" then return "I"
if mclass.name == "Int" then return "J"
if mclass.name == "Float" then return "D"
if mclass.name == "Byte" then return "B"
if mclass.name == "Int8" then return "B"
if mclass.name == "Int16" then return "S"
if mclass.name == "UInt16" then return "S"
if mclass.name == "Int32" then return "I"
if mclass.name == "UInt32" then return "I"
return super
end
redef fun jni_signature_alt
do
var ftype = mclass.ftype
if ftype isa ForeignJavaType then return "Object"
if mclass.name == "Bool" then return "Boolean"
if mclass.name == "Char" then return "Int"
if mclass.name == "Int" then return "Long"
if mclass.name == "Float" then return "Double"
if mclass.name == "Byte" then return "Byte"
if mclass.name == "Int8" then return "Byte"
if mclass.name == "Int16" then return "Short"
if mclass.name == "UInt16" then return "Short"
if mclass.name == "Int32" then return "Int"
if mclass.name == "UInt32" then return "Int"
return super
end
redef fun compile_callback_to_java(mmodule, mainmodule, ccu)
do
# Don't generate functions for reference counters on extern classes
if mclass.ftype != null then return
super
end
redef fun jni_methods_declaration(from_mmodule)
do
# Don't generate functions for reference counters on extern classes
if mclass.ftype != null then return new Array[String]
return super
end
end
src/ffi/java.nit:610,1--754,3
redef class MClassType
redef fun cname_normal_class do return "void*"
end
src/compiler/compiler_ffi/light_only.nit:20,1--22,3
redef class MClassType
redef fun html_link(text, title) do return mclass.html_link(text, title)
end
src/doc/templates/html_model.nit:279,1--281,3
redef class MClassType
redef fun call_arg_field
do
if is_cprimitive and mclass.kind != extern_kind then
return "value_{name}"
else return super
end
end
src/interpreter/dynamic_loading_ffi/on_demand_compiler.nit:385,1--392,3