DLESE Tools
v1.6.0

org.dlese.dpc.xml.schema
Class SchemaReader

java.lang.Object
  extended by 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 Summary
SchemaReader(Document doc, URI source, DefinitionMiner definitionMiner, String defaultTargetNamespaceURI)
          Constructor for the SchemaReader object.
 
Method Summary
 GlobalDef getGlobalDef(String typeName)
          Return globalDef from the globalDefMap after resolving the given typeName into a baseName and namespace.
 ArrayList getImportPaths()
          Gets the importPaths attribute of the SchemaReader object
 ArrayList getIncludePaths()
          Returns a list of the paths that are declared as "include"s for the given Document
 NamespaceRegistry getInstanceNamespaces()
           
 String getInstanceQualifiedName(String name)
           
 URI getLocation()
           
 NamespaceRegistry getNamespaces()
           
 String getXsdPrefix()
           
 boolean isBuiltIn(String qualifiedTypeName)
           
 void read()
          NOT YET DOCUMENTED
 String resolveToInstancePrefix(String prefix)
           
static void setDebug(boolean bool)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

SchemaReader

public SchemaReader(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 Detail

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)

DLESE Tools
v1.6.0