|
jbpm-form-modeler-request-dispatcher 6.0.0.CR4-Pre1 | |||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectorg.jbpm.formModeler.service.bb.mvc.taglib.formatter.Formatter
public abstract class Formatter
This is the base class for all formatters. It provides methods to render output fragments, and to set attributes for the output fragments. Also, input parameters can be read.
ALL classes extending this class MUST provide documentation on the parameters they need, the fragments they render, and the attributes they pass to the fragments. The following template is to be used: This class extends Formatter to provide support for [ ... what this class does ... ]. It expects the following input parameters:
| Constructor Summary | |
|---|---|
Formatter()
|
|
| Method Summary | |
|---|---|
void |
afterRendering(javax.servlet.http.HttpServletRequest request,
javax.servlet.http.HttpServletResponse response)
Called after the formatter finished rendering |
protected String |
getLang()
|
protected Locale |
getLocale()
|
protected LocaleManager |
getLocaleManager()
|
protected Object |
getParameter(String name)
Return a parameter by its name. |
protected void |
includePage(String pageName)
|
protected void |
renderFragment(String fragmentName)
Orders the processing of fragment with given name. |
abstract void |
service(javax.servlet.http.HttpServletRequest request,
javax.servlet.http.HttpServletResponse response)
Perform the required logic for this Formatter. |
protected void |
setAttribute(String name,
boolean value)
Sets a parameter for the fragment. |
protected void |
setAttribute(String name,
byte value)
Sets a parameter for the fragment. |
protected void |
setAttribute(String name,
char value)
Sets a parameter for the fragment. |
protected void |
setAttribute(String name,
double value)
Sets a parameter for the fragment. |
protected void |
setAttribute(String name,
float value)
Sets a parameter for the fragment. |
protected void |
setAttribute(String name,
int value)
Sets a parameter for the fragment. |
protected void |
setAttribute(String name,
long value)
Sets a parameter for the fragment. |
protected void |
setAttribute(String name,
Object value)
Sets a parameter for the fragment. |
protected void |
setAttribute(String name,
short value)
Sets a parameter for the fragment. |
protected void |
setAttributeInterpreter(FormaterTagDynamicAttributesInterpreter interpreter)
|
void |
setTag(FormatterTag tag)
Sets the parent tag. |
protected void |
writeToOut(String text)
|
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
|---|
public Formatter()
| Method Detail |
|---|
public void setTag(FormatterTag tag)
protected LocaleManager getLocaleManager()
protected Locale getLocale()
protected String getLang()
protected void renderFragment(String fragmentName)
fragmentName - Name of the fragment to be rendered.protected void includePage(String pageName)
protected void writeToOut(String text)
protected void setAttributeInterpreter(FormaterTagDynamicAttributesInterpreter interpreter)
protected void setAttribute(String name,
Object value)
Example, of a iterating formatter:
StringBuffer sb = new StringBuffer();
for( int i= 0; i<10; i++){
sb.delete(0,sb.length())
sb.append( i );
setAttribute("index",sb);
renderFragment("output");
}
*
will generate an output like :
10 10 10 10 10 10 10 10 10 10
while the expected output is:
0 1 2 3 4 5 6 7 8 9
So, use objects and don't change them. This is usually easy to accomplish, by using
different instances, in the example above, replace sb.delete(0,sb.length()) with
sb = new StringBuffer();
name - Name of the parameter.value - It's value. Must not be changed during all the execution.
protected void setAttribute(String name,
int value)
Example, of a iterating formatter:
StringBuffer sb = new StringBuffer();
for( int i= 0; i<10; i++){
sb.delete(0,sb.length())
sb.append( i );
setAttribute("index",sb);
renderFragment("output");
}
*
will generate an output like :
10 10 10 10 10 10 10 10 10 10
while the expected output is:
0 1 2 3 4 5 6 7 8 9
So, use objects and don't change them. This is usually easy to accomplish, by using
different instances, in the example above, replace sb.delete(0,sb.length()) with
sb = new StringBuffer();
name - Name of the parameter.value - It's value. Must not be changed during all the execution.
protected void setAttribute(String name,
byte value)
Example, of a iterating formatter:
StringBuffer sb = new StringBuffer();
for( int i= 0; i<10; i++){
sb.delete(0,sb.length())
sb.append( i );
setAttribute("index",sb);
renderFragment("output");
}
*
will generate an output like :
10 10 10 10 10 10 10 10 10 10
while the expected output is:
0 1 2 3 4 5 6 7 8 9
So, use objects and don't change them. This is usually easy to accomplish, by using
different instances, in the example above, replace sb.delete(0,sb.length()) with
sb = new StringBuffer();
name - Name of the parameter.value - It's value. Must not be changed during all the execution.
protected void setAttribute(String name,
long value)
Example, of a iterating formatter:
StringBuffer sb = new StringBuffer();
for( int i= 0; i<10; i++){
sb.delete(0,sb.length())
sb.append( i );
setAttribute("index",sb);
renderFragment("output");
}
*
will generate an output like :
10 10 10 10 10 10 10 10 10 10
while the expected output is:
0 1 2 3 4 5 6 7 8 9
So, use objects and don't change them. This is usually easy to accomplish, by using
different instances, in the example above, replace sb.delete(0,sb.length()) with
sb = new StringBuffer();
name - Name of the parameter.value - It's value. Must not be changed during all the execution.
protected void setAttribute(String name,
short value)
Example, of a iterating formatter:
StringBuffer sb = new StringBuffer();
for( int i= 0; i<10; i++){
sb.delete(0,sb.length())
sb.append( i );
setAttribute("index",sb);
renderFragment("output");
}
*
will generate an output like :
10 10 10 10 10 10 10 10 10 10
while the expected output is:
0 1 2 3 4 5 6 7 8 9
So, use objects and don't change them. This is usually easy to accomplish, by using
different instances, in the example above, replace sb.delete(0,sb.length()) with
sb = new StringBuffer();
name - Name of the parameter.value - It's value. Must not be changed during all the execution.
protected void setAttribute(String name,
boolean value)
Example, of a iterating formatter:
StringBuffer sb = new StringBuffer();
for( int i= 0; i<10; i++){
sb.delete(0,sb.length())
sb.append( i );
setAttribute("index",sb);
renderFragment("output");
}
*
will generate an output like :
10 10 10 10 10 10 10 10 10 10
while the expected output is:
0 1 2 3 4 5 6 7 8 9
So, use objects and don't change them. This is usually easy to accomplish, by using
different instances, in the example above, replace sb.delete(0,sb.length()) with
sb = new StringBuffer();
name - Name of the parameter.value - It's value. Must not be changed during all the execution.
protected void setAttribute(String name,
char value)
Example, of a iterating formatter:
StringBuffer sb = new StringBuffer();
for( int i= 0; i<10; i++){
sb.delete(0,sb.length())
sb.append( i );
setAttribute("index",sb);
renderFragment("output");
}
*
will generate an output like :
10 10 10 10 10 10 10 10 10 10
while the expected output is:
0 1 2 3 4 5 6 7 8 9
So, use objects and don't change them. This is usually easy to accomplish, by using
different instances, in the example above, replace sb.delete(0,sb.length()) with
sb = new StringBuffer();
name - Name of the parameter.value - It's value. Must not be changed during all the execution.
protected void setAttribute(String name,
float value)
Example, of a iterating formatter:
StringBuffer sb = new StringBuffer();
for( int i= 0; i<10; i++){
sb.delete(0,sb.length())
sb.append( i );
setAttribute("index",sb);
renderFragment("output");
}
*
will generate an output like :
10 10 10 10 10 10 10 10 10 10
while the expected output is:
0 1 2 3 4 5 6 7 8 9
So, use objects and don't change them. This is usually easy to accomplish, by using
different instances, in the example above, replace sb.delete(0,sb.length()) with
sb = new StringBuffer();
name - Name of the parameter.value - It's value. Must not be changed during all the execution.
protected void setAttribute(String name,
double value)
Example, of a iterating formatter:
StringBuffer sb = new StringBuffer();
for( int i= 0; i<10; i++){
sb.delete(0,sb.length())
sb.append( i );
setAttribute("index",sb);
renderFragment("output");
}
*
will generate an output like :
10 10 10 10 10 10 10 10 10 10
while the expected output is:
0 1 2 3 4 5 6 7 8 9
So, use objects and don't change them. This is usually easy to accomplish, by using
different instances, in the example above, replace sb.delete(0,sb.length()) with
sb = new StringBuffer();
name - Name of the parameter.value - It's value. Must not be changed during all the execution.protected Object getParameter(String name)
name - Parameter name to be used.
public abstract void service(javax.servlet.http.HttpServletRequest request,
javax.servlet.http.HttpServletResponse response)
throws FormatterException
request - user requestresponse - response to the user
FormatterException - in case of an unexpected exception.
public void afterRendering(javax.servlet.http.HttpServletRequest request,
javax.servlet.http.HttpServletResponse response)
throws FormatterException
request - response -
FormatterException
|
jbpm-form-modeler-request-dispatcher 6.0.0.CR4-Pre1 | |||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||