|
Apache CXF API | |||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object org.apache.cxf.javascript.JavascriptUtils
public class JavascriptUtils
A set of functions that assist in JavaScript generation. This includes functions for appending strings of JavaScript to a buffer as well as some type utilities.
Constructor Summary | |
---|---|
JavascriptUtils(StringBuilder code)
|
Method Summary | |
---|---|
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. |
String |
getDefaultValueForSimpleType(org.apache.ws.commons.schema.XmlSchemaType 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)
|
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public JavascriptUtils(StringBuilder code)
Method Detail |
---|
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 static String protectSingleQuotes(String value)
public String escapeStringQuotes(String data)
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 startFor(String start, String test, String increment)
public void startForIn(String var, String collection)
public void startWhile(String test)
public void startDo()
public String javascriptParseExpression(org.apache.ws.commons.schema.XmlSchemaType type, String value)
public static String javaScriptNameToken(String token)
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)
elementInfo
- schemaCollection
-
|
Apache CXF API | |||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |