Overview | Package | Class | Tree | Deprecated | Index | Help
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD

## org.apache.cayenne.validation
Class BeanValidationFailure

    java.lang.Object
      org.apache.cayenne.validation.SimpleValidationFailure
          org.apache.cayenne.validation.BeanValidationFailure

All Implemented Interfaces:
  java.io.Serializable, ValidationFailure

    public class BeanValidationFailure

extends SimpleValidationFailure

ValidationFailure implementation that described a failure of a single named property of a Java Bean object.

Since:
  1.1
Author:
  Fabricio Voznika, Andrus Adamchik
See Also:
  Serialized Form

Field Summary
`protected java.lang.String` | `property`

Fields inherited from class org.apache.cayenne.validation.SimpleValidationFailure
`error, source`

Constructor Summary
`BeanValidationFailure(java.lang.Object source, java.lang.String property, java.lang.Object error)` Creates new BeanValidationFailure.

Method Summary
`java.lang.String` | `getProperty()` Returns a failed property of the failure source object.
`java.lang.String` | `toString()` Returns a String representation of the failure.
`static ValidationFailure` | `validateJavaClassName(java.lang.Object bean, java.lang.String attribute, java.lang.String identifier)` A utility method that checks that a given string is a valid Java full class name, returning a non-null ValidationFailure if this is not so.
`static ValidationFailure` | `validateMandatory(java.lang.Object bean, java.lang.String attribute)`
`static ValidationFailure` | `validateMandatory(java.lang.Object bean, java.lang.String attribute, java.lang.Object value)`
`static ValidationFailure` | `validateNotEmpty(java.lang.Object bean, java.lang.String attribute, java.util.Collection value)` Returns a ValidationFailure if a collection attribute of an object is null or empty.
`static ValidationFailure` | `validateNotEmpty(java.lang.Object bean, java.lang.String attribute, java.lang.String value)` A utility method that returns a ValidationFailure if a string is either null or has a length of zero; otherwise returns null.
`static ValidationFailure` | `validateNotNull(java.lang.Object bean, java.lang.String attribute, java.lang.Object value)`

Methods inherited from class org.apache.cayenne.validation.SimpleValidationFailure
`getDescription, getError, getSource`

Methods inherited from class java.lang.Object
`clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait`

Field Detail

### property

    protected java.lang.String property

Constructor Detail

### BeanValidationFailure

    public BeanValidationFailure(java.lang.Object source,
                                 java.lang.String property,
                                 java.lang.Object error)

  Creates new BeanValidationFailure.

Method Detail

### validateNotEmpty

    public static ValidationFailure validateNotEmpty(java.lang.Object bean,
                                                     java.lang.String attribute,
                                                     java.util.Collection value)

  Returns a ValidationFailure if a collection attribute of an object is null or empty.

### validateMandatory

    public static ValidationFailure validateMandatory(java.lang.Object bean,
                                                      java.lang.String attribute,
                                                      java.lang.Object value)

### validateMandatory

    public static ValidationFailure validateMandatory(java.lang.Object bean,
                                                      java.lang.String attribute)

### validateNotNull

    public static ValidationFailure validateNotNull(java.lang.Object bean,
                                                    java.lang.String attribute,
                                                    java.lang.Object value)

### validateNotEmpty

    public static ValidationFailure validateNotEmpty(java.lang.Object bean,
                                                     java.lang.String attribute,
                                                     java.lang.String value)

  A utility method that returns a ValidationFailure if a string is either null or has a length of zero; otherwise returns null.

### validateJavaClassName

    public static ValidationFailure validateJavaClassName(java.lang.Object bean,
                                                          java.lang.String attribute,
                                                          java.lang.String identifier)

  A utility method that checks that a given string is a valid Java full class name, returning a non-null ValidationFailure if this is not so. Special case: primitive arrays like byte[] are also handled as a valid java class name.

  Since:
    1.2

### getProperty

    public java.lang.String getProperty()

  Returns a failed property of the failure source object.

### toString

    public java.lang.String toString()

  Returns a String representation of the failure.

  Overrides:
    `toString` in class `SimpleValidationFailure`

Overview | Package | Class | Tree | Deprecated | Index | Help
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD

Copyright © 2001-2006 Apache.org All Rights Reserved.