Package org.codehaus.stax2.osgi
Interface Stax2ValidationSchemaFactoryProvider
-
public interface Stax2ValidationSchemaFactoryProvider
Simple interface to be used for registering objects that can constructXMLValidationSchemaFactory
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(java.lang.String)
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
Fields Modifier and Type Field Description static String
OSGI_SVC_PROP_IMPL_NAME
Service property that defines name of Stax2 implementation that this provider represents.static String
OSGI_SVC_PROP_IMPL_VERSION
Service property that defines version of Stax2 implementation that this provider represents.static String
OSGI_SVC_PROP_SCHEMA_TYPE
Service property that defines type of Schemas (one of constants fromXMLValidationSchema
, such asXMLValidationSchema.SCHEMA_ID_DTD
) that the schema factory this provider handles supports.
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description XMLValidationSchemaFactory
createValidationSchemaFactory()
Method called to create a newXMLValidationSchemaFactory
instance.String
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_NAME
static final String OSGI_SVC_PROP_IMPL_NAME
Service property that defines name of Stax2 implementation that this provider represents.- See Also:
- Constant Field Values
-
OSGI_SVC_PROP_IMPL_VERSION
static final String OSGI_SVC_PROP_IMPL_VERSION
Service property that defines version of Stax2 implementation that this provider represents.- See Also:
- Constant Field Values
-
OSGI_SVC_PROP_SCHEMA_TYPE
static final String OSGI_SVC_PROP_SCHEMA_TYPE
Service property that defines type of Schemas (one of constants fromXMLValidationSchema
, such asXMLValidationSchema.SCHEMA_ID_DTD
) that the schema factory this provider handles supports. Can be used to locate proper provider for the schema type.- See Also:
- Constant Field Values
-
-
Method Detail
-
getSchemaType
String getSchemaType()
Method that can be used to determine which schema type this provider (or, rather, factory instances of which provider constructs) supports.- Returns:
- Id of schema type that the factory instantiated by this provider will support.
-
createValidationSchemaFactory
XMLValidationSchemaFactory createValidationSchemaFactory()
Method called to create a newXMLValidationSchemaFactory
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 (seegetSchemaType()
).- Returns:
- ValidationSchema factory configured to implementation-specific default settings, if type is supported by this provider; null if not.
-
-