public TypeDef apply(final TypeDef item) { final Modifier[] modifiers = item.isAbstract() ? new Modifier[]{Modifier.PUBLIC, Modifier.ABSTRACT} : new Modifier[]{Modifier.PUBLIC}; final TypeDef editable = EDITABLE.apply(item); return new TypeDefBuilder(BUILDER.apply(item)) .withAnnotations() .accept(new TypedVisitor<MethodBuilder>() { public void visit(MethodBuilder builder) { if (builder.getName() != null && builder.getName().equals("build")) { builder.withModifiers(TypeUtils.modifiersToInt(modifiers)); builder.withReturnType(editable.toInternalReference()); builder.withBlock(new Block(new Provider<List<Statement>>() { @Override public List<Statement> get() { return toBuild(editable, editable); } })); } } }).build(); } });
.withAnnotations() .withProperties(properties) .withMethods(nestedMethods)
.withAnnotations() .withInnerTypes(nestedClazzes) .withMethods(methods)
.withAnnotations() .withConstructors(constructors) .withProperties(properties)
? POJO.apply(ref.getDefinition()) : POJO.apply(new TypeDefBuilder(ref.getDefinition()) .withAnnotations(annotationRefs) .addToAnnotations(inheritedPojoRef) .withAttributes(item.getAttributes()) .withModifiers(modifiersToInt(Modifier.PUBLIC)) .withName(pojoName) .withAnnotations(annotationRefs) .withProperties(fields) .withConstructors(constructors)
.withAnnotations() .withModifiers(TypeUtils.modifiersToInt(Modifier.PUBLIC)) .withProperties(properties)
.withAnnotations() .withModifiers(TypeUtils.modifiersToInt(modifiers)) .withConstructors(constructors)
public TypeDefBuilder(TypeDef instance,Boolean validationEnabled){ this.fluent = this; this.withKind(instance.getKind()); this.withPackageName(instance.getPackageName()); this.withName(instance.getName()); this.withComments(instance.getComments()); this.withAnnotations(instance.getAnnotations()); this.withExtendsList(instance.getExtendsList()); this.withImplementsList(instance.getImplementsList()); this.withParameters(instance.getParameters()); this.withProperties(instance.getProperties()); this.withConstructors(instance.getConstructors()); this.withMethods(instance.getMethods()); this.withOuterType(instance.getOuterType()); this.withInnerTypes(instance.getInnerTypes()); this.withModifiers(instance.getModifiers()); this.withAttributes(instance.getAttributes()); this.validationEnabled = validationEnabled; }
.withAnnotations() .withModifiers(TypeUtils.modifiersToInt(Modifier.PUBLIC)) .withConstructors(constructors)
.withAnnotations() .withModifiers(TypeUtils.modifiersToInt(modifiers)) .withProperties(fields)
.withAnnotations(new ArrayList<>()) .build();