Top Description Fields Constructors Methods
org.codehaus.stax2.validation

public abstract Class XMLValidationSchemaFactory

extends Object
Class Inheritance
Imports
java.io.*, java.net.URL, java.util.*, javax.xml.stream.FactoryConfigurationError, .XMLStreamException

Defines an abstract factory for constructing XMLValidationSchema instances. This abstract base class has methods for instantiating the actual implementation (similar to the way javax.xml.stream.XMLInputFactory works, and defines the API to use for configuring these instances, as well as factory methods concrete classes implement for actually creating XMLValidationSchema instances.

Note

this class is part of the second major revision of StAX 2 API (StAX2, v2), and is optional for StAX2 implementations to support.

See Also
javax.xml.stream.XMLInputFactory, org.codehaus.stax2.validation.XMLValidationSchema, org.codehaus.stax2.XMLInputFactory2

Field Summary

Modifier and TypeField and Description
public static final String
public static final String
public static final String
public static final String
pack-priv static final String
JAXP_PROP_FILENAME

Name of resource file that contains JAXP properties.

protected final String
mSchemaType

Schema type this factory instance supports.

public static final String
P_ENABLE_CACHING

Property that determines whether schema instances created by this factory instance can be cached by the factory; if false, no caching is allowed to be doe; if true, factory can do caching if it wants to.

public static final String
P_IS_NAMESPACE_AWARE

Property that determines whether schemas constructed are namespace-aware, in cases where schema supports both namespace-aware and non-namespace aware modes.

public static final String
SERVICE_DEFINITION_PATH

Path to resource that should contain implementation class definition.

pack-priv static final HashMap<String, String>
public static final String
SYSTEM_PROPERTY_FOR_IMPL

Defines the system property that can be set to explicitly specify which implementation to use (in case there are multiple StAX2 implementations; or the one used does not specify other mechanisms for the loader to find the implementation class).

Constructor Summary

AccessConstructor and Description
protected
XMLValidationSchemaFactory(String
Schema type this factory supports; one of SCHEMA_ID_xxx constants.
st
)

Method Summary

Modifier and TypeMethod and Description
private static XMLValidationSchemaFactory
public XMLValidationSchema
public XMLValidationSchema
public abstract XMLValidationSchema
createSchema(InputStream in, String encoding, String publicId, String systemId)

public XMLValidationSchema
public abstract XMLValidationSchema
createSchema(Reader r, String publicId, String systemId)

public abstract XMLValidationSchema
public abstract XMLValidationSchema
public abstract Object
getProperty(String propName)

public final String

Returns:

Name of schema type (one of SCHEMA_ID_xxx constants) that this factory supports.
getSchemaType
()

public abstract boolean
public static XMLValidationSchemaFactory
newInstance(String schemaType)

Creates a new XMLValidationFactory instance, using the default instance configuration mechanism.

public static XMLValidationSchemaFactory
newInstance(String schemaType, ClassLoader classLoader)

public abstract boolean

Returns:

True if setting succeeded; false if property was recognized but could not be changed to specified value, or if it was not recognized but the implementation did not throw an exception.
setProperty
(String
Name of property to set
propName
,
Object
Value to set property to
value
)

Inherited from java.lang.Object:
cloneequalsfinalizegetClasshashCodenotifynotifyAlltoStringwaitwaitwait

Field Detail

INTERNAL_ID_SCHEMA_DTDback to summary
public static final String INTERNAL_ID_SCHEMA_DTD
INTERNAL_ID_SCHEMA_RELAXNGback to summary
public static final String INTERNAL_ID_SCHEMA_RELAXNG
INTERNAL_ID_SCHEMA_TREXback to summary
public static final String INTERNAL_ID_SCHEMA_TREX
INTERNAL_ID_SCHEMA_W3Cback to summary
public static final String INTERNAL_ID_SCHEMA_W3C
JAXP_PROP_FILENAMEback to summary
pack-priv static final String JAXP_PROP_FILENAME

Name of resource file that contains JAXP properties.

mSchemaTypeback to summary
protected final String mSchemaType

Schema type this factory instance supports.

P_ENABLE_CACHINGback to summary
public static final String P_ENABLE_CACHING

Property that determines whether schema instances created by this factory instance can be cached by the factory; if false, no caching is allowed to be doe; if true, factory can do caching if it wants to. The exact rules used to determine unique id of schema instances is factory dependant; it is expected that the implementations use implementation based on unified system ids (serialized URLs or such).

P_IS_NAMESPACE_AWAREback to summary
public static final String P_IS_NAMESPACE_AWARE

Property that determines whether schemas constructed are namespace-aware, in cases where schema supports both namespace-aware and non-namespace aware modes. In general this only applies to DTDs, since namespace support for DTDs is both optional, and not well specified.

Default value is TRUE. For schema types for which only one value (usually TRUE) is allowed, this property will be ignored.

SERVICE_DEFINITION_PATHback to summary
public static final String SERVICE_DEFINITION_PATH

Path to resource that should contain implementation class definition.

sSchemaIdsback to summary
pack-priv static final HashMap<String, String> sSchemaIds
SYSTEM_PROPERTY_FOR_IMPLback to summary
public static final String SYSTEM_PROPERTY_FOR_IMPL

Defines the system property that can be set to explicitly specify which implementation to use (in case there are multiple StAX2 implementations; or the one used does not specify other mechanisms for the loader to find the implementation class).

Constructor Detail

XMLValidationSchemaFactoryback to summary
protected XMLValidationSchemaFactory(String st)
Parameters
st:String

Schema type this factory supports; one of SCHEMA_ID_xxx constants.

Method Detail

createNewInstanceback to summary
private static XMLValidationSchemaFactory createNewInstance(ClassLoader cloader, String clsName) throws FactoryConfigurationError
createSchemaback to summary
public XMLValidationSchema createSchema(InputStream in) throws XMLStreamException
createSchemaback to summary
public XMLValidationSchema createSchema(InputStream in, String encoding) throws XMLStreamException
createSchemaback to summary
public abstract XMLValidationSchema createSchema(InputStream in, String encoding, String publicId, String systemId) throws XMLStreamException
createSchemaback to summary
public XMLValidationSchema createSchema(Reader r) throws XMLStreamException
createSchemaback to summary
public abstract XMLValidationSchema createSchema(Reader r, String publicId, String systemId) throws XMLStreamException
createSchemaback to summary
public abstract XMLValidationSchema createSchema(URL url) throws XMLStreamException
createSchemaback to summary
public abstract XMLValidationSchema createSchema(File f) throws XMLStreamException
getPropertyback to summary
public abstract Object getProperty(String propName)
getSchemaTypeback to summary
public final String getSchemaType()
Returns:String

Name of schema type (one of SCHEMA_ID_xxx constants) that this factory supports.

isPropertySupportedback to summary
public abstract boolean isPropertySupported(String propName)
newInstanceback to summary
public static XMLValidationSchemaFactory newInstance(String schemaType) throws FactoryConfigurationError

Creates a new XMLValidationFactory instance, using the default instance configuration mechanism.

newInstanceback to summary
public static XMLValidationSchemaFactory newInstance(String schemaType, ClassLoader classLoader) throws FactoryConfigurationError
setPropertyback to summary
public abstract boolean setProperty(String propName, Object value)
Parameters
propName:String

Name of property to set

value:Object

Value to set property to

Returns:boolean

True if setting succeeded; false if property was recognized but could not be changed to specified value, or if it was not recognized but the implementation did not throw an exception.