All Downloads are FREE. Search and download functionalities are using the official Maven repository.

com.github.dynamicextensionsalfresco.webscripts.arguments.ModelArgumentResolver Maven / Gradle / Ivy

Go to download

Adds an OSGi container to alfresco repository supporting dynamic code reloading, classpath isolation and a bunch of other useful features

There is a newer version: 3.1.0
Show newest version
package com.github.dynamicextensionsalfresco.webscripts.arguments;

import java.lang.annotation.Annotation;
import java.util.Map;

import com.github.dynamicextensionsalfresco.webscripts.AnnotationWebScriptRequest;

import org.springframework.extensions.webscripts.WebScriptRequest;
import org.springframework.extensions.webscripts.WebScriptResponse;

/**
 * Resolves {@link Map} handler method arguments to the model.
 * 
 * @author Laurens Fridael
 * 
 */
public class ModelArgumentResolver implements ArgumentResolver, Annotation> {

	@Override
	public boolean supports(final Class parameterType, final Class annotationType) {
		return Map.class.equals(parameterType);
	}

	@Override
	public Map resolveArgument(final Class argumentType, final Annotation parameterAnnotation,
			final String name, final WebScriptRequest request, final WebScriptResponse response) {
		return ((AnnotationWebScriptRequest) request).getModel();
	}

}




© 2015 - 2025 Weber Informatics LLC | Privacy Policy