Search in sources :

Example 6 with FieldOutline

use of com.sun.tools.xjc.outline.FieldOutline in project vcd-api-tools by vmware.

the class RestApiJsonBindingsPlugin method processClassOutline.

/**
 * Annotates {@link ClassOutline} with necessary json-relevant annotations
 *
 * @param classOutline
 * @param errorHandler
 */
private void processClassOutline(ClassOutline classOutline, ErrorHandler errorHandler) {
    addJsonInheritenceInformation(classOutline);
    final JAnnotationUse enableFieldFiltering = classOutline.implClass.annotate(JsonFilter.class);
    enableFieldFiltering.param("value", Supported.VCLOUD_LEGACY_FILTER_PARAM);
    for (FieldOutline fieldOutline : classOutline.getDeclaredFields()) {
        addJsonPropertyOutline(fieldOutline);
    }
}
Also used : JAnnotationUse(com.sun.codemodel.JAnnotationUse) FieldOutline(com.sun.tools.xjc.outline.FieldOutline)

Example 7 with FieldOutline

use of com.sun.tools.xjc.outline.FieldOutline in project vcd-api-tools by vmware.

the class RestApiVersionsPlugin method processClassOutline.

/**
 * Annotates {@link ClassOutline}.
 *
 * @param classOutline
 * @param errorHandler
 */
private void processClassOutline(ClassOutline classOutline, ErrorHandler errorHandler) {
    CCustomizations customizations = CustomizationUtils.getCustomizations(classOutline);
    JDefinedClass implClass = classOutline.implClass;
    addSupportedAnnotation(implClass, customizations);
    addContentTypeAnnotation(classOutline, customizations);
    addSourceLocationComment(implClass, classOutline.target.getLocator());
    for (FieldOutline fieldOutline : classOutline.getDeclaredFields()) {
        processFieldOutline(fieldOutline, errorHandler);
    }
}
Also used : CCustomizations(com.sun.tools.xjc.model.CCustomizations) JDefinedClass(com.sun.codemodel.JDefinedClass) FieldOutline(com.sun.tools.xjc.outline.FieldOutline)

Aggregations

FieldOutline (com.sun.tools.xjc.outline.FieldOutline)7 JDefinedClass (com.sun.codemodel.JDefinedClass)3 JAnnotationUse (com.sun.codemodel.JAnnotationUse)2 JMethod (com.sun.codemodel.JMethod)2 JVar (com.sun.codemodel.JVar)2 JAnnotationArrayMember (com.sun.codemodel.JAnnotationArrayMember)1 JAnnotationValue (com.sun.codemodel.JAnnotationValue)1 JBlock (com.sun.codemodel.JBlock)1 JClass (com.sun.codemodel.JClass)1 JFieldVar (com.sun.codemodel.JFieldVar)1 JInvocation (com.sun.codemodel.JInvocation)1 JType (com.sun.codemodel.JType)1 FieldRenderer (com.sun.tools.xjc.generator.bean.field.FieldRenderer)1 CCustomizations (com.sun.tools.xjc.model.CCustomizations)1 CPluginCustomization (com.sun.tools.xjc.model.CPluginCustomization)1 CPropertyInfo (com.sun.tools.xjc.model.CPropertyInfo)1 Constructor (com.sun.tools.xjc.model.Constructor)1 ClassOutline (com.sun.tools.xjc.outline.ClassOutline)1 FieldAccessor (com.sun.tools.xjc.outline.FieldAccessor)1 JAXBException (jakarta.xml.bind.JAXBException)1