Skip to main content

Source code revision

svn

summary: * Modified the way the DefaultsGenerator interface and Default annotation are used. * Update the private/internal metadata wrapper classes so that they maintain the calling context
revision: 55498
author: Jason Lee
date: 2012-08-15 21:28:05 UTC (2 years)
message: * Modified the way the DefaultsGenerator interface and Default annotation are used.
* Update the private/internal metadata wrapper classes so that they maintain the calling context

One way REST model authors can specify a default value for a property on the model is
via @Default. This annotation has two propertys: generator, and useContext. If the
value of generator is an implementation of DefaultsGenerator, the class is instantiated
and getDefaultValue(String) is called to retrieve the default value for the given
property. However, there are times when the default value needs to be context sensitive.
For example, when determining the default value for an environment name, the account
name must be used. In these cases, the model author can set useContext to true, which
will instruct the system to call getDefaultValue(String) on the calling composite resource
instance (which implements DefaultsGenerator). The resource can then take context-aware
steps to generate/calculate the default value.
Change Path Actions
M trunk/main/nucleus/admin/rest/rest-service/src/main/java/org/glassfish/admin/rest/composite/CompositeResource.java
M trunk/main/nucleus/admin/rest/rest-service/src/main/java/org/glassfish/admin/rest/composite/CompositeUtil.java
M trunk/main/nucleus/admin/rest/rest-service/src/main/java/org/glassfish/admin/rest/composite/metadata/Default.java
M trunk/main/nucleus/admin/rest/rest-service/src/main/java/org/glassfish/admin/rest/composite/metadata/DefaultGenerator.java
A trunk/main/nucleus/admin/rest/rest-service/src/main/java/org/glassfish/admin/rest/composite/metadata/DefaultsGenerator.java
M trunk/main/nucleus/admin/rest/rest-service/src/main/java/org/glassfish/admin/rest/composite/metadata/ParamMetadata.java
M trunk/main/nucleus/admin/rest/rest-service/src/main/java/org/glassfish/admin/rest/composite/metadata/RestMethodMetadata.java
M trunk/main/nucleus/admin/rest/rest-service/src/main/java/org/glassfish/admin/rest/composite/metadata/RestResourceMetadata.java
 
 
Close
loading
Please Confirm
Close