Package org.codehaus.groovy.runtime.m12n
Class StandardPropertiesModuleFactory
java.lang.Object
org.codehaus.groovy.runtime.m12n.PropertiesModuleFactory
org.codehaus.groovy.runtime.m12n.StandardPropertiesModuleFactory
This is the standard Groovy module factory. This factory will build a module
using the
MetaInfExtensionModule by default, unless a key named
"moduleFactory" is found in the properties file. If this is the case, then a new
factory is instantiated and used instead of this factory.-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final StringProperty key in META-INF configuration file for specifying a custom module factory class.Fields inherited from class org.codehaus.groovy.runtime.m12n.PropertiesModuleFactory
MODULE_NAME_KEY, MODULE_VERSION_KEY -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionnewModule(Properties properties, ClassLoader classLoader) Creates a new extension module from the given properties.
-
Field Details
-
MODULE_FACTORY_KEY
Property key in META-INF configuration file for specifying a custom module factory class. If specified, the factory class must extend PropertiesModuleFactory and have a no-arg constructor.- See Also:
-
-
Constructor Details
-
StandardPropertiesModuleFactory
public StandardPropertiesModuleFactory()
-
-
Method Details
-
newModule
Creates a new extension module from the given properties. If the properties contain a custom factory class name under the keyMODULE_FACTORY_KEY, that factory is instantiated and used. Otherwise, aMetaInfExtensionModuleis created.- Specified by:
newModulein classPropertiesModuleFactory- Parameters:
properties- the module metadata propertiesclassLoader- the class loader to use for loading extension classes and custom factory classes- Returns:
- a new extension module
- Throws:
GroovyRuntimeException- if the custom factory cannot be loaded or instantiated
-