|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Objectorg.codehaus.enunciate.modules.BasicDeploymentModule
org.codehaus.enunciate.modules.FreemarkerDeploymentModule
org.codehaus.enunciate.modules.ruby.RubyDeploymentModule
public class RubyDeploymentModule
The Ruby module generates Ruby data types that can be used in conjunction with the Ruby JSON implementation to (de)serialize the REST resources as they are represented as JSON data.
The order of the Ruby deployment module is 0, as it doesn't depend on any artifacts exported by any other module.
The Ruby module is configured with the "ruby" element under the "modules" element of the enunciate configuration file. It supports the following attributes:
The "package-conversions" subelement of the "ruby" element is used to map packages from the original API packages to Ruby modules. This element supports an arbitrary number of "convert" child elements that are used to specify the conversions. These "convert" elements support the following attributes:
| Field Summary |
|---|
| Fields inherited from class org.codehaus.enunciate.modules.BasicDeploymentModule |
|---|
enunciate |
| Constructor Summary | |
|---|---|
RubyDeploymentModule()
|
|
| Method Summary | |
|---|---|
void |
addClientPackageConversion(PackageModuleConversion conversion)
Add a client package conversion. |
void |
doFreemarkerGenerate()
Generate using Freemarker. |
protected boolean |
existsAnyJsonResourceMethod(java.util.List<RootResource> rootResources)
Whether any root resources exist that produce json. |
org.apache.commons.digester.RuleSet |
getConfigurationRules()
Default implementation returns null. |
java.lang.String |
getLabel()
The label for the Ruby API. |
java.lang.String |
getName()
The name of the deployment module. |
protected freemarker.template.ObjectWrapper |
getObjectWrapper()
The object wrapper to use for the model. |
java.util.Map<java.lang.String,java.lang.String> |
getPackageToModuleConversions()
The package-to-module conversions. |
protected java.lang.String |
getSourceFileName()
The name of the generated Ruby source file. |
protected java.net.URL |
getTemplateURL(java.lang.String template)
Get a template URL for the template of the given name. |
Validator |
getValidator()
Get the validator for this module, or null if none. |
void |
initModel(EnunciateFreemarkerModel model)
Initialize the model. |
boolean |
isDisabled()
Whether this deployment module has been disabled, e.g. |
boolean |
isForceEnable()
Whether to force-enable the Ruby module. |
void |
onClassesFound(java.util.Set<java.lang.String> classes)
Logic for handling a set of classes that were found on the Enunciate classpath. |
protected java.lang.String |
packageToModule(java.lang.String pckg)
|
protected java.lang.String |
readResource(java.lang.String resource)
Reads a resource into string form. |
void |
setForceEnable(boolean forceEnable)
Whether to force-enable the Ruby module. |
void |
setLabel(java.lang.String label)
The label for the Ruby API. |
| Methods inherited from class org.codehaus.enunciate.modules.FreemarkerDeploymentModule |
|---|
close, doGenerate, getConfiguration, getModel, getModelInternal, getTemplateExceptionHandler, getTemplateLoader, processTemplate, processTemplate, processTemplate, processTemplate |
| Methods inherited from class org.codehaus.enunciate.modules.BasicDeploymentModule |
|---|
debug, doBuild, doCompile, doPackage, getAliases, getBuildDir, getCompileDir, getEnunciate, getGenerateDir, getOrder, getPackageDir, info, init, setBuildDir, setCompileDir, setDisabled, setGenerateDir, setPackageDir, step, warn |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
|---|
public RubyDeploymentModule()
| Method Detail |
|---|
public java.lang.String getName()
DeploymentModule
getName in interface DeploymentModulegetName in class BasicDeploymentModulepublic void onClassesFound(java.util.Set<java.lang.String> classes)
EnunciateClasspathListener
onClassesFound in interface EnunciateClasspathListenerclasses - The classes that were found.public void initModel(EnunciateFreemarkerModel model)
EnunciateModelAware
initModel in interface EnunciateModelAwareinitModel in class FreemarkerDeploymentModulemodel - The model to initialize.protected java.lang.String packageToModule(java.lang.String pckg)
public void doFreemarkerGenerate()
throws java.io.IOException,
freemarker.template.TemplateException,
EnunciateException
FreemarkerDeploymentModuleFreemarkerDeploymentModule.doGenerate() but can throw a TemplateException.
doFreemarkerGenerate in class FreemarkerDeploymentModulejava.io.IOException
freemarker.template.TemplateException
EnunciateException
protected java.lang.String readResource(java.lang.String resource)
throws java.io.IOException,
EnunciateException
resource - The resource to read.
java.io.IOException
EnunciateExceptionprotected java.lang.String getSourceFileName()
protected freemarker.template.ObjectWrapper getObjectWrapper()
FreemarkerDeploymentModule
getObjectWrapper in class FreemarkerDeploymentModuleprotected java.net.URL getTemplateURL(java.lang.String template)
template - The specified template.
public boolean isForceEnable()
public void setForceEnable(boolean forceEnable)
forceEnable - Whether to force-enable the Ruby module.public java.lang.String getLabel()
public void setLabel(java.lang.String label)
label - The label for the Ruby API.public java.util.Map<java.lang.String,java.lang.String> getPackageToModuleConversions()
public void addClientPackageConversion(PackageModuleConversion conversion)
conversion - The conversion to add.public org.apache.commons.digester.RuleSet getConfigurationRules()
BasicDeploymentModule
getConfigurationRules in interface DeploymentModulegetConfigurationRules in class BasicDeploymentModulepublic Validator getValidator()
DeploymentModule
getValidator in interface DeploymentModulegetValidator in class BasicDeploymentModulepublic boolean isDisabled()
DeploymentModule
isDisabled in interface DeploymentModuleisDisabled in class BasicDeploymentModuleprotected boolean existsAnyJsonResourceMethod(java.util.List<RootResource> rootResources)
rootResources - The root resources.
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||