nitc :: MGroup :: _default_mmodule
The default module of a group (if any, and if loaded)nitc :: MGroup :: _in_nesting
The group is the group tree on the package (mpackage.mgroups
)
nitc :: MGroup :: _is_example
nitc :: MGroup :: collect_all_mmodules
Collect all modules contained inself
nitc :: MGroup :: collect_mgroups
Collect all groups contained inself
nitc :: MGroup :: collect_mmodules
Collect all modules contained inself
nitc :: MGroup :: default_mmodule
The default module of a group (if any, and if loaded)nitc :: MGroup :: default_mmodule=
The default module of a group (if any, and if loaded)nitc :: MGroup :: defaultinit
nitc :: MGroup :: in_nesting
The group is the group tree on the package (mpackage.mgroups
)
nitc :: MGroup :: in_nesting=
The group is the group tree on the package (mpackage.mgroups
)
nitc :: MGroup :: is_example=
nitc :: MGroup :: is_interesting
Is the group interesting for a final user?nitc :: MGroup :: mmodules_by_name
Return the modules in self and subgroups namedname
.
nitc :: model_collect $ MGroup :: collect_children
Collect all group that directly importself
nitc :: api_metrics $ MGroup :: collect_metrics
nitc :: model_collect $ MGroup :: collect_modifiers
Collect modifier keywords likeredef
, private
etc
nitc :: model_collect $ MGroup :: collect_parents
Collect all groups directly import byself
nitc :: html_model $ MGroup :: html_namespace
Returnsfull_name
decorated with HTML links
nitc :: model_examples $ MGroup :: is_example
Isself
existing for an example purpose?
nitc :: json_model $ MGroup :: json_namespace
Returnself.full_name
as an object that can be serialized to json.
nitc :: mmodule $ MGroup :: mdoc_or_fallback
The documentation associated to the entity or their main nested entity.nitc :: model_index $ MGroup :: mentity_kind_rank
Compare MEntity class kindnitc $ MGroup :: parent_concern
The concern that containsself
or null if self
is the root of the concern hierarchy
nitc :: commands_graph $ MGroup :: to_dot_node
Returnself
as a DotNode
nitc :: model_visitor $ MGroup :: visit_all
Visit all the subgroups and modules of the group.nitc :: MEntity :: _const_color
nitc :: MEntity :: _css_classes
CSS classes used to decorateself
nitc :: MGroup :: _default_mmodule
The default module of a group (if any, and if loaded)nitc :: MEntity :: _deprecation
Is the entity deprecated?nitc :: MEntity :: _html_full_name
The MEntityfull_name
escaped for HTML
nitc :: MGroup :: _in_nesting
The group is the group tree on the package (mpackage.mgroups
)
nitc :: MEntity :: _is_broken
The indication that the entity did not pass some semantic verifications.nitc :: MGroup :: _is_example
serialization :: Serializable :: accept_inspect_serializer_core
serialization :: Serializable :: accept_json_serializer
Refinable service to customize the serialization of this class to JSONserialization :: Serializable :: accept_msgpack_attribute_counter
Hook to customize the behavior of theAttributeCounter
serialization :: Serializable :: accept_msgpack_serializer
Hook to customize the serialization of this class to MessagePacknitc :: MEntity :: add_doc_to_infobox
Append an entry for the doc in the given infoboxserialization :: Serializable :: add_to_bundle
Called by[]=
to dynamically choose the appropriate method according
core :: Object :: class_factory
Implementation used byget_class
to create the specific class.
nitc :: MGroup :: collect_all_mmodules
Collect all modules contained inself
nitc :: MEntity :: collect_ancestors
Collectself
ancestors (direct and indirect)
nitc :: MEntity :: collect_children
Collectself
children (direct descendants)
nitc :: MEntity :: collect_descendants
Collectself
descendants (direct and direct)
nitc :: MEntity :: collect_linearization
Collectself
linearization anchored on mainmodule
nitc :: MEntity :: collect_metrics
nitc :: MGroup :: collect_mgroups
Collect all groups contained inself
nitc :: MGroup :: collect_mmodules
Collect all modules contained inself
nitc :: MEntity :: collect_modifiers
Collect modifier keywords likeredef
, private
etc
nitc :: MEntity :: collect_parents
Collectself
parents (direct ancestors)
nitc :: MEntity :: const_color
nitc :: MEntity :: const_color=
nitc :: MEntity :: core_serialize_base
serialization :: Serializable :: core_serialize_to
Actual serialization ofself
to serializer
nitc :: MEntity :: create_ast_representation
Build a ANode fromself
nitc :: MEntity :: cs_comment
Returns the comment of this MEntity formatted for console.nitc :: MEntity :: cs_declaration
Returns the complete MEntity declaration (modifiers + name + signature).nitc :: MEntity :: cs_full_name
Returnsself.full_name
formatted for console
nitc :: MEntity :: cs_list_item
Returnsself
as a list element that can be displayed in console.
nitc :: MEntity :: cs_location
Source code location of this MEntity formatted for consolenitc :: MEntity :: cs_short_comment
Returns the comment of this MEntity formatted for console.nitc :: MEntity :: cs_signature
Returnsself
signature formatted for console.
nitc :: MEntity :: cs_source_code
Source code associated to this MEntity.nitc :: MEntity :: css_classes=
CSS classes used to decorateself
nitc :: MGroup :: default_mmodule
The default module of a group (if any, and if loaded)nitc :: MGroup :: default_mmodule=
The default module of a group (if any, and if loaded)nitc :: MEntity :: defaultinit
nitc :: MConcern :: defaultinit
core :: Object :: defaultinit
nitc :: HInfoBoxable :: defaultinit
nitc :: MGroup :: defaultinit
nitc :: MEntity :: deprecation=
Is the entity deprecated?nitc :: MEntity :: field_separator
serialization :: Serializable :: from_deserializer
Create an instance of this class from thedeserializer
nitc :: MEntity :: hierarchy_poset
Build a poset representingself
in it's own hierarchy
nitc :: MEntity :: html_declaration
Returns the complete MEntity declaration decorated with HTMLnitc :: MEntity :: html_full_name=
The MEntityfull_name
escaped for HTML
nitc :: MEntity :: html_name=
The MEntity name escaped for HTMLnitc :: MEntity :: html_namespace
Returnsfull_name
decorated with HTML links
nitc :: MEntity :: html_signature
Returns the MEntity signature decorated with HTMLnitc :: MGroup :: in_nesting
The group is the group tree on the package (mpackage.mgroups
)
nitc :: MGroup :: in_nesting=
The group is the group tree on the package (mpackage.mgroups
)
nitc :: HInfoBoxable :: infobox
An new infobox documenting the entitynitc :: MEntity :: is_broken=
The indication that the entity did not pass some semantic verifications.nitc :: MGroup :: is_example=
nitc :: MEntity :: is_fictive=
Isself
created for internal purpose?
nitc :: MGroup :: is_interesting
Is the group interesting for a final user?core :: Object :: is_same_instance
Return true ifself
and other
are the same instance (i.e. same identity).
core :: Object :: is_same_serialized
Isself
the same as other
in a serialization context?
core :: Object :: is_same_type
Return true ifself
and other
have the same dynamic type.
nitc :: MEntity :: json_namespace
Returnself.full_name
as an object that can be serialized to json.
nitc :: MEntity :: line_separator
nitc :: MEntity :: linkto_text
Link to theself
with a specific text.
nitc :: MEntity :: mdoc_or_fallback
The documentation associated to the entity or their main nested entity.nitc :: MGroup :: mmodules_by_name
Return the modules in self and subgroups namedname
.
serialization :: Serializable :: msgpack_extra_array_items
Hook to request a larger than usual metadata arraycore :: Object :: native_class_name
The class name of the object in CString format.core :: Object :: output_class_name
Display class name on stdout (debug only).nitc :: MConcern :: parent_concern
The concern that containsself
or null if self
is the root of the concern hierarchy
mentity
nitc :: MEntity :: ratings_by_dimension
Get the ratings of adimension
serialization :: Serializable :: serialize_msgpack
Serializeself
to MessagePack bytes
serialization :: Serializable :: serialize_to
Serializeself
to serializer
serialization :: Serializable :: serialize_to_json
Serializeself
to JSON
serialization :: Serializable :: serialize_to_or_delay
Accept references or force direct serialization (usingserialize_to
)
nitc :: MEntity :: source_url
Render a HTML link for the MEntity locationserialization :: Serializable :: to_pretty_json
Serializeself
to plain pretty JSON
nitc :: MEntity :: tpl_module
Builds a dot UML package diagram entity fromself
v.enter_visit
on all nested entities.
nitc :: MEntity :: write_extra_doc
Extra auto documentation to append to thestream
nitc :: MEntity :: write_location
Location (file and line when available) of related declarationsSerializer::serialize
# A group of modules in a package
class MGroup
super MConcern
# The name of the group
# empty name for a default group in a single-module package
redef var name
redef var location
# The enclosing package
var mpackage: MPackage
# The parent group if any
# see `in_nesting` for more
var parent: nullable MGroup
# Fully qualified name.
# It includes each parent group separated by `>`.
# The full_name is terminated by `>` to avoid collision with other entities.
#
# E.g. `core>` and `core>collection>`
redef fun full_name
do
var p = parent
if p == null then return "{name}>"
return "{p.full_name}{name}>"
end
# The group is the group tree on the package (`mpackage.mgroups`)
# nested groups (children) are smaller
# nesting group (see `parent`) is bigger
var in_nesting: POSetElement[MGroup] is noinit
# Is `self` the root of its package?
fun is_root: Bool do return mpackage.root == self
# The filepath (usually a directory) of the group, if any
#
# safe alias to `location.file.filename`
fun filepath: nullable String do
var res
res = self.location.file
if res == null then return null
return res.filename
end
init
do
var tree = mpackage.mgroups
self.in_nesting = tree.add_node(self)
var parent = self.parent
if parent != null then
tree.add_edge(self, parent)
end
end
redef fun model do return mpackage.model
redef fun parent_concern do
if not is_root then return parent
return mpackage
end
redef fun to_s do return name
end
src/model/mpackage.nit:115,1--180,3
redef class MGroup
# The loaded modules of this group
var mmodules = new Array[MModule]
# The default module of a group (if any, and if loaded)
#
# The default module of a group is the one that has the same name.
# Return `null` if the group has no default module or if the default
# module is not loaded.
var default_mmodule: nullable MModule = null
redef fun mdoc_or_fallback
do
if mdoc != null then return mdoc
var default_mmodule = self.default_mmodule
if default_mmodule == null then return null
return default_mmodule.mdoc_or_fallback
end
end
src/model/mmodule.nit:53,1--71,3
redef class MGroup
# Is the group interesting for a final user?
#
# Groups are mandatory in the model but for simple packages they are not
# always interesting.
#
# A interesting group has, at least, one of the following true:
#
# * it has 2 modules or more
# * it has a subgroup
# * it has a documentation
fun is_interesting: Bool
do
return mmodules.length > 1 or
not in_nesting.direct_smallers.is_empty or
mdoc != null or
(mmodules.length == 1 and default_mmodule == null)
end
# Are files and directories in self scanned?
#
# See `ModelBuilder::scan_group`.
var scanned = false
# Return the modules in self and subgroups named `name`.
#
# If `self` is not scanned (see `ModelBuilder::scan_group`) the
# results might be partial.
fun mmodules_by_name(name: String): Array[MModule]
do
var res = new Array[MModule]
for g in in_nesting.smallers do
for mp in g.mmodules do
if mp.name == name then
res.add mp
end
end
end
return res
end
end
src/loader.nit:1230,1--1270,3
redef class MGroup
redef var is_example is lazy do
var parent = self.parent
if parent != null and parent.is_example then return true
return name == "examples"
end
redef fun examples do
var res = super
for mmodule in mmodules do
for example in mmodule.examples do
if not res.has(example) then res.add example
end
end
return res
end
end
src/model/model_examples.nit:73,1--89,3
redef class MGroup
redef fun to_node(nodes: HashMap[MEntity, NeoNode], model_name: nullable String): NeoNode do
if nodes.has_key(self) then return nodes[self]
var node = super
var parent = parent
node.out_edges.add(new NeoEdge(node, "PROJECT", mpackage.to_node(nodes, model_name)))
if parent != null then
node.out_edges.add(new NeoEdge(node, "PARENT", parent.to_node(nodes, model_name)))
end
for mmodule in mmodules do
node.out_edges.add(new NeoEdge(node, "DECLARES", mmodule.to_node(nodes, model_name)))
end
for subgroup in in_nesting.direct_smallers do
node.in_edges.add(new NeoEdge(node, "NESTS", subgroup.to_node(nodes, model_name)))
end
return node
end
end
src/neo.nit:697,1--714,3
redef class MGroup
redef fun collect_modifiers do return super + ["group"]
# Collect all groups directly import by `self`
redef fun collect_parents(mainmodule, filter) do
var res = new HashSet[MENTITY]
for mmodule in mmodules do
for parent in mmodule.collect_parents(mainmodule, filter) do
var mgroup = parent.mgroup
if mgroup == null or mgroup == self then continue
if filter == null or filter.accept_mentity(mgroup) then res.add(mgroup)
end
end
return res
end
# Collect all group that directly import `self`
redef fun collect_children(mainmodule, filter) do
var res = new HashSet[MENTITY]
for mgroup in model.collect_mgroups(filter) do
if mgroup == self then continue
if filter != null and not filter.accept_mentity(mgroup) then continue
if mgroup.collect_parents(mainmodule, filter).has(self) then res.add mgroup
end
return res
end
# Collect all groups contained in `self`
fun collect_mgroups(filter: nullable ModelFilter): HashSet[MENTITY] do
var res = new HashSet[MENTITY]
for mgroup in in_nesting.direct_smallers do
if filter == null or filter.accept_mentity(mgroup) then res.add(mgroup)
end
return res
end
# Collect all modules contained in `self`
fun collect_all_mmodules(filter: nullable ModelFilter): HashSet[MModule] do
var res = new HashSet[MModule]
for mgroup in collect_mgroups(filter) do
res.add_all mgroup.collect_all_mmodules(filter)
end
return res
end
# Collect all modules contained in `self`
fun collect_mmodules(filter: nullable ModelFilter): HashSet[MModule] do
var res = new HashSet[MModule]
for mmodule in mmodules do
if filter == null or filter.accept_mentity(mmodule) then res.add(mmodule)
end
return res
end
end
src/model/model_collect.nit:419,1--473,3
redef class MGroup
# Visit all the subgroups and modules of the group.
redef fun visit_all(v) do
for x in in_nesting.direct_smallers do v.enter_visit(x)
for x in mmodules do v.enter_visit(x)
end
end
src/model/model_visitor.nit:120,1--126,3
redef class MGroup
redef fun mentity_kind_rank do return 2
end
src/model/model_index.nit:650,1--652,3
redef class MGroup
redef fun html_icon do return new BSIcon("folder-close", ["text-muted"])
redef fun html_namespace do
var tpl = new Template
var parent = self.parent
if parent != null then
tpl.add parent.html_namespace
tpl.add " > "
end
tpl.add html_link
return tpl
end
end
src/doc/templates/html_model.nit:104,1--117,3
redef class MGroup
redef var nitdoc_breadcrumbs is lazy do
var parent = self.parent
if parent != null then
return parent.nitdoc_breadcrumbs + [self]
end
return mpackage.nitdoc_breadcrumbs
end
end
src/doc/static/static_base.nit:253,1--261,3
redef class MGroup
redef fun collect_metrics(h) do
var mclasses = new HashSet[MClass]
for mmodule in self.mmodules do mclasses.add_all mmodule.intro_mclasses
var mclasses_metrics = h.mclasses_metrics
mclasses_metrics.collect(new HashSet[MClass].from(mclasses))
var mmodules_metrics = h.mmodules_metrics
mmodules_metrics.collect(new HashSet[MModule].from(mmodules))
var metrics = new JsonObject
metrics["mclasses"] = mclasses_metrics
metrics["mmodules"] = mmodules_metrics
return metrics
end
end
src/doc/api/api_metrics.nit:108,1--124,3