Example usage for com.fasterxml.jackson.databind.introspect AnnotationMap AnnotationMap

List of usage examples for com.fasterxml.jackson.databind.introspect AnnotationMap AnnotationMap

Introduction

In this page you can find the example usage for com.fasterxml.jackson.databind.introspect AnnotationMap AnnotationMap.

Prototype

public AnnotationMap() 

Source Link

Usage

From source file:com.github.mrenou.jacksonatic.internal.annotations.ClassAnnotationDecorator.java

private AnnotatedClass addClassAnnotations(AnnotatedClass annotatedClass,
        ClassMappingInternal<Object> classMapping) {
    AnnotationMap annotationMap = new AnnotationMap();
    stream(annotatedClass.annotations()).forEach(annotationMap::add);
    classMapping.getAnnotations().values().stream().forEach(annotationMap::add);
    return annotatedClass.withAnnotations(annotationMap);
}

From source file:java2typescript.jackson.module.visitors.TSJsonObjectFormatVisitor.java

private AbstractType getTSTypeForClass(AnnotatedMember member) {

    TypeBindings bindings = new TypeBindings(TypeFactory.defaultInstance(), member.getDeclaringClass());
    JavaType javaType = member.getType(bindings);
    if (javaType.getRawClass().getSimpleName().equals("Observable")) {
        javaType = javaType.containedType(0);
    }//from   ww  w  . ja v  a 2  s .com

    BeanProperty prop = new BeanProperty.Std(member.getName(), javaType, NO_NAME, new AnnotationMap(), member,
            false);

    try {
        return getTSTypeForProperty(prop);
    } catch (JsonMappingException e) {
        throw new RuntimeException(e);
    }
}

From source file:java2typescript.jackson.module.visitors.TSJsonObjectFormatVisitor.java

private void addMethod(Method method) {
    FunctionType function = new FunctionType();

    AnnotatedMethod annotMethod = new AnnotatedMethod(null, method, new AnnotationMap(), null);

    function.setResultType(getTSTypeForClass(annotMethod));
    for (int i = 0; i < annotMethod.getParameterCount(); i++) {
        AnnotatedParameter param = annotMethod.getParameter(i);
        String name = "param" + i;
        function.getParameters().put(name, getTSTypeForClass(param));
    }/*from ww  w . j  a v a2s  .co m*/
    this.type.getMethods().put(method.getName(), function);
}