This section details how to go about using the dynamic features of Groovy such as implementing the GroovyObject interface and using ExpandoMetaClass, a expandable MetaClass that allows adding of methods, properties and constructors.
- Using invokeMethod and getProperty
- Using methodMissing and propertyMissing
- Evaluating the MetaClass runtime
- Using ExpandoMetaClass to add behaviour
- Customizing MetaClass for a single instance
Dynamic Method Invocation
You can invoke a method even if you don't know the method name until it is invoked:
Labels