net.sf.jagzilla.taglib
Class ReflectFormatter

java.lang.Object
  extended bynet.sf.jagzilla.taglib.ReflectFormatter

public class ReflectFormatter
extends java.lang.Object

Helper class to handle the use of formatting strings. The main method is format which basically takes a string and a class, in the string, every value like this {val} will be substituted by the result of invoking getVal() on the class. This allows for a flexible and reusable system for string formatting. Especially usefull in taglib context and web application, where you will probably want a list of products as a combo, a listbox, os an unordered list.

Author:
mgriffa

Constructor Summary
ReflectFormatter()
           
 
Method Summary
 java.lang.String format(java.lang.String string, java.lang.Object o)
          formats a string .
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ReflectFormatter

public ReflectFormatter()
Method Detail

format

public java.lang.String format(java.lang.String string,
                               java.lang.Object o)
                        throws JagzillaException
formats a string .

Parameters:
string - the string to format
o - the object where to look for methods
Returns:
a string with the resulting formatted string
Throws:
JagzillaException
See Also:
ReflectFormatter


Distributed under the GPL. By Miguel Griffa. See the Jagzilla project page for more info.