[hibernate-commits] Hibernate SVN: r16978 - beanvalidation/trunk/validation-tck/src/main/java/org/hibernate/jsr303/tck/tests/constraints/invalidconstraintdefinitions.

hibernate-commits at lists.jboss.org hibernate-commits at lists.jboss.org
Tue Jun 30 08:45:13 EDT 2009


Author: hardy.ferentschik
Date: 2009-06-30 08:45:13 -0400 (Tue, 30 Jun 2009)
New Revision: 16978

Added:
   beanvalidation/trunk/validation-tck/src/main/java/org/hibernate/jsr303/tck/tests/constraints/invalidconstraintdefinitions/InvalidGroupsType.java
Log:
  HV-178 

Added: beanvalidation/trunk/validation-tck/src/main/java/org/hibernate/jsr303/tck/tests/constraints/invalidconstraintdefinitions/InvalidGroupsType.java
===================================================================
--- beanvalidation/trunk/validation-tck/src/main/java/org/hibernate/jsr303/tck/tests/constraints/invalidconstraintdefinitions/InvalidGroupsType.java	                        (rev 0)
+++ beanvalidation/trunk/validation-tck/src/main/java/org/hibernate/jsr303/tck/tests/constraints/invalidconstraintdefinitions/InvalidGroupsType.java	2009-06-30 12:45:13 UTC (rev 16978)
@@ -0,0 +1,52 @@
+// $Id: InvalidDefaultGroup.java 16691 2009-06-04 09:18:14Z hardy.ferentschik $
+/*
+* JBoss, Home of Professional Open Source
+* Copyright 2008, Red Hat Middleware LLC, and individual contributors
+* by the @authors tag. See the copyright.txt in the distribution for a
+* full listing of individual contributors.
+*
+* Licensed under the Apache License, Version 2.0 (the "License");
+* you may not use this file except in compliance with the License.
+* You may obtain a copy of the License at
+* http://www.apache.org/licenses/LICENSE-2.0
+* Unless required by applicable law or agreed to in writing, software
+* distributed under the License is distributed on an "AS IS" BASIS,
+* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+* See the License for the specific language governing permissions and
+* limitations under the License.
+*/
+package org.hibernate.jsr303.tck.tests.constraints.invalidconstraintdefinitions;
+
+import java.lang.annotation.Documented;
+import static java.lang.annotation.ElementType.TYPE;
+import java.lang.annotation.Retention;
+import static java.lang.annotation.RetentionPolicy.RUNTIME;
+import java.lang.annotation.Target;
+import javax.validation.Constraint;
+import javax.validation.ConstraintValidator;
+import javax.validation.ConstraintValidatorContext;
+
+/**
+ * @author Hardy Ferentschik
+ */
+ at Documented
+ at Constraint(validatedBy = InvalidGroupsType.InvalidDefaultGroupValidator.class)
+ at Target({ TYPE })
+ at Retention(RUNTIME)
+public @interface InvalidGroupsType {
+	public abstract String message() default "";
+
+	public abstract String groups() default "";
+
+	public abstract Class<?>[] payload() default { };
+
+	public class InvalidDefaultGroupValidator implements ConstraintValidator<InvalidGroupsType, Object> {
+
+		public void initialize(InvalidGroupsType parameters) {
+		}
+
+		public boolean isValid(Object object, ConstraintValidatorContext constraintValidatorContext) {
+			return false;
+		}
+	}
+}
\ No newline at end of file




More information about the hibernate-commits mailing list