Qizx fe-4.4p2 API

com.qizx.api.util
Class DefaultModuleResolver

java.lang.Object
  extended by com.qizx.api.util.DefaultModuleResolver
All Implemented Interfaces:
ModuleResolver

public class DefaultModuleResolver
extends Object
implements ModuleResolver

Default ModuleResolver implementation using a base URL.

The strategy used consists of appending the module namespace URI to the base URI, and (if possible) checking the existence of the pointed resource.

If the check fails, and if location hints are provided, then each hint is appended to the base URL and put to the result list, unless it can be verified that the URL formed this way points to a non-existent resource.


Constructor Summary
DefaultModuleResolver(URL base)
          Creates a resolver using a base URL.
 
Method Summary
 URL getBase()
           
 URL[] resolve(String moduleNamespaceURI, String[] locationHints)
          Resolves a module namespace to one or several compilation units.
 Source resolveTemplates(String url)
          Resolves an URL for an XSLT stylesheet.
 String toString()
           
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

DefaultModuleResolver

public DefaultModuleResolver(URL base)
Creates a resolver using a base URL.

Parameters:
base - an URL used as a base for resolving module URI's.
Method Detail

toString

public String toString()
Overrides:
toString in class Object

resolve

public URL[] resolve(String moduleNamespaceURI,
                     String[] locationHints)
              throws MalformedURLException
Description copied from interface: ModuleResolver
Resolves a module namespace to one or several compilation units.

Specified by:
resolve in interface ModuleResolver
Parameters:
moduleNamespaceURI - target namespace of the module to import.
locationHints - optional URI's used as resolution hints.
Returns:
one or several physical locations of module units.
Throws:
MalformedURLException - if provided module URI's or hints are invalid
See Also:
ModuleResolver.resolve(java.lang.String, java.lang.String[])

getBase

public URL getBase()

resolveTemplates

public Source resolveTemplates(String url)
Description copied from interface: ModuleResolver
Resolves an URL for an XSLT stylesheet.

Specified by:
resolveTemplates in interface ModuleResolver
Parameters:
url - URL of the stylesheet
Returns:
null if not resolved, otherwise a resolved JAXP Source

© 2010 Axyana Software