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: 1.5.0
Show newest version
package play.data.binding;

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 {"*"};
    String[] format() default {"html"};
    Class> binder() default DEFAULT.class;
    Class> unbinder() default DEFAULT.class;

    public static final class DEFAULT implements TypeBinder, TypeUnbinder {
        public Object bind(String name, Annotation[] annotations, String value, Class actualClass, Type genericType) throws Exception {
            throw new UnsupportedOperationException("Not supported.");
        }

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