private void appendParameterFacets(final XMLStreamWriter writer, final EdmParameter parameter)
     throws XMLStreamException {
   if (!parameter.isNullable()) {
     writer.writeAttribute(XML_NULLABLE, "" + parameter.isNullable());
   }
   if (parameter.getMaxLength() != null) {
     writer.writeAttribute(XML_MAX_LENGTH, "" + parameter.getMaxLength());
   }
   if (parameter.getPrecision() != null) {
     writer.writeAttribute(XML_PRECISION, "" + parameter.getPrecision());
   }
   if (parameter.getScale() != null) {
     writer.writeAttribute(XML_SCALE, "" + parameter.getScale());
   }
 }
  private void appendOperationParameters(final XMLStreamWriter writer, final EdmOperation operation)
      throws XMLStreamException {
    for (String parameterName : operation.getParameterNames()) {
      EdmParameter parameter = operation.getParameter(parameterName);
      writer.writeEmptyElement(XML_PARAMETER);
      writer.writeAttribute(XML_NAME, parameterName);
      String typeFqnString;
      if (EdmTypeKind.PRIMITIVE.equals(parameter.getType().getKind())) {
        typeFqnString = getFullQualifiedName(parameter.getType(), parameter.isCollection());
      } else {
        typeFqnString = getAliasedFullQualifiedName(parameter.getType(), parameter.isCollection());
      }
      writer.writeAttribute(XML_TYPE, typeFqnString);

      appendParameterFacets(writer, parameter);
    }
  }