Package org.apache.cxf.javascript.types
Class SchemaJavascriptBuilder
java.lang.Object
org.apache.cxf.javascript.types.SchemaJavascriptBuilder
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
ConstructorsConstructorDescriptionSchemaJavascriptBuilder(SchemaCollection schemaCollection, NamespacePrefixAccumulator prefixAccumulator, NameManager nameManager) -
Method Summary
Modifier and TypeMethodDescriptionvoidcomplexTypeConstructorAndAccessors(QName name, org.apache.ws.commons.schema.XmlSchemaComplexType type) protected voidcomplexTypeSerializerBody(org.apache.ws.commons.schema.XmlSchemaComplexType type, String elementPrefix, JavascriptUtils bodyUtils) Build the serialization code for a complex type.voidcomplexTypeSerializerFunction(QName name, org.apache.ws.commons.schema.XmlSchemaComplexType type) Produce a serializer function for a type.voiddomDeserializerFunction(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.generateCodeForSchema(org.apache.ws.commons.schema.XmlSchema schema) generateCodeForSchemaCollection(org.apache.ws.commons.schema.XmlSchemaCollection collection)
-
Constructor Details
-
SchemaJavascriptBuilder
public SchemaJavascriptBuilder(SchemaCollection schemaCollection, NamespacePrefixAccumulator prefixAccumulator, NameManager nameManager)
-
-
Method Details
-
generateCodeForSchemaCollection
public String generateCodeForSchemaCollection(org.apache.ws.commons.schema.XmlSchemaCollection collection) -
generateCodeForSchema
-
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
-