Class AppSchemaXSDRegistry

  • All Implemented Interfaces:
    XSDSchemaLocator

    public final class AppSchemaXSDRegistry
    extends Object
    implements XSDSchemaLocator
    A singleton registry to store all XSD schema's that are created by app-schema. This registry has two purposes: (1) Reusing schema's that have already been built previously, so that schema content in memory isn't cluttered with multiple versions of the same schema (with respect to .
    Author:
    Niels Charlier (Curtin University of Technology)
    • Method Summary

      All Methods Static Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      void dispose()
      Flush all schema's (remove all references to them from other schema's) and clear register
      static AppSchemaXSDRegistry getInstance()
      Get lazy loaded singleton instance
      XSDSchema locateSchema​(XSDSchema xsdSchema, String namespaceURI, String rawSchemaLocationURI, String resolvedSchemaLocationURI)
      Implements schema locator... creates and registers new schema if necessary
      XSDSchema lookUp​(String schemaLocation)
      Look up schema in register
      void register​(XSDSchema schema)
      Register schema
      • Methods inherited from class Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Method Detail

      • getInstance

        public static AppSchemaXSDRegistry getInstance()
        Get lazy loaded singleton instance
        Returns:
        singleton instance
      • register

        public void register​(XSDSchema schema)
        Register schema
        Parameters:
        schema - schema to be registered
      • lookUp

        public XSDSchema lookUp​(String schemaLocation)
        Look up schema in register
        Parameters:
        schemaLocation - (resolved) schema location
        Returns:
        schema
      • dispose

        public void dispose()
        Flush all schema's (remove all references to them from other schema's) and clear register
      • locateSchema

        public XSDSchema locateSchema​(XSDSchema xsdSchema,
                                      String namespaceURI,
                                      String rawSchemaLocationURI,
                                      String resolvedSchemaLocationURI)
        Implements schema locator... creates and registers new schema if necessary
        Specified by:
        locateSchema in interface XSDSchemaLocator