A global method

Introduced properties

private var _getter_for: nullable MAttribute

nitc :: MMethod :: _getter_for

The attribute this getter is for
private var _is_init: Bool

nitc :: MMethod :: _is_init

Is the property a constructor?
private var _is_new: Bool

nitc :: MMethod :: _is_new

Is the property a 'new' constructor?
private var _is_root_init: Bool

nitc :: MMethod :: _is_root_init

The constructor is a (the) root init with empty signature but a set of initializers
private var _is_toplevel: Bool

nitc :: MMethod :: _is_toplevel

Is the property defined at the top_level of the module?
private var _mcontract_facet: nullable MFacet

nitc :: MMethod :: _mcontract_facet

The contract facet of the method
private var _mensure: nullable MEnsure

nitc :: MMethod :: _mensure

The MEnsure contract if any
private var _mexpect: nullable MExpect

nitc :: MMethod :: _mexpect

The MExpect contract if any
private var _offset: Int

nitc :: MMethod :: _offset

Relative offset of this method in the virtual table (from the beginning of the block)
private var _restful_async: Bool

nitc :: MMethod :: _restful_async

Is this a restful method to be executed asynchronously
private var _restful_resources: Array[String]

nitc :: MMethod :: _restful_resources

Associated resources within an action, e.g. foo in http://localhost/foo?arg=bar
private var _restful_verbs: Array[String]

nitc :: MMethod :: _restful_verbs

HTTP access methods, e.g. GET
private var _setter_for: nullable MAttribute

nitc :: MMethod :: _setter_for

The attribute this setter is for
private fun build_c_implementation_signature(recv_mtype: MClassType, from_mmodule: MModule, suffix: nullable String, length: SignatureLength, call_context: CallContext): String

nitc :: MMethod :: build_c_implementation_signature

Similar to build_c_signature but adapted to create the signature expected by JNI for C functions
fun build_ccall(recv_mtype: MClassType, from_mmodule: MModule, suffix: nullable String, length: SignatureLength, call_context: CallContext, param_suffix: nullable String): String

nitc :: MMethod :: build_ccall

Build a C function call for the FFI implementation (uses friendly naming).
fun build_cname(recv_mtype: MClassType, from_mmodule: MModule, suffix: nullable String, length: SignatureLength): String

nitc :: MMethod :: build_cname

Build a C function name for the FFI implementation (uses friendly naming).
private fun build_contract_facet: MFacet

nitc :: MMethod :: build_contract_facet

Build mcontract_facet if is not exist and return it
fun build_csignature(recv_mtype: MClassType, from_mmodule: MModule, suffix: nullable String, length: SignatureLength, call_context: CallContext): String

nitc :: MMethod :: build_csignature

Build a C function signature for the FFI implementation (uses friendly naming).
private fun build_ensure: MEnsure

nitc :: MMethod :: build_ensure

Build mensure if is not exist and return it
private fun build_expect: MExpect

nitc :: MMethod :: build_expect

Build mexpect if is not exist and return it
private fun build_jni_format(recv_mtype: MClassType, from_mmodule: MModule): String

nitc :: MMethod :: build_jni_format

Returns the JNI signature format of this Nit method
private fun create_facet(v: ContractsVisitor, classdef: MClassDef, facet: MFacet, called: MMethod): AMethPropdef

nitc :: MMethod :: create_facet

Method to create a facet of the method.
init defaultinit(intro_mclassdef: MClassDef, name: String, location: Location, visibility: MVisibility)

nitc :: MMethod :: defaultinit

private fun define_contract_facet(v: ContractsVisitor, classdef: MClassDef, mcontract: nullable MContract)

nitc :: MMethod :: define_contract_facet

Define contract facet for MMethod in the given mclassdef. The facet represents the entry point with contracts (expect, ensure) of the method.
fun getter_for: nullable MAttribute

nitc :: MMethod :: getter_for

The attribute this getter is for
fun getter_for=(getter_for: nullable MAttribute)

nitc :: MMethod :: getter_for=

The attribute this getter is for
fun has_contract_facet: Bool

nitc :: MMethod :: has_contract_facet

Is there an contract facet?
fun has_ensure: Bool

nitc :: MMethod :: has_ensure

Is there an ensure contract?
fun has_expect: Bool

nitc :: MMethod :: has_expect

Is there an expect contract?
fun is_accessor: Bool

nitc :: MMethod :: is_accessor

Is this method a getter or a setter?
fun is_getter: Bool

nitc :: MMethod :: is_getter

Is this method a getter (auto or not)?
fun is_init: Bool

nitc :: MMethod :: is_init

Is the property a constructor?
fun is_init=(is_init: Bool)

nitc :: MMethod :: is_init=

Is the property a constructor?
fun is_init_for(mclass: MClass): Bool

nitc :: MMethod :: is_init_for

Is the property a legal constructor for a given class?
fun is_new: Bool

nitc :: MMethod :: is_new

Is the property a 'new' constructor?
fun is_new=(is_new: Bool)

nitc :: MMethod :: is_new=

Is the property a 'new' constructor?
fun is_null_safe: Bool

nitc :: MMethod :: is_null_safe

A specific method that is safe to call on null.
fun is_root_init: Bool

nitc :: MMethod :: is_root_init

The constructor is a (the) root init with empty signature but a set of initializers
fun is_root_init=(is_root_init: Bool)

nitc :: MMethod :: is_root_init=

The constructor is a (the) root init with empty signature but a set of initializers
fun is_setter: Bool

nitc :: MMethod :: is_setter

Is this method a setter (auto or not)?
fun is_toplevel: Bool

nitc :: MMethod :: is_toplevel

Is the property defined at the top_level of the module?
fun is_toplevel=(is_toplevel: Bool)

nitc :: MMethod :: is_toplevel=

Is the property defined at the top_level of the module?
fun mcontract_facet: nullable MFacet

nitc :: MMethod :: mcontract_facet

The contract facet of the method
protected fun mcontract_facet=(mcontract_facet: nullable MFacet)

nitc :: MMethod :: mcontract_facet=

The contract facet of the method
fun mensure: nullable MEnsure

nitc :: MMethod :: mensure

The MEnsure contract if any
protected fun mensure=(mensure: nullable MEnsure)

nitc :: MMethod :: mensure=

The MEnsure contract if any
fun mexpect: nullable MExpect

nitc :: MMethod :: mexpect

The MExpect contract if any
protected fun mexpect=(mexpect: nullable MExpect)

nitc :: MMethod :: mexpect=

The MExpect contract if any
private fun restful_async: Bool

nitc :: MMethod :: restful_async

Is this a restful method to be executed asynchronously
private fun restful_async=(restful_async: Bool)

nitc :: MMethod :: restful_async=

Is this a restful method to be executed asynchronously
private fun restful_resources: Array[String]

nitc :: MMethod :: restful_resources

Associated resources within an action, e.g. foo in http://localhost/foo?arg=bar
private fun restful_resources=(restful_resources: Array[String])

nitc :: MMethod :: restful_resources=

Associated resources within an action, e.g. foo in http://localhost/foo?arg=bar
private fun restful_verbs: Array[String]

nitc :: MMethod :: restful_verbs

HTTP access methods, e.g. GET
private fun restful_verbs=(restful_verbs: Array[String])

nitc :: MMethod :: restful_verbs=

