|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object net.sf.groovydice.plugin.GroovyDiceAPI
public class GroovyDiceAPI
This class is responsible to modify the runtime environment and manage the dynamically added methods in order to enable them to be called from a Groovy expression.
Constructor Summary | |
---|---|
GroovyDiceAPI()
|
Method Summary | |
---|---|
void |
add(Object entryMap,
Object logic)
Add a new entry to the dynamic API. |
groovy.lang.MetaClass |
getMetaClass()
|
Object |
getMethods()
|
Object |
getNumberClasses()
Util method to get the list of number classes. |
Object |
getProperty(String name)
|
protected void |
injectAspects()
Inject code to enable Groovy's number classes and dice rolling commands to trigger the dynamic API lookup. |
Object |
invokeMethod(String name,
Object args)
|
Object |
isCommand(Object obj)
Check whether the given object is a dice rolling command. |
Object |
isNumber(Object obj)
Whether the given object is a number. |
void |
setMetaClass(groovy.lang.MetaClass metaClass)
|
void |
setProperty(String name,
Object value)
|
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public GroovyDiceAPI()
Method Detail |
---|
public final Object getMethods()
public void add(Object entryMap, Object logic)
entryMap
- Map that contains information about the entry.logic
- Closure to call when the method gets invoked.public Object getNumberClasses()
public Object isCommand(Object obj)
obj
- Object to check.
public Object isNumber(Object obj)
obj
- Object to check
protected void injectAspects()
injectAspect(java.lang.Class)
public groovy.lang.MetaClass getMetaClass()
getMetaClass
in interface groovy.lang.GroovyObject
public void setMetaClass(groovy.lang.MetaClass metaClass)
setMetaClass
in interface groovy.lang.GroovyObject
public Object invokeMethod(String name, Object args)
invokeMethod
in interface groovy.lang.GroovyObject
public Object getProperty(String name)
getProperty
in interface groovy.lang.GroovyObject
public void setProperty(String name, Object value)
setProperty
in interface groovy.lang.GroovyObject
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |