Class DefinitionMiner

java.lang.Object
org.dlese.dpc.xml.schema.DefinitionMiner

public class DefinitionMiner extends Object
DefinitionMiner builds data structures that aid in processing and validation of XML Instance Documents. These key schema elements are represented as GlobalDefs and stored in a GlobalDefMap which is keyed by element name.
Author:
ostwald
  • Constructor Details

    • DefinitionMiner

      public DefinitionMiner(URI schemaURI, String rootElementName, Log log) throws SchemaHelperException
      Constructor for the DefinitionMiner object.
      Parameters:
      schemaURI - URI of root Schema File
      rootElementName - NOT YET DOCUMENTED
      log - NOT YET DOCUMENTED
      Throws:
      SchemaHelperException - Description of the Exception
  • Method Details

    • getSchemaURI

      public URI getSchemaURI()
      Gets the schemaURI attribute of the DefinitionMiner object
      Returns:
      The schemaURI value
    • setDebug

      public static void setDebug(boolean d)
      Sets the debug attribute of the DefinitionMiner class
      Parameters:
      d - The new debug value
    • getInlineTypeName

      public String getInlineTypeName(String base)
      Gets the inlineTypeName attribute of the DefinitionMiner object
      Parameters:
      base - NOT YET DOCUMENTED
      Returns:
      The inlineTypeName value
    • getNamespaces

      public NamespaceRegistry getNamespaces()
      Gets the namespaces attribute of the DefinitionMiner object
      Returns:
      The namespaces value
    • addGlobalDef

      public void addGlobalDef(String name, GlobalDef globalDef) throws Exception
      Adds a feature to the GlobalDef attribute of the DefinitionMiner object
      Parameters:
      name - The feature to be added to the GlobalDef attribute
      globalDef - The feature to be added to the GlobalDef attribute
      Throws:
      Exception - NOT YET DOCUMENTED
    • addGlobalDef

      public void addGlobalDef(String name, GlobalDef globalDef, org.dom4j.Namespace ns) throws Exception
      Adds a feature to the GlobalDef attribute of the DefinitionMiner object
      Parameters:
      name - The feature to be added to the GlobalDef attribute
      globalDef - The feature to be added to the GlobalDef attribute
      ns - The feature to be added to the GlobalDef attribute
      Throws:
      Exception - NOT YET DOCUMENTED
    • getGlobalDefMap

      public GlobalDefMap getGlobalDefMap()
      Gets the globalDefMap attribute of the DefinitionMiner object
      Returns:
      The globalDefMap value
    • getSchemaRootElement

      public org.dom4j.Element getSchemaRootElement()
      Gets the schemaRootElement attribute of the DefinitionMiner object
      Returns:
      The schemaRootElement value
    • getRootDoc

      public org.dom4j.Document getRootDoc()
      Gets the rootDoc attribute of the DefinitionMiner object
      Returns:
      The rootDoc value
    • addSchemaReader

      public void addSchemaReader(URI uri, SchemaReader reader)
      Adds a feature to the SchemaFile attribute of the DefinitionMiner object
      Parameters:
      uri - The feature to be added to the SchemaFile attribute
      reader - The feature to be added to the SchemaReader attribute
    • getSchemaReader

      public SchemaReader getSchemaReader(URI uri)
      Gets the schemaReader attribute of the DefinitionMiner object
      Parameters:
      uri - NOT YET DOCUMENTED
      Returns:
      The schemaReader value
    • getSchemaReader

      public SchemaReader getSchemaReader(String nsUri)
      Gets the schemaReader attribute of the DefinitionMiner object
      Parameters:
      nsUri - NOT YET DOCUMENTED
      Returns:
      The schemaReader value
    • hasSchemaReader

      public boolean hasSchemaReader(URI uri)
      NOT YET DOCUMENTED
      Parameters:
      uri - NOT YET DOCUMENTED
      Returns:
      NOT YET DOCUMENTED
    • processSchemaFile

      protected void processSchemaFile(URI uri, String defaultTargetNamespaceURI) throws SchemaHelperException
      Process all files in the schema tree recursively. Does a depth-first traversal of the include structure of the multi-file schema, and for each file, finds the DataType definitions (ComplexType, SimpleType and GlobalElement) and adds them all to the global GlobalDefMap.
      Parameters:
      uri - the particular file to be processed
      defaultTargetNamespaceURI - NOT YET DOCUMENTED
      Throws:
      SchemaHelperException - NOT YET DOCUMENTED
    • main

      public static void main(String[] args) throws Exception
      The main program for the DefinitionMiner class
      Parameters:
      args - The command line arguments
      Throws:
      Exception - Description of the Exception
    • destroy

      public void destroy()
      NOT YET DOCUMENTED