com.ricebridge.xmlman.in.func
Class TrimFunction

java.lang.Object
  extended bycom.ricebridge.xmlman.in.func.TrimFunction
All Implemented Interfaces:
Function

public class TrimFunction
extends Object
implements Function

Defines XPath function to trim whitespace from strings.

Function signature: string trim(object)

An implicit call to string() is made on the argument object. This function simply performs a Java String.trim(). Under the default settings it would normally be used like so: rb:trim(' foo '), returning 'foo'.

The Source Code of this Java class is available under a BSD-style license.


Constructor Summary
TrimFunction()
           
 
Method Summary
 Object call(com.ricebridge.xmlman.tp.Context pContext, List pArgs)
          Call the function.
static String evaluate(Object pObject, com.ricebridge.xmlman.tp.Navigator pNavigator)
          Evaluate the function.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

TrimFunction

public TrimFunction()
Method Detail

call

public Object call(com.ricebridge.xmlman.tp.Context pContext,
                   List pArgs)
            throws com.ricebridge.xmlman.tp.FunctionCallException
Call the function.

Specified by:
call in interface Function
Parameters:
pContext - XPath execution context
pArgs - Function arguments
Throws:
com.ricebridge.xmlman.tp.FunctionCallException

evaluate

public static String evaluate(Object pObject,
                              com.ricebridge.xmlman.tp.Navigator pNavigator)
Evaluate the function.

Parameters:
pObject - object representing string to trim
pNavigator - Source document navigator


Copyright © 2004-2005 Ricebridge