org.apache.tapestry.valid
Class FieldTracking

java.lang.Object
  extended byorg.apache.tapestry.valid.FieldTracking
All Implemented Interfaces:
IFieldTracking, java.io.Serializable

public class FieldTracking
extends java.lang.Object
implements IFieldTracking, java.io.Serializable

Default implementation of IFieldTracking.

Since:
1.0.8
Author:
Howard Lewis Ship
See Also:
Serialized Form

Method Summary
 IFormComponent getComponent()
          Returns the field component.
 ValidationConstraint getConstraint()
          Returns the validation constraint that was violated by the input.
 IRender getErrorRenderer()
          Returns an object that will render the error message.
 java.lang.String getFieldName()
          Returns the name of the field, that is, the name assigned by the form (this will differ from the component's id when any kind of looping operation is in effect).
 java.lang.String getInput()
          Returns the invalid input recorded for the field.
 boolean isInError()
          Returns true if the field is in error (that is, if it has an error message renderer.
 void setConstraint(ValidationConstraint constraint)
           
 void setErrorRenderer(IRender value)
           
 void setInput(java.lang.String value)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Method Detail

getComponent

public IFormComponent getComponent()
Description copied from interface: IFieldTracking
Returns the field component. This may return null if the error is not associated with any particular field. Note: may return null after the field tracking object is serialized and deserialized (the underlying component reference is transient); this metehod is primarily used for testing.

Specified by:
getComponent in interface IFieldTracking

getErrorRenderer

public IRender getErrorRenderer()
Description copied from interface: IFieldTracking
Returns an object that will render the error message. The renderer must implement a simple toString() that does not produce markup, but is a simple message.

Specified by:
getErrorRenderer in interface IFieldTracking
See Also:
ValidatorException.ValidatorException(String, IRender, ValidationConstraint)

setErrorRenderer

public void setErrorRenderer(IRender value)

getInput

public java.lang.String getInput()
Description copied from interface: IFieldTracking
Returns the invalid input recorded for the field. This is stored so that, on a subsequent render, the smae invalid input can be presented to the client to be corrected.

Specified by:
getInput in interface IFieldTracking

setInput

public void setInput(java.lang.String value)

getFieldName

public java.lang.String getFieldName()
Description copied from interface: IFieldTracking
Returns the name of the field, that is, the name assigned by the form (this will differ from the component's id when any kind of looping operation is in effect).

Specified by:
getFieldName in interface IFieldTracking

getConstraint

public ValidationConstraint getConstraint()
Description copied from interface: IFieldTracking
Returns the validation constraint that was violated by the input. This may be null if the constraint isn't known.

Specified by:
getConstraint in interface IFieldTracking

setConstraint

public void setConstraint(ValidationConstraint constraint)

isInError

public boolean isInError()
Description copied from interface: IFieldTracking
Returns true if the field is in error (that is, if it has an error message renderer.

Specified by:
isInError in interface IFieldTracking
Since:
3.0 *