org.geotools.xml
Class SchemaFactory

java.lang.Object
  extended byorg.geotools.xml.SchemaFactory
Direct Known Subclasses:
WFSSchemaFactory

public class SchemaFactory
extends java.lang.Object

SchemaFactory purpose.

This is the main entry point into the XSI parsing routines.

Example Use:


 
  
    
     Schema x = SchemaFactory.getInstance("MyTargetNameSpace",new URI("MyNameSpaceURI");
     
   
  
 

Version:
$Id: SchemaFactory.java 17701 2006-01-23 00:00:51Z desruisseaux $
Author:
dzwiers, Refractions Research, Inc. http://www.refractions.net, $Author:$ (last modification)

Field Summary
protected static SchemaFactory is
           
 
Constructor Summary
SchemaFactory()
           
 
Method Summary
protected static SchemaFactory getInstance()
           
static Schema getInstance(java.net.URI targetNamespace)
          Returns an instance of the targetNamespace if it can be found ... null otherwise. targetNamespaces which can be found are either hard-coded namespaces (SchemaFactory.properties), have already been parsed or were registered.
static Schema getInstance(java.net.URI targetNamespace, java.io.InputStream is1)
           
static Schema getInstance(java.net.URI targetNamespace, java.io.InputStream is1, java.util.logging.Level level)
           
static Schema getInstance(java.net.URI targetNamespace, java.net.URI desiredSchema)
          Returns an instance of the desired class.
static Schema getInstance(java.net.URI targetNamespace, java.net.URI desiredSchema, java.util.logging.Level level)
          Returns an instance of the desired class.
protected  XSISAXHandler getSAXHandler(java.net.URI uri)
           
static Schema[] getSchemas(java.lang.String prefix)
           
static void registerSchema(java.net.URI targetNamespace, Schema schema)
          Registers a Schema instance with the factory.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

is

protected static SchemaFactory is
Constructor Detail

SchemaFactory

public SchemaFactory()
Method Detail

getInstance

protected static SchemaFactory getInstance()

getInstance

public static Schema getInstance(java.net.URI targetNamespace,
                                 java.net.URI desiredSchema)
                          throws org.xml.sax.SAXException
Returns an instance of the desired class. There is no provision for: a) same instances each call b) different instances each call c) this factory being thread safe

Parameters:
targetNamespace -
desiredSchema - URI the uri of which you want a schema instance.
Returns:
Schema an instance of the desired schema.
Throws:
org.xml.sax.SAXException

getInstance

public static Schema getInstance(java.net.URI targetNamespace,
                                 java.io.InputStream is1)
                          throws org.xml.sax.SAXException
Throws:
org.xml.sax.SAXException

getInstance

public static Schema getInstance(java.net.URI targetNamespace)
Returns an instance of the targetNamespace if it can be found ... null otherwise. targetNamespaces which can be found are either hard-coded namespaces (SchemaFactory.properties), have already been parsed or were registered.

Parameters:
targetNamespace -
Returns:
See Also:
registerSchema(Strin,Schema)

getSchemas

public static Schema[] getSchemas(java.lang.String prefix)

getInstance

public static Schema getInstance(java.net.URI targetNamespace,
                                 java.net.URI desiredSchema,
                                 java.util.logging.Level level)
                          throws org.xml.sax.SAXException
Returns an instance of the desired class. There is no provision for: a) same instances each call b) different instances each call c) this factory being thread safe

Parameters:
targetNamespace - The targetNamespace to search for.
desiredSchema - URI the uri of which you want a schema instance.
level - Level
Returns:
Schema an instance of the desired schema.
Throws:
org.xml.sax.SAXException - When something goes wrong

getSAXHandler

protected XSISAXHandler getSAXHandler(java.net.URI uri)

getInstance

public static Schema getInstance(java.net.URI targetNamespace,
                                 java.io.InputStream is1,
                                 java.util.logging.Level level)
                          throws org.xml.sax.SAXException
Throws:
org.xml.sax.SAXException

registerSchema

public static void registerSchema(java.net.URI targetNamespace,
                                  Schema schema)
Registers a Schema instance with the factory. A clone is NOT created within this method. The Schema passed in is associated with the specified targetNamespace. The Schema is not tested to ensure the intended targetNamespace (schema.getTargetNamespace()) is equal to targetNamespace. The ramifications is that you may hack wildly within the repository, but we aware you may have some 'undocumented features' as a result (odd Schemas being returned).

Parameters:
targetNamespace -
schema -


Copyright © GeoTools. All Rights Reserved.