Class SchemaJavascriptBuilder

java.lang.Object
org.apache.cxf.javascript.types.SchemaJavascriptBuilder

public class SchemaJavascriptBuilder extends Object
Generate Javascript for a schema, and provide information needed for the service builder. As of this pass, there is no support for non-sequence types or for attribute mappings.
  • Constructor Details

  • Method Details

    • generateCodeForSchemaCollection

      public String generateCodeForSchemaCollection(org.apache.ws.commons.schema.XmlSchemaCollection collection)
    • generateCodeForSchema

      public String generateCodeForSchema(org.apache.ws.commons.schema.XmlSchema schema)
    • complexTypeConstructorAndAccessors

      public void complexTypeConstructorAndAccessors(QName name, org.apache.ws.commons.schema.XmlSchemaComplexType type)
    • complexTypeSerializerFunction

      public void complexTypeSerializerFunction(QName name, org.apache.ws.commons.schema.XmlSchemaComplexType type)
      Produce a serializer function for a type. These functions emit the surrounding element XML if the caller supplies an XML element name. It's not quite as simple as that, though. The element name may need namespace qualification, and this function will add more namespace prefixes as needed.
      Parameters:
      type -
    • complexTypeSerializerBody

      protected void complexTypeSerializerBody(org.apache.ws.commons.schema.XmlSchemaComplexType type, String elementPrefix, JavascriptUtils bodyUtils)
      Build the serialization code for a complex type. At the top level, this operates on single items, so it does not pay attention to minOccurs and maxOccurs. However, as it works through the sequence, it manages optional elements and arrays.
      Parameters:
      type -
      elementPrefix -
      bodyUtils -
    • domDeserializerFunction

      public void domDeserializerFunction(QName name, org.apache.ws.commons.schema.XmlSchemaComplexType type)
      Generate a JavaScript function that takes an element for a complex type and walks through its children using them to fill in the values for a JavaScript object.
      Parameters:
      type - schema type for the process