org.n52.security.common.xml
Class ClasspathLSResourceResolver

java.lang.Object
  extended by org.n52.security.common.xml.ClasspathEntityResolver
      extended by org.n52.security.common.xml.ClasspathLSResourceResolver
All Implemented Interfaces:
org.w3c.dom.ls.LSResourceResolver, org.xml.sax.EntityResolver

public class ClasspathLSResourceResolver
extends ClasspathEntityResolver
implements org.w3c.dom.ls.LSResourceResolver

Class ClasspathLSResourceResolver resolves resources based on the entity-mapping file.

In contrast to the quite mode of the EnityResolver, the quite mode of a resource resolver, only ensures, that unknown xsd mappings are never resolved, this means that a xsd validator will never contain warnings about non resloved xsd files. So be carefull with the quite mode of the resource resolver.

Version:
$Revision: $
Author:
Marko Reiprecht Created on 23.03.2008
See Also:
ClasspathEntityResolver

Constructor Summary
ClasspathLSResourceResolver()
           
ClasspathLSResourceResolver(boolean quite)
          Constructor creates a new instance.
ClasspathLSResourceResolver(boolean quite, java.lang.ClassLoader loader)
          Constructor creates a new instance.
 
Method Summary
 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)
          Method resolveResource resolves the resource by looking for special mapping file.
 
Methods inherited from class org.n52.security.common.xml.ClasspathEntityResolver
createInputSource, emptyInputSource, getMappedResourceFileName, isQuite, loadMapping, resolveEntity
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ClasspathLSResourceResolver

public ClasspathLSResourceResolver()
See Also:
ClasspathEntityResolver.ClasspathEntityResolver()

ClasspathLSResourceResolver

public ClasspathLSResourceResolver(boolean quite)
Constructor creates a new instance.

Parameters:
quite - the quite mode.

ClasspathLSResourceResolver

public ClasspathLSResourceResolver(boolean quite,
                                   java.lang.ClassLoader loader)
Constructor creates a new instance.

Parameters:
quite - the quite mode.
loader - the classloader to use, if null this.getClass().getClassLoader() is used.
Method Detail

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)
Method resolveResource resolves the resource by looking for special mapping file.

First it looks for a namespaceURI mapping, then for a publicId mapping and then for a systemId mapping. If none mapping is found it returns a "emtpy" inputsource in quite mode or null in nonquite mode.

Specified by:
resolveResource in interface org.w3c.dom.ls.LSResourceResolver
Parameters:
type - the type.
namespaceURI - the namespaceURI.
publicId - the publicId.
systemId - the systemId.
baseURI - the baseURI.
Returns:
LSInput.


Copyright © 2004-2009 52north.org. All Rights Reserved.