HTTP access methods, e.g. GET
fun setter_for: nullable MAttribute

nitc :: MMethod :: setter_for

The attribute this setter is for
fun setter_for=(setter_for: nullable MAttribute)

nitc :: MMethod :: setter_for=

The attribute this setter is for
fun short_cname: String

nitc :: MMethod :: short_cname

Short name of this method in C (without the class name)

Redefined properties

redef type MPROPDEF: MMethodDef

nitc $ MMethod :: MPROPDEF

The associated MPropDef subclass.
redef type SELF: MMethod

nitc $ MMethod :: SELF

Type of this instance, automatically specialized in every class
redef fun core_serialize_to(v: Serializer)

nitc :: json_model $ MMethod :: core_serialize_to

Actual serialization of self to serializer
redef fun offset: Int

nitc :: virtual_machine $ MMethod :: offset

Relative offset of this method in the virtual table (from the beginning of the block)
redef fun offset=(offset: Int)

nitc :: virtual_machine $ MMethod :: offset=

Relative offset of this method in the virtual table (from the beginning of the block)
redef fun to_node(nodes: HashMap[MEntity, NeoNode], model_name: nullable String): NeoNode

nitc :: neo $ MMethod :: to_node

Build a NeoNode representing self.
redef fun tpl_class(model: UMLModel): Writable

nitc :: uml_class $ MMethod :: tpl_class

Generates a dot-compatible Writable UML Class diagram from self

All properties

fun !=(other: nullable Object): Bool

core :: Object :: !=

Have self and other different values?
fun ==(other: nullable Object): Bool

core :: Object :: ==

Have self and other the same value?
type CLASS: Class[SELF]

core :: Object :: CLASS

The type of the class of self.
type MENTITY: SELF

nitc :: MEntity :: MENTITY

FIXME used to bypass RTA limitation on type resolution
type MPROPDEF: MPropDef

nitc :: MProperty :: MPROPDEF

The associated MPropDef subclass.
type SELF: Object

core :: Object :: SELF

Type of this instance, automatically specialized in every class
private var _c_name: String

nitc :: MProperty :: _c_name

private var _css_classes: Array[String]

nitc :: MEntity :: _css_classes

CSS classes used to decorate self
private var _deprecation: nullable MDeprecationInfo

nitc :: MEntity :: _deprecation

Is the entity deprecated?
private var _examples: Array[MExample]

nitc :: MEntity :: _examples

Examples found for self
private var _full_name: String

nitc :: MProperty :: _full_name

The canonical name of the property.
private var _getter_for: nullable MAttribute

nitc :: MMethod :: _getter_for

The attribute this getter is for
private var _html_full_name: String

nitc :: MEntity :: _html_full_name

The MEntity full_name escaped for HTML
private var _html_id: String

nitc :: MEntity :: _html_id

The MEntity unique ID in the HTML output
private var _html_name: String

nitc :: MEntity :: _html_name

The MEntity name escaped for HTML
private var _html_url: String

nitc :: MEntity :: _html_url

private var _html_url: String

nitc :: MEntity :: _html_url

The MEntity URL in the HTML output
private var _html_url: String

nitc :: MProperty :: _html_url

private var _intro: MPROPDEF

nitc :: MProperty :: _intro

The definition that introduces the property.
private var _intro_mclassdef: MClassDef

nitc :: MProperty :: _intro_mclassdef

The classdef that introduce the property
private var _is_after: Bool

nitc :: MProperty :: _is_after

Does self have the after annotation?
private var _is_after_all: Bool

nitc :: MProperty :: _is_after_all

Does self have the after_all annotation?
private var _is_autoinit: Bool

nitc :: MProperty :: _is_autoinit

Is the property usable as an initializer?
private var _is_before: Bool

nitc :: MProperty :: _is_before

Does self have the before annotation?
private var _is_before_all: Bool

nitc :: MProperty :: _is_before_all

Does self have the before_all annotation?
private var _is_broken: Bool

nitc :: MEntity :: _is_broken

The indication that the entity did not pass some semantic verifications.
private var _is_example: Bool

nitc :: MProperty :: _is_example

private var _is_fictive: Bool

nitc :: MEntity :: _is_fictive

Is self created for internal purpose?
private var _is_init: Bool

nitc :: MMethod :: _is_init

Is the property a constructor?
private var _is_new: Bool

nitc :: MMethod :: _is_new

Is the property a 'new' constructor?
private var _is_root_init: Bool

nitc :: MMethod :: _is_root_init

The constructor is a (the) root init with empty signature but a set of initializers
private var _is_test: Bool

nitc :: MProperty :: _is_test

private var _is_test: Bool

nitc :: MEntity :: _is_test

Is self created for unit testing purpose?
private var _is_toplevel: Bool

nitc :: MMethod :: _is_toplevel

Is the property defined at the top_level of the module?
private var _location: Location

nitc :: MProperty :: _location

private var _mcontract_facet: nullable MFacet

nitc :: MMethod :: _mcontract_facet

The contract facet of the method
private var _mdoc: nullable MDoc

nitc :: MEntity :: _mdoc

The documentation associated to the entity
private var _mensure: nullable MEnsure

nitc :: MMethod :: _mensure

The MEnsure contract if any
private var _mexample: nullable MExample

nitc :: MEntity :: _mexample

Return this entity as a MExample
private var _mexpect: nullable MExpect

nitc :: MMethod :: _mexpect

The MExpect contract if any
private var _mpropdefs: Array[MPROPDEF]

nitc :: MProperty :: _mpropdefs

All definitions of the property.
private var _name: String

nitc :: MProperty :: _name

The (short) name of the property
private var _offset: Int

nitc :: MMethod :: _offset

Relative offset of this method in the virtual table (from the beginning of the block)
private var _offset: Int

nitc :: MProperty :: _offset

Relative offset of this in the runtime instance
private var _restful_async: Bool

nitc :: MMethod :: _restful_async

Is this a restful method to be executed asynchronously
private var _restful_resources: Array[String]

nitc :: MMethod :: _restful_resources

Associated resources within an action, e.g. foo in http://localhost/foo?arg=bar
private var _restful_verbs: Array[String]

nitc :: MMethod :: _restful_verbs

HTTP access methods, e.g. GET
private var _setter_for: nullable MAttribute

nitc :: MMethod :: _setter_for

The attribute this setter is for
private var _visibility: MVisibility

nitc :: MProperty :: _visibility

The visibility of the property
protected fun accept_json_serializer(v: JsonSerializer)

serialization :: Serializable :: accept_json_serializer

Refinable service to customize the serialization of this class to JSON
protected fun accept_msgpack_attribute_counter(v: AttributeCounter)

serialization :: Serializable :: accept_msgpack_attribute_counter

Hook to customize the behavior of the AttributeCounter
protected fun accept_msgpack_serializer(v: MsgPackSerializer)

serialization :: Serializable :: accept_msgpack_serializer

Hook to customize the serialization of this class to MessagePack
private fun add_doc_to_infobox(res: HInfoBox)

nitc :: MEntity :: add_doc_to_infobox

Append an entry for the doc in the given infobox
protected fun add_to_bundle(bundle: NativeBundle, key: JavaString)

serialization :: Serializable :: add_to_bundle

Called by []= to dynamically choose the appropriate method according
fun api_url: String

