org.springframework.roo.addon.web.mvc.controller.json
Annotation Type RooWebJson


@Retention(value=SOURCE)
@Target(value=TYPE)
public @interface RooWebJson

Indicates a type that requires ROO controller support.

This annotation will cause ROO to produce code that would typically appear in MVC JSON-enabled controllers.

Since:
1.2.0
Author:
Stefan Schmidt

Required Element Summary
 Class<?> jsonObject
          Every controller is responsible for a single JSON-enabled object.
 
Optional Element Summary
 String createFromJsonArrayMethod
          Creates a createFromJsonArray() method which finds all objects.
 String createFromJsonMethod
          Creates a createFromJson() method which finds all objects.
 String deleteFromJsonMethod
          Creates a deleteFromJson() method which finds all objects.
 boolean exposeFinders
          Will scan the formBackingObjects for installed finder methods and expose them when configured.
 String listJsonMethod
          Creates a listJson() method which finds all objects.
 String showJsonMethod
          Creates a showJson() method which finds an object for a given id.
 String updateFromJsonArrayMethod
          Creates a updateFromJsonArray() method which finds all objects.
 String updateFromJsonMethod
          Creates a updateFromJson() method which finds all objects.
 

Element Detail

jsonObject

public abstract Class<?> jsonObject
Every controller is responsible for a single JSON-enabled object. The backing object defined here class will be exposed in a RESTful way.

createFromJsonArrayMethod

public abstract String createFromJsonArrayMethod
Creates a createFromJsonArray() method which finds all objects. Set methodName to "" to prevent its generation.

Returns:
indicates the method name for the createFromJsonArray() method (optional)
Default:
"createFromJsonArray"

createFromJsonMethod

public abstract String createFromJsonMethod
Creates a createFromJson() method which finds all objects. Set methodName to "" to prevent its generation.

Returns:
indicates the method name for the createFromJson() method (optional)
Default:
"createFromJson"

deleteFromJsonMethod

public abstract String deleteFromJsonMethod
Creates a deleteFromJson() method which finds all objects. Set methodName to "" to prevent its generation.

Returns:
indicates the method name for the deleteFromJson() method (optional)
Default:
"deleteFromJson"

exposeFinders

public abstract boolean exposeFinders
Will scan the formBackingObjects for installed finder methods and expose them when configured.

Returns:
indicates if the finders methods should be provided (defaults to "true"; optional)
Default:
true

listJsonMethod

public abstract String listJsonMethod
Creates a listJson() method which finds all objects. Set methodName to "" to prevent its generation.

Returns:
indicates the method name for the listJson() method (optional)
Default:
"listJson"

showJsonMethod

public abstract String showJsonMethod
Creates a showJson() method which finds an object for a given id. Set methodName to "" to prevent its generation.

Returns:
indicates the method name for the showJson() method (optional)
Default:
"showJson"

updateFromJsonArrayMethod

public abstract String updateFromJsonArrayMethod
Creates a updateFromJsonArray() method which finds all objects. Set methodName to "" to prevent its generation.

Returns:
indicates the method name for the updateFromJsonArray() method (optional)
Default:
"updateFromJsonArray"

updateFromJsonMethod

public abstract String updateFromJsonMethod
Creates a updateFromJson() method which finds all objects. Set methodName to "" to prevent its generation.

Returns:
indicates the method name for the updateFromJson() method (optional)
Default:
"updateFromJson"


Copyright © 2009–2015. All rights reserved.