|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||

java.lang.Objecttoolbox.web.validation.AbstractField
public abstract class AbstractField
Abstract partial field implementation to provide a convenience base class for implementing fields.
Provide implementations of all Field methods except validate.
| Constructor Summary | |
|---|---|
AbstractField()
Protected constructor |
|
| Method Summary | |
|---|---|
java.lang.String |
getDefault()
Return the string representation of the default value of this field. |
java.lang.String |
getName()
Return the name of this field. |
java.util.regex.Pattern |
getPattern()
Return the pattern used to identify this field. |
java.util.Properties |
getProperties()
Return all the field specific properties. |
java.lang.String |
getProperty(java.lang.String name)
Return a field specific property. |
java.lang.String |
getResourceKey()
Return the resource key used to lookup the display value of this field. |
protected java.lang.String |
getResourceString(java.lang.String key,
java.lang.Object[] args,
java.util.ResourceBundle bundle)
Return a resource string by formatting the resource string using the provided parameters. |
protected java.lang.String |
getResourceString(java.lang.String key,
java.util.ResourceBundle bundle)
Return a resource string from the given bundle |
boolean |
isRequired()
Indicates whether this field is required or not. |
void |
setDefault(java.lang.String def)
Set the string representation of the default value of this field. |
void |
setName(java.lang.String name)
Set the name of this field. |
void |
setPattern(java.util.regex.Pattern pattern)
Set the pattern used to identify this field. |
void |
setProperties(java.util.Properties props)
Set any field specific properties. |
void |
setRequired(java.lang.Boolean required)
Set the required flag of this field. |
void |
setResourceKey(java.lang.String key)
Set the value of the resource key used to look up the display value of this field. |
protected java.lang.String |
validateRequired(java.lang.String value,
java.util.ResourceBundle bundle)
Convenience method to perform the "required" validation test. |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Methods inherited from interface toolbox.web.validation.Field |
|---|
validate |
| Constructor Detail |
|---|
public AbstractField()
| Method Detail |
|---|
public java.lang.String getName()
getName in interface Fieldpublic void setName(java.lang.String name)
setName in interface Fieldname - String indicating the name of this field.public java.lang.String getResourceKey()
getResourceKey in interface Fieldpublic void setResourceKey(java.lang.String key)
setResourceKey in interface Fieldkey - String containing resource key.public java.util.regex.Pattern getPattern()
getPattern in interface Fieldpublic void setPattern(java.util.regex.Pattern pattern)
setPattern in interface Fieldpattern - Pattern containing the regex pattern used to identify
this field.public boolean isRequired()
isRequired in interface Fieldpublic void setRequired(java.lang.Boolean required)
setRequired in interface Fieldrequired - Flag to indicate whether this field is required.public java.lang.String getDefault()
getDefault in interface Fieldpublic void setDefault(java.lang.String def)
setDefault in interface Fielddef - String representation of the default value of this field.public void setProperties(java.util.Properties props)
setProperties in interface Fieldprops - Field specific properties.public java.lang.String getProperty(java.lang.String name)
getProperty in interface Fieldname - Property name.
public java.util.Properties getProperties()
getProperties in interface Field
protected java.lang.String getResourceString(java.lang.String key,
java.util.ResourceBundle bundle)
key - The resource key.bundle - The resource bundle.
protected java.lang.String getResourceString(java.lang.String key,
java.lang.Object[] args,
java.util.ResourceBundle bundle)
throws ValidationException
key - The resource key.args - Object array of arguments.bundle - The resource bundle.
ValidationException
protected java.lang.String validateRequired(java.lang.String value,
java.util.ResourceBundle bundle)
throws ValidationException
value - String to test.bundle - ResourceBundle to use for localisation.
ValidationException - if this field is reqiured and
the given value is empty/null and no default is available.
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||