org.merlotxml.util.xml.xerces
Class DTDGrammarDocumentImpl

java.lang.Object
  extended byorg.merlotxml.util.xml.xerces.DTDGrammarDocumentImpl
All Implemented Interfaces:
GrammarDocument

public class DTDGrammarDocumentImpl
extends java.lang.Object
implements GrammarDocument


Constructor Summary
DTDGrammarDocumentImpl(org.apache.xerces.xni.grammars.Grammar[] grammars)
           
 
Method Summary
protected  void analyzeContentSpecs()
           
protected  org.apache.xerces.impl.dtd.DTDGrammar getGrammar()
           
 GrammarComplexType getGrammarComplexType(GrammarComplexType parent, java.lang.String name)
          Gets a complex type that is defined within the scope of a parent based on its name.
 GrammarComplexType getTopLevelGrammarComplexType(java.lang.String name)
          Gets a specific top level complex type.
 GrammarComplexType[] getTopLevelGrammarComplexTypes()
          Gets the elements that are defined in the top level.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

DTDGrammarDocumentImpl

public DTDGrammarDocumentImpl(org.apache.xerces.xni.grammars.Grammar[] grammars)
Method Detail

getGrammarComplexType

public GrammarComplexType getGrammarComplexType(GrammarComplexType parent,
                                                java.lang.String name)
Description copied from interface: GrammarDocument
Gets a complex type that is defined within the scope of a parent based on its name.

Specified by:
getGrammarComplexType in interface GrammarDocument
Parameters:
parent - The parent element.
name - The child element name.
Returns:
The grammarComplexType value

getTopLevelGrammarComplexType

public GrammarComplexType getTopLevelGrammarComplexType(java.lang.String name)
Description copied from interface: GrammarDocument
Gets a specific top level complex type.

Specified by:
getTopLevelGrammarComplexType in interface GrammarDocument
Parameters:
name - The name of a named, top level element.
Returns:
A top level element with this name.

getTopLevelGrammarComplexTypes

public GrammarComplexType[] getTopLevelGrammarComplexTypes()
Description copied from interface: GrammarDocument
Gets the elements that are defined in the top level. For DTDs, this is all elements. For Schemas, all the elements that are not defined within the scope of other elements. Remember that with Schemas, complex types might not always have names and more than one complex type with the same name might exist, as long as they are defined within the scopes of different parents. Thus, with Schemas a complex type can not be assumed to be unique by name within the whole XSD. This is why we need to work with complex types and not with elements.

Specified by:
getTopLevelGrammarComplexTypes in interface GrammarDocument
Returns:
The top level elements.

analyzeContentSpecs

protected void analyzeContentSpecs()

getGrammar

protected org.apache.xerces.impl.dtd.DTDGrammar getGrammar()