nitc :: MEntity :: api_url

URL to self within the JSON api.
private fun build_c_implementation_signature(recv_mtype: MClassType, from_mmodule: MModule, suffix: nullable String, length: SignatureLength, call_context: CallContext): String

nitc :: MMethod :: build_c_implementation_signature

Similar to build_c_signature but adapted to create the signature expected by JNI for C functions
fun build_ccall(recv_mtype: MClassType, from_mmodule: MModule, suffix: nullable String, length: SignatureLength, call_context: CallContext, param_suffix: nullable String): String

nitc :: MMethod :: build_ccall

Build a C function call for the FFI implementation (uses friendly naming).
fun build_cname(recv_mtype: MClassType, from_mmodule: MModule, suffix: nullable String, length: SignatureLength): String

nitc :: MMethod :: build_cname

Build a C function name for the FFI implementation (uses friendly naming).
private fun build_contract_facet: MFacet

nitc :: MMethod :: build_contract_facet

Build mcontract_facet if is not exist and return it
fun build_csignature(recv_mtype: MClassType, from_mmodule: MModule, suffix: nullable String, length: SignatureLength, call_context: CallContext): String

nitc :: MMethod :: build_csignature

Build a C function signature for the FFI implementation (uses friendly naming).
private fun build_ensure: MEnsure

nitc :: MMethod :: build_ensure

Build mensure if is not exist and return it
private fun build_expect: MExpect

nitc :: MMethod :: build_expect

Build mexpect if is not exist and return it
private fun build_jni_format(recv_mtype: MClassType, from_mmodule: MModule): String

nitc :: MMethod :: build_jni_format

Returns the JNI signature format of this Nit method
abstract fun c_name: String

nitc :: MEntity :: c_name

A fully-qualified C-like identifier of this model entity.
protected fun c_name=(c_name: String)

nitc :: MProperty :: c_name=

protected fun class_factory(name: String): CLASS

core :: Object :: class_factory

Implementation used by get_class to create the specific class.
fun class_name: String

core :: Object :: class_name

The class name of the object.
fun collect_ancestors(mainmodule: MModule, filter: nullable ModelFilter): Set[MENTITY]

nitc :: MEntity :: collect_ancestors

Collect self ancestors (direct and indirect)
abstract fun collect_children(mainmodule: MModule, filter: nullable ModelFilter): Set[MENTITY]

nitc :: MEntity :: collect_children

Collect self children (direct descendants)
fun collect_descendants(mainmodule: MModule, filter: nullable ModelFilter): Set[MENTITY]

nitc :: MEntity :: collect_descendants

Collect self descendants (direct and direct)
fun collect_linearization(mainmodule: MModule): nullable Array[MEntity]

nitc :: MEntity :: collect_linearization

Collect self linearization anchored on mainmodule
fun collect_modifiers: Array[String]

nitc :: MEntity :: collect_modifiers

Collect modifier keywords like redef, private etc
fun collect_mpropdefs(filter: nullable ModelFilter): Set[MPropDef]

nitc :: MProperty :: collect_mpropdefs

Collect all property definitions of self
abstract fun collect_parents(mainmodule: MModule, filter: nullable ModelFilter): Set[MENTITY]

nitc :: MEntity :: collect_parents

Collect self parents (direct ancestors)
fun color: String

nitc :: MEntity :: color

private fun complete_mdoc: nullable MDoc

nitc :: MEntity :: complete_mdoc

Doc to use in completion
private fun complete_name: String

nitc :: MEntity :: complete_name

Actual name used in completion
protected fun const_color=(const_color: String)

nitc :: MEntity :: const_color=

fun core_serialize_to(serializer: Serializer)

serialization :: Serializable :: core_serialize_to

Actual serialization of self to serializer
abstract fun create_ast_representation(astbuilder: nullable ASTBuilder): ANode

nitc :: MEntity :: create_ast_representation

Build a ANode from self
private fun create_facet(v: ContractsVisitor, classdef: MClassDef, facet: MFacet, called: MMethod): AMethPropdef

nitc :: MMethod :: create_facet

Method to create a facet of the method.
fun cs_comment(no_color: nullable Bool): nullable String

nitc :: MEntity :: cs_comment

Returns the comment of this MEntity formatted for console.
fun cs_declaration(no_color: nullable Bool): String

nitc :: MEntity :: cs_declaration

Returns the complete MEntity declaration (modifiers + name + signature).
fun cs_full_name(no_color: nullable Bool): String

nitc :: MEntity :: cs_full_name

Returns self.full_name formatted for console
fun cs_icon(no_color: nullable Bool): String

nitc :: MEntity :: cs_icon

Text icon to be displayed in front of the entity
fun cs_list_item(no_color: nullable Bool): String

nitc :: MEntity :: cs_list_item

Returns self as a list element that can be displayed in console.
fun cs_location(no_color: nullable Bool): String

nitc :: MEntity :: cs_location

Source code location of this MEntity formatted for console
fun cs_short_comment(no_color: nullable Bool): nullable String

nitc :: MEntity :: cs_short_comment

Returns the comment of this MEntity formatted for console.
fun cs_signature(no_color: nullable Bool): String

nitc :: MEntity :: cs_signature

Returns self signature formatted for console.
fun cs_source_code: String

nitc :: MEntity :: cs_source_code

Source code associated to this MEntity.
fun css_classes: Array[String]

nitc :: MEntity :: css_classes

CSS classes used to decorate self
protected fun css_classes=(css_classes: Array[String])

nitc :: MEntity :: css_classes=

CSS classes used to decorate self
init defaultinit(intro_mclassdef: MClassDef, name: String, location: Location, visibility: MVisibility)

nitc :: MProperty :: defaultinit

init defaultinit(intro_mclassdef: MClassDef, name: String, location: Location, visibility: MVisibility)

nitc :: MMethod :: defaultinit

private fun define_contract_facet(v: ContractsVisitor, classdef: MClassDef, mcontract: nullable MContract)

nitc :: MMethod :: define_contract_facet

Define contract facet for MMethod in the given mclassdef. The facet represents the entry point with contracts (expect, ensure) of the method.
fun deprecation: nullable MDeprecationInfo

nitc :: MEntity :: deprecation

Is the entity deprecated?
fun deprecation=(deprecation: nullable MDeprecationInfo)

nitc :: MEntity :: deprecation=

Is the entity deprecated?
fun examples: Array[MExample]

nitc :: MEntity :: examples

Examples found for self
protected fun examples=(examples: Array[MExample])

nitc :: MEntity :: examples=

Examples found for self
init from_deserializer(deserializer: Deserializer)

serialization :: Serializable :: from_deserializer

Create an instance of this class from the deserializer
abstract fun full_name: String

nitc :: MEntity :: full_name

A fully-qualified name of this model entity.
protected fun full_name=(full_name: String)

nitc :: MProperty :: full_name=

The canonical name of the property.
fun get_class: CLASS

core :: Object :: get_class

The meta-object representing the dynamic type of self.
fun getter_for: nullable MAttribute

nitc :: MMethod :: getter_for

The attribute this getter is for
fun getter_for=(getter_for: nullable MAttribute)

nitc :: MMethod :: getter_for=

The attribute this getter is for
fun has_contract_facet: Bool

nitc :: MMethod :: has_contract_facet

Is there an contract facet?
fun has_ensure: Bool

