DLESE Tools
v1.6.0

org.dlese.dpc.xml.schema
Class DefinitionMiner

java.lang.Object
  extended by 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 Summary
DefinitionMiner(URI schemaURI, String rootElementName, Log log)
          Constructor for the DefinitionMiner object.
 
Method Summary
 void addGlobalDef(String name, GlobalDef globalDef)
          Adds a feature to the GlobalDef attribute of the DefinitionMiner object
 void addGlobalDef(String name, GlobalDef globalDef, Namespace ns)
          Adds a feature to the GlobalDef attribute of the DefinitionMiner object
 void addSchemaReader(URI uri, SchemaReader reader)
          Adds a feature to the SchemaFile attribute of the DefinitionMiner object
 void destroy()
          NOT YET DOCUMENTED
 GlobalDefMap getGlobalDefMap()
          Gets the globalDefMap attribute of the DefinitionMiner object
 String getInlineTypeName(String base)
          Gets the inlineTypeName attribute of the DefinitionMiner object
 NamespaceRegistry getNamespaces()
          Gets the namespaces attribute of the DefinitionMiner object
 Document getRootDoc()
          Gets the rootDoc attribute of the DefinitionMiner object
 SchemaReader getSchemaReader(String nsUri)
          Gets the schemaReader attribute of the DefinitionMiner object
 SchemaReader getSchemaReader(URI uri)
          Gets the schemaReader attribute of the DefinitionMiner object
 Element getSchemaRootElement()
          Gets the schemaRootElement attribute of the DefinitionMiner object
 URI getSchemaURI()
          Gets the schemaURI attribute of the DefinitionMiner object
 boolean hasSchemaReader(URI uri)
          NOT YET DOCUMENTED
static void main(String[] args)
          The main program for the DefinitionMiner class
protected  void processSchemaFile(URI uri, String defaultTargetNamespaceURI)
          Process all files in the schema tree recursively.
static void setDebug(boolean d)
          Sets the debug attribute of the DefinitionMiner class
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

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 Detail

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,
                         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 Element getSchemaRootElement()
Gets the schemaRootElement attribute of the DefinitionMiner object

Returns:
The schemaRootElement value

getRootDoc

public 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


DLESE Tools
v1.6.0