Docjar: A Java Source and Docuemnt Enginecom.*    java.*    javax.*    org.*    all    new    plug-in

Quick Search    Search Deep

gnu.xml.validation.relaxng
Class FullSyntaxBuilder  view FullSyntaxBuilder download FullSyntaxBuilder.java

java.lang.Object
  extended bygnu.xml.validation.relaxng.FullSyntaxBuilder

class FullSyntaxBuilder
extends java.lang.Object

Parses a RELAX NG XML DOM tree, constructing a compiled internal representation.


Field Summary
private  java.util.Map datatypeLibraries
           
(package private) static java.util.Set PATTERN_ELEMENTS
           
private  int refCount
           
(package private) static java.util.Set STRIPPED_ATTRIBUTES
           
private  java.util.Set urls
           
(package private) static java.util.Map VOCABULARY
          Complete vocabulary (elements and attributes) of the full syntax.
 
Constructor Summary
(package private) FullSyntaxBuilder()
           
 
Method Summary
(package private)  void checkName(org.w3c.dom.Element node, java.lang.String name)
           
private static void combineNodes(org.w3c.dom.Node node, java.lang.String combine, java.lang.String name, java.util.List nodes)
           
private  java.lang.String createRefName()
           
private static java.lang.String escapeURL(java.lang.String url)
           
private  void expandRefs(java.util.Set defines, org.w3c.dom.Element node)
           
private static void forbidDescendants(org.w3c.dom.Node node, java.util.Set names)
           
private  void forbidRefs(org.w3c.dom.Element node, java.lang.String name)
           
private  java.util.List getComponents(org.w3c.dom.Node node)
          Returns the "components" of an element, as described in section 4.7.
(package private)  org.relaxng.datatype.DatatypeLibrary getDatatypeLibrary(java.lang.String uri)
           
private  void getDefines(java.util.Set defines, org.w3c.dom.Element grammar, org.w3c.dom.Element node, boolean followRefs)
           
private  void getElements(java.util.Set elements, org.w3c.dom.Element grammar, org.w3c.dom.Element node)
           
private static org.w3c.dom.Element getFirstChildElement(org.w3c.dom.Node node)
           
private static org.w3c.dom.Element getNextSiblingElement(org.w3c.dom.Node node)
           
private  void handleRefs(org.w3c.dom.Node grammar1, org.w3c.dom.Node grammar2, org.w3c.dom.Node node)
          Checks that all references in the specified grammar match a define in the grammar.
private static boolean isDescendantOfFirstChildOfAttribute(org.w3c.dom.Node node)
           
private static boolean isWhitespace(java.lang.String text)
           
(package private)  Grammar parse(org.w3c.dom.Document doc)
          Parse the specified document into a grammar.
(package private)  AnyNameNameClass parseAnyName(org.w3c.dom.Element node)
           
(package private)  AttributePattern parseAttribute(org.w3c.dom.Element node)
           
(package private)  ChoicePattern parseChoice(org.w3c.dom.Element node)
           
(package private)  ChoiceNameClass parseChoiceNameClass(org.w3c.dom.Element node)
           
(package private)  DataPattern parseData(org.w3c.dom.Element node)
           
(package private)  Define parseDefine(org.w3c.dom.Element node)
           
(package private)  ElementPattern parseElement(org.w3c.dom.Element node)
           
(package private)  EmptyPattern parseEmpty(org.w3c.dom.Element node)
           
(package private)  Grammar parseGrammar(org.w3c.dom.Element node)
           
(package private)  GroupPattern parseGroup(org.w3c.dom.Element node)
           
(package private)  InterleavePattern parseInterleave(org.w3c.dom.Element node)
           
(package private)  ListPattern parseList(org.w3c.dom.Element node)
           
(package private)  NameNameClass parseName(org.w3c.dom.Element node)
           
(package private)  NameClass parseNameClass(org.w3c.dom.Element node)
           
(package private)  Pattern parseNonEmptyPattern(org.w3c.dom.Element node)
           
(package private)  NotAllowedPattern parseNotAllowed(org.w3c.dom.Element node)
           
(package private)  NSNameNameClass parseNsName(org.w3c.dom.Element node)
           
(package private)  OneOrMorePattern parseOneOrMore(org.w3c.dom.Element node)
           
(package private)  Param parseParam(org.w3c.dom.Element node)
           
(package private)  Pattern parsePattern(org.w3c.dom.Element node)
           
(package private)  RefPattern parseRef(org.w3c.dom.Element node)
           
(package private)  TextPattern parseText(org.w3c.dom.Element node)
           
(package private)  Pattern parseTop(org.w3c.dom.Element node)
           
(package private)  ValuePattern parseValue(org.w3c.dom.Element node)
           
private static org.w3c.dom.Element resolve(java.lang.String url)
          Resolve a URL to an element, as described in section 4.5.
private  void transform(org.w3c.dom.Node node)
           
private  void transform2(org.w3c.dom.Node node)
           
private  void transformGrammar(org.w3c.dom.Node grammar, org.w3c.dom.Node node)
          Transforms the schema to place all defines under the top-level grammar element and replace all other grammar elements by their start child.
private static void transformToOneChildElement(org.w3c.dom.Node node, java.lang.String name)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

VOCABULARY

static final java.util.Map VOCABULARY
Complete vocabulary (elements and attributes) of the full syntax.


STRIPPED_ATTRIBUTES

static final java.util.Set STRIPPED_ATTRIBUTES

PATTERN_ELEMENTS

static final java.util.Set PATTERN_ELEMENTS

urls

private java.util.Set urls

refCount

