Method concept, you can get the methods using the .getConceptMethods,
and you can get some informations about those methods using this concept.
I suppose you have an mn8 script named Test.mn8 and you want to obtain the methods
from your script and you want to work with the informations from methods.
# first step is collecting the methods from script
# but without the methods inherited from Concept
$tmp1 = Concept.getConceptMethods
$tmp2 = Test.getConceptMethods
$methods typeof Series
each $i in $tmp2 do [
if not $tmp1.contains($i) then [
$methods.add($i)
]
]
# now in the $methods we have only the
# methods from script
# in the second step we are printing out all the
# parameter names and types from methods
each $i in $methods do [
print "The method name is: " + $i.getName
print "The return type is: " + $i.getReturnType
$ser1 = $i.getParameterTypes
$ser2 = $i.getParameterNames
each $p in $ser1 do [
$idx = $ser1@index
print "parameter nr." + $idx
print " - name: " + $ser2.elementAt($idx)
print " - type: " + $p
]
]
Methods inherited from: Concept
cloneConcept, extendsConcept, fromXML, getAllInheritedConcepts, getConceptAttribute, getConceptAttributeField, getConceptAttributeFields, getConceptAttributes, getConceptConstructors, getConceptElement, getConceptElementField, getConceptElementFields, getConceptElements, getConceptLabel, getConceptMethod, getConceptMethods, getConceptOperators, getConceptType, getErrorHandler, getInheritedConcepts, getResourceURI, hasConceptAttribute, hasConceptElement, hasConceptMethod, hasPath, isHidden, loadContent, setConceptLabel, setErrorHandler, setHidden, setShowEmpty, showEmpty, toTXT, toXML, setResourceURI |
|
Parameters: |
$on : | The method will be invoked in this concept |
$parameters : | The invoked method parameters |
|
Usefull method to invoke a method from another Concept.
Getting the method signature in method name and parameter types format.
Obtaining the method name.
The concept name were the method was declared.
Obtaining the the method's return type.
Loking after the method's return, if it have will returns true.
True if the method is static.
Gets the parameter types.
Gets the parameter names.
Returns the method modifiers: null, static (others like public, private is not implemented yet)
Human readable 'about' form of method.