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

MProperty are global to the model; it means that a MProperty is not bound to a specific MModule nor a specific MClass.

A MProperty gather definitions (see mpropdefs) ; one for the introduction and the other in subclasses and in refinements.

A MProperty is used to denotes services in polymorphic way (ie. independent of any dynamic type). For instance, a call site "x.foo" is associated to a MProperty.

Introduced properties

type MPROPDEF: MPropDef

nitc :: MProperty :: MPROPDEF

The associated MPropDef subclass.
private var _c_name: String

nitc :: MProperty :: _c_name

private var _full_name: String

nitc :: MProperty :: _full_name

The canonical name of the property.
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_example: Bool

nitc :: MProperty :: _is_example

private var _is_test: Bool

nitc :: MProperty :: _is_test

private var _location: Location

nitc :: MProperty :: _location

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 :: MProperty :: _offset

Relative offset of this in the runtime instance
private var _visibility: MVisibility

nitc :: MProperty :: _visibility

The visibility of the property
protected fun c_name=(c_name: String)

nitc :: MProperty :: c_name=

fun collect_mpropdefs(filter: nullable ModelFilter): Set[MPropDef]

nitc :: MProperty :: collect_mpropdefs

Collect all property definitions of self
init defaultinit(intro_mclassdef: MClassDef, name: String, location: Location, visibility: MVisibility)

nitc :: MProperty :: defaultinit

protected fun full_name=(full_name: String)

nitc :: MProperty :: full_name=

The canonical name of the property.
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_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?
protected fun is_example=(is_example: Bool)

nitc :: MProperty :: is_example=

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.
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 name=(name: String)

nitc :: MProperty :: name=

The (short) name of the property
protected fun nitdoc_breadcrumbs=(nitdoc_breadcrumbs: Array[MEntity])

nitc :: MProperty :: nitdoc_breadcrumbs=

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
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
protected fun visibility=(visibility: MVisibility)

nitc :: MProperty :: visibility=

The visibility of the property
private fun write_synopsis(mainmodule: MModule, stream: Writer)

nitc :: MProperty :: write_synopsis

Redefined properties

redef type SELF: MProperty

nitc $ MProperty :: SELF

Type of this instance, automatically specialized in every class
redef fun c_name: String

nitc $ MProperty :: c_name

A fully-qualified C-like identifier of this model entity.
redef fun collect_children(mainmodule: MModule, filter: nullable ModelFilter): Set[MENTITY]

nitc :: model_collect $ MProperty :: collect_children

Collection all definitions that have self as a direct super definition
redef fun collect_linearization(mainmodule: MModule): nullable Array[MEntity]

nitc :: model_collect $ MProperty :: collect_linearization

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

nitc :: model_collect $ MProperty :: collect_modifiers

Collect modifier keywords like redef, private etc
redef fun collect_parents(mainmodule: MModule, filter: nullable ModelFilter): Set[MENTITY]

nitc :: model_collect $ MProperty :: collect_parents

Collect all direct super definitions of self
redef fun cs_icon(no_color: nullable Bool): String

nitc :: term_model $ MProperty :: cs_icon

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

nitc :: term_model $ MProperty :: cs_signature

Returns self signature formatted for console.
redef fun css_classes: Array[String]

nitc :: html_model $ MProperty :: css_classes

CSS classes used to decorate self
redef fun examples: Array[MExample]

nitc :: model_examples $ MProperty :: examples

Examples found for self
redef fun full_name: String

nitc $ MProperty :: full_name

The canonical name of the property.
redef fun href(v: NitlightVisitor): nullable String

nitc :: nitlight $ MProperty :: href

redef fun html_declaration: Template

nitc :: html_model $ MProperty :: html_declaration

Returns the complete MEntity declaration decorated with HTML
redef fun html_icon: BSIcon

nitc :: html_model $ MProperty :: html_icon

An icon representative of the mentity
redef fun html_namespace: Template

nitc :: html_model $ MProperty :: html_namespace

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

nitc :: html_model $ MProperty :: html_signature

