org.apache.ws.commons.schema
Class XmlSchemaCollection

java.lang.Object
  extended by org.apache.ws.commons.schema.XmlSchemaCollection

public final class XmlSchemaCollection
extends java.lang.Object

Contains a cache of XML Schema definition language (XSD).


Field Summary
(package private)  java.lang.String baseUri
          base URI is used as the base for loading the imports
(package private)  java.util.Map inScopeNamespaces
          In-scope namespaces for XML processing
(package private)  java.util.Map namespaces
          Namespaces we know about.
(package private)  URIResolver schemaResolver
          An org.xml.sax.EntityResolver that is used to resolve the imports/includes
(package private)  java.util.Set schemas
          A Set of all the scehmas in this collection.
(package private)  java.util.Map systemId2Schemas
          Schemas in this colelction sorted by system id.
(package private)  java.util.Map unresolvedTypes
           
(package private)  XmlSchema xsd
           
 
Constructor Summary
XmlSchemaCollection()
          Creates new XmlSchemaCollection
 
Method Summary
(package private)  void addUnresolvedType(javax.xml.namespace.QName type, TypeReceiver receiver)
           
 XmlSchemaElement getElementByQName(javax.xml.namespace.QName qname)
           
 java.lang.String getNamespaceForPrefix(java.lang.String prefix)
           
 XmlSchemaType getTypeByQName(javax.xml.namespace.QName schemaTypeName)
           
 XmlSchema getXmlSchema(java.lang.String systemId)
          Retreive an XmlSchema from the collection by its system ID.
 java.util.Set getXmlSchemas()
          Return a Set of all the XmlSchemas in this collection.
 void init()
          This section should comply to the XMLSchema specification
 void mapNamespace(java.lang.String prefix, java.lang.String namespaceURI)
           
 XmlSchema read(org.w3c.dom.Document doc, java.lang.String uri, ValidationEventHandler veh)
           
 XmlSchema read(org.w3c.dom.Document doc, ValidationEventHandler veh)
           
 XmlSchema read(org.w3c.dom.Element elem)
           
 XmlSchema read(org.w3c.dom.Element elem, java.lang.String uri)
           
 XmlSchema read(org.xml.sax.InputSource inputSource, ValidationEventHandler veh)
           
 XmlSchema read(java.io.Reader r, ValidationEventHandler veh)
           
 XmlSchema read(javax.xml.transform.Source source, ValidationEventHandler veh)
           
(package private)  void resolveType(javax.xml.namespace.QName typeName, XmlSchemaType type)
           
 void setBaseUri(java.lang.String baseUri)
          Set the base URI.
 void setSchemaResolver(URIResolver schemaResolver)
          Register a custom URI resolver
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

namespaces

java.util.Map namespaces
Namespaces we know about. Each one has an equivalent XmlSchema.


baseUri

java.lang.String baseUri
base URI is used as the base for loading the imports


inScopeNamespaces

java.util.Map inScopeNamespaces
In-scope namespaces for XML processing


systemId2Schemas

java.util.Map systemId2Schemas
Schemas in this colelction sorted by system id.


schemaResolver

URIResolver schemaResolver
An org.xml.sax.EntityResolver that is used to resolve the imports/includes


xsd

XmlSchema xsd

schemas

java.util.Set schemas
A Set of all the scehmas in this collection.


unresolvedTypes

java.util.Map unresolvedTypes
Constructor Detail

XmlSchemaCollection

public XmlSchemaCollection()
Creates new XmlSchemaCollection

Method Detail

setBaseUri

public void setBaseUri(java.lang.String baseUri)
Set the base URI. This is used when schemas need to be loaded from relative locations

Parameters:
baseUri -

setSchemaResolver

public void setSchemaResolver(URIResolver schemaResolver)
Register a custom URI resolver

Parameters:
schemaResolver -

init

public void init()
This section should comply to the XMLSchema specification

See Also:
This needs to be inspected by another pair of eyes

read

public XmlSchema read(java.io.Reader r,
                      ValidationEventHandler veh)

read

public XmlSchema read(org.xml.sax.InputSource inputSource,
                      ValidationEventHandler veh)

read

public XmlSchema read(javax.xml.transform.Source source,
                      ValidationEventHandler veh)

read

public XmlSchema read(org.w3c.dom.Document doc,
                      ValidationEventHandler veh)

read

public XmlSchema read(org.w3c.dom.Element elem)

read

public XmlSchema read(org.w3c.dom.Document doc,
                      java.lang.String uri,
                      ValidationEventHandler veh)

read

public XmlSchema read(org.w3c.dom.Element elem,
                      java.lang.String uri)

getXmlSchema

public XmlSchema getXmlSchema(java.lang.String systemId)
Retreive an XmlSchema from the collection by its system ID.

Parameters:
systemId -
Returns:

getXmlSchemas

public java.util.Set getXmlSchemas()
Return a Set of all the XmlSchemas in this collection.

Returns:

getElementByQName

public XmlSchemaElement getElementByQName(javax.xml.namespace.QName qname)

getTypeByQName

public XmlSchemaType getTypeByQName(javax.xml.namespace.QName schemaTypeName)

addUnresolvedType

void addUnresolvedType(javax.xml.namespace.QName type,
                       TypeReceiver receiver)

resolveType

void resolveType(javax.xml.namespace.QName typeName,
                 XmlSchemaType type)

getNamespaceForPrefix

public java.lang.String getNamespaceForPrefix(java.lang.String prefix)

mapNamespace

public void mapNamespace(java.lang.String prefix,
                         java.lang.String namespaceURI)


Copyright 2004-2004-2006 Apache Software Foundation. All Rights Reserved.