@Override public TypeSpec.Builder onType(TypeContext context, TypeSpec.Builder builder, V10GType type, BuildPhase buildPhase) { String namespace = type.xml().namespace() != null ? type.xml().namespace() : "##default"; String name = type.xml().name() != null ? type.xml().name() : type.name(); if (buildPhase == BuildPhase.IMPLEMENTATION) { builder.addAnnotation(AnnotationSpec.builder(XmlAccessorType.class) .addMember("value", "$T.$L", XmlAccessType.class, "FIELD").build()); AnnotationSpec.Builder annotation = AnnotationSpec.builder(XmlRootElement.class) .addMember("namespace", "$S", namespace) .addMember("name", "$S", name); builder.addAnnotation(annotation.build()); } else { builder.addAnnotation(AnnotationSpec.builder(XmlRootElement.class) .addMember("namespace", "$S", namespace) .addMember("name", "$S", name).build()); } return builder; }
@Override public FieldSpec.Builder fieldBuilt(ObjectPluginContext objectPluginContext, TypeDeclaration property, FieldSpec.Builder fieldSpec, EventType eventType) { String namespace = property.xml() != null && property.xml().namespace() != null ? property.xml().namespace() : "##default"; String name = property.xml() != null && property.xml().name() != null ? property.xml().name() : property.name(); if (property.xml() != null && property.xml().wrapped() != null && property.xml().wrapped() && isArray(property)) { if (property.xml().attribute() != null && property.xml().attribute()) { fieldSpec.addAnnotation( AnnotationSpec.builder(XmlAttribute.class) if (property.xml() != null && property.xml().attribute()) { fieldSpec.addAnnotation( AnnotationSpec.builder(XmlAttribute.class)
String namespace = property.xml().namespace() != null ? property.xml().namespace() : "##default"; String name = property.xml().name() != null ? property.xml().name() : property.name(); if (property.xml().wrapped() != null && property.xml().wrapped() && property.type().isArray()) { ); if (property.xml().attribute() != null && property.xml().attribute()) { fieldSpec.addAnnotation( AnnotationSpec.builder(XmlAttribute.class) if (property.xml().attribute()) { fieldSpec.addAnnotation( AnnotationSpec.builder(XmlAttribute.class)
@Override public TypeSpec.Builder classCreated(ObjectPluginContext objectPluginContext, ObjectTypeDeclaration type, TypeSpec.Builder builder, EventType eventType) { String namespace = type.xml() != null && type.xml().namespace() != null ? type.xml().namespace() : "##default"; String name = type.xml() != null && type.xml().name() != null ? type.xml().name() : type.name(); if (eventType == EventType.IMPLEMENTATION) { builder.addAnnotation(AnnotationSpec.builder(XmlAccessorType.class) .addMember("value", "$T.$L", XmlAccessType.class, "FIELD").build()); AnnotationSpec.Builder annotation = AnnotationSpec.builder(XmlRootElement.class) .addMember("namespace", "$S", namespace) .addMember("name", "$S", name); builder.addAnnotation(annotation.build()); } else { builder.addAnnotation(AnnotationSpec.builder(XmlRootElement.class) .addMember("namespace", "$S", namespace) .addMember("name", "$S", name).build()); } return builder; }
@Override public TypeSpec.Builder classCreated(UnionPluginContext unionPluginContext, UnionTypeDeclaration type, TypeSpec.Builder builder, EventType eventType) { String namespace = type.xml() != null && type.xml().namespace() != null ? type.xml().namespace() : "##default"; String name = type.xml() != null && type.xml().name() != null ? type.xml().name() : type.name(); if (eventType == EventType.IMPLEMENTATION) { builder.addAnnotation(AnnotationSpec.builder(XmlAccessorType.class) .addMember("value", "$T.$L", XmlAccessType.class, "FIELD").build()); AnnotationSpec.Builder annotation = AnnotationSpec.builder(XmlRootElement.class) .addMember("namespace", "$S", namespace) .addMember("name", "$S", name); builder.addAnnotation(annotation.build()); } else { builder.addAnnotation(AnnotationSpec.builder(XmlRootElement.class) .addMember("namespace", "$S", namespace) .addMember("name", "$S", name).build()); } return builder; }