com.ldodds.foaf.thinlet.model
Class ValidationError

java.lang.Object
  |
  +--com.ldodds.foaf.thinlet.model.ValidationError

public class ValidationError
extends java.lang.Object

Describes a validation error, generated by a Validatable object. Each validation error is tied with a particular field. Ideally field names should match up to field names in the user interface, making it easy to provide feedback to the user.

This code is Public Domain

Author:
ccslrd

Constructor Summary
ValidationError(java.lang.String field, java.lang.String message)
          Constructs a ValidationError representing a problem with a specific field.
 
Method Summary
static ValidationError createMissingFieldError(java.lang.String field)
           
 java.lang.String getField()
          Gets the name of the field
 java.lang.String getMessage()
          Gets the error message
 java.lang.String toString()
          Returns a string representation of this error message for logging purposes.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

ValidationError

public ValidationError(java.lang.String field,
                       java.lang.String message)
Constructs a ValidationError representing a problem with a specific field.
Parameters:
field - the name of the field
message - the error message
Method Detail

getField

public java.lang.String getField()
Gets the name of the field

getMessage

public java.lang.String getMessage()
Gets the error message

toString

public java.lang.String toString()
Returns a string representation of this error message for logging purposes.
Overrides:
toString in class java.lang.Object

createMissingFieldError

public static ValidationError createMissingFieldError(java.lang.String field)