nitc :: MMethod :: has_ensure

Is there an ensure contract?
fun has_expect: Bool

nitc :: MMethod :: has_expect

Is there an expect contract?
fun hash: Int

core :: Object :: hash

The hash code of the object.
fun hierarchy_poset(mainmodule: MModule, filter: nullable ModelFilter): POSet[MENTITY]

nitc :: MEntity :: hierarchy_poset

Build a poset representing self in it's own hierarchy
private fun href(v: NitlightVisitor): nullable String

nitc :: MEntity :: href

fun html_declaration: Template

nitc :: MEntity :: html_declaration

Returns the complete MEntity declaration decorated with HTML
fun html_full_name: String

nitc :: MEntity :: html_full_name

The MEntity full_name escaped for HTML
protected fun html_full_name=(html_full_name: String)

nitc :: MEntity :: html_full_name=

The MEntity full_name escaped for HTML
fun html_icon: BSIcon

nitc :: MEntity :: html_icon

An icon representative of the mentity
fun html_id: String

nitc :: MEntity :: html_id

The MEntity unique ID in the HTML output
protected fun html_id=(html_id: String)

nitc :: MEntity :: html_id=

The MEntity unique ID in the HTML output
fun html_name: String

nitc :: MEntity :: html_name

The MEntity name escaped for HTML
protected fun html_name=(html_name: String)

nitc :: MEntity :: html_name=

The MEntity name escaped for HTML
abstract fun html_namespace: Template

nitc :: MEntity :: html_namespace

Returns full_name decorated with HTML links
fun html_signature(short: nullable Bool): Template

nitc :: MEntity :: html_signature

Returns the MEntity signature decorated with HTML
fun html_url: String

nitc :: MEntity :: html_url

The MEntity URL in the HTML output
protected fun html_url=(html_url: String)

nitc :: MEntity :: html_url=

The MEntity URL in the HTML output
abstract fun infobox(v: HtmlightVisitor): HInfoBox

nitc :: HInfoBoxable :: infobox

An new infobox documenting the entity
init init

core :: Object :: init

fun inspect: String

core :: Object :: inspect

Developer readable representation of self.
protected fun inspect_head: String

core :: Object :: inspect_head

Return "CLASSNAME:#OBJECTID".
fun intro: MPROPDEF

nitc :: MProperty :: intro

The definition that introduces the property.
protected fun intro=(intro: MPROPDEF)

nitc :: MProperty :: intro=

The definition that introduces the property.
fun intro_mclassdef: MClassDef

nitc :: MProperty :: intro_mclassdef

The classdef that introduce the property
protected fun intro_mclassdef=(intro_mclassdef: MClassDef)

nitc :: MProperty :: intro_mclassdef=

The classdef that introduce the property
fun is_accessor: Bool

nitc :: MMethod :: is_accessor

Is this method a getter or a setter?
fun is_after: Bool

nitc :: MProperty :: is_after

Does self have the after annotation?
protected fun is_after=(is_after: Bool)

nitc :: MProperty :: is_after=

Does self have the after annotation?
fun is_after_all: Bool

nitc :: MProperty :: is_after_all

Does self have the after_all annotation?
protected fun is_after_all=(is_after_all: Bool)

nitc :: MProperty :: is_after_all=

Does self have the after_all annotation?
fun is_autoinit: Bool

nitc :: MProperty :: is_autoinit

Is the property usable as an initializer?
fun is_autoinit=(is_autoinit: Bool)

nitc :: MProperty :: is_autoinit=

Is the property usable as an initializer?
fun is_before: Bool

nitc :: MProperty :: is_before

Does self have the before annotation?
protected fun is_before=(is_before: Bool)

nitc :: MProperty :: is_before=

Does self have the before annotation?
fun is_before_all: Bool

nitc :: MProperty :: is_before_all

Does self have the before_all annotation?
protected fun is_before_all=(is_before_all: Bool)

nitc :: MProperty :: is_before_all=

Does self have the before_all annotation?
fun is_broken: Bool

nitc :: MEntity :: is_broken

The indication that the entity did not pass some semantic verifications.
fun is_broken=(is_broken: Bool)

nitc :: MEntity :: is_broken=

The indication that the entity did not pass some semantic verifications.
fun is_example: Bool

nitc :: MEntity :: is_example

Is self existing for an example purpose?
protected fun is_example=(is_example: Bool)

nitc :: MProperty :: is_example=

fun is_fictive: Bool

nitc :: MEntity :: is_fictive

Is self created for internal purpose?
fun is_fictive=(is_fictive: Bool)

nitc :: MEntity :: is_fictive=

Is self created for internal purpose?
fun is_getter: Bool

nitc :: MMethod :: is_getter

Is this method a getter (auto or not)?
fun is_init: Bool

nitc :: MMethod :: is_init

Is the property a constructor?
fun is_init=(is_init: Bool)

nitc :: MMethod :: is_init=

Is the property a constructor?
fun is_init_for(mclass: MClass): Bool

nitc :: MMethod :: is_init_for

Is the property a legal constructor for a given class?
fun is_new: Bool

nitc :: MMethod :: is_new

Is the property a 'new' constructor?
fun is_new=(is_new: Bool)

nitc :: MMethod :: is_new=

Is the property a 'new' constructor?
fun is_null_safe: Bool

nitc :: MMethod :: is_null_safe

A specific method that is safe to call on null.
fun is_root_init: Bool

nitc :: MMethod :: is_root_init

The constructor is a (the) root init with empty signature but a set of initializers
fun is_root_init=(is_root_init: Bool)

nitc :: MMethod :: is_root_init=

The constructor is a (the) root init with empty signature but a set of initializers
intern fun is_same_instance(other: nullable Object): Bool

core :: Object :: is_same_instance

Return true if self and other are the same instance (i.e. same identity).
fun is_same_serialized(other: nullable Object): Bool

core :: Object :: is_same_serialized

Is self the same as other in a serialization context?
intern fun is_same_type(other: Object): Bool

core :: Object :: is_same_type

Return true if self and other have the same dynamic type.
fun is_setter: Bool

nitc :: MMethod :: is_setter

Is this method a setter (auto or not)?
fun is_test: Bool

nitc :: MEntity :: is_test

Is self created for unit testing purpose?
fun is_test=(is_test: Bool)

nitc :: MEntity :: is_test=

Is self created for unit testing purpose?
fun is_toplevel: Bool

nitc :: MMethod :: is_toplevel

Is the property defined at the top_level of the module?
fun is_toplevel=(is_toplevel: Bool)

nitc :: MMethod :: is_toplevel=

Is the property defined at the top_level of the module?
private fun jname: String

nitc :: MEntity :: jname

A Java compatible name for self
abstract fun json_namespace: JsonNamespace

nitc :: MEntity :: json_namespace

Return self.full_name as an object that can be serialized to json.
fun linkto(v: HtmlightVisitor): HTMLTag

nitc :: MEntity :: linkto

A HTML version of to_s with hyper-links.
fun linkto_text(v: HtmlightVisitor, text: String): HTMLTag

nitc :: MEntity :: linkto_text

Link to the self with a specific text.
fun location: Location

nitc :: MEntity :: location

The origin of the definition.
protected fun location=(location: Location)

nitc :: MProperty :: location=

