|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.apache.tapestry.form.AbstractFormComponentContributor
org.apache.tapestry.form.translator.AbstractTranslator
public abstract class AbstractTranslator
Abstract Translator
implementation that provides default behavior for trimming, null
object, and empty text handling.
Constructor Summary | |
---|---|
AbstractTranslator()
|
|
AbstractTranslator(String initializer)
|
Method Summary | |
---|---|
protected String |
buildMessage(ValidationMessages messages,
IFormComponent field,
String key)
|
String |
format(IFormComponent field,
Locale locale,
Object object)
Invoked during rendering to format an object (which may be null) into a text value (which should not be null) appropriate for the specified field. |
protected abstract String |
formatObject(IFormComponent field,
Locale locale,
Object object)
|
String |
getMessage()
|
protected Object[] |
getMessageParameters(Locale locale,
String label)
|
protected Object |
getValueForEmptyInput()
The value to be used when the value supplied in the request is blank (null or empty). |
boolean |
isTrim()
|
Object |
parse(IFormComponent field,
ValidationMessages messages,
String text)
Invoked during rewind to parse a submitted input value into an object suitable for the specified component. |
protected abstract Object |
parseText(IFormComponent field,
ValidationMessages messages,
String text)
|
void |
renderContribution(IMarkupWriter writer,
IRequestCycle cycle,
FormComponentContributorContext context,
IFormComponent field)
Invoked by a form component after it finishes rendering its tag (but before the tag is closed) to allow this object to contribute to the component's rendering process. |
void |
setMessage(String message)
|
void |
setTrim(boolean trim)
|
Methods inherited from class org.apache.tapestry.form.AbstractFormComponentContributor |
---|
accumulateProfileProperty, accumulateProperty, defaultScript, getScript, setScript |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public AbstractTranslator()
public AbstractTranslator(String initializer)
Method Detail |
---|
public String format(IFormComponent field, Locale locale, Object object)
Translator
format
in interface Translator
locale
- TODOTranslator.format(org.apache.tapestry.form.IFormComponent,
Locale, java.lang.Object)
public Object parse(IFormComponent field, ValidationMessages messages, String text) throws ValidatorException
Translator
parse
in interface Translator
messages
- TODO
ValidatorException
- if the specified text could not be parsed into an object.Translator.parse(org.apache.tapestry.form.IFormComponent,
ValidationMessages, java.lang.String)
protected abstract String formatObject(IFormComponent field, Locale locale, Object object)
protected abstract Object parseText(IFormComponent field, ValidationMessages messages, String text) throws ValidatorException
ValidatorException
protected Object getValueForEmptyInput()
parse(IFormComponent, ValidationMessages, String)
protected String buildMessage(ValidationMessages messages, IFormComponent field, String key)
protected Object[] getMessageParameters(Locale locale, String label)
public void renderContribution(IMarkupWriter writer, IRequestCycle cycle, FormComponentContributorContext context, IFormComponent field)
FormComponentContributor
renderContribution
in interface FormComponentContributor
renderContribution
in class AbstractFormComponentContributor
writer
- allows contributor to write additional attributes into the component's tagcycle
- for accessing request informationcontext
- utilities for genering messages and client-side validationfield
- the field for which contributions are being renderedFormComponentContributor.renderContribution(IMarkupWriter, IRequestCycle, FormComponentContributorContext, IFormComponent)
public boolean isTrim()
public void setTrim(boolean trim)
public String getMessage()
public void setMessage(String message)
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |