package org.springframework.roo.addon.web.mvc.controller.addon.responses;
import org.springframework.roo.addon.web.mvc.controller.annotations.config.RooDeserializer;
import org.springframework.roo.addon.web.mvc.controller.annotations.config.RooJsonMixin;
import org.springframework.roo.model.JavaType;
import org.springframework.roo.project.Feature;
import org.springframework.roo.project.maven.Pom;
/**
* This interface provides some different operations that allow
* to manage controller response types.
*
* @author Juan Carlos GarcĂa
* @since 2.0
*/
public interface ControllerMVCResponseService extends Feature {
/**
* This operation returns the implementation response type.
*
* @return String with an unique identifier of response type
*/
String getResponseType();
/**
* This operation returns the annotation type that identifies the implementation
* response.
*
* @return JavaType with the annotation managed by the implementation
*/
JavaType getAnnotation();
/**
* This operation annotates a controller with the annotation defined by
* getAnnotation() operation.
*
* @param controller JavaType with the controller to be annotated.
*/
void annotate(JavaType controller);
/**
* This operation will check if some controller has the implemented
* response type.
*
* @param controller JavaType with controller to check
* @return true if provided controller has the implemented responseType.
* If not, return false.
*/
boolean hasResponseType(JavaType controller);
/**
* This operation will install all the necessary items to be able to use
* the implemented responseType.
*
* @param module Pom with the module where this responsetype should
* be installed.
*/
void install(Pom module);
/**
* This operation returns the annotation type that identifies the main
* controller generated by implementation
*
* @return JavaType with the annotation managed by the implementation. Maybe,
* this operation will return null if the implementation doesn't provide any
* main controller.
*
*/
JavaType getMainControllerAnnotation();
/**
* This operation returns the main controller generated by implementation.
*
*
* @return JavaType with the main controller generated by the implementation. Maybe,
* this operation will return null if the implementation doesn't provide any
* main controller.
*/
JavaType getMainController();
/**
* Return a string which should be added to controller name to identify this
* kind of Response. (By example 'Json', 'Jsp', etc)
* @return
*/
String getControllerNameModifier();
/**
* Informs if response type requires Json Deserializer classes
*
* @return true if requires class
* @see RooDeserializer
*/
boolean requiresJsonDeserializer();
/**
* Informs if response type requires Json Mixin classes
*
* @return true if requires class
* @see RooJsonMixin
*/
boolean requiresJsonMixin();
/**
* Informs if this response type will provide views
*
* @return true if provides views
*/
boolean providesViews();
}