|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--org.apache.xerces.domx.XGrammarWriter
This program allows you to print the grammar of a document either in XML Schema format or the standard DTD format.
Inner Class Summary | |
static class |
XGrammarWriter.OutputFormat
Output format enumeration. |
Field Summary | |
protected boolean |
canonical
Canonical output. |
protected static java.lang.String[] |
CONTENT_MODEL_ELEMENT_NAMES
Content model element names. |
protected static XGrammarWriter.OutputFormat |
DEFAULT_OUTPUT_FORMAT
Default output format. |
protected java.lang.String |
encoding
Encoding. |
protected XGrammarWriter.OutputFormat |
format
Output format. |
protected int |
indent
Indent level. |
protected java.io.PrintWriter |
out
Output writer. |
protected boolean |
verbose
Verbose. |
Constructor Summary | |
XGrammarWriter()
Default constructor. |
|
XGrammarWriter(java.io.OutputStream stream)
Constructs a grammar writer with the specified writer. |
|
XGrammarWriter(java.io.PrintWriter writer)
Constructs a grammar writer with the specified print writer. |
|
XGrammarWriter(java.io.Writer writer,
java.lang.String encoding)
Constructs a grammar writer with the specified writer. |
Method Summary | |
protected boolean |
containsMoreThanOneChildOfType(Element node,
java.lang.String[] names)
Returns true if the specified element has more than one child with any of the given names. |
protected Node |
getFirstChildOfType(Node node,
short type)
Returns the first child of the given node type. |
protected Node |
getNextSiblingOfType(Node node,
short type)
Returns the next sibling of the given node type. |
XGrammarWriter.OutputFormat |
getOutputFormat()
Returns the output format. |
protected boolean |
isBasicAttributeType(java.lang.String type)
Returns true if the attribute type is basic. |
protected boolean |
isBasicOccurrenceCount(java.lang.String minOccurs,
java.lang.String maxOccurs)
Returns true if the occurrence count is basic. |
boolean |
isCanonical()
Returns true if the output is canonical. |
protected boolean |
isEmpty(Element element)
Returns true if the element is "empty". |
boolean |
isVerbose()
Returns true if the output is verbose. |
static void |
main(java.lang.String[] argv)
Main program. |
protected java.lang.String |
normalize(java.lang.String s)
Normalizes the given string. |
protected int |
parseInt(java.lang.String s,
int defaultValue)
Parses a string and returns the integer value. |
void |
printAttribute(Attr attribute)
Prints an attribute. |
void |
printAttributeDecl(java.lang.String elemName,
Element attribute)
Prints a DTD attribute declaration. |
void |
printCloseElement(Element element)
Prints a close element. |
void |
printComment(Element comment)
Prints a comment. |
void |
printElement(Element element)
Prints the given element. |
void |
printElementDecl(Element element)
Prints a DTD element declaration. |
void |
printElementDeclContentModel(Element archetype)
Prints a DTD element declaration content model. |
void |
printElementDeclContentModelChildren(Element archetype)
Prints a DTD element declaration children content model. |
void |
printElementDeclContentModelMixed(Element archetype)
Prints a DTD element declaration mixed content model. |
void |
printEmptyElement(Element element)
Prints an empty element. |
void |
printEntityDecl(Element entity)
Prints a DTD entity declaration. |
void |
printGrammar(java.lang.String systemId,
DocumentType doctype)
Prints the given grammar with the specified output format. |
void |
printIndent(int level)
Prints an indent level. |
void |
printNotationDecl(Element notation)
Prints a DTD notation declaration. |
void |
printOpenElement(Element element)
Prints an open element. |
protected void |
printOpenElement(Element element,
boolean empty)
Prints an open or empty element. |
void |
printText(Text text)
Prints text. |
void |
setCanonical(boolean canonical)
Sets whether the output is canonical. |
void |
setOutputFormat(XGrammarWriter.OutputFormat format)
Sets the output format. |
void |
setVerbose(boolean verbose)
Sets whether the output is verbose. |
Methods inherited from class java.lang.Object |
clone,
equals,
finalize,
getClass,
hashCode,
notify,
notifyAll,
toString,
wait,
wait,
wait |
Field Detail |
protected static final XGrammarWriter.OutputFormat DEFAULT_OUTPUT_FORMAT
protected static final java.lang.String[] CONTENT_MODEL_ELEMENT_NAMES
protected java.io.PrintWriter out
protected int indent
protected XGrammarWriter.OutputFormat format
protected boolean verbose
protected java.lang.String encoding
protected boolean canonical
Constructor Detail |
public XGrammarWriter()
public XGrammarWriter(java.io.PrintWriter writer)
public XGrammarWriter(java.io.OutputStream stream)
public XGrammarWriter(java.io.Writer writer, java.lang.String encoding)
Method Detail |
public static void main(java.lang.String[] argv)
public void setOutputFormat(XGrammarWriter.OutputFormat format)
public XGrammarWriter.OutputFormat getOutputFormat()
public void setVerbose(boolean verbose)
public boolean isVerbose()
public void setCanonical(boolean canonical)
public boolean isCanonical()
public void printGrammar(java.lang.String systemId, DocumentType doctype)
public void printComment(Element comment)
public void printElement(Element element)
public void printIndent(int level)
public void printOpenElement(Element element)
public void printEmptyElement(Element element)
public void printCloseElement(Element element)
public void printAttribute(Attr attribute)
public void printText(Text text)
public void printElementDecl(Element element)
public void printElementDeclContentModel(Element archetype)
public void printElementDeclContentModelMixed(Element archetype)
public void printElementDeclContentModelChildren(Element archetype)
public void printAttributeDecl(java.lang.String elemName, Element attribute)
public void printEntityDecl(Element entity)
public void printNotationDecl(Element notation)
protected void printOpenElement(Element element, boolean empty)
protected boolean isEmpty(Element element)
protected boolean isBasicAttributeType(java.lang.String type)
protected boolean isBasicOccurrenceCount(java.lang.String minOccurs, java.lang.String maxOccurs)
protected int parseInt(java.lang.String s, int defaultValue)
protected boolean containsMoreThanOneChildOfType(Element node, java.lang.String[] names)
protected Node getFirstChildOfType(Node node, short type)
protected Node getNextSiblingOfType(Node node, short type)
protected java.lang.String normalize(java.lang.String s)
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |