Return an UML diagram about a mentity
.
nitc :: CmdUML :: defaultinit
nitc :: CmdGraph :: _allowed_formats
Allowed rendering formats.nitc :: CmdEntity :: _mentity_name
Name of the mentity this command is aboutnitc :: CmdGraph :: allowed_formats=
Allowed rendering formats.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 :: CmdGraph :: defaultinit
core :: Object :: defaultinit
nitc :: CmdUML :: defaultinit
nitc :: DocCommand :: defaultinit
nitc :: CmdEntity :: 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 :: CmdGraph :: mainmodule=
Mainmodule for linearizationnitc :: 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 :: DocCommand :: to_json
Return a JSON Serializable representation ofself
results
# UML command
#
# Return an UML diagram about a `mentity`.
class CmdUML
super CmdEntity
super CmdGraph
autoinit(model, mainmodule, filter, mentity, mentity_name, format, uml)
# UML model to return
var uml: nullable UMLModel = null is optional, writable
redef fun init_command do
if uml != 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 mentity isa MClass or mentity isa MModule then
uml = new UMLModel(model, mainmodule, filter)
else
return new WarningNoUML(mentity)
end
return res
end
redef fun render do
var uml = self.uml
if uml == null then return null
if mentity isa MClass then
dot = uml.generate_class_uml.write_to_string
else if mentity isa MModule then
dot = uml.generate_package_uml.write_to_string
end
return super
end
end
src/doc/commands/commands_graph.nit:90,1--128,3