public class JavascriptUtils extends Object
Constructor and Description |
---|
JavascriptUtils(StringBuilder code) |
Modifier and Type | Method and Description |
---|---|
void |
appendElse() |
void |
appendExpression(String value) |
void |
appendLine(String line) |
void |
appendString(String value)
emit javascript to append a value to the accumulator.
|
void |
endBlock() |
String |
escapeStringQuotes(String data) |
void |
generateCodeToSerializeAny(ParticleInfo itemInfo,
String prefix,
SchemaCollection schemaCollection)
Generate code to serialize an xs:any.
|
void |
generateCodeToSerializeElement(ParticleInfo elementInfo,
String referencePrefix,
SchemaCollection schemaCollection)
Given an element, generate the serialization code.
|
static org.apache.ws.commons.schema.XmlSchemaAll |
getAll(org.apache.ws.commons.schema.XmlSchemaComplexType type) |
static org.apache.ws.commons.schema.XmlSchemaChoice |
getChoice(org.apache.ws.commons.schema.XmlSchemaComplexType type) |
static List<org.apache.ws.commons.schema.XmlSchemaObject> |
getContentElements(org.apache.ws.commons.schema.XmlSchemaComplexType type,
SchemaCollection collection) |
static org.apache.ws.commons.schema.XmlSchemaSequence |
getContentSequence(org.apache.ws.commons.schema.XmlSchemaComplexType type) |
String |
getDefaultValueForSimpleType(org.apache.ws.commons.schema.XmlSchemaType type) |
static org.apache.ws.commons.schema.XmlSchemaAnnotated |
getObjectAnnotated(org.apache.ws.commons.schema.XmlSchemaObject object,
QName contextName)
If the object is an attribute or an anyAttribute,
return the 'Annotated'.
|
static org.apache.ws.commons.schema.XmlSchemaParticle |
getObjectParticle(org.apache.ws.commons.schema.XmlSchemaObject object,
QName contextName,
org.apache.ws.commons.schema.XmlSchema currentSchema)
If the object is an element or an any, return the particle.
|
static org.apache.ws.commons.schema.XmlSchemaSequence |
getSequence(org.apache.ws.commons.schema.XmlSchemaComplexType type) |
boolean |
isStringSimpleType(QName typeName) |
static String |
javaScriptNameToken(String token) |
String |
javascriptParseExpression(org.apache.ws.commons.schema.XmlSchemaType type,
String value) |
static boolean |
mtomCandidateType(org.apache.ws.commons.schema.XmlSchemaType type)
Return true for xsd:base64Binary or simple restrictions of it, as in the xmime stock type.
|
static boolean |
notVeryComplexType(org.apache.ws.commons.schema.XmlSchemaType type)
We don't want to generate Javascript overhead for complex types with simple content models,
at least until or unless we decide to cope with attributes in a general way.
|
static String |
protectSingleQuotes(String value) |
void |
setXmlStringAccumulator(String variableName) |
void |
startBlock() |
void |
startDo() |
void |
startFor(String start,
String test,
String increment) |
void |
startForIn(String var,
String collection) |
void |
startIf(String test) |
void |
startWhile(String test) |
void |
startXmlStringAccumulator(String variableName) |
public JavascriptUtils(StringBuilder code)
public String getDefaultValueForSimpleType(org.apache.ws.commons.schema.XmlSchemaType type)
public boolean isStringSimpleType(QName typeName)
public void setXmlStringAccumulator(String variableName)
public void startXmlStringAccumulator(String variableName)
public void appendString(String value)
value
- public void appendExpression(String value)
public void appendLine(String line)
public void startIf(String test)
public void startBlock()
public void appendElse()
public void endBlock()
public void startWhile(String test)
public void startDo()
public String javascriptParseExpression(org.apache.ws.commons.schema.XmlSchemaType type, String value)
public static boolean notVeryComplexType(org.apache.ws.commons.schema.XmlSchemaType type)
type
- public static boolean mtomCandidateType(org.apache.ws.commons.schema.XmlSchemaType type)
type
- public void generateCodeToSerializeElement(ParticleInfo elementInfo, String referencePrefix, SchemaCollection schemaCollection)
elementInfo
- description of the element we are serializingreferencePrefix
- prefix to the Javascript variable. Nothing for
args, this._ for members.schemaCollection
- caller's schema collection.public void generateCodeToSerializeAny(ParticleInfo itemInfo, String prefix, SchemaCollection schemaCollection)
itemInfo
- prefix
- schemaCollection
- public static org.apache.ws.commons.schema.XmlSchemaAnnotated getObjectAnnotated(org.apache.ws.commons.schema.XmlSchemaObject object, QName contextName)
object
- public static org.apache.ws.commons.schema.XmlSchemaParticle getObjectParticle(org.apache.ws.commons.schema.XmlSchemaObject object, QName contextName, org.apache.ws.commons.schema.XmlSchema currentSchema)
object
- public static org.apache.ws.commons.schema.XmlSchemaSequence getSequence(org.apache.ws.commons.schema.XmlSchemaComplexType type)
public static org.apache.ws.commons.schema.XmlSchemaChoice getChoice(org.apache.ws.commons.schema.XmlSchemaComplexType type)
public static org.apache.ws.commons.schema.XmlSchemaAll getAll(org.apache.ws.commons.schema.XmlSchemaComplexType type)
public static List<org.apache.ws.commons.schema.XmlSchemaObject> getContentElements(org.apache.ws.commons.schema.XmlSchemaComplexType type, SchemaCollection collection)
public static org.apache.ws.commons.schema.XmlSchemaSequence getContentSequence(org.apache.ws.commons.schema.XmlSchemaComplexType type)
Apache CXF