Returns the MEntity signature decorated with HTML
redef fun html_url: String

nitc :: static_html $ MProperty :: html_url

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

nitc :: static_html $ MProperty :: html_url=

The MEntity URL in the HTML output
redef init init

nitc $ MProperty :: init

redef fun is_example: Bool

nitc :: model_examples $ MProperty :: is_example

Is self existing for an example purpose?
redef fun is_test: Bool

nitc $ MProperty :: is_test

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

nitc $ MProperty :: is_test=

Is self created for unit testing purpose?
redef fun json_namespace: JsonNamespace

nitc :: json_model $ MProperty :: json_namespace

Return self.full_name as an object that can be serialized to json.
redef fun location: Location

nitc $ MProperty :: location

The origin of the definition.
redef fun mdoc_or_fallback: nullable MDoc

nitc $ MProperty :: mdoc_or_fallback

The documentation associated to the entity or their main nested entity.
redef fun mentity_kind_rank: Int

nitc :: model_index $ MProperty :: mentity_kind_rank

Compare MEntity class kind
redef fun model: Model

nitc $ MProperty :: model

A Model Entity has a direct link to its model
redef fun name: String

nitc $ MProperty :: name

The (short) name of the property
redef fun nitdoc_breadcrumbs: Array[MEntity]

nitc :: static_base $ MProperty :: nitdoc_breadcrumbs

MEntities composing the breadcrumbs of a nitdoc page
redef fun to_node(nodes: HashMap[MEntity, NeoNode], model_name: nullable String): NeoNode

nitc :: neo $ MProperty :: to_node

Build a NeoNode representing self.
redef fun to_s: String

nitc $ MProperty :: to_s

Alias for name
redef fun visibility: MVisibility

nitc $ MProperty :: visibility

The visibility of the property

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 _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 :: MProperty :: _html_url

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 _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_test: Bool

nitc :: MEntity :: _is_test

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

nitc :: MProperty :: _is_test

private var _location: Location

nitc :: MProperty :: _location

private var _mdoc: nullable MDoc

nitc :: MEntity :: _mdoc

The documentation associated to the entity
private var _mexample: nullable MExample

nitc :: MEntity :: _mexample

Return this entity as a MExample
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 :: MProperty :: _offset

Relative offset of this in the runtime instance
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.
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
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

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 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_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?
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_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?
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 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.
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
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 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)
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::MProperty MProperty nitc::MEntity MEntity nitc::MProperty->nitc::MEntity nitc::PropertyLayoutElement PropertyLayoutElement nitc::MProperty->nitc::PropertyLayoutElement nitc::HInfoBoxable HInfoBoxable nitc::MEntity->nitc::HInfoBoxable serialization::Serializable Serializable nitc::MEntity->serialization::Serializable core::Object Object nitc::PropertyLayoutElement->core::Object ...nitc::HInfoBoxable ... ...nitc::HInfoBoxable->nitc::HInfoBoxable ...serialization::Serializable ... ...serialization::Serializable->serialization::Serializable ...core::Object ... ...core::Object->core::Object nitc::MMethod MMethod nitc::MMethod->nitc::MProperty nitc::MAttribute MAttribute nitc::MAttribute->nitc::MProperty nitc::MVirtualTypeProp MVirtualTypeProp nitc::MVirtualTypeProp->nitc::MProperty nitc::MInnerClass MInnerClass nitc::MInnerClass->nitc::MProperty nitc::MContract MContract nitc::MContract->nitc::MMethod nitc::MFacet MFacet nitc::MFacet->nitc::MMethod nitc::MContract... ... nitc::MContract...->nitc::MContract nitc::MFacet... ... nitc::MFacet...->nitc::MFacet

Ancestors

interface HInfoBoxable

nitc :: HInfoBoxable

Model entity or whatever that can produce an infobox
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 MEntity

nitc :: MEntity

A named and possibly documented entity in the model.

Children

class MAttribute

nitc :: MAttribute

A global attribute
class MInnerClass

nitc :: MInnerClass

An inner class.
class MMethod

nitc :: MMethod

