A named and possibly documented entity in the model.

This class is useful to generalize presentation of entities to the human.

Introduced properties

type MENTITY: SELF

nitc :: MEntity :: MENTITY

FIXME used to bypass RTA limitation on type resolution
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 _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 _is_broken: Bool

nitc :: MEntity :: _is_broken

The indication that the entity did not pass some semantic verifications.
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 _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 fun add_doc_to_infobox(res: HInfoBox)

nitc :: MEntity :: add_doc_to_infobox

Append an entry for the doc in the given infobox
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.
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
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=

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
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
abstract fun full_name: String

nitc :: MEntity :: full_name

A fully-qualified name of this model entity.
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
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?
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_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.
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
abstract fun name: String

nitc :: MEntity :: name

The short (unqualified) name of this model entity.
abstract fun nitdoc_breadcrumbs: Array[MEntity]

nitc :: MEntity :: nitdoc_breadcrumbs

MEntities composing the breadcrumbs of a nitdoc page
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 source_url(url_pattern: nullable String): String

nitc :: MEntity :: source_url

Render a HTML link for the MEntity location
fun to_dot_node: DotNode

nitc :: MEntity :: to_dot_node

Return self as a DotNode
fun to_json_ref: MEntityRef

nitc :: MEntity :: to_json_ref

Return a new MEntityRef to self.
private fun to_node(nodes: HashMap[MEntity, NeoNode], model_name: nullable String): NeoNode

nitc :: MEntity :: to_node

Build a NeoNode representing 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.
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

Redefined properties

redef type SELF: MEntity

nitc $ MEntity :: SELF

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

nitc :: json_model $ MEntity :: core_serialize_to

Actual serialization of self to serializer
redef fun core_serialize_to(v: Serializer)

nitc :: api_base $ MEntity :: core_serialize_to

Actual serialization of self to serializer
redef init from_deserializer(v: Deserializer)

nitc :: json_model $ MEntity :: from_deserializer

Create an instance of this class from the deserializer
redef fun html_url: String

nitc :: static_html $ MEntity :: html_url

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

nitc :: api_base $ MEntity :: html_url

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

nitc :: static_html $ MEntity :: html_url=

The MEntity URL in the HTML output
redef fun to_dot_node: DotNode

nitc :: static_html $ MEntity :: to_dot_node

Return self as a DotNode

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 SELF: Object

core :: Object :: SELF

Type of this instance, automatically specialized in every class
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 _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

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

nitc :: MEntity :: _html_url

private var _is_broken: Bool

nitc :: MEntity :: _is_broken

The indication that the entity did not pass some semantic verifications.
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 _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
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 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
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
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.
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 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?
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.
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
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.
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
intern fun object_id: Int

core :: Object :: object_id

An internal hash code for the object based on its identity.
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
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.
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
package_diagram nitc::MEntity MEntity nitc::HInfoBoxable HInfoBoxable nitc::MEntity->nitc::HInfoBoxable serialization::Serializable Serializable nitc::MEntity->serialization::Serializable core::Object Object nitc::HInfoBoxable->core::Object serialization::Serializable->core::Object ...core::Object ... ...core::Object->core::Object nitc::CallSite CallSite nitc::CallSite->nitc::MEntity nitc::MClass MClass nitc::MClass->nitc::MEntity nitc::MClassDef MClassDef nitc::MClassDef->nitc::MEntity nitc::MType MType nitc::MType->nitc::MEntity nitc::MParameter MParameter nitc::MParameter->nitc::MEntity nitc::MProperty MProperty nitc::MProperty->nitc::MEntity nitc::MPropDef MPropDef nitc::MPropDef->nitc::MEntity nitc::Model Model nitc::Model->nitc::MEntity nitc::MConcern MConcern nitc::MConcern->nitc::MEntity nitc::MTypePart MTypePart nitc::MTypePart->nitc::MEntity nitc::MClassType MClassType nitc::MClassType->nitc::MType nitc::MFormalType MFormalType nitc::MFormalType->nitc::MType nitc::MProxyType MProxyType nitc::MProxyType->nitc::MType nitc::MNullType MNullType nitc::MNullType->nitc::MType nitc::MBottomType MBottomType nitc::MBottomType->nitc::MType nitc::MErrorType MErrorType nitc::MErrorType->nitc::MType nitc::MSignature MSignature nitc::MSignature->nitc::MType nitc::MInitType MInitType nitc::MInitType->nitc::MType nitc::MRawType MRawType nitc::MRawType->nitc::MType nitc::MClassType... ... nitc::MClassType...->nitc::MClassType nitc::MFormalType... ... nitc::MFormalType...->nitc::MFormalType nitc::MProxyType... ... nitc::MProxyType...->nitc::MProxyType nitc::MNullType... ... nitc::MNullType...->nitc::MNullType nitc::MBottomType... ... nitc::MBottomType...->nitc::MBottomType nitc::MErrorType... ... nitc::MErrorType...->nitc::MErrorType nitc::MSignature... ... nitc::MSignature...->nitc::MSignature nitc::MInitType... ... nitc::MInitType...->nitc::MInitType nitc::MRawType... ... nitc::MRawType...->nitc::MRawType 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::MMethod... ... nitc::MMethod...->nitc::MMethod nitc::MAttribute... ... nitc::MAttribute...->nitc::MAttribute nitc::MVirtualTypeProp... ... nitc::MVirtualTypeProp...->nitc::MVirtualTypeProp nitc::MInnerClass... ... nitc::MInnerClass...->nitc::MInnerClass nitc::MMethodDef MMethodDef nitc::MMethodDef->nitc::MPropDef nitc::MAttributeDef MAttributeDef nitc::MAttributeDef->nitc::MPropDef nitc::MVirtualTypeDef MVirtualTypeDef nitc::MVirtualTypeDef->nitc::MPropDef nitc::MInnerClassDef MInnerClassDef nitc::MInnerClassDef->nitc::MPropDef nitc::MMethodDef... ... nitc::MMethodDef...->nitc::MMethodDef nitc::MAttributeDef... ... nitc::MAttributeDef...->nitc::MAttributeDef nitc::MVirtualTypeDef... ... nitc::MVirtualTypeDef...->nitc::MVirtualTypeDef nitc::MInnerClassDef... ... nitc::MInnerClassDef...->nitc::MInnerClassDef nitc::ModelStandalone ModelStandalone nitc::ModelStandalone->nitc::Model nitc::ModelStandalone... ... nitc::ModelStandalone...->nitc::ModelStandalone nitc::MModule MModule nitc::MModule->nitc::MConcern nitc::MPackage MPackage nitc::MPackage->nitc::MConcern nitc::MGroup MGroup nitc::MGroup->nitc::MConcern nitc::MModule... ... nitc::MModule...->nitc::MModule nitc::MPackage... ... nitc::MPackage...->nitc::MPackage nitc::MGroup... ... nitc::MGroup...->nitc::MGroup

Ancestors

interface Object

core :: Object

The root of the class hierarchy.

Parents

interface HInfoBoxable

nitc :: HInfoBoxable

Model entity or whatever that can produce an infobox
interface Serializable

serialization :: Serializable

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

Children

class CallSite

nitc :: CallSite

A specific method call site with its associated informations.
class MClass

nitc :: MClass

A named class
class MClassDef

nitc :: MClassDef

A definition (an introduction or a refinement) of a class in a module
abstract class MConcern

nitc :: MConcern

Something that represents a concern
class MParameter

nitc :: MParameter

A parameter in a signature
abstract class MPropDef

nitc :: MPropDef

A definition of a property (local property)
abstract class MProperty

nitc :: MProperty

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

nitc :: MType

A global static type
class MTypePart

nitc :: MTypePart

A part of a RawType.
class Model

nitc :: Model

The container class of a Nit object-oriented model.

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 MAttribute

nitc :: MAttribute

A global attribute
class MAttributeDef

nitc :: MAttributeDef

A local definition of an attribute
class MBottomType

nitc :: MBottomType

The special universal most specific type.
class MClassType

nitc :: MClassType

A type based on a class.
abstract class MContract

nitc :: MContract

The root of all contracts
class MEnsure

nitc :: MEnsure

A ensure (postcondition) representation
class MErrorType

nitc :: MErrorType

A special type used as a silent error marker when building types.
class MExpect

nitc :: MExpect

A expect (precondition) contract representation
abstract class MFormalType

nitc :: MFormalType

A formal type (either virtual of parametric).
class MGenericType

nitc :: MGenericType

A type based on a generic class.
class MGroup

nitc :: MGroup

A group of modules in a package
class MInitType

nitc :: MInitType

