Interface Stax2ValidationSchemaFactoryProvider


  • public interface Stax2ValidationSchemaFactoryProvider
    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(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 Detail

      • OSGI_SVC_PROP_IMPL_NAME

        static final java.lang.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 java.lang.String OSGI_SVC_PROP_IMPL_VERSION
        Service property that defines version of Stax2 implementation that this provider represents.
        See Also:
        Constant Field Values
    • Method Detail

      • getSchemaType

        java.lang.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 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:
        ValidationSchema factory configured to implementation-specific default settings, if type is supported by this provider; null if not.