Class SchemaReader

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

public class SchemaReader extends Object
SchemaReader traverses an XML schema, which may be represented using multiple files, and extracts the key schema elements (including Data Type definitions and global elements). These key schema elements are represented as GlobalDefs and stored in a GlobalDefMap which is keyed by element name.
Author:
ostwald
  • Constructor Details

    • SchemaReader

      public SchemaReader(org.dom4j.Document doc, URI source, DefinitionMiner definitionMiner, String defaultTargetNamespaceURI) throws SchemaHelperException
      Constructor for the SchemaReader object.
      Parameters:
      doc - NOT YET DOCUMENTED
      source - NOT YET DOCUMENTED
      definitionMiner - NOT YET DOCUMENTED
      defaultTargetNamespaceURI - NOT YET DOCUMENTED
      Throws:
      SchemaHelperException - Description of the Exception
  • Method Details

    • getXsdPrefix

      public String getXsdPrefix()
    • isBuiltIn

      public boolean isBuiltIn(String qualifiedTypeName)
    • getNamespaces

      public NamespaceRegistry getNamespaces()
    • getInstanceNamespaces

      public NamespaceRegistry getInstanceNamespaces()
    • resolveToInstancePrefix

      public String resolveToInstancePrefix(String prefix)
    • getLocation

      public URI getLocation()
    • read

      public void read() throws SchemaHelperException
      NOT YET DOCUMENTED
      Throws:
      SchemaHelperException - NOT YET DOCUMENTED
    • getIncludePaths

      public ArrayList getIncludePaths()
      Returns a list of the paths that are declared as "include"s for the given Document
      Returns:
      an ArrayList containing the paths of all include schema files
    • getImportPaths

      public ArrayList getImportPaths()
      Gets the importPaths attribute of the SchemaReader object
      Returns:
      The importPaths value
    • getGlobalDef

      public GlobalDef getGlobalDef(String typeName)
      Return globalDef from the globalDefMap after resolving the given typeName into a baseName and namespace. Returns null if namespace cannot be determined. NOTE: this can be refactored to use getInstanceQualifiedName (returned prefix must be resolved into a namespace before the call to globalDefMap.getValue (baseName, namespace)
    • getInstanceQualifiedName

      public String getInstanceQualifiedName(String name)
    • setDebug

      public static void setDebug(boolean bool)