Is the type of the initial value inside attributes
class MInnerClass

nitc :: MInnerClass

An inner class.
class MInnerClassDef

nitc :: MInnerClassDef

An inner class definition.
class MMethod

nitc :: MMethod

A global method
class MMethodDef

nitc :: MMethodDef

A local definition of a method
class MModule

nitc :: MModule

A Nit module is usually associated with a Nit source file.
class MNotNullType

nitc :: MNotNullType

A non-null version of a formal type.
class MNullType

nitc :: MNullType

The type of the only value null
class MNullableType

nitc :: MNullableType

A type prefixed with "nullable"
class MPackage

nitc :: MPackage

A Nit package, that encompass a product
class MParameterType

nitc :: MParameterType

The type associated to a formal parameter generic type of a class
abstract class MProxyType

nitc :: MProxyType

A type that decorates another type.
class MRawType

nitc :: MRawType

A type described by a text annoted with links.
class MSignature

nitc :: MSignature

A signature of a method
class MVirtualType

nitc :: MVirtualType

A virtual formal type.
class MVirtualTypeDef

nitc :: MVirtualTypeDef

A local definition of a virtual type
class MVirtualTypeProp

nitc :: MVirtualTypeProp

A global virtual type
class ModelDiamond

nitc :: ModelDiamond

A standalone model with the common class diamond-hierarchy ABCD
class ModelStandalone

nitc :: ModelStandalone

A standalone pre-constructed model used to test various model-related methods.

Class definitions

nitc $ MEntity
# A named and possibly documented entity in the model.
# This class is useful to generalize presentation of entities to the human.
abstract class MEntity
	# The short (unqualified) name of this model entity.
	#
	# The short-name is based from the identifiers used to declare or denote the entity.
	# It is usually globally ambiguous but is often enough in a precise local context.
	#
	# It is suitable to use the short-name in message to the user.
	# However, special care must be used in case of potential ambiguities or name conflict.
	fun name: String is abstract

	# A fully-qualified name of this model entity.
	#
	# The full-name is based on the short name and is usually prefixed by the name of an outer entity.
	# Usually the quad (`::`) is used to separate the different names.
	#
	# The full-name is expected to be unique and unambiguous in lawful Nit models for the same kind of entity.
	#
	# It is often suitable to use it in message to the user.
	# However, some full-name could be long and verbose,
	#
	# See the specific implementation in subclasses for details.
	fun full_name: String is abstract

	# A fully-qualified C-like identifier of this model entity.
	#
	# The C-name is a name that respects the rule of identifiers in the C language:
	# it is only made of alphanumeric characters and starts with a letter (or a underscore).
	#
	# The C-name can be seen as a mangled version of the `full_name`.
	# Therefore, it is expected to be unique and unambiguous in lawful Nit models for the same kind of entity.
	#
	# The C-name is used by tools that need some identifiers in generated files to designate the
	# entity.
	#
	# Is is not suitable to use it directly with the user (e.g. in message) and
	# indirect use should be restricted (e.g. to name a web-page)
	fun c_name: String is abstract

	# The origin of the definition.
	#
	# Most model entities are defined in a specific place in the source base.
	#
	# Because most model entities have one,
	# it is simpler for the client to have a non-nullable return value.
	# For entities that lack a location, mock-up special locations are used instead.
	# By default it is `model.no_location`.
	fun location: Location do return model.no_location

	# A Model Entity has a direct link to its model
	fun model: Model is abstract

	# The indication that the entity did not pass some semantic verifications.
	#
	# This simple flag is set by a given analysis to say that the entity is broken and unusable in
	# an execution.
	# When an entity status is set to broken, it is usually associated with a error message.
	#
	# If it is safe to do so, clients of the model SHOULD just skip broken entities in their processing.
	# Clients that do not care about the executability (e.g. metrics) MAY still process the entity or
	# perform specific checks to determinate the validity of the entity.
	#
	# Note that the broken status is not propagated to enclosing and enclosed entities.
	# e.g. a broken method does not make the whole module broken.
	var is_broken = false is writable

	# Is `self` created for internal purpose?
	#
	# Fictive entities are used internally but they should not be
	# exposed to the final user.
	var is_fictive: Bool = false is writable

	# Is `self` created for unit testing purpose?
	#
	# See `nitunit`.
	var is_test: Bool = false is writable
end
src/model/model_base.nit:34,1--111,3