fun lookup_all_definitions(mmodule: MModule, mtype: MType): Array[MPROPDEF]

nitc :: MProperty :: lookup_all_definitions

Return all definitions in a linearization order
fun lookup_definitions(mmodule: MModule, mtype: MType): Array[MPROPDEF]

nitc :: MProperty :: lookup_definitions

Return the most specific property definitions defined or inherited by a type.
fun lookup_first_definition(mmodule: MModule, mtype: MType): MPROPDEF

nitc :: MProperty :: lookup_first_definition

Return the most specific definition in the linearization of mtype.
fun lookup_super_definitions(mmodule: MModule, mtype: MType): Array[MPROPDEF]

nitc :: MProperty :: lookup_super_definitions

Return the most specific property definitions inherited by a type.
private fun make_node(nodes: HashMap[MEntity, NeoNode], model_name: nullable String): NeoNode

nitc :: MEntity :: make_node

Make a new NeoNode based on mentity.
fun mcontract_facet: nullable MFacet

nitc :: MMethod :: mcontract_facet

The contract facet of the method
protected fun mcontract_facet=(mcontract_facet: nullable MFacet)

nitc :: MMethod :: mcontract_facet=

The contract facet of the method
fun mdoc: nullable MDoc

nitc :: MEntity :: mdoc

The documentation associated to the entity
fun mdoc=(mdoc: nullable MDoc)

nitc :: MEntity :: mdoc=

The documentation associated to the entity
fun mdoc_or_fallback: nullable MDoc

nitc :: MEntity :: mdoc_or_fallback

The documentation associated to the entity or their main nested entity.
fun mensure: nullable MEnsure

nitc :: MMethod :: mensure

The MEnsure contract if any
protected fun mensure=(mensure: nullable MEnsure)

nitc :: MMethod :: mensure=

The MEnsure contract if any
private fun mentity_kind_rank: Int

nitc :: MEntity :: mentity_kind_rank

Compare MEntity class kind
fun mexample: nullable MExample

nitc :: MEntity :: mexample

Return this entity as a MExample
protected fun mexample=(mexample: nullable MExample)

nitc :: MEntity :: mexample=

Return this entity as a MExample
fun mexpect: nullable MExpect

nitc :: MMethod :: mexpect

The MExpect contract if any
protected fun mexpect=(mexpect: nullable MExpect)

nitc :: MMethod :: mexpect=

The MExpect contract if any
abstract fun model: Model

nitc :: MEntity :: model

A Model Entity has a direct link to its model
fun mpropdefs: Array[MPROPDEF]

nitc :: MProperty :: mpropdefs

All definitions of the property.
protected fun mpropdefs=(mpropdefs: Array[MPROPDEF])

nitc :: MProperty :: mpropdefs=

All definitions of the property.
protected fun msgpack_extra_array_items: Int

serialization :: Serializable :: msgpack_extra_array_items

Hook to request a larger than usual metadata array
abstract fun name: String

nitc :: MEntity :: name

The short (unqualified) name of this model entity.
protected fun name=(name: String)

nitc :: MProperty :: name=

The (short) name of the property
private intern fun native_class_name: CString

core :: Object :: native_class_name

The class name of the object in CString format.
abstract fun nitdoc_breadcrumbs: Array[MEntity]

nitc :: MEntity :: nitdoc_breadcrumbs

MEntities composing the breadcrumbs of a nitdoc page
protected fun nitdoc_breadcrumbs=(nitdoc_breadcrumbs: Array[MEntity])

nitc :: MProperty :: nitdoc_breadcrumbs=

intern fun object_id: Int

core :: Object :: object_id

An internal hash code for the object based on its identity.
fun offset: Int

nitc :: MProperty :: offset

Relative offset of this in the runtime instance
protected fun offset=(offset: Int)

nitc :: MProperty :: offset=

Relative offset of this in the runtime instance
fun output

core :: Object :: output

Display self on stdout (debug only).
intern fun output_class_name

core :: Object :: output_class_name

Display class name on stdout (debug only).
fun ratings(config: NitwebConfig, user: nullable String): JsonObject

nitc :: MEntity :: ratings

Get the ratings of a mentity
fun ratings_by_dimension(config: NitwebConfig, dimension: String, user: nullable String): JsonObject

nitc :: MEntity :: ratings_by_dimension

Get the ratings of a dimension
private fun restful_async: Bool

nitc :: MMethod :: restful_async

Is this a restful method to be executed asynchronously
private fun restful_async=(restful_async: Bool)

nitc :: MMethod :: restful_async=

Is this a restful method to be executed asynchronously
private fun restful_resources: Array[String]

nitc :: MMethod :: restful_resources

Associated resources within an action, e.g. foo in http://localhost/foo?arg=bar
private fun restful_resources=(restful_resources: Array[String])

nitc :: MMethod :: restful_resources=

Associated resources within an action, e.g. foo in http://localhost/foo?arg=bar
private fun restful_verbs: Array[String]

nitc :: MMethod :: restful_verbs

HTTP access methods, e.g. GET
private fun restful_verbs=(restful_verbs: Array[String])

nitc :: MMethod :: restful_verbs=

HTTP access methods, e.g. GET
private fun select_most_specific(mmodule: MModule, candidates: Array[MPROPDEF]): Array[MPROPDEF]

nitc :: MProperty :: select_most_specific

Return an array containing olny the most specific property definitions
fun serialization_hash: Int

core :: Object :: serialization_hash

Hash value use for serialization
fun serialize_msgpack(plain: nullable Bool): Bytes

serialization :: Serializable :: serialize_msgpack

Serialize self to MessagePack bytes
fun serialize_to(serializer: Serializer)

serialization :: Serializable :: serialize_to

Serialize self to serializer
fun serialize_to_json(plain: nullable Bool, pretty: nullable Bool): String

serialization :: Serializable :: serialize_to_json

Serialize self to JSON
private fun serialize_to_or_delay(v: Serializer)

serialization :: Serializable :: serialize_to_or_delay

Accept references or force direct serialization (using serialize_to)
fun setter_for: nullable MAttribute

nitc :: MMethod :: setter_for

The attribute this setter is for
fun setter_for=(setter_for: nullable MAttribute)

nitc :: MMethod :: setter_for=

The attribute this setter is for
fun short_cname: String

nitc :: MMethod :: short_cname

Short name of this method in C (without the class name)
private fun source_url(url_pattern: nullable String): String

nitc :: MEntity :: source_url

Render a HTML link for the MEntity location
intern fun sys: Sys

core :: Object :: sys

Return the global sys object, the only instance of the Sys class.
fun to_dot_node: DotNode

nitc :: MEntity :: to_dot_node

Return self as a DotNode
fun to_json: String

serialization :: Serializable :: to_json

Serialize self to plain JSON
fun to_json_ref: MEntityRef

nitc :: MEntity :: to_json_ref

Return a new MEntityRef to self.
abstract fun to_jvalue(env: JniEnv): JValue

core :: Object :: to_jvalue

private fun to_node(nodes: HashMap[MEntity, NeoNode], model_name: nullable String): NeoNode

nitc :: MEntity :: to_node

Build a NeoNode representing self.
fun to_pretty_json: String

serialization :: Serializable :: to_pretty_json

Serialize self to plain pretty JSON
fun to_s: String

core :: Object :: to_s

