mentity
as a type for its parametersmentity
must be a MClass or a MClassDef.
nitc :: CmdParam :: defaultinit
nitc :: CmdEntity :: _mentity_name
Name of the mentity this command is aboutnitc :: 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 :: CmdEntityList :: defaultinit
nitc :: DocCommand :: defaultinit
nitc :: CmdEntity :: defaultinit
nitc :: CmdParam :: defaultinit
nitc :: CmdList :: defaultinit
nitc :: CmdEntities :: 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 aboutcore :: 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 using `mentity` as a type for its parameters
#
# `mentity` must be a MClass or a MClassDef.
class CmdParam
super CmdEntityList
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 mproperty in model.collect_mproperties(filter) do
if not mproperty isa MMethod then continue
var msignature = mproperty.intro.msignature
if msignature != null then
for mparam in msignature.mparameters do
var mtype = mparam.mtype
if mtype isa MNullableType then mtype = mtype.mtype
if not mtype isa MClassType then continue
if mtype.mclass != mentity then continue
mentities.add mproperty
end
end
end
results = mentities.to_a
return res
end
end
src/doc/commands/commands_usage.nit:21,1--54,3
redef class CmdParam
redef fun execute(no_color) do
var full_name = mentity.as(not null).cs_full_name(no_color)
print_list("Methods accepting `{full_name}` as parameter:", results, no_color)
end
end
src/doc/term/term.nit:272,1--277,3