@Override public boolean apply(@Nullable TypeDeclaration input) { return name.equals(input.name()); } };
@Nullable @Override public String apply(@Nullable TypeDeclaration input) { return "\"" + input.name() + "\""; } });
@Nullable @Override public String apply(@Nullable TypeDeclaration input) { return "\"" + input.name() + "\""; } });
private Map<String, String> typeDeclarationToMap(TypeDeclaration typeDeclaration) { Map<String, String> nameTypeMapping = new LinkedHashMap<>(); nameTypeMapping.put(typeDeclaration.name(), typeDeclaration.type()); return nameTypeMapping; }
@Override public boolean shouldCreateInlineType(TypeDeclaration declaration) { // this seems wrong. return declaration.name().contains("|") || declaration.type().contains("|"); } },
private static AnnotationRef findRef(Annotable annotable, String annotation) { for (AnnotationRef annotationRef : annotable.annotations()) { if (annotationRef.annotation().name().equalsIgnoreCase(annotation)) { return annotationRef; } } return null; }
private static AnnotationRef findRef(Annotable annotable, String annotation) { for (AnnotationRef annotationRef : annotable.annotations()) { if (annotationRef.annotation().name().equalsIgnoreCase(annotation)) { return annotationRef; } } return null; }
private void localTypes(List<TypeDeclaration> types, GFinderListener listener) { for (TypeDeclaration typeDeclaration : types) { foundTypes.put(typeDeclaration.name(), typeDeclaration); V10GType type = registry.fetchType(typeDeclaration); listener.newTypeDeclaration(type); } }
@Override public String toString() { return "V10GType{" + "input=" + typeDeclaration.name() + ":" + typeDeclaration.type() + ", name='" + name() + '\'' + '}'; }
@Override public String toString() { return "V10GTypeUnion{" + "input=" + typeDeclaration.name() + ":" + typeDeclaration.type() + ", name='" + name() + '\'' + '}'; }
@Override public void onGetterMethodImplementation(CurrentBuild currentBuild, MethodSpec.Builder methodSpec, TypeDeclaration typeDeclaration) { methodSpec.addAnnotation(AnnotationSpec.builder(JsonProperty.class) .addMember("value", "$S", typeDeclaration.name()).build()); }
@Override public MethodSpec.Builder setterBuilt(ObjectPluginContext objectPluginContext, TypeDeclaration declaration, MethodSpec.Builder methodSpec, EventType eventType) { return methodSpec.addAnnotation(AnnotationSpec.builder(JsonProperty.class) .addMember("value", "$S", declaration.name()).build()); } }
@Override public String getRawType() { if (queryParameter instanceof StringTypeDeclaration && "string".equalsIgnoreCase(queryParameter.type())) { List<String> items = ((StringTypeDeclaration) queryParameter).enumValues(); if (!items.isEmpty()) { return NamingHelper.convertToClassName(queryParameter.name()); } } return queryParameter.type(); }
@Override public void onFieldImplementation(CurrentBuild currentBuild, FieldSpec.Builder fieldSpec, TypeDeclaration typeDeclaration) { fieldSpec.addAnnotation(AnnotationSpec.builder(JsonProperty.class) .addMember("value", "$S", typeDeclaration.name()).build()); }
@Override public MethodSpec.Builder setterBuilt(ObjectPluginContext objectPluginContext, TypeDeclaration declaration, MethodSpec.Builder methodSpec, EventType eventType) { AnnotationSpec.Builder annotation = AnnotationSpec.builder(JsonProperty.class) .addMember("value", "$S", declaration.name()); if (declaration.defaultValue() != null) { annotation.addMember("defaultValue", "$S", declaration.defaultValue()); } return methodSpec.addAnnotation(annotation.build()); } }
public static String javaTypeName(Resource resource, Method method, Response response, TypeDeclaration declaration) { return typeName(resource.resourcePath(), method.method(), response.code().value(), declaration.name()); }
public static String javaTypeName(Resource resource, Method method, Response response, TypeDeclaration declaration) { return typeName(resource.resourcePath(), method.method(), response.code().value(), declaration.name()); }
public static String javaTypeName(Resource resource, Method method, Response response, TypeDeclaration declaration) { return typeName(resource.resourcePath(), method.method(), response.code().value(), declaration.name()); }
@Override public void onFieldImplementation(CurrentBuild currentBuild, FieldSpec.Builder fieldSpec, TypeDeclaration typeDeclaration) { fieldSpec .addAnnotation( AnnotationSpec.builder(SerializedName.class) .addMember("value", "$S", typeDeclaration.name()).build()) .addAnnotation(AnnotationSpec.builder(Expose.class).build()); } }
@Override public FieldSpec.Builder fieldBuilt(ObjectPluginContext objectPluginContext, TypeDeclaration declaration, FieldSpec.Builder fieldSpec, EventType eventType) { AnnotationSpec.Builder annotation = AnnotationSpec.builder(JsonProperty.class) .addMember("value", "$S", declaration.name()); if (declaration.defaultValue() != null) { annotation.addMember("defaultValue", "$S", declaration.defaultValue()); } return fieldSpec.addAnnotation( annotation.build()); }