com.evolveum.midpoint.schema
Class SchemaRegistry

java.lang.Object
  extended by com.evolveum.midpoint.schema.SchemaRegistry
All Implemented Interfaces:
Dumpable, org.w3c.dom.ls.LSResourceResolver, org.xml.sax.EntityResolver

public class SchemaRegistry
extends java.lang.Object
implements org.w3c.dom.ls.LSResourceResolver, org.xml.sax.EntityResolver, Dumpable

Registry and resolver of schema files and resources.

Author:
Radovan Semancik

Constructor Summary
SchemaRegistry()
           
 
Method Summary
 java.lang.String dump()
          Show the content of the object intended for diagnostics by developer.
 javax.xml.validation.Schema getJavaxSchema()
           
 Schema getObjectSchema()
          Returns a schema that contains all the object definitions augmented with extension definitions as appropriate.
 Schema getSchema(java.lang.String namespace)
           
 void initialize()
           
 void registerMidPointSchemaFile(java.io.File file)
           
 void registerMidPointSchemaResource(java.lang.String resourcePath, java.lang.String usualPrefix)
          Must be called before call to initialize()
 void registerMidPointSchemasFromDirectory(java.io.File directory)
           
 void registerSchema(org.w3c.dom.Node node, java.lang.String sourceDescription)
          Must be called before call to initialize()
 void registerSchema(org.w3c.dom.Node node, java.lang.String sourceDescription, java.lang.String usualPrefix)
          Must be called before call to initialize()
 void registerSchemaResource(java.lang.String resourcePath, java.lang.String usualPrefix)
          Must be called before call to initialize()
 org.xml.sax.InputSource resolveEntity(java.lang.String publicId, java.lang.String systemId)
           
 org.w3c.dom.ls.LSInput resolveResource(java.lang.String type, java.lang.String namespaceURI, java.lang.String publicId, java.lang.String systemId, java.lang.String baseURI)
           
 org.xml.sax.InputSource resolveResourceUsingBuiltinResolver(java.lang.String type, java.lang.String namespaceURI, java.lang.String publicId, java.lang.String systemId, java.lang.String baseURI)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

SchemaRegistry

public SchemaRegistry()
Method Detail

registerSchemaResource

public void registerSchemaResource(java.lang.String resourcePath,
                                   java.lang.String usualPrefix)
                            throws SchemaException
Must be called before call to initialize()

Throws:
SchemaException

registerMidPointSchemaResource

public void registerMidPointSchemaResource(java.lang.String resourcePath,
                                           java.lang.String usualPrefix)
                                    throws SchemaException
Must be called before call to initialize()

Throws:
SchemaException

registerSchema

public void registerSchema(org.w3c.dom.Node node,
                           java.lang.String sourceDescription)
                    throws SchemaException
Must be called before call to initialize()

Parameters:
node -
Throws:
SchemaException

registerSchema

public void registerSchema(org.w3c.dom.Node node,
                           java.lang.String sourceDescription,
                           java.lang.String usualPrefix)
                    throws SchemaException
Must be called before call to initialize()

Parameters:
node -
Throws:
SchemaException

registerMidPointSchemaFile

public void registerMidPointSchemaFile(java.io.File file)
                                throws java.io.FileNotFoundException,
                                       SchemaException
Throws:
java.io.FileNotFoundException
SchemaException

registerMidPointSchemasFromDirectory

public void registerMidPointSchemasFromDirectory(java.io.File directory)
                                          throws java.io.FileNotFoundException,
                                                 SchemaException
Throws:
java.io.FileNotFoundException
SchemaException

initialize

public void initialize()
                throws org.xml.sax.SAXException,
                       java.io.IOException,
                       SchemaException
Throws:
org.xml.sax.SAXException
java.io.IOException
SchemaException

getJavaxSchema

public javax.xml.validation.Schema getJavaxSchema()

getSchema

public Schema getSchema(java.lang.String namespace)

getObjectSchema

public Schema getObjectSchema()
Returns a schema that contains all the object definitions augmented with extension definitions as appropriate. This is the method intended for common usage in the code. The returned schema is considered to be immutable. Any attempt to change it may lead to unexpected results.


resolveEntity

public org.xml.sax.InputSource resolveEntity(java.lang.String publicId,
                                             java.lang.String systemId)
                                      throws org.xml.sax.SAXException,
                                             java.io.IOException
Specified by:
resolveEntity in interface org.xml.sax.EntityResolver
Throws:
org.xml.sax.SAXException
java.io.IOException

resolveResource

public org.w3c.dom.ls.LSInput resolveResource(java.lang.String type,
                                              java.lang.String namespaceURI,
                                              java.lang.String publicId,
                                              java.lang.String systemId,
                                              java.lang.String baseURI)
Specified by:
resolveResource in interface org.w3c.dom.ls.LSResourceResolver

resolveResourceUsingBuiltinResolver

public org.xml.sax.InputSource resolveResourceUsingBuiltinResolver(java.lang.String type,
                                                                   java.lang.String namespaceURI,
                                                                   java.lang.String publicId,
                                                                   java.lang.String systemId,
                                                                   java.lang.String baseURI)

dump

public java.lang.String dump()
Description copied from interface: Dumpable
Show the content of the object intended for diagnostics by developer. The content may be multi-line, in case of hierarchical objects it may be intended. The use of this method may not be efficient. It is not supposed to be used in normal operation. However, it is very useful in tests or in case of dumping objects in severe error situations.

Specified by:
dump in interface Dumpable
Returns:
content of the object intended for diagnostics.


Copyright © 2012 evolveum. All Rights Reserved.