ru.onego.industrial.catalog.util
Class ReplaceAllFunction

java.lang.Object
  extended by ru.onego.industrial.catalog.util.ReplaceAllFunction
All Implemented Interfaces:
FunctionInterface

public class ReplaceAllFunction
extends java.lang.Object
implements FunctionInterface

Class implements adapter for Java API function replaceAll(regex, newValue).

Version:
1.0
Author:
Lev Levin

Constructor Summary
ReplaceAllFunction()
           
 
Method Summary
 java.lang.Object exec(java.util.List params)
          Core method.
 java.lang.String getName()
          Return name of this function.
 int getParamCount()
          Returns number of function parameters.
 java.lang.Class getParamType(int param)
          Returns type of parameter, specified by the index.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ReplaceAllFunction

public ReplaceAllFunction()
Method Detail

getName

public java.lang.String getName()
Description copied from interface: FunctionInterface
Return name of this function.

Specified by:
getName in interface FunctionInterface
Returns:
Name of the function

getParamCount

public int getParamCount()
                  throws FunctionException
Description copied from interface: FunctionInterface
Returns number of function parameters.

Specified by:
getParamCount in interface FunctionInterface
Returns:
Number of parameters
Throws:
FunctionException - Thrown if something goes wrong

getParamType

public java.lang.Class getParamType(int param)
                             throws FunctionException
Description copied from interface: FunctionInterface
Returns type of parameter, specified by the index. Parameters should be convertible t the results of this method.

Specified by:
getParamType in interface FunctionInterface
Parameters:
param - Index of the parameter
Returns:
Class representing type of parameter
Throws:
FunctionException - Thrown if index out of bounbds

exec

public java.lang.Object exec(java.util.List params)
                      throws FunctionException
Description copied from interface: FunctionInterface
Core method. Executes function with the given parameters. First parameter is always value which should be treated.

Specified by:
exec in interface FunctionInterface
Parameters:
params - List of function parameters
Returns:
Treated value
Throws:
FunctionException - Thrown if any error occur while executing function