org.inria.ns.reflex.modules.io
Class RelativizeURIFunction

java.lang.Object
  extended by org.inria.ns.reflex.xml.xpath.XPathFunction.NamedXPathFunction
      extended by org.inria.ns.reflex.modules.io.RelativizeURIFunction
All Implemented Interfaces:
XPathFunction

public class RelativizeURIFunction
extends XPathFunction.NamedXPathFunction
implements XPathFunction

The io:relativize-uri() function relativizes an URI against another base URI.

Author:
Philippe Poulard

Nested Class Summary
 
Nested classes/interfaces inherited from interface org.inria.ns.reflex.xml.xpath.XPathFunction
XPathFunction.NamedXPathFunction
 
Constructor Summary
RelativizeURIFunction()
           
 
Method Summary
 Object evaluate(XPathContext context, List args)
          Perform the function.
static URI relativize(Object base, Object uri)
          Return a relativized URI.
static URI relativize(URI base, URI uri)
          Return a relativized URI.
 
Methods inherited from class org.inria.ns.reflex.xml.xpath.XPathFunction.NamedXPathFunction
getQName, setQName
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface org.inria.ns.reflex.xml.xpath.XPathFunction
getQName
 

Constructor Detail

RelativizeURIFunction

public RelativizeURIFunction()
Method Detail

evaluate

public Object evaluate(XPathContext context,
                       List args)
                throws XPathFunctionException
Perform the function.

Specified by:
evaluate in interface XPathFunction
Parameters:
context - The context of the function.
args - The list of arguments of this function.
Returns:
The result of the evaluation.
Throws:
XPathFunctionException - When this function fails to be evaluated.
See Also:
XPathFunction.evaluate(org.inria.ns.reflex.xml.xpath.XPathContext, java.util.List)

relativize

public static URI relativize(Object base,
                             Object uri)
Return a relativized URI.

Parameters:
base - The base URI.
uri - The URI to relativize against the base URI.
Returns:
The URI relativized.

relativize

public static URI relativize(URI base,
                             URI uri)
                      throws URISyntaxException
Return a relativized URI.

Parameters:
base - The base URI.
uri - The URI to relativize against the base URI.
Returns:
The URI relativized.
Throws:
URISyntaxException - When