Overview | Package | Class | Use | Tree | Deprecated | Index | Help
|  | BEA Systems, Inc.
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD

WebLogic Server 6.0sp2 API Reference

## weblogic.apache.xerces.domx
Class XGrammarWriter

    java.lang.Object
      |
      +--weblogic.apache.xerces.domx.XGrammarWriter

public class XGrammarWriter
extends java.lang.Object

This program allows you to print the grammar of a document either in XML Schema format or the standard DTD format.

This class is based on an implementation from the Apache XML Project. In future releases the XML parser, XSLT processor, and associated classes will likely be updated to be based on a later version of the Apache implementations. Since Apache does not guarantee backwards compatibility between versions of their software, we cannot guarantee backwards compatibility of any of the classes contained in the weblogic.apache package or sub-packages.

Author:
  Copyright © 2001 BEA Systems, Inc. All Rights Reserved.

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(org.w3c.dom.Element node, java.lang.String[] names)` Returns true if the specified element has more than one child with any of the given names.
`protected org.w3c.dom.Node` | `getFirstChildOfType(org.w3c.dom.Node node, short type)` Returns the first child of the given node type.
`protected org.w3c.dom.Node` | `getNextSiblingOfType(org.w3c.dom.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(org.w3c.dom.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(org.w3c.dom.Attr attribute)` Prints an attribute.
`void` | `printAttributeDecl(java.lang.String elemName, org.w3c.dom.Element attribute)` Prints a DTD attribute declaration.
`void` | `printCloseElement(org.w3c.dom.Element element)` Prints a close element.
`void` | `printComment(org.w3c.dom.Element comment)` Prints a comment.
`void` | `printElement(org.w3c.dom.Element element)` Prints the given element.
`void` | `printElementDecl(org.w3c.dom.Element element)` Prints a DTD element declaration.
`void` | `printElementDeclContentModel(org.w3c.dom.Element archetype)` Prints a DTD element declaration content model.
`void` | `printElementDeclContentModelChildren(org.w3c.dom.Element archetype)` Prints a DTD element declaration children content model.
`void` | `printElementDeclContentModelMixed(org.w3c.dom.Element archetype)` Prints a DTD element declaration mixed content model.
`void` | `printEmptyElement(org.w3c.dom.Element element)` Prints an empty element.
`void` | `printEntityDecl(org.w3c.dom.Element entity)` Prints a DTD entity declaration.
`void` | `printGrammar(java.lang.String systemId, org.w3c.dom.DocumentType doctype)` Prints the given grammar with the specified output format.
`void` | `printIndent(int level)` Prints an indent level.
`void` | `printNotationDecl(org.w3c.dom.Element notation)` Prints a DTD notation declaration.
`void` | `printOpenElement(org.w3c.dom.Element element)` Prints an open element.
`protected void` | `printOpenElement(org.w3c.dom.Element element, boolean empty)` Prints an open or empty element.
`void` | `printText(org.w3c.dom.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

### DEFAULT_OUTPUT_FORMAT

    protected static final XGrammarWriter.OutputFormat DEFAULT_OUTPUT_FORMAT

  Default output format.

### CONTENT_MODEL_ELEMENT_NAMES

    protected static final java.lang.String[] CONTENT_MODEL_ELEMENT_NAMES

  Content model element names.

### out

    protected java.io.PrintWriter out

  Output writer.

### indent

    protected int indent

  Indent level.

### format

    protected XGrammarWriter.OutputFormat format

  Output format.

### verbose

    protected boolean verbose

  Verbose.

### encoding

    protected java.lang.String encoding

  Encoding.

### canonical

    protected boolean canonical

  Canonical output.

Constructor Detail

### XGrammarWriter

    public XGrammarWriter()

  Default constructor.

### XGrammarWriter

    public XGrammarWriter(java.io.PrintWriter writer)

  Constructs a grammar writer with the specified print writer.

### XGrammarWriter

    public XGrammarWriter(java.io.OutputStream stream)

  Constructs a grammar writer with the specified writer.

### XGrammarWriter

    public XGrammarWriter(java.io.Writer writer,
                          java.lang.String encoding)

  Constructs a grammar writer with the specified writer.

Method Detail

### main

    public static void main(java.lang.String[] argv)

  Main program.

### setOutputFormat

    public void setOutputFormat(XGrammarWriter.OutputFormat format)

  Sets the output format.

### getOutputFormat

    public XGrammarWriter.OutputFormat getOutputFormat()

  Returns the output format.

### setVerbose

    public void setVerbose(boolean verbose)

  Sets whether the output is verbose.

### isVerbose

    public boolean isVerbose()

  Returns true if the output is verbose.

### setCanonical

    public void setCanonical(boolean canonical)

  Sets whether the output is canonical.

### isCanonical

    public boolean isCanonical()

  Returns true if the output is canonical.

### printGrammar

    public void printGrammar(java.lang.String systemId,
                             org.w3c.dom.DocumentType doctype)

  Prints the given grammar with the specified output format.

### printComment

    public void printComment(org.w3c.dom.Element comment)

  Prints a comment.

### printElement

    public void printElement(org.w3c.dom.Element element)

  Prints the given element.

### printIndent

    public void printIndent(int level)

  Prints an indent level.

### printOpenElement

    public void printOpenElement(org.w3c.dom.Element element)

  Prints an open element.

### printEmptyElement

    public void printEmptyElement(org.w3c.dom.Element element)

  Prints an empty element.

### printCloseElement

    public void printCloseElement(org.w3c.dom.Element element)

  Prints a close element.

### printAttribute

    public void printAttribute(org.w3c.dom.Attr attribute)

  Prints an attribute.

### printText

    public void printText(org.w3c.dom.Text text)

  Prints text.

### printElementDecl

    public void printElementDecl(org.w3c.dom.Element element)

  Prints a DTD element declaration.

### printElementDeclContentModel

    public void printElementDeclContentModel(org.w3c.dom.Element archetype)

  Prints a DTD element declaration content model.

### printElementDeclContentModelMixed

    public void printElementDeclContentModelMixed(org.w3c.dom.Element archetype)

  Prints a DTD element declaration mixed content model.

### printElementDeclContentModelChildren

    public void printElementDeclContentModelChildren(org.w3c.dom.Element archetype)

  Prints a DTD element declaration children content model.

### printAttributeDecl

    public void printAttributeDecl(java.lang.String elemName,
                                   org.w3c.dom.Element attribute)

  Prints a DTD attribute declaration.

### printEntityDecl

    public void printEntityDecl(org.w3c.dom.Element entity)

  Prints a DTD entity declaration.

### printNotationDecl

    public void printNotationDecl(org.w3c.dom.Element notation)

  Prints a DTD notation declaration.

### printOpenElement

    protected void printOpenElement(org.w3c.dom.Element element,
                                    boolean empty)

  Prints an open or empty element.

### isEmpty

    protected boolean isEmpty(org.w3c.dom.Element element)

  Returns true if the element is "empty". In other words, if it does not contain element or text node children.

### isBasicAttributeType

    protected boolean isBasicAttributeType(java.lang.String type)

  Returns true if the attribute type is basic.

### isBasicOccurrenceCount

    protected boolean isBasicOccurrenceCount(java.lang.String minOccurs,
                                             java.lang.String maxOccurs)

  Returns true if the occurrence count is basic.

### parseInt

    protected int parseInt(java.lang.String s,
                           int defaultValue)

  Parses a string and returns the integer value.

### containsMoreThanOneChildOfType

    protected boolean containsMoreThanOneChildOfType(org.w3c.dom.Element node,
                                                     java.lang.String[] names)

  Returns true if the specified element has more than one child with any of the given names.

### getFirstChildOfType

    protected org.w3c.dom.Node getFirstChildOfType(org.w3c.dom.Node node,
                                                   short type)

  Returns the first child of the given node type.

### getNextSiblingOfType

    protected org.w3c.dom.Node getNextSiblingOfType(org.w3c.dom.Node node,
                                                    short type)

  Returns the next sibling of the given node type.

### normalize

    protected java.lang.String normalize(java.lang.String s)

  Normalizes the given string.

Overview | Package | Class | Use | Tree | Deprecated | Index | Help
| Documentation is available at http://e-docs.bea.com/wls/docs60
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD