schema2template.model
public class XMLModel extends Object
Constructor and Description |
---|
XMLModel(com.sun.msv.grammar.Expression root)
Constructs new model by the MSV root expression
|
Modifier and Type | Method and Description |
---|---|
static String |
camelCase(QNamed def)
Convert a-few:words into AFewWords in CamelCase spelling
|
static String |
camelCase(String raw)
Convert a-few:words into AFewWords in CamelCase spelling
|
static String |
constantCase(QNamed def)
Convert a-few:words into A_FEW_WORDS in spelling used for Java constants
|
static String |
constantCase(String raw)
Convert a-few:words into A_FEW_WORDS in spelling used for Java constants
|
static String |
escapeKeyword(QNamed in)
(Java) member variable may not start with a number, so escape it
|
static String |
escapeKeyword(String in)
(Java) Keyword may not start with a number, so escape it
|
static String |
escapeLiteral(QNamed in)
Escape the quotation marks of String literals
|
static String |
escapeLiteral(String in)
Escape the quotation marks of String literals
|
static String |
extractLocalname(QNamed def)
Extract localname local from ns:local name
|
static String |
extractLocalname(String name)
Extract localname local from ns:local name
|
static String |
extractNamespace(QNamed def)
Extract namespace ns from ns:local name
|
static String |
extractNamespace(String name)
Extract namespace ns from ns:local name
|
static String |
firstWord(QNamed def)
Maybe not used anymore: Get first word out of a QNamed object containing delimiters like "-:/ _.,"
|
static String |
firstWord(String raw)
Assist method for camel-case adaptions or namespace extraction.
|
QNamedPuzzleComponent |
getAttribute(String name)
Get attribute by tag name.
|
PuzzlePiece |
getAttribute(String name,
int hashCode)
Get attribute by tag name and hash code.
|
PuzzlePieceSet |
getAttributes()
Get all attributes, sorted by ns:local name.
|
QNamedPuzzleComponent |
getElement(String name)
Get element(s) by tag name.
|
PuzzlePiece |
getElement(String name,
int hashCode)
Get element by tag name and hash code.
|
PuzzlePieceSet |
getElements()
Get all elements, sorted by ns:local name.
|
static String |
javaCase(QNamed def)
Convert a-few:words into aFewWords in spelling for java method names
|
static String |
javaCase(String raw)
Convert a-few:words into aFewWords in spelling for java method names
|
static String |
lastWord(QNamed def)
Maybe not used anymore: Get last word out of a String containing delimiters like "-:/ _.,"
|
static String |
lastWord(String raw)
Maybe not used anymore: Get last word out of a String containing delimiters like "-:/ _.,"
|
public XMLModel(com.sun.msv.grammar.Expression root)
root
- MSV root Expressionpublic PuzzlePieceSet getElements()
public PuzzlePieceSet getAttributes()
public QNamedPuzzleComponent getElement(String name)
name
- public PuzzlePiece getElement(String name, int hashCode)
name
- hashCode
- public QNamedPuzzleComponent getAttribute(String name)
name
- public PuzzlePiece getAttribute(String name, int hashCode)
name
- hashCode
- public static String camelCase(String raw)
raw
- input Stringpublic static String camelCase(QNamed def)
def
- inputpublic static String javaCase(String raw)
raw
- input Stringpublic static String javaCase(QNamed def)
def
- inputpublic static String constantCase(String raw)
raw
- input Stringpublic static String constantCase(QNamed def)
def
- inputpublic static String firstWord(String raw)
raw
- input Stringpublic static String firstWord(QNamed def)
def
- inputpublic static String lastWord(String raw)
raw
- inputpublic static String lastWord(QNamed def)
def
- inputpublic static String escapeKeyword(QNamed in)
in
- raw inputpublic static String escapeKeyword(String in)
in
- raw inputpublic static String escapeLiteral(QNamed in)
in
- raw inputpublic static String escapeLiteral(String in)
in
- raw inputpublic static String extractNamespace(String name)
name
- in form ns:localpublic static String extractNamespace(QNamed def)
def
- QNamed objectpublic static String extractLocalname(String name)
name
- in form ns:localCopyright © 2010-2014 The Apache Software Foundation. All Rights Reserved.