@Override public String getRawType() { return this.formParameter.type(); } }
@Override public String getRawType() { return this.uriParameter.type(); } }
@Override public String getRawType() { return this.header.type(); } }
@Override public String type() { return typeDeclaration.type(); }
private String elementType(TypeDeclaration type) { final String t = type.type(); if (t.endsWith("[]")) { return t.substring(0, t.length() - 2); } if (type instanceof ArrayTypeDeclaration) { final String items = ((ArrayTypeDeclaration) type).items().type(); return "array".equals(items) ? "string" : items; } return null; }
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("|"); } },
@Override public RamlParamType getType() { return ramlModelFactory.createRamlParamType(formParameter.type()); }
@Override public RamlParamType getType() { return ramlModelFactory.createRamlParamType(header.type()); }
@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(); }
@Nullable @Override public GParameter apply(@Nullable TypeDeclaration input) { return new V10PGParameter(input, currentBuild.fetchType(input.type(), input)); } });
@Nullable @Override public V10GProperty apply(@Nullable TypeDeclaration declaration) { return new V10GProperty(declaration, registry.fetchType(declaration.type(), declaration)); } });
@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() + '\'' + '}'; }
private boolean isInline(TypeDeclaration typeDeclaration) { if (typeDeclaration instanceof JSONTypeDeclaration || typeDeclaration instanceof XMLTypeDeclaration) { return !foundTypes.containsKey(typeDeclaration.type()); } if (typeDeclaration instanceof ObjectTypeDeclaration || typeDeclaration instanceof UnionTypeDeclaration || (typeDeclaration instanceof StringTypeDeclaration && !((StringTypeDeclaration) typeDeclaration).enumValues().isEmpty()) || (typeDeclaration instanceof NumberTypeDeclaration && !((NumberTypeDeclaration) typeDeclaration).enumValues().isEmpty())) { return build.fetchRamlToPojoBuilder().isInline(typeDeclaration); } return false; }
@Nullable @Override public GParameter apply(@Nullable TypeDeclaration input) { if (TypeUtils.shouldCreateNewClass(input, input.parentTypes().toArray(new TypeDeclaration[0]))) { return new V10PGParameter(input, currentBuild.fetchType(v10GResource.implementation(), method, input)); } else { return new V10PGParameter(input, currentBuild.fetchType(input.type(), input)); } } });
@Nullable @Override public GRequest apply(@Nullable TypeDeclaration input) { if (TypeUtils.shouldCreateNewClass(input, input.parentTypes().toArray(new TypeDeclaration[0]))) { return new V10GRequest(input, registry.fetchType(v10GResource.implementation(), method, input)); } else { return new V10GRequest(input, registry.fetchType(input.type(), input)); } } });
@Nullable @Override public GParameter apply(@Nullable TypeDeclaration input) { if (TypeUtils.shouldCreateNewClass(input, input.parentTypes().toArray(new TypeDeclaration[0]))) { return new V10PGParameter(input, currentBuild.fetchType(v10GResource.implementation(), method, input)); } else { return new V10PGParameter(input, currentBuild.fetchType(input.type(), input)); } } });
@Override public RamlInterpretationResult interpret(RamlRoot document, TypeDeclaration type, JCodeModel builderModel, boolean property) { RamlInterpretationResult result = new RamlInterpretationResult(type.required()); result.setResolvedClass(builderModel.ref(SchemaHelper.mapDateFormat(type.type()))); return result; } }