nitc :: mdoc $ MEntity
redef class MEntity
	# The documentation associated to the entity
	var mdoc: nullable MDoc = null is writable

	# The documentation associated to the entity or their main nested entity.
	#
	# * `MPackage`s fall back to their root `MGroup`.
	# * `MGroup`s fall back to their `default_mmodule`.
	# * `MClass`es, `MClassDef`s, `MProperty`s and `MPropDef`s fall-back to
	#   their introducing definition.
	# * `MClassType`s fall back to their wrapped `MClass`.
	# * `MVirtualType`s fall back to their wrapped `MProperty`.
	# * `CallSite` fall back on the wrapped `MProperty`.
	# * Other entities do not fall back.
	#
	# One may use `MDoc::original_mentity` to retrieve the original
	# source of the documentation.
	fun mdoc_or_fallback: nullable MDoc do return mdoc

	# Is the entity deprecated?
	#
	# Used for warnings and in documentation.
	# Has no other specific effect.
	var deprecation: nullable MDeprecationInfo = null is writable
end
src/model/mdoc.nit:49,1--73,3

nitc :: model $ MEntity
redef class MEntity
	# The visibility of the MEntity.
	#
	# MPackages, MGroups and MModules are always public.
	# The visibility of `MClass` and `MProperty` is defined by the keyword used.
	# `MClassDef` and `MPropDef` return the visibility of `MClass` and `MProperty`.
	fun visibility: MVisibility do return public_visibility
end
src/model/model.nit:33,1--40,3

nitc :: model_examples $ MEntity
redef class MEntity

	# Is `self` existing for an example purpose?
	#
	# All mentities annotated with `is example` or located inside a mentity that
	# is an example are considered as examples.
	fun is_example: Bool do return mexample != null

	# Return this entity as a MExample
	var mexample: nullable MExample = null

	# Examples found for `self`
	var examples = new Array[MExample]
end
src/model/model_examples.nit:46,1--59,3

nitc :: neo $ MEntity
redef class MEntity
	# Build a `NeoNode` representing `self`.
	private 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 self.class_name
		return node
	end

	# Make a new `NeoNode` based on `mentity`.
	private fun make_node(nodes: HashMap[MEntity, NeoNode], model_name: nullable String): NeoNode do
		var node = new NeoNode
		nodes[self] = node
		node.labels.add "MEntity"
		if model_name != null then node.labels.add model_name
		node["name"] = self.name
		if not self isa MSignature then
			#FIXME: MSignature is a MEntity, but has no model :/
			node["location"] = self.location.to_s
		end
		var mdoc = self.mdoc
		if mdoc != null then
			node["mdoc"] = new JsonArray.from(mdoc.content)
			node["mdoc_location"] = mdoc.location.to_s
		end
		return node
	end
end
src/neo.nit:987,1--1014,3

nitc :: astbuilder $ MEntity
redef class MEntity
	# Build a ANode from `self`
	#
	# Allows the creation of an AST node from a model entity.
	fun create_ast_representation(astbuilder: nullable ASTBuilder): ANode is abstract
end
src/astbuilder.nit:949,1--954,3

nitc :: separate_compiler $ MEntity
redef class MEntity
	var const_color: String is lazy do return "COLOR_{c_name}"
end
src/compiler/separate_compiler.nit:2642,1--2644,3

