ilog.cpl.css.function
Class IlpFormatFunction

java.lang.Object
  extended by ilog.views.util.styling.IlvCSSFunction
      extended by ilog.cpl.css.function.IlpConvertionFunction
          extended by ilog.cpl.css.function.IlpFormatFunction
All Implemented Interfaces:
Serializable

public class IlpFormatFunction
extends IlpConvertionFunction

Function to convert a value to a String based on the given Format.

The function should be defined as follows:


   aString : '@|format(#formatBean, args)'
 

This definition converts the given value to a String based on the given format.

Arguments:

If the function argument is not valid or cannot be converted, an IllegalArgumentException exception will be thrown.

Since:
JTGO 3.5
See Also:
Format, IlpDecimalFormat, IlpMessageFormat, IlpSimpleDateFormat, Serialized Form

Constructor Summary
IlpFormatFunction()
          Default constructor.
IlpFormatFunction(IlpContext context)
          Constructor.
 
Method Summary
 Object call(Object[] args, Class type, ilog.views.util.css.IlvCSSModel model, Object node, Object target, Object closure)
          Method called to execute the function.
 String getDelimiters()
          Returns the delimiters of the function parameters.
 String getName()
          Retrieves the name of the function.
 boolean returnDelimitersAsToken()
          Returns true whether the delimiters are returned also as token.
 
Methods inherited from class ilog.cpl.css.function.IlpConvertionFunction
convertColor, getContext
 
Methods inherited from class ilog.views.util.styling.IlvCSSFunction
getImportance, getShortDescription
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

IlpFormatFunction

public IlpFormatFunction()
Default constructor.

It has no arguments and gets the default application context.


IlpFormatFunction

public IlpFormatFunction(IlpContext context)
Constructor.

Parameters:
context - A context to be used by the function.
Method Detail

getName

public String getName()
Retrieves the name of the function.

Specified by:
getName in class IlvCSSFunction
Returns:
This function name, which is "format".
See Also:
IlvCSSFunction

getDelimiters

public String getDelimiters()
Returns the delimiters of the function parameters.

Overrides:
getDelimiters in class IlvCSSFunction
Returns:
Returns ",".

returnDelimitersAsToken

public boolean returnDelimitersAsToken()
Returns true whether the delimiters are returned also as token.

Overrides:
returnDelimitersAsToken in class IlvCSSFunction
Returns:
false means the delimiters are discarded.

call

public Object call(Object[] args,
                   Class type,
                   ilog.views.util.css.IlvCSSModel model,
                   Object node,
                   Object target,
                   Object closure)
Method called to execute the function.

Specified by:
call in class IlvCSSFunction
Parameters:
args - List of arguments passed to the function.
type - Expected type of the object returned by the function.
model - The CSS model being used.
node - Current model object being called on
target - The target object where the returned object will be applied.
closure - An object set by IlvCSSBeans.setFunctionClosure(java.lang.Object)
Returns:
The value computed by this function, which is String.
See Also:
IlvCSSFunction


Copyright © 1996-2007 ILOG S.A. All rights reserved.   Documentation homepage.   . All Rights Reserved.