Top Description Fields Methods
org.codehaus.stax2.osgi

public Interface Stax2ValidationSchemaFactoryProvider

Imports
org.codehaus.stax2.XMLStreamProperties, org.codehaus.stax2.validation.XMLValidationSchemaFactory

Simple interface to be used for registering objects that can construct XMLValidationSchemaFactory instances with OSGi framework. The added indirection (provider constructing factory) is needed because of impedance between OSGi service objects (which are essentially singletons) and Stax/Stax2 factories which are not.

Note

implementations of provider should NOT use introspection via XMLValidationSchemaFactory#newInstance as it will not work with OSGi. Instead, providers should directly construct instances of concrete factory they represent. That is, there will be one provider implementation per concrete Stax/Stax2 implementation

Field Summary

Modifier and TypeField and Description
public static final String
OSGI_SVC_PROP_IMPL_NAME

Service property that defines name of Stax2 implementation that this provider represents.

public static final String
OSGI_SVC_PROP_IMPL_VERSION

Service property that defines version of Stax2 implementation that this provider represents.

public static final String
OSGI_SVC_PROP_SCHEMA_TYPE

Service property that defines type of Schemas (one of constants from org.codehaus.stax2.validation.XMLValidationSchema, such as org.codehaus.stax2.validation.XMLValidationSchema#SCHEMA_ID_DTD) that the schema factory this provider handles supports.

Method Summary

Modifier and TypeMethod and Description
public XMLValidationSchemaFactory

Returns:

ValidationSchema factory configured to implementation-specific default settings, if type is supported by this provider; null if not.
createValidationSchemaFactory
()

Method called to create a new XMLValidationSchemaFactory instance.

public String

Returns:

Id of schema type that the factory instantiated by this provider will support.
getSchemaType
()

Method that can be used to determine which schema type this provider (or, rather, factory instances of which provider constructs) supports.

Field Detail

OSGI_SVC_PROP_IMPL_NAMEback to summary
public static final String OSGI_SVC_PROP_IMPL_NAME

Service property that defines name of Stax2 implementation that this provider represents.

OSGI_SVC_PROP_IMPL_VERSIONback to summary
public static final String OSGI_SVC_PROP_IMPL_VERSION

Service property that defines version of Stax2 implementation that this provider represents.

OSGI_SVC_PROP_SCHEMA_TYPEback to summary
public static final String OSGI_SVC_PROP_SCHEMA_TYPE

Service property that defines type of Schemas (one of constants from org.codehaus.stax2.validation.XMLValidationSchema, such as org.codehaus.stax2.validation.XMLValidationSchema#SCHEMA_ID_DTD) that the schema factory this provider handles supports. Can be used to locate proper provider for the schema type.

Method Detail

createValidationSchemaFactoryback to summary
public XMLValidationSchemaFactory createValidationSchemaFactory()

Method called to create a new XMLValidationSchemaFactory instance. Each schema factory supports a single schema type; so caller has to ensure that the factory it is using supports schema it needs to instantiate. This can be done either by using service properties, or by inspecting provider instances for schema type they support (see getSchemaType).

Returns:XMLValidationSchemaFactory

ValidationSchema factory configured to implementation-specific default settings, if type is supported by this provider; null if not.

getSchemaTypeback to summary
public String getSchemaType()

Method that can be used to determine which schema type this provider (or, rather, factory instances of which provider constructs) supports.

Returns:String

Id of schema type that the factory instantiated by this provider will support.