nitc :: model_collect $ MEntity
redef class MEntity

	# FIXME used to bypass RTA limitation on type resolution
	type MENTITY: SELF

	# Collect modifier keywords like `redef`, `private` etc
	fun collect_modifiers: Array[String] do return new Array[String]

	# Collect `self` linearization anchored on `mainmodule`
	fun collect_linearization(mainmodule: MModule): nullable Array[MEntity] do
		return null
	end

	# Collect `self` ancestors (direct and indirect)
	#
	# The concept of ancestor is abstract at this stage.
	fun collect_ancestors(mainmodule: MModule, filter: nullable ModelFilter): Set[MENTITY] do
		var done = new HashSet[MENTITY]
		var todo = new Array[MENTITY]

		todo.add_all collect_parents(mainmodule, filter)
		while todo.not_empty do
			var mentity = todo.pop
			if mentity == self or done.has(mentity) then continue
			done.add mentity
			todo.add_all mentity.collect_parents(mainmodule, filter)
		end
		return done
	end

	# Collect `self` parents (direct ancestors)
	#
	# The concept of parent is abstract at this stage.
	fun collect_parents(mainmodule: MModule, filter: nullable ModelFilter): Set[MENTITY] is abstract

	# Collect `self` children (direct descendants)
	#
	# The concept of child is abstract at this stage.
	fun collect_children(mainmodule: MModule, filter: nullable ModelFilter): Set[MENTITY] is abstract

	# Collect `self` descendants (direct and direct)
	#
	# The concept of descendant is abstract at this stage.
	fun collect_descendants(mainmodule: MModule, filter: nullable ModelFilter): Set[MENTITY] do
		var done = new HashSet[MENTITY]
		var todo = new Array[MENTITY]

		todo.add_all collect_children(mainmodule, filter)
		while todo.not_empty do
			var mentity = todo.pop
			if mentity == self or done.has(mentity) then continue
			done.add mentity
			todo.add_all mentity.collect_children(mainmodule, filter)
		end
		return done
	end

	# Build a poset representing `self` in it's own hierarchy
	#
	# The notion of hierarchy depends on the type of MEntity.
	#
	# Here a recap:
	# * `MPackage`: package dependencies
	# * `MGroup`: group dependencies
	# * `MModule`: modules imports
	# * `MClass`: class inheritance (all classdefs flattened)
	# * `MClassDef`: classdef inheritance
	# * `MProperty`: property definitions graph (all propdefs flattened)
	# * `MPropDef`: property definitions graph
	fun hierarchy_poset(mainmodule: MModule, filter: nullable ModelFilter): POSet[MENTITY] do
		var poset = new POSet[MENTITY]
		var parents_done = new HashSet[MENTITY]
		var parents = new Array[MENTITY]
		parents.add self
		while parents.not_empty do
			var mentity = parents.pop
			if parents_done.has(mentity) then continue
			parents_done.add mentity
			poset.add_node mentity
			for parent in mentity.collect_parents(mainmodule, filter) do
				poset.add_edge(mentity, parent)
				parents.add parent
			end
		end
		var children_done = new HashSet[MEntity]
		var children = new Array[MEntity]
		children.add self
		while children.not_empty do
			var mentity = children.pop
			if children_done.has(mentity) then continue
			children_done.add mentity
			for child in mentity.collect_children(mainmodule, filter) do
				poset.add_edge(child, mentity)
				children.add child
			end
		end
		return poset
	end
end
src/model/model_collect.nit:48,1--146,3

nitc :: model_visitor $ MEntity
redef class MEntity
	# Call `v.enter_visit` on all nested entities.
	#
	# See the specific implementation in the subclasses.
	fun visit_all(v: ModelVisitor) do end
end
src/model/model_visitor.nit:99,1--104,3

nitc :: java_compiler $ MEntity
redef class MEntity
	# A Java compatible name for `self`
	private fun jname: String do return name.to_cmangle
end
src/compiler/java_compiler.nit:1143,1--1146,3