A global method
class MVirtualTypeProp

nitc :: MVirtualTypeProp

A global virtual type

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).
abstract class MContract

nitc :: MContract

The root of all contracts
class MEnsure

nitc :: MEnsure

A ensure (postcondition) representation
class MExpect

nitc :: MExpect

An expect (precondition) contract representation
class MFacet

nitc :: MFacet

A facet contract representation

Class definitions

nitc $ MProperty
# A service (global property) that generalize method, attribute, etc.
#
# `MProperty` are global to the model; it means that a `MProperty` is not bound
# to a specific `MModule` nor a specific `MClass`.
#
# A MProperty gather definitions (see `mpropdefs`) ; one for the introduction
# and the other in subclasses and in refinements.
#
# A `MProperty` is used to denotes services in polymorphic way (ie. independent
# of any dynamic type).
# For instance, a call site "x.foo" is associated to a `MProperty`.
abstract class MProperty
	super MEntity

	# The associated MPropDef subclass.
	# The two specialization hierarchy are symmetric.
	type MPROPDEF: MPropDef

	# The classdef that introduce the property
	# While a property is not bound to a specific module, or class,
	# the introducing mclassdef is used for naming and visibility
	var intro_mclassdef: MClassDef

	# The (short) name of the property
	redef var name

	redef var location

	redef fun mdoc_or_fallback
	do
		# Don’t use `intro.mdoc_or_fallback` because it would create an infinite
		# recursion.
		return intro.mdoc
	end

	# The canonical name of the property.
	#
	# It is currently the short-`name` prefixed by the short-name of the class and the full-name of the module.
	# Example: "my_package::my_module::MyClass::my_method"
	#
	# The full-name of the module is needed because two distinct modules of the same package can
	# still refine the same class and introduce homonym properties.
	#
	# For public properties not introduced by refinement, the module name is not used.
	#
	# Example: `my_package::MyClass::My_method`
	redef var full_name is lazy do
		if intro_mclassdef.is_intro then
			return "{intro_mclassdef.mmodule.namespace_for(visibility)}::{intro_mclassdef.mclass.name}::{name}"
		else
			return "{intro_mclassdef.mmodule.full_name}::{intro_mclassdef.mclass.name}::{name}"
		end
	end

	redef var c_name is lazy do
		# FIXME use `namespace_for`
		return "{intro_mclassdef.mmodule.c_name}__{intro_mclassdef.mclass.name.to_cmangle}__{name.to_cmangle}"
	end

	# The visibility of the property
	redef var visibility

	# Is the property usable as an initializer?
	var is_autoinit = false is writable

	init
	do
		intro_mclassdef.intro_mproperties.add(self)
		var model = intro_mclassdef.mmodule.model
		model.mproperties_by_name.add_one(name, self)
		model.mproperties.add(self)
	end

	# All definitions of the property.
	# The first is the introduction,
	# The other are redefinitions (in refinements and in subclasses)
	var mpropdefs = new Array[MPROPDEF]

	# The definition that introduces the property.
	#
	# Warning: such a definition may not exist in the early life of the object.
	# In this case, the method will abort.
	var intro: MPROPDEF is noinit

	redef fun model do return intro.model

	# Alias for `name`
	redef fun to_s do return name

	# Return the most specific property definitions defined or inherited by a type.
	# The selection knows that refinement is stronger than specialization;
	# however, in case of conflict more than one property are returned.
	# If mtype does not know mproperty then an empty array is returned.
	#
	# If you want the really most specific property, then look at `lookup_first_definition`
	#
	# REQUIRE: `not mtype.need_anchor` to simplify the API (no `anchor` parameter)
	# ENSURE: `not mtype.has_mproperty(mmodule, self) == result.is_empty`
	fun lookup_definitions(mmodule: MModule, mtype: MType): Array[MPROPDEF]
	do
		assert not mtype.need_anchor
		mtype = mtype.undecorate

		var cache = self.lookup_definitions_cache[mmodule, mtype]
		if cache != null then return cache

		#print "select prop {mproperty} for {mtype} in {self}"
		# First, select all candidates
		var candidates = new Array[MPROPDEF]

		# Here we have two strategies: iterate propdefs or iterate classdefs.
		var mpropdefs = self.mpropdefs
		if mpropdefs.length <= 1 or mpropdefs.length < mtype.collect_mclassdefs(mmodule).length then
			# Iterate on all definitions of `self`, keep only those inherited by `mtype` in `mmodule`
			for mpropdef in mpropdefs do
				# If the definition is not imported by the module, then skip
				if not mmodule.in_importation <= mpropdef.mclassdef.mmodule then continue
				# If the definition is not inherited by the type, then skip
				if not mtype.is_subtype(mmodule, null, mpropdef.mclassdef.bound_mtype) then continue
				# Else, we keep it
				candidates.add(mpropdef)
			end
		else
			# Iterate on all super-classdefs of `mtype`, keep only the definitions of `self`, if any.
			for mclassdef in mtype.collect_mclassdefs(mmodule) do
				var p = mclassdef.mpropdefs_by_property.get_or_null(self)
				if p != null then candidates.add p
			end
		end

		# Fast track for only one candidate
		if candidates.length <= 1 then
			self.lookup_definitions_cache[mmodule, mtype] = candidates
			return candidates
		end

		# Second, filter the most specific ones
		return select_most_specific(mmodule, candidates)
	end

	private var lookup_definitions_cache = new HashMap2[MModule, MType, Array[MPROPDEF]]

	# Return the most specific property definitions inherited by a type.
	# The selection knows that refinement is stronger than specialization;
	# however, in case of conflict more than one property are returned.
	# If mtype does not know mproperty then an empty array is returned.
	#
	# If you want the really most specific property, then look at `lookup_next_definition`
	#
	# REQUIRE: `not mtype.need_anchor` to simplify the API (no `anchor` parameter)
	# ENSURE: `not mtype.has_mproperty(mmodule, self) implies result.is_empty`
	fun lookup_super_definitions(mmodule: MModule, mtype: MType): Array[MPROPDEF]
	do
		assert not mtype.need_anchor
		mtype = mtype.undecorate

		# First, select all candidates
		var candidates = new Array[MPROPDEF]
		for mpropdef in self.mpropdefs do
			# If the definition is not imported by the module, then skip
			if not mmodule.in_importation <= mpropdef.mclassdef.mmodule then continue
			# If the definition is not inherited by the type, then skip
			if not mtype.is_subtype(mmodule, null, mpropdef.mclassdef.bound_mtype) then continue
			# If the definition is defined by the type, then skip (we want the super, so e skip the current)
			if mtype == mpropdef.mclassdef.bound_mtype and mmodule == mpropdef.mclassdef.mmodule then continue
			# Else, we keep it
			candidates.add(mpropdef)
		end
		# Fast track for only one candidate
		if candidates.length <= 1 then return candidates

		# Second, filter the most specific ones
		return select_most_specific(mmodule, candidates)
	end

	# Return an array containing olny the most specific property definitions
	# This is an helper function for `lookup_definitions` and `lookup_super_definitions`
	private fun select_most_specific(mmodule: MModule, candidates: Array[MPROPDEF]): Array[MPROPDEF]
	do
		var res = new Array[MPROPDEF]
		for pd1 in candidates do
			var cd1 = pd1.mclassdef
			var c1 = cd1.mclass
			var keep = true
			for pd2 in candidates do
				if pd2 == pd1 then continue # do not compare with self!
				var cd2 = pd2.mclassdef
				var c2 = cd2.mclass
				if c2.mclass_type == c1.mclass_type then
					if cd2.mmodule.in_importation < cd1.mmodule then
						# cd2 refines cd1; therefore we skip pd1
						keep = false
						break
					end
				else if cd2.bound_mtype.is_subtype(mmodule, null, cd1.bound_mtype) and cd2.bound_mtype != cd1.bound_mtype then
					# cd2 < cd1; therefore we skip pd1
					keep = false
					break
				end
			end
			if keep then
				res.add(pd1)
			end
		end
		if res.is_empty then
			print_error "All lost! {candidates.join(", ")}"
			# FIXME: should be abort!
		end
		return res
	end

	# Return the most specific definition in the linearization of `mtype`.
	#
	# If you want to know the next properties in the linearization,
	# look at `MPropDef::lookup_next_definition`.
	#
	# FIXME: the linearization is still unspecified
	#
	# REQUIRE: `not mtype.need_anchor` to simplify the API (no `anchor` parameter)
	# REQUIRE: `mtype.has_mproperty(mmodule, self)`
	fun lookup_first_definition(mmodule: MModule, mtype: MType): MPROPDEF
	do
		return lookup_all_definitions(mmodule, mtype).first
	end

	# Return all definitions in a linearization order
	# Most specific first, most general last
	#
	# REQUIRE: `not mtype.need_anchor` to simplify the API (no `anchor` parameter)
	# REQUIRE: `mtype.has_mproperty(mmodule, self)`
	fun lookup_all_definitions(mmodule: MModule, mtype: MType): Array[MPROPDEF]
	do
		mtype = mtype.undecorate

		var cache = self.lookup_all_definitions_cache[mmodule, mtype]
		if cache != null then return cache

		assert not mtype.need_anchor
		assert mtype.has_mproperty(mmodule, self)

		#print "select prop {mproperty} for {mtype} in {self}"
		# First, select all candidates
		var candidates = new Array[MPROPDEF]
		for mpropdef in self.mpropdefs do
			# If the definition is not imported by the module, then skip
			if not mmodule.in_importation <= mpropdef.mclassdef.mmodule then continue
			# If the definition is not inherited by the type, then skip
			if not mtype.is_subtype(mmodule, null, mpropdef.mclassdef.bound_mtype) then continue
			# Else, we keep it
			candidates.add(mpropdef)
		end
		# Fast track for only one candidate
		if candidates.length <= 1 then
			self.lookup_all_definitions_cache[mmodule, mtype] = candidates
			return candidates
		end

		mmodule.linearize_mpropdefs(candidates)
		candidates = candidates.reversed
		self.lookup_all_definitions_cache[mmodule, mtype] = candidates
		return candidates
	end

	private var lookup_all_definitions_cache = new HashMap2[MModule, MType, Array[MPROPDEF]]

	redef var is_test is lazy do return intro.is_test

	# Does self have the `before` annotation?
	var is_before: Bool is lazy do return intro.is_before

	# Does self have the `before_all` annotation?
	var is_before_all: Bool is lazy do return intro.is_before_all

	# Does self have the `after` annotation?
	var is_after: Bool is lazy do return intro.is_after

	# Does self have the `after_all` annotation?
	var is_after_all: Bool is lazy do return intro.is_after_all
