private void appendTypeDefinitions(final XMLStreamWriter writer, final List<EdmTypeDefinition> typeDefinitions) throws XMLStreamException { for (EdmTypeDefinition definition : typeDefinitions) { writer.writeStartElement(XML_TYPE_DEFINITION); writer.writeAttribute(XML_NAME, definition.getName()); writer.writeAttribute(XML_UNDERLYING_TYPE, getFullQualifiedName(definition.getUnderlyingType(), false)); // Facets if (definition.getMaxLength() != null) { writer.writeAttribute(XML_MAX_LENGTH, "" + definition.getMaxLength()); } if (definition.getPrecision() != null) { writer.writeAttribute(XML_PRECISION, "" + definition.getPrecision()); } if (definition.getScale() != null) { writer.writeAttribute(XML_SCALE, "" + definition.getScale()); } appendAnnotations(writer, definition); writer.writeEndElement(); } }
private void appendTypeDefinitions(final XMLStreamWriter writer, final List<EdmTypeDefinition> typeDefinitions) throws XMLStreamException { for (EdmTypeDefinition definition : typeDefinitions) { writer.writeStartElement(XML_TYPE_DEFINITION); writer.writeAttribute(XML_NAME, definition.getName()); writer.writeAttribute(XML_UNDERLYING_TYPE, getFullQualifiedName(definition.getUnderlyingType(), false)); // Facets if (definition.getMaxLength() != null) { writer.writeAttribute(XML_MAX_LENGTH, "" + definition.getMaxLength()); } if (definition.getPrecision() != null) { writer.writeAttribute(XML_PRECISION, "" + definition.getPrecision()); } if (definition.getScale() != null) { writer.writeAttribute(XML_SCALE, "" + definition.getScale()); } appendAnnotations(writer, definition); writer.writeEndElement(); } }
private void appendTypeDefinitions(final JsonGenerator json, final List<EdmTypeDefinition> typeDefinitions) throws SerializerException, IOException { for (EdmTypeDefinition definition : typeDefinitions) { json.writeObjectFieldStart(definition.getName()); json.writeStringField(KIND, definition.getKind().name()); json.writeStringField(UNDERLYING_TYPE, getFullQualifiedName(definition.getUnderlyingType())); // Facets if (definition.getMaxLength() != null) { json.writeStringField(MAX_LENGTH, "" + definition.getMaxLength()); } if (definition.getPrecision() != null) { json.writeStringField(PRECISION, "" + definition.getPrecision()); } if (definition.getScale() != null) { json.writeStringField(SCALE, "" + definition.getScale()); } if (definition.getSrid() != null) { json.writeStringField(SRID, "" + definition.getSrid()); } appendAnnotations(json, definition, null); json.writeEndObject(); } }
private void appendTypeDefinitions(final JsonGenerator json, final List<EdmTypeDefinition> typeDefinitions) throws SerializerException, IOException { for (EdmTypeDefinition definition : typeDefinitions) { json.writeObjectFieldStart(definition.getName()); json.writeStringField(KIND, definition.getKind().name()); json.writeStringField(UNDERLYING_TYPE, getFullQualifiedName(definition.getUnderlyingType())); // Facets if (definition.getMaxLength() != null) { json.writeStringField(MAX_LENGTH, "" + definition.getMaxLength()); } if (definition.getPrecision() != null) { json.writeStringField(PRECISION, "" + definition.getPrecision()); } if (definition.getScale() != null) { json.writeStringField(SCALE, "" + definition.getScale()); } if (definition.getSrid() != null) { json.writeStringField(SRID, "" + definition.getSrid()); } appendAnnotations(json, definition, null); json.writeEndObject(); } }