User readable representation of self.
abstract fun tpl_class(model: UMLModel): Writable

nitc :: MEntity :: tpl_class

Generates a dot-compatible Writable UML Class diagram from self
abstract fun tpl_module(model: UMLModel): Writable

nitc :: MEntity :: tpl_module

Builds a dot UML package diagram entity from self
fun visibility: MVisibility

nitc :: MEntity :: visibility

The visibility of the MEntity.
protected fun visibility=(visibility: MVisibility)

nitc :: MProperty :: visibility=

The visibility of the property
fun visit_all(v: ModelVisitor)

nitc :: MEntity :: visit_all

Call v.enter_visit on all nested entities.
fun web_url: String

nitc :: MEntity :: web_url

URL to self within the web interface.
private fun write_doc(model: Model, mainmodule: MModule, stream: Writer)

nitc :: MEntity :: write_doc

private fun write_extra_doc(model: Model, mainmodule: MModule, stream: Writer)

nitc :: MEntity :: write_extra_doc

Extra auto documentation to append to the stream
private fun write_location(mainmodule: MModule, stream: Writer)

nitc :: MEntity :: write_location

Location (file and line when available) of related declarations
private fun write_synopsis(mainmodule: MModule, stream: Writer)

nitc :: MProperty :: write_synopsis

package_diagram nitc::MMethod MMethod nitc::MProperty MProperty nitc::MMethod->nitc::MProperty nitc::java_compiler::TableCallable TableCallable nitc::MMethod->nitc::java_compiler::TableCallable nitc::MEntity MEntity nitc::MProperty->nitc::MEntity nitc::PropertyLayoutElement PropertyLayoutElement nitc::MProperty->nitc::PropertyLayoutElement core::Object Object nitc::java_compiler::TableCallable->core::Object ...nitc::MEntity ... ...nitc::MEntity->nitc::MEntity ...nitc::PropertyLayoutElement ... ...nitc::PropertyLayoutElement->nitc::PropertyLayoutElement ...core::Object ... ...core::Object->core::Object nitc::MContract MContract nitc::MContract->nitc::MMethod nitc::MFacet MFacet nitc::MFacet->nitc::MMethod nitc::MExpect MExpect nitc::MExpect->nitc::MContract nitc::BottomMContract BottomMContract nitc::BottomMContract->nitc::MContract nitc::MExpect... ... nitc::MExpect...->nitc::MExpect nitc::BottomMContract... ... nitc::BottomMContract...->nitc::BottomMContract

Ancestors

interface HInfoBoxable

nitc :: HInfoBoxable

Model entity or whatever that can produce an infobox
abstract class MEntity

nitc :: MEntity

A named and possibly documented entity in the model.
interface Object

core :: Object

The root of the class hierarchy.
interface Serializable

serialization :: Serializable

Instances of this class can be passed to Serializer::serialize

Parents

abstract class MProperty

nitc :: MProperty

A service (global property) that generalize method, attribute, etc.
private interface TableCallable

nitc :: TableCallable

Used as a common type between MMethod and MMethodDef for table_send

Children

abstract class MContract

nitc :: MContract

The root of all contracts
class MFacet

nitc :: MFacet

A facet contract representation

Descendants

abstract class BottomMContract

nitc :: BottomMContract

The root of all contracts where the call is after the execution of the original method (invariant and ensure).
class MEnsure

nitc :: MEnsure

A ensure (postcondition) representation
class MExpect

nitc :: MExpect

An expect (precondition) contract representation

Class definitions

nitc $ MMethod
# A global method
class MMethod
	super MProperty

	redef type MPROPDEF: MMethodDef

	# Is the property defined at the top_level of the module?
	# Currently such a property are stored in `Object`
	var is_toplevel: Bool = false is writable

	# Is the property a constructor?
	# Warning, this property can be inherited by subclasses with or without being a constructor
	# therefore, you should use `is_init_for` the verify if the property is a legal constructor for a given class
	var is_init: Bool = false is writable

	# The constructor is a (the) root init with empty signature but a set of initializers
	var is_root_init: Bool = false is writable

	# Is the property a 'new' constructor?
	var is_new: Bool = false is writable

	# Is the property a legal constructor for a given class?
	# As usual, visibility is not considered.
	# FIXME not implemented
	fun is_init_for(mclass: MClass): Bool
	do
		return self.is_init
	end

	# A specific method that is safe to call on null.
	# Currently, only `==`, `!=` and `is_same_instance` are safe
	fun is_null_safe: Bool do return name == "==" or name == "!=" or name == "is_same_instance"

	# Is this method a getter (auto or not)?
	#
	# See `getter_for`.
	fun is_getter: Bool do return getter_for != null

	# The attribute this getter is for
	#
	# Return `null` is this method is not a getter.
	var getter_for: nullable MAttribute = null is writable

	# Is this method a setter (auto or not)?
	#
	# See `setter_for`.
	fun is_setter: Bool do return setter_for != null

	# The attribute this setter is for
	#
	# Return `null` is this method is not a setter.
	var setter_for: nullable MAttribute = null is writable

	# Is this method a getter or a setter?
	fun is_accessor: Bool do return is_getter or is_setter
end
src/model/model.nit:2411,1--2466,3

nitc :: nitni_base $ MMethod
redef class MMethod
	# Short name of this method in C (without the class name)
	fun short_cname: String do
		var nit_name = name

		if nit_name == "+" then return "_plus"
		if nit_name == "-" then return "_minus"
		if nit_name == "unary -" then return "_unary_minus"
		if nit_name == "unary +" then return "_unary_plus"
		if nit_name == "unary ~" then return "_unary_tilde"
		if nit_name == "*" then return "_star"
		if nit_name == "/" then return "_slash"
		if nit_name == "%" then return "_percent"
		if nit_name == "[]" then return "_index"
		if nit_name == "[]=" then return "_index_assign"
		if nit_name == "==" then return "_equal"
		if nit_name == "<" then return "_less"
		if nit_name == ">" then return "_greater"
		if nit_name == "<=" then return "_less_or_equal"
		if nit_name == ">=" then return "_greater_or_equal"
		if nit_name == "!=" then return "_not_equal"
		if nit_name == "<<" then return "_left"
		if nit_name == ">>" then return "_right"
		if nit_name == "<=>" then return "_starship"
		if nit_name == "|" then return "_pipe"
		if nit_name == "^" then return "_caret"
		if nit_name == "&" then return "_amp"
		if nit_name == "~" then return "_tilde"

		if nit_name.chars.last == '=' then return "{nit_name.substring(0, nit_name.length-1)}__assign"
		return nit_name
	end
end
src/nitni/nitni_base.nit:26,1--58,3

