|
||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectuk.ac.ic.doc.automed.wrappers.AutoMedWrapper
uk.ac.ic.doc.automed.wrappers.XMLSchemaWrapper
public class XMLSchemaWrapper
Field Summary | |
---|---|
private Construct |
att
|
private Construct |
ce
|
(package private) Document |
doc
An internal representation of the XSDOM document |
static java.lang.String |
driverString
|
private java.util.HashMap |
elementHash
|
(package private) org.w3c.dom.Document |
inputDoc
An internal representation of the Schema document |
private Construct |
key
|
private Construct |
keyref
|
private Construct |
multiparentLink
|
private Construct |
multiparentNode
|
private java.lang.String |
nsprefix
The ns prefix used by the schema doc |
private java.util.HashMap |
parentNodeIdsHash
|
static java.lang.String |
protocolString
|
private Construct |
recursiveDepth
|
private Construct |
rootElement
|
private static char |
separator
The separator for a query |
private int |
tempNo
|
private static java.lang.String |
unNamedComplexType
|
(package private) org.w3c.dom.Document |
xmlDoc
An internal representation of the XML document |
private java.lang.String |
xmlRootElementName
|
private Model |
xs
|
(package private) org.apache.xerces.xs.XSModel |
xsm
The schema model for the XML doc loaded in |
Fields inherited from class uk.ac.ic.doc.automed.wrappers.AutoMedWrapper |
---|
am, awf, debug, driver, emptyKeyProtection, emptyKeys, optionKeyProtection, optionKeys, optionSet, password, protocol, s, url, username |
Constructor Summary | |
---|---|
XMLSchemaWrapper()
Creates a new, empty instance of XMLSchemaWrapper |
|
XMLSchemaWrapper(AccessMethod am,
java.lang.String password)
This constructor is used when wrapping or querying the schema |
Method Summary | |
---|---|
protected void |
connect()
Check that the XML file exists |
private java.lang.String |
createXPath(SchemaObject so,
java.lang.String currentPath)
|
private ComplexType |
createXSDOMComplexType(org.apache.xerces.xs.XSComplexTypeDefinition xsct)
Create a new XSDOM complexType |
void |
createXSDOMRepresentation(org.apache.xerces.xs.XSModel xsModel)
Create an internal representation of the XML Schema. |
ASG |
executeIQL(ASG q)
Execute an IQL query on the datasource. |
ASG |
executeIQL(ASG q,
QueryProcessorConfiguration qr)
|
ASG |
executeXMLSchemaQuery(ASG ASGquery)
Given an IQL query, this method queries the XML file, then returns the answer in ASG format. |
private void |
findKey(org.apache.xerces.xs.XSIDCDefinition idc)
Find the XSDOM constructs that make up this XS key |
private void |
findKeyRef(org.apache.xerces.xs.XSIDCDefinition idc)
Find the XSDOM constructs that make up this XS keyRef |
private ComplexType |
findSelectorCT(org.apache.xerces.xs.XSIDCDefinition idc)
Find the CT associated with the selector for this idc |
private Attribute |
getAttribute(org.apache.xerces.xs.XSAttributeUse attUse)
Create an XSDOM attribute from the XMLSchema |
protected AutoMedWrapperFactory |
getDefaultWrapperFactory()
Return the default AutoMedWrapperFactory that is used to generate
Schema instances from information in a data sources |
Document |
getDoc()
Return the XSDOM document |
private Element |
getElement(org.apache.xerces.xs.XSElementDeclaration xst,
org.apache.xerces.xs.XSParticle xsp)
Create an XSDOM element from the XMLSchema |
java.lang.String |
getProtocolName()
Returns the protocol typeName for the XMLSchemaWrapper |
private SchemaObject |
hasAKey(SchemaObject so)
|
private boolean |
inmultiparentLink(SchemaObject so)
|
private ASG |
multiparentLinkQuery(java.lang.String parentElement,
java.lang.String queryElement)
|
private ASG |
parentsQuery(java.lang.String childName)
|
private java.util.ArrayList |
processModelGroupInComplexType(org.apache.xerces.xs.XSModelGroup modelgroup)
|
private ASG |
recursiveDepthQuery(java.lang.String childName)
|
private ASG |
rootNodeQuery()
|
private void |
setupElementHash()
|
private org.apache.xerces.xs.XSModel |
validateDoc()
Parse the XML Schema for this XML document |
private ASG |
xmlSchemaQuery(java.lang.String queryElement,
SchemaObject keyNode,
SchemaObject parentKeyNode,
Construct constructType,
java.lang.String typeName,
boolean simpleContent)
Non root node query |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
private int tempNo
public static final java.lang.String driverString
public static final java.lang.String protocolString
private static final java.lang.String unNamedComplexType
Document doc
org.w3c.dom.Document inputDoc
org.w3c.dom.Document xmlDoc
private static char separator
org.apache.xerces.xs.XSModel xsm
private java.lang.String nsprefix
private java.lang.String xmlRootElementName
private java.util.HashMap elementHash
private java.util.HashMap parentNodeIdsHash
private Model xs
private Construct rootElement
private Construct ce
private Construct att
private Construct key
private Construct keyref
private Construct multiparentNode
private Construct multiparentLink
private Construct recursiveDepth
Constructor Detail |
---|
public XMLSchemaWrapper()
public XMLSchemaWrapper(AccessMethod am, java.lang.String password) throws DataSourceException, NotFoundException
DataSourceException
NotFoundException
Method Detail |
---|
public Document getDoc()
protected AutoMedWrapperFactory getDefaultWrapperFactory()
AutoMedWrapper
AutoMedWrapperFactory
that is used to generate
Schema
instances from information in a data sources
getDefaultWrapperFactory
in class AutoMedWrapper
public java.lang.String getProtocolName()
getProtocolName
in class AutoMedWrapper
protected void connect() throws DataSourceException
connect
in class AutoMedWrapper
DataSourceException
- if unable to connect to the data sourceprivate org.apache.xerces.xs.XSModel validateDoc() throws DataSourceException
DataSourceException
private ComplexType findSelectorCT(org.apache.xerces.xs.XSIDCDefinition idc)
private void findKey(org.apache.xerces.xs.XSIDCDefinition idc)
private void findKeyRef(org.apache.xerces.xs.XSIDCDefinition idc)
private Element getElement(org.apache.xerces.xs.XSElementDeclaration xst, org.apache.xerces.xs.XSParticle xsp) throws AutoMedException
AutoMedException
private Attribute getAttribute(org.apache.xerces.xs.XSAttributeUse attUse)
private java.util.ArrayList processModelGroupInComplexType(org.apache.xerces.xs.XSModelGroup modelgroup) throws AutoMedException
AutoMedException
private ComplexType createXSDOMComplexType(org.apache.xerces.xs.XSComplexTypeDefinition xsct) throws AutoMedException
AutoMedException
public void createXSDOMRepresentation(org.apache.xerces.xs.XSModel xsModel) throws java.lang.Exception
java.lang.Exception
private SchemaObject hasAKey(SchemaObject so) throws DataSourceException
DataSourceException
private boolean inmultiparentLink(SchemaObject so)
private void setupElementHash()
public ASG executeIQL(ASG q) throws DataSourceException
AutoMedWrapper
executeIQL
in class AutoMedWrapper
q
- An IQL query held in an ASG
which complies with the
limitations of what this wrapper is able to process
ASG
containing the results of the query
DataSourceException
public ASG executeIQL(ASG q, QueryProcessorConfiguration qr) throws DataSourceException
DataSourceException
public ASG executeXMLSchemaQuery(ASG ASGquery)
ASGquery
- the IQL query in ASG format
private ASG rootNodeQuery()
private ASG multiparentLinkQuery(java.lang.String parentElement, java.lang.String queryElement)
private ASG parentsQuery(java.lang.String childName)
private ASG recursiveDepthQuery(java.lang.String childName)
private ASG xmlSchemaQuery(java.lang.String queryElement, SchemaObject keyNode, SchemaObject parentKeyNode, Construct constructType, java.lang.String typeName, boolean simpleContent)
private java.lang.String createXPath(SchemaObject so, java.lang.String currentPath)
|
||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |