org.apache.openjpa.example.gallery.constraint
Class ImageValidator
java.lang.Object
org.apache.openjpa.example.gallery.constraint.ImageValidator
- All Implemented Interfaces:
- ConstraintValidator<ImageConstraint,Image>
public class ImageValidator
- extends Object
- implements ConstraintValidator<ImageConstraint,Image>
Simple validator used to verify that image data is of a supported type
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
ImageValidator
public ImageValidator()
initialize
public void initialize(ImageConstraint constraint)
- Configure the constraint validator based on the image
types it should support.
- Specified by:
initialize
in interface ConstraintValidator<ImageConstraint,Image>
- Parameters:
constraint
- the constraint definition
isValid
public boolean isValid(Image value,
ConstraintValidatorContext context)
- Validate a specified value.
- Specified by:
isValid
in interface ConstraintValidator<ImageConstraint,Image>
Copyright © 2006-2012 Apache Software Foundation. All Rights Reserved.