private TypeSpec.Builder getDeclaration(final GenerationContext generationContext, UnionPluginContext context, CreationResult preCreationResult) { TypeSpec.Builder typeSpec = TypeSpec.interfaceBuilder(preCreationResult.getJavaName(EventType.INTERFACE)).addModifiers(Modifier.PUBLIC); List<TypeName> names = FluentIterable.from(union.of()).transform(new Function<TypeDeclaration, TypeName>() { @Nullable @Override
for (TypeDeclaration typeDeclaration : union.of()) {
.addException(JsonProcessingException.class); for (TypeDeclaration typeDeclaration : union.of()) {
for (TypeDeclaration typeDeclaration : union.of()) {
.addException(JsonProcessingException.class); for (TypeDeclaration typeDeclaration : union.of()) {
.addStatement("$T<String, Object> map = mapper.readValue(jsonParser, Map.class)", Map.class); for (TypeDeclaration typeDeclaration : union.of()) {
for (TypeDeclaration unitedType : union.of()) {
.addException(JsonProcessingException.class); for (TypeDeclaration typeDeclaration : union.of()) {
.build()); for (TypeDeclaration typeDeclaration : union.of()) {
@Override public FieldSpec.Builder anyFieldCreated(UnionPluginContext context, UnionTypeDeclaration union, TypeSpec.Builder typeSpec, FieldSpec.Builder anyType, EventType eventType) { AnnotationSpec.Builder elementsAnnotation = AnnotationSpec.builder(XmlElements.class); for (TypeDeclaration typeDeclaration : union.of()) { elementsAnnotation.addMember("value", "$L", AnnotationSpec .builder(XmlElement.class) .addMember("name", "$S", typeDeclaration.name()) .addMember("type", "$T.class",context.creationResult().getJavaName(EventType.IMPLEMENTATION) ) .build()); } anyType.addAnnotation(elementsAnnotation.build()); return anyType; } }
for (TypeDeclaration objectProperty : objectType.of()) { RamlInterpretationResult childResult = RamlInterpreterFactory.getInterpreterForType(objectProperty).interpret(document, objectProperty, builderModel, true);
for (TypeDeclaration typeDeclaration : union.of()) {