nitc :: model_contract $ MMethod
redef class MMethod

	# The contract facet of the method
	# is representing the method with a contract
	# This method calls contracts (expect, ensure) and the method
	var mcontract_facet: nullable MFacet = null

	# The `MExpect` contract if any
	var mexpect: nullable MExpect = null

	# The `MEnsure` contract if any
	var mensure: nullable MEnsure = null

	# Build `mensure` if is not exist and return it
	private fun build_ensure: MEnsure
	do
		var m_mensure = self.mensure
		# build a new `MEnsure` contract
		if m_mensure == null then m_mensure = new MEnsure(intro_mclassdef, "_ensure_{name}", intro_mclassdef.location, public_visibility)
		self.mensure = m_mensure
		return m_mensure
	end

	# Is there an ensure contract?
	fun has_ensure: Bool
	do
		return self.mensure != null
	end

	# Build `mexpect` if is not exist and return it
	private fun build_expect: MExpect
	do
		var m_mexpect = self.mexpect
		# build a new `MExpect` contract
		if m_mexpect == null then m_mexpect = new MExpect(intro_mclassdef, "_expect_{name}", intro_mclassdef.location, public_visibility)
		self.mexpect = m_mexpect
		return m_mexpect
	end

	# Is there an expect contract?
	fun has_expect: Bool
	do
		return self.mexpect != null
	end

	# Build `mcontract_facet` if is not exist and return it
	private fun build_contract_facet: MFacet
	do
		var m_mcontract_facet = self.mcontract_facet
		# build a new `MFacet` contract
		if m_mcontract_facet == null then m_mcontract_facet = new MFacet(intro_mclassdef, "_contract_{name}", intro_mclassdef.location, public_visibility)
		self.mcontract_facet = m_mcontract_facet
		return m_mcontract_facet
	end

	# Is there an contract facet?
	fun has_contract_facet: Bool
	do
		return self.mcontract_facet != null
	end
end
src/model/model_contract.nit:60,1--120,3

nitc :: nitni_utilities $ MMethod
redef class MMethod
	# Build a C function name for the FFI implementation (uses friendly naming).
	# * On a specific static receiver type `recv_mtype`
	# * In referene to the module `from_module` (used for type resolving and as a possible prefix)
	# * Has a possible `suffix` to the method name (may be "__super", "__impl", null, etc.)
	# * With a specified length indicating whether it uses the sort name or the long name with
	#   the module name as prefix
	fun build_cname(recv_mtype: MClassType, from_mmodule: MModule, suffix: nullable String, length: SignatureLength): String
	do
		var cname
		if self.is_init then
			if self.name == "init" or self.name == "new" or self.name == "defaultinit" then
				cname = "new_{recv_mtype.mangled_cname}"
			else
				cname = "new_{recv_mtype.mangled_cname}_{self.short_cname}"
			end
		else
			cname = "{recv_mtype.mangled_cname}_{self.short_cname}"
		end

		if suffix != null then cname = "{cname}{suffix}"

		if length.long then cname = "{from_mmodule.c_name}___{cname}"

		return cname
	end

	# Build a C function signature for the FFI implementation (uses friendly naming).
	# * On a specific static receiver type `recv_mtype`
	# * In referene to the module `from_module` (used for type resolving and as a possible prefix)
	# * Has a possible `suffix` to the method name (may be "__super", "__impl", null, etc.)
	# * With a specified length indicating whether it uses the sort name or the long name with
	#   the module name as prefix
	# * The `call_context` identifying which types and casts to use (see `CallContext` and its instances)
	fun build_csignature(recv_mtype: MClassType, from_mmodule: MModule, suffix: nullable String, length: SignatureLength, call_context: CallContext): String
	do
		var mmethoddef = lookup_first_definition(from_mmodule, recv_mtype)
		var signature = mmethoddef.msignature
		assert signature != null

		var creturn_type
		if self.is_init then
			creturn_type = call_context.name_mtype(recv_mtype)
		else if signature.return_mtype != null then
			var ret_mtype = signature.return_mtype
			ret_mtype = ret_mtype.resolve_for(recv_mtype, recv_mtype, from_mmodule, true)
			creturn_type = call_context.name_mtype(ret_mtype)
		else
			creturn_type = "void"
		end

		var cname = build_cname(recv_mtype, from_mmodule, suffix, length)

		var cparams = new List[String]
		if not self.is_init then
			cparams.add( "{call_context.name_mtype(recv_mtype)} self" )
		end
		for p in signature.mparameters do
			var param_mtype = p.mtype.resolve_for(recv_mtype, recv_mtype, from_mmodule, true)
			cparams.add( "{call_context.name_mtype(param_mtype)} {p.name}" )
		end

		return "{creturn_type} {cname}( {cparams.join(", ")} )"
	end

	# Build a C function call for the FFI implementation (uses friendly naming).
	# * On a specific static receiver type `recv_mtype`
	# * In referene to the module `from_module` (used for type resolving and as a possible prefix)
	# * Has a possible `suffix` to the method name (may be "__super", "__impl", null, etc.)
	# * With a specified length indicating whether it uses the sort name or the long name with
	#   the module name as prefix
	# * The `call_context` identifying which types and casts to use (see `CallContext` and its instances)
	# * Possible suffix to the parameters `param_suffix`
	fun build_ccall(recv_mtype: MClassType, from_mmodule: MModule, suffix: nullable String, length: SignatureLength, call_context: CallContext, param_suffix: nullable String): String
	do
		if param_suffix == null then param_suffix = ""

		var mmethoddef = lookup_first_definition(from_mmodule, recv_mtype)
		var signature = mmethoddef.msignature
		assert signature != null

		var return_mtype = null
		if self.is_init then
			return_mtype = recv_mtype
		else if signature.return_mtype != null then
			return_mtype = signature.return_mtype
			return_mtype = return_mtype.resolve_for(recv_mtype, recv_mtype, from_mmodule, true)
		end

		var cname = build_cname(recv_mtype, from_mmodule, suffix, length)

		var cparams = new List[String]
		if not self.is_init then
			cparams.add(call_context.cast_to(recv_mtype, "self{param_suffix}"))
		end

		for p in signature.mparameters do
			var param_mtype = p.mtype.resolve_for(recv_mtype, recv_mtype, from_mmodule, true)
			cparams.add(call_context.cast_to(param_mtype, "{p.name}{param_suffix}"))
		end

		var joined_cparams = cparams.join(", ")
		var ccall = "{cname}({joined_cparams})"
		if return_mtype != null then
			return "return {call_context.cast_from(return_mtype, ccall)};"
		else
			return "{ccall};"
		end
	end
end
src/nitni/nitni_utilities.nit:20,1--129,3

nitc :: virtual_machine $ MMethod
redef class MMethod
	# Relative offset of this method in the virtual table (from the beginning of the block)
	redef var offset: Int
end
src/vm/virtual_machine.nit:872,1--875,3

nitc :: nitrestful $ MMethod
redef class MMethod
	# HTTP access methods, e.g. `GET, POST, PUT or DELETE`
	private var restful_verbs = new Array[String] is lazy

	# Associated resources within an action, e.g. `foo` in `http://localhost/foo?arg=bar`
	private var restful_resources: Array[String] = [name] is lazy

	# Is this a `restful` method to be executed asynchronously
	private var restful_async = false
end
src/nitrestful.nit:94,1--103,3

nitc :: neo $ MMethod
redef class MMethod
	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["is_init"] = is_init
		return node
	end
end
src/neo.nit:780,1--787,3

