Package org.dlese.dpc.xml.schema
Class DefinitionMiner
java.lang.Object
org.dlese.dpc.xml.schema.DefinitionMiner
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
ConstructorsConstructorDescriptionDefinitionMiner(URI schemaURI, String rootElementName, Log log) Constructor for the DefinitionMiner object. -
Method Summary
Modifier and TypeMethodDescriptionvoidaddGlobalDef(String name, GlobalDef globalDef) Adds a feature to the GlobalDef attribute of the DefinitionMiner objectvoidaddGlobalDef(String name, GlobalDef globalDef, org.dom4j.Namespace ns) Adds a feature to the GlobalDef attribute of the DefinitionMiner objectvoidaddSchemaReader(URI uri, SchemaReader reader) Adds a feature to the SchemaFile attribute of the DefinitionMiner objectvoiddestroy()NOT YET DOCUMENTEDGets the globalDefMap attribute of the DefinitionMiner objectgetInlineTypeName(String base) Gets the inlineTypeName attribute of the DefinitionMiner objectGets the namespaces attribute of the DefinitionMiner objectorg.dom4j.DocumentGets the rootDoc attribute of the DefinitionMiner objectgetSchemaReader(String nsUri) Gets the schemaReader attribute of the DefinitionMiner objectgetSchemaReader(URI uri) Gets the schemaReader attribute of the DefinitionMiner objectorg.dom4j.ElementGets the schemaRootElement attribute of the DefinitionMiner objectGets the schemaURI attribute of the DefinitionMiner objectbooleanhasSchemaReader(URI uri) NOT YET DOCUMENTEDstatic voidThe main program for the DefinitionMiner classprotected voidprocessSchemaFile(URI uri, String defaultTargetNamespaceURI) Process all files in the schema tree recursively.static voidsetDebug(boolean d) Sets the debug attribute of the DefinitionMiner class
-
Constructor Details
-
DefinitionMiner
Constructor for the DefinitionMiner object.- Parameters:
schemaURI- URI of root Schema FilerootElementName- NOT YET DOCUMENTEDlog- NOT YET DOCUMENTED- Throws:
SchemaHelperException- Description of the Exception
-
-
Method Details
-
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
Gets the inlineTypeName attribute of the DefinitionMiner object- Parameters:
base- NOT YET DOCUMENTED- Returns:
- The inlineTypeName value
-
getNamespaces
Gets the namespaces attribute of the DefinitionMiner object- Returns:
- The namespaces value
-
addGlobalDef
Adds a feature to the GlobalDef attribute of the DefinitionMiner object- Parameters:
name- The feature to be added to the GlobalDef attributeglobalDef- The feature to be added to the GlobalDef attribute- Throws:
Exception- NOT YET DOCUMENTED
-
addGlobalDef
Adds a feature to the GlobalDef attribute of the DefinitionMiner object- Parameters:
name- The feature to be added to the GlobalDef attributeglobalDef- The feature to be added to the GlobalDef attributens- The feature to be added to the GlobalDef attribute- Throws:
Exception- NOT YET DOCUMENTED
-
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
Adds a feature to the SchemaFile attribute of the DefinitionMiner object- Parameters:
uri- The feature to be added to the SchemaFile attributereader- The feature to be added to the SchemaReader attribute
-
getSchemaReader
Gets the schemaReader attribute of the DefinitionMiner object- Parameters:
uri- NOT YET DOCUMENTED- Returns:
- The schemaReader value
-
getSchemaReader
Gets the schemaReader attribute of the DefinitionMiner object- Parameters:
nsUri- NOT YET DOCUMENTED- Returns:
- The schemaReader value
-
hasSchemaReader
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 processeddefaultTargetNamespaceURI- NOT YET DOCUMENTED- Throws:
SchemaHelperException- NOT YET DOCUMENTED
-
main
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
-