end
src/model/model.nit:2131,1--2409,3

nitc :: virtual_machine $ MProperty
redef class MProperty
	# Relative offset of this in the runtime instance
	# (beginning of the block of its introducing class for attributes or methods)
	var offset: Int
end
src/vm/virtual_machine.nit:860,1--864,3

nitc :: model_examples $ MProperty
redef class MProperty
	redef var is_example is lazy do return intro.is_example

	redef fun examples do
		var res = super
		for mpropdef in mpropdefs do
			for example in mpropdef.examples do
				if not res.has(example) then res.add example
			end
		end
		return res
	end
end
src/model/model_examples.nit:105,1--117,3

nitc :: neo $ MProperty
redef class MProperty
	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 = make_node(nodes, model_name)
		node.labels.add "MProperty"
		node["visibility"] = visibility.to_s
		node.out_edges.add(new NeoEdge(node, "INTRO_CLASSDEF", intro_mclassdef.to_node(nodes, model_name)))
		node.labels.add self.class_name
		return node
	end
end
src/neo.nit:768,1--778,3

nitc :: model_collect $ MProperty
redef class MProperty
	redef fun collect_modifiers do return intro.collect_modifiers

	redef fun collect_linearization(mainmodule) do
		var mpropdefs = self.mpropdefs.to_a
		mainmodule.linearize_mpropdefs(mpropdefs)
		return mpropdefs
	end

	# Collect all property definitions of `self`
	fun collect_mpropdefs(filter: nullable ModelFilter): Set[MPropDef] do
		var res = new HashSet[MPropDef]
		for mpropdef in mpropdefs do
			if filter == null or filter.accept_mentity(mpropdef) then res.add mpropdef
		end
		return res
	end

	# Collect all direct super definitions of `self`
	redef fun collect_parents(mainmodule, filter) do
		var res = new HashSet[MENTITY]
		for mpropdef in mpropdefs do
			for parent in mpropdef.collect_parents(mainmodule, filter) do
				var mprop = parent.mproperty
				if filter == null or filter.accept_mentity(mprop) then res.add mprop
			end
		end
		return res
	end

	# Collection all definitions that have `self` as a direct super definition
	redef fun collect_children(mainmodule, filter) do
		var res = new HashSet[MENTITY]
		for mpropdef in mpropdefs do
			for child in mpropdef.collect_parents(mainmodule, filter) do
				var mprop = child.mproperty
				if filter == null or filter.accept_mentity(mprop) then res.add mprop
			end
		end
		return res
	end
