|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object de.bsd.x2svg.parsers.XsdParser
public class XsdParser
Parser for XML Schema files
Field Summary | |
---|---|
private boolean |
alsoAttributes
|
private boolean |
debug
|
private int |
depth
|
private static java.lang.String |
FILE_SUFFIX_STRING
|
private boolean |
limitSubstitutions
|
private boolean |
limitTypes
|
private org.apache.commons.logging.Log |
log
|
private static java.lang.String |
MODE_STRING
|
private org.apache.xerces.xs.XSModel |
model
|
private java.lang.String |
rootElementName
|
private boolean |
startIsType
|
private int |
treeDepth
|
private java.io.File |
xsdFile
|
Constructor Summary | |
---|---|
XsdParser()
|
Method Summary | |
---|---|
private java.lang.String |
getCompositorForModelGroup(short compositor)
|
java.lang.String |
getFileSuffix()
Return the file suffix for this parser (.xsd) |
java.lang.String |
getMode()
Return the mode string for this parser (xsd) |
java.lang.String |
getSpecificHelp()
Return a String that gives help for this specific parser. |
private boolean |
isDebug()
Return if the debug flag got passed in and debug logging is enabled in the logging framework |
private void |
parseDefinition(org.apache.xerces.xs.XSTypeDefinition rootDefinition,
Container root)
Start parsing from a given Type Definition |
private void |
parseElement(org.apache.xerces.xs.XSElementDeclaration rootElement,
Container root)
Parses an Element recursively |
Container |
parseInput()
Parse the input. |
private void |
parseModelGroup(org.apache.xerces.xs.XSModelGroup group,
Container container)
|
private void |
setContentModelForModelGroup(Container root,
org.apache.xerces.xs.XSModelGroup mg)
Set the content model for the passed container |
void |
setDebug()
Tells the parer to set the debug mode. |
void |
setInputFile(java.io.File inputFile)
Pass in the input file to parse |
void |
setParserOptions(java.lang.String[] options)
Pass in options that are parser specific. |
void |
setWithAttributes(boolean value)
Tells the parser that parsing attributes of elements is wanted. |
void |
setWithElementComments(boolean value)
Tells the parser that parsing comments for elements (and possibly attributes) is desired. |
private java.lang.String |
termTypeToString(int type)
Return the TermType as a String instead of a number. |
private void |
workOnParticlesForModelGroup(Container container,
org.apache.xerces.xs.XSModelGroup modelGroup)
|
private void |
workOnTypeDefinition(Container root,
org.apache.xerces.xs.XSTypeDefinition tdef)
Parse a type definition. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
private static final java.lang.String MODE_STRING
private static final java.lang.String FILE_SUFFIX_STRING
private java.io.File xsdFile
private java.lang.String rootElementName
private org.apache.xerces.xs.XSModel model
private int treeDepth
private boolean limitTypes
private int depth
private boolean startIsType
private boolean limitSubstitutions
private boolean debug
private boolean alsoAttributes
private final org.apache.commons.logging.Log log
Constructor Detail |
---|
public XsdParser()
Method Detail |
---|
public Container parseInput() throws java.lang.Exception
parseInput
in interface InputParser
java.lang.Exception
- if anything goes wrong.InputParser.parseInput()
private void parseDefinition(org.apache.xerces.xs.XSTypeDefinition rootDefinition, Container root)
rootDefinition
- The definition to start withroot
- The Container that is the root of the treeprivate void parseElement(org.apache.xerces.xs.XSElementDeclaration rootElement, Container root)
rootElement
- The root element with which parsing startsroot
- The container on which children and attributes gets added.private void workOnTypeDefinition(Container root, org.apache.xerces.xs.XSTypeDefinition tdef)
root
- the starting container to which attributes and children will be added.tdef
- the type definition to start withprivate void workOnParticlesForModelGroup(Container container, org.apache.xerces.xs.XSModelGroup modelGroup)
private void parseModelGroup(org.apache.xerces.xs.XSModelGroup group, Container container)
private java.lang.String getCompositorForModelGroup(short compositor)
private void setContentModelForModelGroup(Container root, org.apache.xerces.xs.XSModelGroup mg)
root
- The containermg
- The XSModelGroup of the XSModelpublic java.lang.String getFileSuffix()
getFileSuffix
in interface InputParser
InputParser.getFileSuffix()
public java.lang.String getMode()
getMode
in interface InputParser
InputParser.getMode()
public java.lang.String getSpecificHelp()
InputParser
getSpecificHelp
in interface InputParser
public void setInputFile(java.io.File inputFile)
InputParser
setInputFile
in interface InputParser
inputFile
- a File objectpublic void setParserOptions(java.lang.String[] options)
InputParser
setParserOptions
in interface InputParser
options
- array of individual option parts as passed on the command line.public void setDebug()
InputParser
setDebug
in interface InputParser
private boolean isDebug()
private java.lang.String termTypeToString(int type)
type
- A XSTerm type
public void setWithAttributes(boolean value)
InputParser
DtdParser
is able to do this, while the PropertiesParser
is not.
setWithAttributes
in interface InputParser
value
- The value to set this to.public void setWithElementComments(boolean value)
InputParser
setWithElementComments
in interface InputParser
value
- The value to set this to.
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |