mentity
mentity
must be a MClass or a MClassDef.
nitc :: CmdNew :: _modelbuilder
ModelBuilder used to retrieve AST nodesnitc :: CmdNew :: defaultinit
nitc :: CmdNew :: modelbuilder
ModelBuilder used to retrieve AST nodesnitc :: CmdNew :: modelbuilder=
ModelBuilder used to retrieve AST nodesnitc :: CmdEntity :: _mentity_name
Name of the mentity this command is aboutnitc :: CmdNew :: _modelbuilder
ModelBuilder used to retrieve AST nodesnitc :: CmdEntities :: _sorter
core :: Object :: class_factory
Implementation used byget_class
to create the specific class.
nitc :: DocCommand :: cmd_filter
Return a new filter for that command execution.nitc :: CmdEntity :: defaultinit
nitc :: CmdEntityList :: defaultinit
nitc :: CmdEntities :: defaultinit
nitc :: CmdNew :: defaultinit
nitc :: DocCommand :: defaultinit
nitc :: CmdList :: defaultinit
core :: Object :: defaultinit
nitc :: DocCommand :: execute
nitc :: DocCommand :: filter=
ModelFilter to apply if anynitc :: DocCommand :: http_init
Init the command from an HTTPRequestcore :: 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 :: CmdEntity :: mentity_name
Name of the mentity this command is aboutnitc :: CmdEntity :: mentity_name=
Name of the mentity this command is aboutnitc :: CmdNew :: modelbuilder
ModelBuilder used to retrieve AST nodesnitc :: CmdNew :: modelbuilder=
ModelBuilder used to retrieve AST nodescore :: 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 :: DocCommand :: parser_init
Initialize the command from the CommandParser datanitc :: CmdList :: print_list
nitc :: DocCommand :: to_json
Return a JSON Serializable representation ofself
results
# Retrieve all the mproperties that initialize `mentity`
#
# `mentity` must be a MClass or a MClassDef.
class CmdNew
super CmdEntityList
autoinit(model, modelbuilder, filter, mentity, mentity_name, limit, page, count, max)
# ModelBuilder used to retrieve AST nodes
var modelbuilder: ModelBuilder
redef fun init_results do
if results != null then return new CmdSuccess
var res = super
if not res isa CmdSuccess then return res
var mentity = self.mentity.as(not null)
if mentity isa MClassDef then mentity = mentity.mclass
if not mentity isa MClass then return new ErrorNotClass(mentity)
var mentities = new HashSet[MEntity]
for mpropdef in model.collect_mpropdefs(filter) do
var visitor = new TypeInitVisitor(mentity)
var npropdef = modelbuilder.mpropdef2node(mpropdef)
if npropdef == null then continue
visitor.enter_visit(npropdef)
if visitor.called then
mentities.add mpropdef
end
end
results = mentities.to_a
return res
end
end
src/doc/commands/commands_usage.nit:90,1--124,3