Apache CXF API

org.apache.cxf.javascript.types
Class SchemaJavascriptBuilder

java.lang.Object
  extended by 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 Summary
SchemaJavascriptBuilder(SchemaCollection schemaCollection, NamespacePrefixAccumulator prefixAccumulator, NameManager nameManager)
           
 
Method Summary
 void complexTypeConstructorAndAccessors(QName name, org.apache.ws.commons.schema.XmlSchemaComplexType type)
           
protected  void complexTypeSerializerBody(org.apache.ws.commons.schema.XmlSchemaComplexType type, String elementPrefix, JavascriptUtils bodyUtils)
          Build the serialization code for a complex type.
 void complexTypeSerializerFunction(QName name, org.apache.ws.commons.schema.XmlSchemaComplexType type)
          Produce a serializer function for a type.
 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.
 String generateCodeForSchema(org.apache.ws.commons.schema.XmlSchema schema)
           
 String generateCodeForSchemaCollection(org.apache.ws.commons.schema.XmlSchemaCollection collection)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

SchemaJavascriptBuilder

public SchemaJavascriptBuilder(SchemaCollection schemaCollection,
                               NamespacePrefixAccumulator prefixAccumulator,
                               NameManager nameManager)
Method Detail

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 -
bodyNamespaceURIs -

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

Apache CXF API

Apache CXF