private int refCount

datatypeLibraries

private java.util.Map datatypeLibraries
Constructor Detail

FullSyntaxBuilder

FullSyntaxBuilder()
Method Detail

parse

Grammar parse(org.w3c.dom.Document doc)
        throws java.io.IOException
Parse the specified document into a grammar.


getDefines

private void getDefines(java.util.Set defines,
                        org.w3c.dom.Element grammar,
                        org.w3c.dom.Element node,
                        boolean followRefs)

getElements

private void getElements(java.util.Set elements,
                         org.w3c.dom.Element grammar,
                         org.w3c.dom.Element node)

expandRefs

private void expandRefs(java.util.Set defines,
                        org.w3c.dom.Element node)
                 throws GrammarException

forbidRefs

private void forbidRefs(org.w3c.dom.Element node,
                        java.lang.String name)
                 throws GrammarException

transform

private void transform(org.w3c.dom.Node node)
                throws java.io.IOException

transformGrammar

private void transformGrammar(org.w3c.dom.Node grammar,
                              org.w3c.dom.Node node)
                       throws GrammarException
Transforms the schema to place all defines under the top-level grammar element and replace all other grammar elements by their start child.


handleRefs

private void handleRefs(org.w3c.dom.Node grammar1,
                        org.w3c.dom.Node grammar2,
                        org.w3c.dom.Node node)
                 throws GrammarException
Checks that all references in the specified grammar match a define in the grammar.


createRefName

private java.lang.String createRefName()

transform2

private void transform2(org.w3c.dom.Node node)
                 throws GrammarException

isWhitespace

private static boolean isWhitespace(java.lang.String text)

escapeURL

private static java.lang.String escapeURL(java.lang.String url)

resolve

private static org.w3c.dom.Element resolve(java.lang.String url)
                                    throws java.io.IOException
Resolve a URL to an element, as described in section 4.5.


getComponents

private java.util.List getComponents(org.w3c.dom.Node node)
Returns the "components" of an element, as described in section 4.7.


transformToOneChildElement

private static void transformToOneChildElement(org.w3c.dom.Node node,
                                               java.lang.String name)

getFirstChildElement

private static org.w3c.dom.Element getFirstChildElement(org.w3c.dom.Node node)

getNextSiblingElement

private static org.w3c.dom.Element getNextSiblingElement(org.w3c.dom.Node node)

forbidDescendants

private static void forbidDescendants(org.w3c.dom.Node node,
                                      java.util.Set names)
                               throws GrammarException

isDescendantOfFirstChildOfAttribute

private static boolean isDescendantOfFirstChildOfAttribute(org.w3c.dom.Node node)

combineNodes

private static void combineNodes(org.w3c.dom.Node node,
                                 java.lang.String combine,
                                 java.lang.String name,
                                 java.util.List nodes)

parseGrammar

Grammar parseGrammar(org.w3c.dom.Element node)
               throws GrammarException

parseDefine

Define parseDefine(org.w3c.dom.Element node)
             throws GrammarException

parseTop

Pattern parseTop(org.w3c.dom.Element node)
           throws GrammarException

parsePattern

Pattern parsePattern(org.w3c.dom.Element node)
               throws GrammarException

parseNonEmptyPattern

Pattern parseNonEmptyPattern(org.w3c.dom.Element node)
                       throws GrammarException

parseElement

ElementPattern parseElement(org.w3c.dom.Element node)
                      throws GrammarException

parseNotAllowed

NotAllowedPattern parseNotAllowed(org.w3c.dom.Element node)
                            throws GrammarException

parseEmpty

EmptyPattern parseEmpty(org.w3c.dom.Element node)
                  throws GrammarException

parseText

TextPattern parseText(org.w3c.dom.Element node)
                throws GrammarException

parseData

DataPattern parseData(org.w3c.dom.Element node)
                throws GrammarException

parseParam

Param parseParam(org.w3c.dom.Element node)
           throws GrammarException

parseValue

ValuePattern parseValue(org.w3c.dom.Element node)
                  throws GrammarException

parseList

ListPattern parseList(org.w3c.dom.Element node)
                throws GrammarException

parseAttribute

AttributePattern parseAttribute(org.w3c.dom.Element node)
                          throws GrammarException

parseRef

RefPattern parseRef(org.w3c.dom.Element node)
              throws GrammarException

parseOneOrMore

OneOrMorePattern parseOneOrMore(org.w3c.dom.Element node)
                          throws GrammarException

parseChoice

ChoicePattern parseChoice(org.w3c.dom.Element node)
                    throws GrammarException

parseGroup

GroupPattern parseGroup(org.w3c.dom.Element node)
                  throws GrammarException

parseInterleave

InterleavePattern parseInterleave(org.w3c.dom.Element node)
                            throws GrammarException

parseNameClass

NameClass parseNameClass(org.w3c.dom.Element node)
                   throws GrammarException

parseAnyName

AnyNameNameClass parseAnyName(org.w3c.dom.Element node)
                        throws GrammarException

parseName

NameNameClass parseName(org.w3c.dom.Element node)
                  throws GrammarException

parseNsName

NSNameNameClass parseNsName(org.w3c.dom.Element node)
                      throws GrammarException

parseChoiceNameClass

ChoiceNameClass parseChoiceNameClass(org.w3c.dom.Element node)
                               throws GrammarException

checkName

void checkName(org.w3c.dom.Element node,
               java.lang.String name)
         throws GrammarException

getDatatypeLibrary

org.relaxng.datatype.DatatypeLibrary getDatatypeLibrary(java.lang.String uri)
                                                  throws GrammarException