nitc :: term_model $ MEntity
redef class MEntity

	# Text icon to be displayed in front of the entity
	fun cs_icon(no_color: nullable Bool): String do
		return public_visibility.cs_icon(no_color)
	end

	# Source code location of this MEntity formatted for console
	fun cs_location(no_color: nullable Bool): String do
		if no_color == null or not no_color then
			return location.to_s.bold.gray
		end
		return location.to_s
	end

	# Returns `self.full_name` formatted for console
	fun cs_full_name(no_color: nullable Bool): String do
		if no_color == null or not no_color then
			return full_name.bold.blue
		end
		return full_name
	end

	# Returns `self` signature formatted for console.
	fun cs_signature(no_color: nullable Bool): String do return ""

	# Returns the comment of this MEntity formatted for console.
	fun cs_comment(no_color: nullable Bool): nullable String do
		var mdoc = mdoc_or_fallback
		if mdoc == null then return null
		# FIXME add markdown for console
		return mdoc.cs_comment(no_color)
	end

	# Returns the comment of this MEntity formatted for console.
	fun cs_short_comment(no_color: nullable Bool): nullable String do
		var mdoc = mdoc_or_fallback
		if mdoc == null then return null
		return mdoc.cs_short_comment(no_color)
	end

	# Returns the complete MEntity declaration (modifiers + name + signature).
	#
	# * MPackage: `package foo`
	# * MGroup: `group foo`
	# * MModule: `module foo`
	# * MClass: `private abstract class Foo[E: Object]`
	# * MClassDef: `redef class Foo[E]`
	# * MProperty: `private fun foo(e: Object): Int`
	# * MPropdef: `redef fun foo(e)`
	fun cs_declaration(no_color: nullable Bool): String do
		var tpl = new FlatBuffer
		tpl.append collect_modifiers.join(" ")
		tpl.append " "
		tpl.append name
		tpl.append cs_signature(no_color)
		if no_color == null or not no_color then
			return tpl.write_to_string.bold
		end
		return tpl.write_to_string
	end

	# Returns `self` as a list element that can be displayed in console.
	#
	# Displays `cs_icon`, `cs_name`, `cs_short_comment, `cs_namespace`,
	# `cs_declaration` and `cs_location`.
	fun cs_list_item(no_color: nullable Bool): String do
		var tpl = new FlatBuffer
		tpl.append " "
		tpl.append cs_icon(no_color)
		tpl.append " "
		tpl.append cs_full_name(no_color)
		var comment = cs_short_comment(no_color)
		if comment != null then
			tpl.append "\n   "
			if no_color == null or not no_color then
				tpl.append "# ".green
			else
				tpl.append "# "
			end
			tpl.append comment
		end
		tpl.append "\n   "
		tpl.append cs_declaration(no_color)
		tpl.append "\n   "
		tpl.append cs_location(no_color)
		return tpl.write_to_string
	end

	# Source code associated to this MEntity.
	#
	# Uses `cs_location` to locate the source code.
	fun cs_source_code: String do
		var tpl = new Buffer
		tpl.append "\n~~~\n"
		tpl.append location.text
		tpl.append "\n~~~\n"
		return tpl.write_to_string
	end
end
src/doc/templates/term_model.nit:47,1--146,3

nitc :: vim_autocomplete $ MEntity
redef class MEntity
	private fun field_separator: String do return "#====#"
	private fun line_separator: String do return "#nnnn#"

	private fun write_doc(model: Model, mainmodule: MModule, stream: Writer)
	do
		# 1. Short name for autocompletion
		stream.write complete_name
		stream.write field_separator

		# 2. Full signature
		stream.write complete_name
		write_signature_to_stream(stream)
		stream.write field_separator

		# 3. Doc synopsis
		var mdoc = complete_mdoc
		if mdoc != null then
			stream.write mdoc.content.first
		end

		# 4. Full doc with extra
		stream.write field_separator
		stream.write "# "
		stream.write full_name
		write_signature_to_stream(stream)
		if mdoc != null then
			for i in 2.times do stream.write line_separator
			stream.write mdoc.content.join(line_separator)
		end

		write_location(mainmodule, stream)

		write_extra_doc(model, mainmodule, stream)

		stream.write "\n"
	end

	private fun write_signature_to_stream(stream: Writer) do end

	# Actual name used in completion
	private fun complete_name: String do return name

	# Doc to use in completion
	private fun complete_mdoc: nullable MDoc do return mdoc

	# Extra auto documentation to append to the `stream`
	private fun write_extra_doc(model: Model, mainmodule: MModule, stream: Writer) do end

	# Location (file and line when available) of related declarations
	private fun write_location(mainmodule: MModule, stream: Writer)
	do
		for i in 2.times do stream.write line_separator
		stream.write "## Location"
		stream.write line_separator
		stream.write "* {location}"
	end
end
src/doc/vim_autocomplete.nit:52,1--109,3

nitc :: uml_class $ MEntity
redef class MEntity
	# Generates a dot-compatible `Writable` UML Class diagram from `self`
	fun tpl_class(model: UMLModel): Writable is abstract
end
src/uml/uml_class.nit:47,1--50,3

nitc :: model_index $ MEntity
redef class MEntity

	# Compare MEntity class kind
	#
	# Unknown kind have a virtually high score.
	private fun mentity_kind_rank: Int do return 10
end
src/model/model_index.nit:638,1--644,3

nitc :: htmlight $ MEntity
redef class MEntity
	super HInfoBoxable

	# A HTML version of `to_s` with hyper-links.
	#
	# By default, `linkto_text(v, to_s)` is used, c.f. see `linkto_text`.
	#
	# For some complex entities, like generic types, multiple `<a>` and `<span>` elements can be generated.
	# E.g. `Array[Int]` might become `<a>Array</a>[<a>Int</a>]` with the correct `href` attributes
	# provided  by `v.hrefto`.
	fun linkto(v: HtmlightVisitor): HTMLTag do return linkto_text(v, to_s)

	# Link to the `self` with a specific text.
	#
	# The whole text is linked with a single `<a>` element.
	#
	# The `href` used is provided by `v.hrefto`.
	# If `href` is null then a `<span>` element is used instead of `<a>`.
	fun linkto_text(v: HtmlightVisitor, text: String): HTMLTag
	do
		var href = v.hrefto(self)
		if href == null then
			return (new HTMLTag("span")).text(text)
		end
		return (new HTMLTag("a")).attr("href", href).text(text)
	end

	# Append an entry for the doc in the given infobox
	private fun add_doc_to_infobox(res: HInfoBox)
	do
		var mdoc = mdoc_or_fallback
		if mdoc != null then mdoc.fill_infobox(res)
	end
end
src/htmlight.nit:440,1--473,3

nitc :: uml_module $ MEntity
redef class MEntity
	# Builds a dot UML package diagram entity from `self`
	fun tpl_module(model: UMLModel): Writable is abstract
end
src/uml/uml_module.nit:43,1--46,3

nitc :: nitlight $ MEntity
redef class MEntity
	private fun href(v: NitlightVisitor): nullable String do return null
end
src/nitlight.nit:38,1--40,3

nitc :: test_model_index $ MEntity
redef class MEntity
	fun color: String do
		if visibility == public_visibility then
			return name.green
		else if visibility == protected_visibility then
			return name.yellow
		else
			return name.red
		end
	end
end
src/test_model_index.nit:37,1--47,3

nitc :: commands_graph $ MEntity
redef class MEntity
	# Return `self` as a DotNode
	fun to_dot_node: DotNode do
		var node = new DotNode(full_name)
		node["label"] = name
		return node
	end
end
src/doc/commands/commands_graph.nit:360,1--367,3

nitc :: html_model $ MEntity
redef class MEntity

	# The MEntity unique ID in the HTML output
	var html_id: String is lazy do return full_name.to_cmangle

	# The MEntity URL in the HTML output
	#
	# You MUST redefine this method.
	# Depending on your implementation, this URL can be a page URL or an anchor.
	var html_url: String is lazy do return html_id

	# The MEntity name escaped for HTML
	var html_name: String is lazy do return name.html_escape

	# The MEntity `full_name` escaped for HTML
	var html_full_name: String is lazy do return full_name.html_escape

	# Link to the MEntity in the HTML output
	#
	# You should redefine this method depending on the organization or your
	# output.
	fun html_link(text, title: nullable String): Link do
		if text == null then
			text = html_name
		end
		var mdoc = self.mdoc_or_fallback
		if title == null and mdoc != null then
			title = mdoc.synopsis
		end
		return new Link(html_url, text, title)
	end

	# Returns the complete MEntity declaration decorated with HTML
	#
	# Examples:
	# * MPackage: `package foo`
	# * MGroup: `group foo`
	# * MModule: `module foo`
	# * MClass: `private abstract class Foo[E: Object]`
	# * MClassDef: `redef class Foo[E]`
	# * MProperty: `private fun foo(e: Object): Int`
	# * MPropdef: `redef fun foo(e)`
	fun html_declaration: Template do
		var tpl = new Template
		tpl.add "<span class='signature'>"
		for modifier in collect_modifiers do
			tpl.add "<span class='modifier'>{modifier}</span>&nbsp;"
		end
		tpl.add "<span class='name'>{html_link.write_to_string}</span>"
		tpl.add html_signature(false)
		tpl.add "</span>"
		return tpl
	end

	# Returns the MEntity signature decorated with HTML
	#
	# This function only returns the parenthesis and return types.
	# See `html_declaration` for the full declaration including modifiers and name.
	fun html_signature(short: nullable Bool): Template do return new Template

	# Returns `full_name` decorated with HTML links
	fun html_namespace: Template is abstract

	# An icon representative of the mentity
	fun html_icon: BSIcon do return new BSIcon("tag", ["text-muted"])

	# CSS classes used to decorate `self`
	#
	# Mainly used for icons.
	var css_classes: Array[String] = collect_modifiers is lazy
end
src/doc/templates/html_model.nit:26,1--96,3

nitc :: json_model $ MEntity
redef class MEntity
	serialize

	private fun core_serialize_base(v: Serializer) do
		v.serialize_attribute("name", name)
		var mdoc = mdoc_or_fallback
		if mdoc != null then
			v.serialize_attribute("synopsis", mdoc.synopsis)
		end
	end

	redef fun core_serialize_to(v) do
		core_serialize_base(v)

		v.serialize_attribute("namespace", json_namespace)
		v.serialize_attribute("class_name", class_name)
		v.serialize_attribute("full_name", full_name)
		v.serialize_attribute("visibility", visibility.to_s)
		var mdoc = mdoc_or_fallback
		if mdoc != null then
			v.serialize_attribute("html_synopsis", mdoc.html_synopsis.write_to_string)
		end

		var modifiers = collect_modifiers
		if modifiers.not_empty then
			v.serialize_attribute("modifiers", modifiers)
		end
	end

	# Return `self.full_name` as an object that can be serialized to json.
	fun json_namespace: JsonNamespace is abstract

	# Return a new MEntityRef to `self`.
	fun to_json_ref: MEntityRef do return new MEntityRef(self)
end
src/doc/templates/json_model.nit:33,1--67,3

nitc :: static_base $ MEntity
redef class MEntity
	# MEntities composing the breadcrumbs of a nitdoc page
	fun nitdoc_breadcrumbs: Array[MEntity] is abstract
end
src/doc/static/static_base.nit:244,1--247,3

nitc :: static_structure $ MEntity
redef class MEntity
	# Render a HTML link for the MEntity location
	private fun source_url(url_pattern: nullable String): String do
		var location = self.location
		var file = location.file

		if file == null then return location.to_s
		if url_pattern == null then return file.filename.simplify_path

		var url = url_pattern
		url = url.replace("%f", file.filename.simplify_path)
		url = url.replace("%l", location.line_start.to_s)
		url = url.replace("%L", location.line_end.to_s)
		return url.simplify_path
	end
end
src/doc/static/static_structure.nit:424,1--439,3

nitc :: static_html $ MEntity
redef class MEntity
	redef fun to_dot_node do
		var node = super
		node["URL"] = html_url
		return node
	end

	redef var html_url = "{html_id}.html" is lazy
end
src/doc/static/static_html.nit:366,1--374,3

nitc :: api_base $ MEntity
redef class MEntity

	# URL to `self` within the web interface.
	fun web_url: String do return "/doc/" / full_name

	# URL to `self` within the JSON api.
	fun api_url: String do return "/api/entity/" / full_name

	redef fun html_url do return web_url

	redef fun core_serialize_to(v) do
		super
		v.serialize_attribute("web_url", web_url)
		v.serialize_attribute("api_url", api_url)
	end
end
src/doc/api/api_base.nit:168,1--183,3

nitc :: api_feedback $ MEntity
redef class MEntity

	# Get the ratings of a `dimension`
	fun ratings_by_dimension(config: NitwebConfig, dimension: String, user: nullable String): JsonObject do
		var match = (new MongoMatch).eq("mentity", full_name).eq("dimension", dimension)
		var pipeline = new MongoPipeline
		pipeline.match(match)
		pipeline.group((new MongoGroup("mean_group")).avg("mean", "$rating"))

		var res = config.stars.collection.aggregate(pipeline)
		var obj = new JsonObject
		obj["mean"] = if res.is_empty then 0.0 else res.first["mean"]
		obj["ratings"] = new JsonArray.from(config.stars.find_all(match))

		if user != null then
			match["user"] = user
			obj["user"] = config.stars.find(match)
		end
		return obj
	end

	# Get the ratings of a `mentity`
	fun ratings(config: NitwebConfig, user: nullable String): JsonObject do
		var match = new JsonObject
		match["mentity"] = full_name
		match["ratings"] = new JsonArray.from(config.stars.find_all(match))
		match["feature"] = ratings_by_dimension(config, "feature", user)
		match["doc"] = ratings_by_dimension(config, "doc", user)
		match["examples"] = ratings_by_dimension(config, "examples", user)
		match["code"] = ratings_by_dimension(config, "code", user)
		return match
	end
end
src/doc/api/api_feedback.nit:214,1--246,3

nitc :: api_metrics $ MEntity
redef class MEntity
	private fun collect_metrics(h: APIStructuralMetrics): nullable JsonObject do return null
end
src/doc/api/api_metrics.nit:79,1--81,3