Package org.geotools.xsd
Class SchemaLocator
- Object
-
- SchemaLocator
-
- All Implemented Interfaces:
XSDSchemaLocator
public class SchemaLocator extends Object implements XSDSchemaLocator
Helper class which ensures that the xsd schema parser uses pre-build schema objects.This class works from a
XSDwhich contains a reference to the schema.Example usage:
XSD xsd = ...; String namespaceURI = xsd.getNamesapceURI(); SchemaLocator locator = new SchemaLocator( xsd ); XSDSchema schema = locator.locateSchema( null, namespaceURI, null, null);- Author:
- Justin Deoliveira, The Open Planning Project
-
-
Constructor Summary
Constructors Constructor Description SchemaLocator(XSD xsd)Creates a new instance of the schema locator.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description booleancanHandle(XSDSchema schema, String namespaceURI, String rawSchemaLocationURI, String resolvedSchemaLocationURI)Determines if the locator can locate a schema for the specified namespace and location.XSDSchemalocateSchema(XSDSchema schema, String namespaceURI, String rawSchemaLocationURI, String resolvedSchemaLocationURI)Creates the schema, returningnullif the schema could not be created.StringtoString()
-
-
-
Constructor Detail
-
SchemaLocator
public SchemaLocator(XSD xsd)
Creates a new instance of the schema locator.- Parameters:
xsd- The XSD instance that references the schema to be "located".
-
-
Method Detail
-
canHandle
public boolean canHandle(XSDSchema schema, String namespaceURI, String rawSchemaLocationURI, String resolvedSchemaLocationURI)Determines if the locator can locate a schema for the specified namespace and location.- Returns:
- true if it can handle, otherwise false.
-
locateSchema
public XSDSchema locateSchema(XSDSchema schema, String namespaceURI, String rawSchemaLocationURI, String resolvedSchemaLocationURI)Creates the schema, returningnullif the schema could not be created.namespaceURIshould not benull. All other parameters are ignored.- Specified by:
locateSchemain interfaceXSDSchemaLocator- See Also:
XSDSchemaLocator.locateSchema(org.eclipse.xsd.XSDSchema, java.lang.String, java.lang.String, java.lang.String)
-
-