end
src/model/model_collect.nit:1074,1--1115,3

nitc :: separate_compiler $ MProperty
redef class MProperty
	super PropertyLayoutElement
end
src/compiler/separate_compiler.nit:2648,1--2650,3

nitc :: nitlight $ MProperty
redef class MProperty
	redef fun href(v)
	do
		# Because we only have code, just link to the introduction
		return intro.href(v)
	end
end
src/nitlight.nit:68,1--74,3

nitc :: term_model $ MProperty
redef class MProperty
	redef fun cs_icon(no_color) do return intro.cs_icon(no_color)
	redef fun cs_signature(no_color) do return intro.cs_signature(no_color)
end
src/doc/templates/term_model.nit:176,1--179,3

nitc :: vim_autocomplete $ MProperty
redef class MProperty
	private fun write_synopsis(mainmodule: MModule, stream: Writer)
	do
		if visibility == public_visibility then
			stream.write "+ "
		else stream.write "~ " # protected_visibility

		if self isa MMethod then
			if is_new and name != "new" then
				stream.write "new "
			else if is_init and name != "init" then
				stream.write "init "
			end
		end

		stream.write name

		if self isa MMethod then
			var intro = intro
			assert intro isa MMethodDef
			var msignature = intro.msignature
			if msignature != null then
				stream.write msignature.to_s
			end
		end

		var mdoc = intro.mdoc
		if mdoc != null then
			stream.write "  # "
			stream.write mdoc.content.first
		end
		stream.write line_separator
	end
end
src/doc/vim_autocomplete.nit:370,1--403,3

nitc :: model_index $ MProperty
redef class MProperty
	redef fun mentity_kind_rank do return 6
end
src/model/model_index.nit:666,1--668,3

nitc :: html_model $ MProperty
redef class MProperty
	redef fun html_declaration do return intro.html_declaration
	redef fun html_signature(short) do return intro.html_signature(short)
	redef fun html_icon do return new BSIcon("tag", css_classes)
	redef fun css_classes do return super + [visibility.to_s]

	redef fun html_namespace do
		var tpl = new Template
		tpl.add intro_mclassdef.mclass.html_namespace
		tpl.add " :: "
		tpl.add intro.html_link
		return tpl
	end
end
src/doc/templates/html_model.nit:206,1--219,3

nitc :: static_base $ MProperty
redef class MProperty
	redef var nitdoc_breadcrumbs is lazy do
		var res = new Array[MEntity].from(intro_mclassdef.mclass.nitdoc_breadcrumbs)
		res.add self
		return res
	end
end
src/doc/static/static_base.nit:287,1--293,3

nitc :: static_html $ MProperty
redef class MProperty
	redef var html_url is lazy do return "property_{super}"
end
src/doc/static/static_html.nit:399,1--401,3