nitc :: contracts $ MMethod
redef class MMethod

	# Define contract facet for MMethod in the given mclassdef. The facet represents the entry point with contracts (expect, ensure) of the method.
	# If a contract is given adapt the contract facet.
	#
	# `classdef`: Indicates the class where we want to introduce our facet
	# `exist_contract`: Indicates if it is necessary to define a new facet for the contract. If `exist_contract_facet and exist_contract` it's not necessary to add a facet.
	#
	# Exemple:
	# ~~~nitish
	# from:
	#	classe A
	#		i :Int
	#		fun add_one is ensure(old(i) + 1 == i)
	#	end
	# to:
	#	classe A
	#		fun add_one is ensure(old(i) + 1 == i)
	#
	#		# The contract facet
	#		fun contract_add_one do
	#			add_one
	#			ensure_add_one(old_add_one)
	#		end
	#	end
	# ~~
	private fun define_contract_facet(v: ContractsVisitor, classdef: MClassDef, mcontract: nullable MContract)
	do
		var exist_contract_facet = has_contract_facet
		var contract_facet = build_contract_facet
		# Do nothing the contract and the contract facet already exist
		if mcontract != null and mcontract.is_already_applied(contract_facet) then return

		var n_contract_facet: AMethPropdef
		if not exist_contract_facet then
			# If has no contract facet in intro just create it
			if classdef != intro_mclassdef then
				var n_intro_face = create_facet(v, intro_mclassdef, contract_facet, self)
				n_intro_face.location = self.intro.location
				n_intro_face.do_all(v.toolcontext)
			end
			n_contract_facet = create_facet(v, classdef, contract_facet, self)
		else
			# Check if the contract facet already exist in this context (in this classdef)
			if classdef.mpropdefs_by_property.has_key(contract_facet) then
				# get the definition
				n_contract_facet = v.toolcontext.modelbuilder.mpropdef2node(classdef.mpropdefs_by_property[contract_facet]).as(AMethPropdef)
			else
				# create a new contract facet definition
				n_contract_facet = create_facet(v, classdef, contract_facet, self)
				var block = v.ast_builder.make_block
				# super call to the contract facet
				var args = n_contract_facet.n_signature.make_parameter_read(v.ast_builder)
				var n_super_call = v.ast_builder.make_super_call(args)
				# verification for add a return or not
				if self.intro.msignature.return_mtype != null then
					block.add(v.ast_builder.make_return(n_super_call))
				else
					block.add(n_super_call)
				end
				n_contract_facet.n_block = block
			end
		end
		if mcontract != null then mcontract.adapt_method_to_contract(v, contract_facet, n_contract_facet)

		n_contract_facet.location = v.current_location
		n_contract_facet.do_all(v.toolcontext)
	end

	# Method to create a facet of the method.
	# See `define_contract_facet` for more information about two types of facets.
	#
	# `called` : is the property to call in this facet.
	private fun create_facet(v: ContractsVisitor, classdef: MClassDef, facet: MFacet, called: MMethod): AMethPropdef
	is
		expect( called.is_same_instance(self) or called.is_same_instance(self.mcontract_facet) )
	do
		# Defines the contract facet is an init or not
		# it is necessary to use the contracts with in a constructor
		facet.is_init = is_init
		var n_contractdef = v.toolcontext.modelbuilder.create_method_from_property(facet, classdef, false, self.intro.msignature)
		# FIXME set the location because the callsite creation need the node location
		n_contractdef.location = v.current_location
		n_contractdef.validate

		var block = v.ast_builder.make_block

		# Arguments to call the `called` property
		var args: Array[AExpr]
		args = n_contractdef.n_signature.make_parameter_read(v.ast_builder)

		var callsite = v.ast_builder.create_callsite(v.toolcontext.modelbuilder, n_contractdef, called, true)
		var n_call = v.ast_builder.make_call(new ASelfExpr, callsite, args)

		if self.intro.msignature.return_mtype == null then
			block.add(n_call)
		else
			block.add(v.ast_builder.make_return(n_call))
		end

		n_contractdef.n_block = block
		n_contractdef.do_all(v.toolcontext)
		return n_contractdef
	end
end
src/contracts.nit:553,1--657,3

nitc :: java $ MMethod
redef class MMethod
	# Returns the JNI signature format of this Nit method
	#
	# Example: a Nity signature `(Bool, Int, Float, JavaString)` is represented by
	# the JNI format `(ZIDLjava/lang/string;)V"
	private fun build_jni_format(recv_mtype: MClassType, from_mmodule: MModule): String
	do
		var mmethoddef = lookup_first_definition(from_mmodule, recv_mtype)
		var msignature = mmethoddef.msignature
		var format = new Array[String]

		format.add "("

		# receiver
		if not self.is_init then format.add recv_mtype.jni_format

		# parameters
		for p in msignature.mparameters do
			var param_mtype = p.mtype.resolve_for(recv_mtype, recv_mtype, from_mmodule, true)
			format.add param_mtype.jni_format
		end
		format.add ")"

		# return
		if self.is_init then
			format.add recv_mtype.jni_format
		else
			var return_mtype = msignature.return_mtype
			if return_mtype != null then
				return_mtype = return_mtype.resolve_for(recv_mtype, recv_mtype, from_mmodule, true)
				format.add return_mtype.jni_format
			else format.add "V"
		end

		return format.join
	end

	# Similar to `build_c_signature` but adapted to create the signature expected by JNI for C functions
	# implementing Java extern methods.
	#
	# Is used to generate FFI callbacks to Nit at `MExplicitCall::compile_callback_to_java`.
	private fun build_c_implementation_signature(recv_mtype: MClassType, from_mmodule: MModule,
		suffix: nullable String, length: SignatureLength, call_context: CallContext): String
	do
		var mmethoddef = lookup_first_definition(from_mmodule, recv_mtype)
		var signature = mmethoddef.msignature
		assert signature != null

		var creturn_type
		if self.is_init then
			creturn_type = call_context.name_mtype(recv_mtype)
		else if signature.return_mtype != null then
			var ret_mtype = signature.return_mtype
			ret_mtype = ret_mtype.resolve_for(recv_mtype, recv_mtype, from_mmodule, true)
			creturn_type = call_context.name_mtype(ret_mtype)
		else
			creturn_type = "void"
		end

		var cname = build_cname(recv_mtype, from_mmodule, suffix, length)

		var cparams = new List[String]

		cparams.add "JNIEnv *nit_ffi_jni_env"
		cparams.add "jclass clazz"

		if not self.is_init then
			cparams.add "{call_context.name_mtype(recv_mtype)} self"
		end
		for p in signature.mparameters do
			var param_mtype = p.mtype.resolve_for(recv_mtype, recv_mtype, from_mmodule, true)
			cparams.add "{call_context.name_mtype(param_mtype)} {p.name}"
		end

		return "{creturn_type} {cname}( {cparams.join(", ")} )"
	end
end
src/ffi/java.nit:756,1--832,3

nitc :: java_compiler $ MMethod
redef class MMethod
	super TableCallable
end
src/compiler/java_compiler.nit:1395,1--1397,3

nitc :: uml_class $ MMethod
redef class MMethod
	redef fun tpl_class(model) do
		var tpl = new Template
		tpl.add visibility.tpl_class
		tpl.add " "
		tpl.add name.escape_to_dot
		tpl.add intro.msignature.tpl_class(model)
		return tpl
	end
end
src/uml/uml_class.nit:104,1--113,3

nitc :: json_model $ MMethod
redef class MMethod
	redef fun core_serialize_to(v) do
		super
		if is_init then
			v.serialize_attribute("is_init", true)
		end
		v.serialize_attribute("msignature", intro.msignature)
	end
end
src/doc/templates/json_model.nit:223,1--231,3