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