com.jaxfront.core.schema.impl
Class XMLSchemaImpl

java.lang.Object
  extended by com.jaxfront.core.schema.impl.XMLSchemaImpl
All Implemented Interfaces:
XMLSchema

public class XMLSchemaImpl
extends java.lang.Object
implements XMLSchema

Represents a W3C XML Schema (wrapping oracles XML Schema: oracle.xml.parser.schema.XMLSchema Every schema is holding the root name, available code tables and all global entities.

Version:
1.60

Field Summary
 boolean _isXUISchema
           
 
Constructor Summary
XMLSchemaImpl(org.apache.xerces.xs.XSModel schema, org.w3c.dom.ls.LSInput schemaInput, java.lang.String rootName, java.util.Hashtable namespaceMapping, java.util.Hashtable schemaRootNodeAttributes)
          Creates an XML Schema based on a oracle XMLSchema, a schemaURL and a root name.
XMLSchemaImpl(org.apache.xerces.xs.XSModel schema, java.net.URL schemaURL, java.lang.String rootName, java.util.Hashtable namespaceMapping, java.util.Hashtable schemaRootNodeAttributes)
          Creates an XML Schema based on a oracle XMLSchema, a schemaURL and a root name.
 
Method Summary
 Type buildType(SchemaNode element)
          Returns the analysed JAXFront type according to my schema element children.
 Type buildType(SchemaNode element, TreeWalkingElementAnalyser analyser)
           
 Document createDocument()
          Returns a new JAXFront Document.
 Document createDocument(java.util.Hashtable params)
          Returns a new JAXFront Document.
 Type createTypeCopy(SchemaNode element)
          Creates a copy of the analysed JAXFront type for the passing element.
 CodeTables getCodeTables()
          Returns the codeTables.
 CodeTables getCodeTables(XMLSchema schema, java.lang.String url, java.net.URL xuiURL)
          Returns all loaded code tables for a specific url (e.q. po.codes).
 java.lang.String getDefaultNamespace()
          Returns the default namespace of this schema.
 java.lang.String[] getDerivedTypeNames(java.lang.String abstractName)
          Returns all derived type names whith a specific name of a submitted abstract type.
 java.util.Set getDerivedTypes(java.lang.String abstractName, java.lang.String name)
          Returns all derived types whith a specific name of a submitted abstract type.
 java.util.Set getDerivedTypes(java.lang.String abstractName, java.lang.String name, java.util.Set derivedTypes)
           
 Type getEditingType(Type edType)
           
 java.util.Map getGlobalElements()
          Returns all global elements of this schema.
 java.util.Map getGlobalEntities()
          Returns all global entities of this schema.
 SchemaNode getGlobalEntity(SchemaNode node)
           
 SchemaNode getGlobalEntity(java.lang.String name)
          Returns a global entity with a specific name.
 java.lang.String getGroupName(org.apache.xerces.xs.XSObject modelGroup)
           
 java.lang.String getGroupQName(org.apache.xerces.xs.XSObject modelGroup)
           
 SchemaKey getKey(java.lang.String keyName)
          Returns a schema key.
 SchemaKeyRef getKeyRef(java.lang.String keyName)
          Returns a schema key.
 java.lang.String getLocationPath()
          Returns the absolute filepath that points to the schema.
 java.util.Vector getNamespaceDeclarations(java.lang.String schemaLocation)
          Gets all namespace declarations of this schema.
 java.util.Vector getNamespaceDeclarations(java.lang.String schemaLocation, boolean isXuiDom)
          Gets all namespace declarations of this schema.
 java.util.Hashtable getNamespaceMapping()
           
 java.lang.String getNamespacePrefix(java.lang.String nsURI)
          Gets the prefix of a namespace URI.
 org.apache.xerces.xs.StringList getNamespaceURIs()
          Gets all namespace URIs of this schema.
 SchemaNode getRootElement()
          Returns the root element of this XML schema.
 java.lang.String getRootName()
          Returns the logical XML Schema root name.
 Type getRootType()
          Returns the analysed JAXFront type of the root element.
 java.util.Map getSchemaRootNodeAttributes()
          Returns all attributes defined on schema node.
 java.lang.String getTargetNamespace()
          Returns the target namespace of this schema.
 Type getType(SchemaNode element)
          Get the analysed JAXFront Type from a Schema Element.
 Type getType(SchemaNode element, TreeWalkingElementAnalyser analyser)
           
 java.net.URL getURL()
          Returns the url location of this schema.
 void initializeXSDKeySystem(Document dom)
           
 boolean isDefaultNamespace(java.lang.String ns)
          Returns true if this schema is the xui.xsd.
 boolean isGlobalEntity(java.lang.String name)
          Returns true if a global entity with the given name is registered.
 boolean isXUISchema()
           
 void registerEditingType(Type edType)
           
 void registerKey(java.lang.String keyName, SchemaKey element)
          Register a key.
 void registerKeyRef(java.lang.String keyName, SchemaKeyRef element)
          Register a key reference.
 void release()
          Release all allocated global entities and derived types and any other resources added to this schema.
 void releaseGlobalXUIDefinitions()
          Get rid of the global xui definitions in the global schema type entities.
 void setBase(java.net.URL base)
          Set the base url of the XML schema.
 void setRootName(java.lang.String rootName)
          Sets the root name for this schema.
 java.lang.String toString()
           
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

_isXUISchema

public boolean _isXUISchema
Constructor Detail

XMLSchemaImpl

public XMLSchemaImpl(org.apache.xerces.xs.XSModel schema,
                     java.net.URL schemaURL,
                     java.lang.String rootName,
                     java.util.Hashtable namespaceMapping,
                     java.util.Hashtable schemaRootNodeAttributes)
Creates an XML Schema based on a oracle XMLSchema, a schemaURL and a root name.

Parameters:
schema - an oracle XML Schema (from oracle schema parser)
schemaURL - scheme url location
rootName - name of the root node

XMLSchemaImpl

public XMLSchemaImpl(org.apache.xerces.xs.XSModel schema,
                     org.w3c.dom.ls.LSInput schemaInput,
                     java.lang.String rootName,
                     java.util.Hashtable namespaceMapping,
                     java.util.Hashtable schemaRootNodeAttributes)
Creates an XML Schema based on a oracle XMLSchema, a schemaURL and a root name.

Parameters:
schema - an oracle XML Schema (from oracle schema parser)
schemaURL - scheme url location
rootName - name of the root node
Method Detail

getSchemaRootNodeAttributes

public java.util.Map getSchemaRootNodeAttributes()
Description copied from interface: XMLSchema
Returns all attributes defined on schema node.

Specified by:
getSchemaRootNodeAttributes in interface XMLSchema

buildType

public Type buildType(SchemaNode element)
Description copied from interface: XMLSchema
Returns the analysed JAXFront type according to my schema element children.

Specified by:
buildType in interface XMLSchema
See Also:
XMLSchema.buildType(com.jaxfront.core.schema.SchemaNode)

buildType

public Type buildType(SchemaNode element,
                      TreeWalkingElementAnalyser analyser)
See Also:
XMLSchema.buildType(com.jaxfront.core.schema.SchemaNode)

getNamespacePrefix

public java.lang.String getNamespacePrefix(java.lang.String nsURI)
Description copied from interface: XMLSchema
Gets the prefix of a namespace URI.

Specified by:
getNamespacePrefix in interface XMLSchema
Parameters:
nsURI - a namespace URI
Returns:
the associated prefix
See Also:
XMLSchema.getNamespacePrefix(java.lang.String)

createDocument

public Document createDocument()
Returns a new JAXFront Document.

Specified by:
createDocument in interface XMLSchema

createDocument

public Document createDocument(java.util.Hashtable params)
Returns a new JAXFront Document.

Specified by:
createDocument in interface XMLSchema

createTypeCopy

public Type createTypeCopy(SchemaNode element)
Creates a copy of the analysed JAXFront type for the passing element.

Specified by:
createTypeCopy in interface XMLSchema
Parameters:
element - SchemaNode to create a type copy from

getCodeTables

public CodeTables getCodeTables()
Returns the codeTables.

Specified by:
getCodeTables in interface XMLSchema

getCodeTables

public CodeTables getCodeTables(XMLSchema schema,
                                java.lang.String url,
                                java.net.URL xuiURL)
Returns all loaded code tables for a specific url (e.q. po.codes).

Specified by:
getCodeTables in interface XMLSchema
Parameters:
url - location of the code table file (e.q. c:\temp\po.codes)

getDerivedTypes

public java.util.Set getDerivedTypes(java.lang.String abstractName,
                                     java.lang.String name)
Returns all derived types whith a specific name of a submitted abstract type.

Specified by:
getDerivedTypes in interface XMLSchema
Parameters:
schemaType - abstract schema base type
name - derived type name to look for

getDerivedTypeNames

public java.lang.String[] getDerivedTypeNames(java.lang.String abstractName)
Returns all derived type names whith a specific name of a submitted abstract type.

Specified by:
getDerivedTypeNames in interface XMLSchema
Parameters:
abstractName - abstract schema base type

getDerivedTypes

public java.util.Set getDerivedTypes(java.lang.String abstractName,
                                     java.lang.String name,
                                     java.util.Set derivedTypes)

getGlobalEntities

public java.util.Map getGlobalEntities()
Returns all global entities of this schema.

Specified by:
getGlobalEntities in interface XMLSchema

getGlobalEntity

public SchemaNode getGlobalEntity(java.lang.String name)
Returns a global entity with a specific name.

Specified by:
getGlobalEntity in interface XMLSchema
Parameters:
name - global entity name to look for

getKey

public SchemaKey getKey(java.lang.String keyName)
Returns a schema key.

Specified by:
getKey in interface XMLSchema

getKeyRef

public SchemaKeyRef getKeyRef(java.lang.String keyName)
Returns a schema key.

Specified by:
getKeyRef in interface XMLSchema

getRootElement

public SchemaNode getRootElement()
Returns the root element of this XML schema.

Specified by:
getRootElement in interface XMLSchema

getRootName

public java.lang.String getRootName()
Returns the logical XML Schema root name.

Specified by:
getRootName in interface XMLSchema

getRootType

public Type getRootType()
Returns the analysed JAXFront type of the root element.

Specified by:
getRootType in interface XMLSchema

getTargetNamespace

public java.lang.String getTargetNamespace()
Returns the target namespace of this schema.

Specified by:
getTargetNamespace in interface XMLSchema

isDefaultNamespace

public boolean isDefaultNamespace(java.lang.String ns)
Description copied from interface: XMLSchema
Returns true if this schema is the xui.xsd.

Specified by:
isDefaultNamespace in interface XMLSchema

getDefaultNamespace

public java.lang.String getDefaultNamespace()
Returns the default namespace of this schema.

Specified by:
getDefaultNamespace in interface XMLSchema

getURL

public java.net.URL getURL()
Returns the url location of this schema.

Specified by:
getURL in interface XMLSchema

getLocationPath

public java.lang.String getLocationPath()
Description copied from interface: XMLSchema
Returns the absolute filepath that points to the schema.

Specified by:
getLocationPath in interface XMLSchema
Returns:
the absolute filepath that points to the schema
See Also:
XMLSchema.getLocationPath()

initializeXSDKeySystem

public void initializeXSDKeySystem(Document dom)

getGroupName

public java.lang.String getGroupName(org.apache.xerces.xs.XSObject modelGroup)

getGroupQName

public java.lang.String getGroupQName(org.apache.xerces.xs.XSObject modelGroup)

isXUISchema

public boolean isXUISchema()
Specified by:
isXUISchema in interface XMLSchema
See Also:
XMLSchema.isXUISchema()

registerKey

public void registerKey(java.lang.String keyName,
                        SchemaKey element)
Description copied from interface: XMLSchema
Register a key.

Specified by:
registerKey in interface XMLSchema
Parameters:
keyName - name of the key
element - holding schema element
See Also:
XMLSchema.registerKey(java.lang.String, com.jaxfront.core.schema.SchemaKey)

registerKeyRef

public void registerKeyRef(java.lang.String keyName,
                           SchemaKeyRef element)
Description copied from interface: XMLSchema
Register a key reference.

Specified by:
registerKeyRef in interface XMLSchema
Parameters:
keyName - name of the key reference
element - holding schema element
See Also:
XMLSchema.registerKeyRef(java.lang.String, com.jaxfront.core.schema.SchemaKeyRef)

release

public void release()
Release all allocated global entities and derived types and any other resources added to this schema.

Specified by:
release in interface XMLSchema

setRootName

public void setRootName(java.lang.String rootName)
Sets the root name for this schema.

Specified by:
setRootName in interface XMLSchema

toString

public java.lang.String toString()
Overrides:
toString in class java.lang.Object

releaseGlobalXUIDefinitions

public void releaseGlobalXUIDefinitions()
Description copied from interface: XMLSchema
Get rid of the global xui definitions in the global schema type entities.

Specified by:
releaseGlobalXUIDefinitions in interface XMLSchema
See Also:
XMLSchema.releaseGlobalXUIDefinitions()

getType

public Type getType(SchemaNode element)
Description copied from interface: XMLSchema
Get the analysed JAXFront Type from a Schema Element.

Specified by:
getType in interface XMLSchema
Parameters:
element - Schema Element to get the analysed JAXFront Type from
See Also:
XMLSchema.getType(com.jaxfront.core.schema.SchemaNode)

getType

public Type getType(SchemaNode element,
                    TreeWalkingElementAnalyser analyser)
Specified by:
getType in interface XMLSchema
See Also:
XMLSchema.getType(com.jaxfront.core.schema.SchemaNode)

registerEditingType

public void registerEditingType(Type edType)

getEditingType

public Type getEditingType(Type edType)

getGlobalElements

public java.util.Map getGlobalElements()
Description copied from interface: XMLSchema
Returns all global elements of this schema.

Specified by:
getGlobalElements in interface XMLSchema
See Also:
XMLSchema.getGlobalElements()

getNamespaceURIs

public org.apache.xerces.xs.StringList getNamespaceURIs()
Description copied from interface: XMLSchema
Gets all namespace URIs of this schema.

Specified by:
getNamespaceURIs in interface XMLSchema
Returns:
all namespace URIs
See Also:
XMLSchema.getNamespaceURIs()

getNamespaceDeclarations

public java.util.Vector getNamespaceDeclarations(java.lang.String schemaLocation)
Description copied from interface: XMLSchema
Gets all namespace declarations of this schema.

Specified by:
getNamespaceDeclarations in interface XMLSchema
Returns:
all namespace declarations (e.g. xmlns:xsi="http://www.w3org/2001/XMLSchema-instance")
See Also:
com.jaxfront.core.schema.XMLSchema#getAllXmlNS()

getNamespaceDeclarations

public java.util.Vector getNamespaceDeclarations(java.lang.String schemaLocation,
                                                 boolean isXuiDom)
Description copied from interface: XMLSchema
Gets all namespace declarations of this schema.

Specified by:
getNamespaceDeclarations in interface XMLSchema
Returns:
all namespace declarations (e.g. xmlns:xsi="http://www.w3org/2001/XMLSchema-instance")

getNamespaceMapping

public java.util.Hashtable getNamespaceMapping()
Specified by:
getNamespaceMapping in interface XMLSchema

setBase

public void setBase(java.net.URL base)
Description copied from interface: XMLSchema
Set the base url of the XML schema.

Specified by:
setBase in interface XMLSchema

isGlobalEntity

public boolean isGlobalEntity(java.lang.String name)
Description copied from interface: XMLSchema
Returns true if a global entity with the given name is registered.

Specified by:
isGlobalEntity in interface XMLSchema
Parameters:
name - global entity name to look for

getGlobalEntity

public SchemaNode getGlobalEntity(SchemaNode node)
Specified by:
getGlobalEntity in interface XMLSchema