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

play.data.binding.As Maven / Gradle / Ivy

There is a newer version: 2.6.2
Show newest version
package play.data.binding;

import play.mvc.Http;
import play.mvc.Scope;

import java.lang.annotation.Annotation;
import java.lang.annotation.ElementType;
import java.lang.annotation.Retention;
import java.lang.annotation.RetentionPolicy;
import java.lang.annotation.Target;
import java.lang.reflect.Type;
import java.util.Map;


@Retention(RetentionPolicy.RUNTIME)
@Target({ElementType.PARAMETER, ElementType.FIELD, ElementType.METHOD, ElementType.TYPE})
public @interface As {

    String[] value() default {""};
    String[] lang() default {"*"};
    Class> binder() default DEFAULT.class;
    Class> unbinder() default DEFAULT.class;

    final class DEFAULT implements TypeBinder, TypeUnbinder {
        @Override
        public Object bind(Http.Request request, Scope.Session session, String name, Annotation[] annotations, String value, Class actualClass, Type genericType) {
            throw new UnsupportedOperationException("Not supported.");
        }

        @Override
        public boolean unBind(Map result, Object src, Class srcClazz, String name,
                Annotation[] annotations) {
            throw new UnsupportedOperationException("Not supported.");   
        }
    }
    
}