org.apache.openjpa.example.gallery.constraint
Class ImageValidator

java.lang.Object
  extended by 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


Constructor Summary
ImageValidator()
           
 
Method Summary
 void initialize(ImageConstraint constraint)
          Configure the constraint validator based on the image types it should support.
 boolean isValid(Image value, ConstraintValidatorContext context)
          Validate a specified value.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ImageValidator

public ImageValidator()
Method Detail

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.