private static boolean hasBuildableAnnotation(Method method) { for (AnnotationRef annotationRef : method.getAnnotations()) { if (annotationRef.getClassRef().equals(Constants.BUILDABLE_ANNOTATION.getClassRef())) { return true; } } return false; }
for (AnnotationRef a : getAnnotations()) { refs.addAll(a.getClassRef().getReferences());
private static Method superConstructorOf(Method constructor, TypeDef constructorType) { List<AnnotationRef> annotations = new ArrayList<AnnotationRef>(); for (AnnotationRef candidate : constructor.getAnnotations()) { if (!candidate.getClassRef().equals(BUILDABLE_ANNOTATION.getClassRef())) { annotations.add(candidate); } } return new MethodBuilder(constructor) .withAnnotations(annotations) .withReturnType(constructorType.toReference()) .withNewBlock() .addNewStringStatementStatement("super(" + StringUtils.join(constructor.getArguments(), new Function<Property, String>() { public String apply(Property item) { return item.getName(); } }, ", ") + ");") .endBlock() .build(); } }
for (AnnotationRef candidate : sourceMethod.getAnnotations()) { if (!candidate.getClassRef().getFullyQualifiedName().startsWith("io.sundr")) { annotations.add(candidate);
public MethodFluentImpl(Method instance){ this.withComments(instance.getComments()); this.withAnnotations(instance.getAnnotations()); this.withParameters(instance.getParameters()); this.withName(instance.getName()); this.withReturnType(instance.getReturnType()); this.withArguments(instance.getArguments()); this.withVarArgPreferred(instance.isVarArgPreferred()); this.withExceptions(instance.getExceptions()); this.withBlock(instance.getBlock()); this.withModifiers(instance.getModifiers()); this.withAttributes(instance.getAttributes()); }
public MethodBuilder(MethodFluent<?> fluent,Method instance,Boolean validationEnabled){ this.fluent = fluent; fluent.withComments(instance.getComments()); fluent.withAnnotations(instance.getAnnotations()); fluent.withParameters(instance.getParameters()); fluent.withName(instance.getName()); fluent.withReturnType(instance.getReturnType()); fluent.withArguments(instance.getArguments()); fluent.withVarArgPreferred(instance.isVarArgPreferred()); fluent.withExceptions(instance.getExceptions()); fluent.withBlock(instance.getBlock()); fluent.withModifiers(instance.getModifiers()); fluent.withAttributes(instance.getAttributes()); this.validationEnabled = validationEnabled; } public MethodBuilder(Method instance){
public MethodBuilder(Method instance,Boolean validationEnabled){ this.fluent = this; this.withComments(instance.getComments()); this.withAnnotations(instance.getAnnotations()); this.withParameters(instance.getParameters()); this.withName(instance.getName()); this.withReturnType(instance.getReturnType()); this.withArguments(instance.getArguments()); this.withVarArgPreferred(instance.isVarArgPreferred()); this.withExceptions(instance.getExceptions()); this.withBlock(instance.getBlock()); this.withModifiers(instance.getModifiers()); this.withAttributes(instance.getAttributes()); this.validationEnabled = validationEnabled; }