Code example for AnnotatedElement

Methods: getAnnotation

0
    } 
 
    @Override 
    public Object findSerializer(Annotated a) {
        AnnotatedElement ae = a.getAnnotated();
        Url an = ae.getAnnotation(Url.class);
        if (an == null) {
            return null; 
        } 
 
        if (an.type() == String.class) {
            return new UriSerializer(an);
        } else if (an.type() == List.class){
            return new UrisSerializer(an);
        } 
 
        throw new UnsupportedOperationException("Unsupported type " + an.type());
 
    } 
}