Search in sources :

Example 16 with JAnnotationUse

use of com.sun.codemodel.JAnnotationUse in project jsonschema2pojo by joelittlejohn.

the class Jackson2Annotator method addJsonTypeInfoAnnotation.

protected void addJsonTypeInfoAnnotation(JDefinedClass jclass, String propertyName) {
    JAnnotationUse jsonTypeInfo = jclass.annotate(JsonTypeInfo.class);
    jsonTypeInfo.param("use", JsonTypeInfo.Id.CLASS);
    jsonTypeInfo.param("include", JsonTypeInfo.As.PROPERTY);
    // When not provided it will use default provided by "use" attribute
    if (StringUtils.isNotBlank(propertyName)) {
        jsonTypeInfo.param("property", propertyName);
    }
}
Also used : JAnnotationUse(com.sun.codemodel.JAnnotationUse)

Aggregations

JAnnotationUse (com.sun.codemodel.JAnnotationUse)16 JClass (com.sun.codemodel.JClass)4 JCodeModel (com.sun.codemodel.JCodeModel)3 JDefinedClass (com.sun.codemodel.JDefinedClass)3 JMethod (com.sun.codemodel.JMethod)3 SimpleDateFormat (java.text.SimpleDateFormat)3 Date (java.util.Date)3 JaxWsAnnotationProcessor (org.eclipse.scout.jaxws.apt.JaxWsAnnotationProcessor)2 ObjectMapper (com.fasterxml.jackson.databind.ObjectMapper)1 ArrayNode (com.fasterxml.jackson.databind.node.ArrayNode)1 JAnnotationArrayMember (com.sun.codemodel.JAnnotationArrayMember)1 JBlock (com.sun.codemodel.JBlock)1 JConditional (com.sun.codemodel.JConditional)1 JFieldVar (com.sun.codemodel.JFieldVar)1 JInvocation (com.sun.codemodel.JInvocation)1 WebService (javax.jws.WebService)1 AnnotationMirror (javax.lang.model.element.AnnotationMirror)1 AnnotationValue (javax.lang.model.element.AnnotationValue)1 WebServiceClient (javax.xml.ws.WebServiceClient)1 LogicalMessageContext (javax.xml.ws.handler.LogicalMessageContext)1