wms-jax.validation

 if (maxIntegerLength < 0) {
      throw new IllegalArgumentException("The length of the integer part cannot be negative.");
    }
    if (maxFractionLength < 0) {
      throw new IllegalArgumentException("The length of the fraction part cannot be negative.");
    }
  }
}

/* Location:
 * Qualified Name:     org.hibernate.validator.constraints.impl.DigitsValidatorForNumber
 * Java Class Version: 5 (49.0)
 * JD-Core Version:    0.7.1
 */
package org.hibernate.validator.constraints.impl;

import java.math.BigDecimal;
import javax.validation.ConstraintValidator;
import javax.validation.ConstraintValidatorContext;
import javax.validation.constraints.Digits;

public class DigitsValidatorForString
  implements ConstraintValidator<Digits, String>
{
  private int maxIntegerLength;
  private int maxFractionLength;
  
  public void initialize(Digits constraintAnnotation)
  {
    maxIntegerLength = constraintAnnotation.integer();
    maxFractionLength = constraintAnnotation.fraction();
    validateParameters();
  }
  
  public boolean isValid(String str, ConstraintValidatorContext constraintValidatorContext)
  {
    if (str == null) {
      return true;
    }
    BigDecimal bigNum = getBigDecimalValue(str);
    if (bigNum == null) {
      return false;
    }
    int integerPartLength = bigNum.precision() - bigNum.scale();
    int fractionPartLength = bigNum.scale() < 0 ? 0 : bigNum.scale();
    
    return (maxIntegerLength >= integerPartLength) && (maxFractionLength >= fractionPartLength);
  }
  
  private BigDecimal getBigDecimalValue(String str)
  {
    BigDecimal bd;
    try
    {
      bd = new BigDecimal(str);
    }
    catch (NumberFormatException nfe)
    {
      return null;
    }
    return bd;
  }
  
  private void validateParameters()
  {
    if (maxIntegerLength < 0) {
      throw new IllegalArgumentException("The length of the integer part cannot be negative.");
    }
    if (maxFractionLength < 0) {
      throw new IllegalArgumentException("The length of the fraction part cannot be negative.");
    }
  }
}

/* Location:
 * Qualified Name:     org.hibernate.validator.constraints.impl.DigitsValidatorForString
 * Java Class Version: 5 (49.0)
 * JD-Core Version:    0.7.1
 */
package org.hibernate.validator.constraints.impl;

import java.util.regex.Matcher;
import java.util.regex.Pattern;
import javax.validation.ConstraintValidator;
import javax.validation.ConstraintValidatorContext;
import org.hibernate.validator.constraints.Email;

public class EmailValidator
  implements ConstraintValidator<Email, String>
{
  private static String ATOM = "[^\\x00-\\x1F^\\(^\\)^\\<^\\>^\\@^\\,^\\;^\\:^\\\\^\\\"^\\.^\\[^\\]^\\s]";
  private static String DOMAIN = "(" + ATOM + "+(\\." + ATOM + "+)*";
  private static String IP_DOMAIN = "\\[[0-9]{1,3}\\.[0-9]{1,3}\\.[0-9]{1,3}\\.[0-9]{1,3}\\]";
  private Pattern pattern = Pattern.compile("^" + ATOM + "+(\\." + ATOM + "+)*@" + DOMAIN + "|" + IP_DOMAIN + ")$", 2);
  
  public void initialize(Email annotation) {}
  
  public boolean isValid(String value, ConstraintValidatorContext context)
  {
    if ((value == null) || (value.length() == 0)) {
      return true;
    }
    Matcher m = pattern.matcher(value);
    return m.matches();
  }
}

/* Location:
 * Qualified Name:     org.hibernate.validator.constraints.impl.EmailValidator
 * Java Class Version: 5 (49.0)
 * JD-Core Version:    0.7.1
 */
package org.hibernate.validator.constraints.impl;

import java.util.Calendar;
import javax.validation.ConstraintValidator;
import javax.validation.ConstraintValidatorContext;
import javax.validation.constraints.Future;

public class FutureValidatorForCalendar
  implements ConstraintValidator<Future, Calendar>
{
  public void initialize(Future constraintAnnotation) {}
  
  public boolean isValid(Calendar cal, ConstraintValidatorContext constraintValidatorContext)
  {
    if (cal == null) {
      return true;
    }
    return cal.after(Calendar.getInstance());
  }
}

/* Location:
 * Qualified Name:     org.hibernate.validator.constraints.impl.FutureValidatorForCalendar
 * Java Class Version: 5 (49.0)
 * JD-Core Version:    0.7.1
 */
package org.hibernate.validator.constraints.impl;

import java.util.Date;
import javax.validation.ConstraintValidator;
import javax.validation.ConstraintValidatorContext;
import javax.validation.constraints.Future;

public class FutureValidatorForDate
  implements ConstraintValidator<Future, Date>
{
  public void initialize(Future constraintAnnotation) {}
  
  public boolean isValid(Date date, ConstraintValidatorContext constraintValidatorContext)
  {
    if (date == null) {
      return true;
    }
    return date.after(new Date());
  }
}

/* Location:
 * Qualified Name:     org.hibernate.validator.constraints.impl.FutureValidatorForDate
 * Java Class Version: 5 (49.0)
 * JD-Core Version:    0.7.1
 */
package org.hibernate.validator.constraints.impl;

import javax.validation.ConstraintValidator;
import javax.validation.ConstraintValidatorContext;
import org.hibernate.validator.constraints.Length;

public class LengthValidator
  implements ConstraintValidator<Length, String>
{
  private int min;
  private int max;
  
  public void initialize(Length parameters)
  {
    min = parameters.min();
    max = parameters.max();
    validateParameters();
  }
  
  public boolean isValid(String value, ConstraintValidatorContext constraintValidatorContext)
  {
    if (value == null) {
      return true;
    }
    int length = value.length();
    return (length >= min) && (length <= max);
  }
  
  private void validateParameters()
  {
    if (min < 0) {
      throw new IllegalArgumentException("The min parameter cannot be negative.");
    }
    if (max < 0) {
      throw new IllegalArgumentException("The max parameter cannot be negative.");
    }
    if (max < min) {
      throw new IllegalArgumentException("The length cannot be negative.");
    }
  }
}

/* Location:
 * Qualified Name:     org.hibernate.validator.constraints.impl.LengthValidator
 * Java Class Version: 5 (49.0)
 * JD-Core Version:    0.7.1
 */
package org.hibernate.validator.constraints.impl;

import java.math.BigDecimal;
import java.math.BigInteger;
import javax.validation.ConstraintValidator;
import javax.validation.ConstraintValidatorContext;
import javax.validation.constraints.Max;

public class MaxValidatorForNumber
  implements ConstraintValidator<Max, Number>
{
  private long maxValue;
  
  public void initialize(Max maxValue)
  {
    this.maxValue = maxValue.value();
  }
  
  public boolean isValid(Number value, ConstraintValidatorContext constraintValidatorContext)
  {
    if (value == null) {
      return true;
    }
    if ((value instanceof BigDecimal)) {
      return ((BigDecimal)value).compareTo(BigDecimal.valueOf(maxValue)) != 1;
    }
    if ((value instanceof BigInteger)) {
      return ((BigInteger)value).compareTo(BigInteger.valueOf(maxValue)) != 1;
    }
    double doubleValue = value.doubleValue();
    return doubleValue <= maxValue;
  }
}

/* Location:
 * Qualified Name:     org.hibernate.validator.constraints.impl.MaxValidatorForNumber
 * Java Class Version: 5 (49.0)
 * JD-Core Version:    0.7.1
 */
package org.hibernate.validator.constraints.impl;

import java.math.BigDecimal;
import javax.validation.ConstraintValidator;
import javax.validation.ConstraintValidatorContext;
import javax.validation.constraints.Max;

public class MaxValidatorForString
  implements ConstraintValidator<Max, String>
{
  private long maxValue;
  
  public void initialize(Max maxValue)
  {
    this.maxValue = maxValue.value();
  }
  
  public boolean isValid(String value, ConstraintValidatorContext constraintValidatorContext)
  {
    if (value == null) {
      return true;
    }
    try
    {
      return new BigDecimal(value).compareTo(BigDecimal.valueOf(maxValue)) != 1;
    }
    catch (NumberFormatException nfe) {}
    return false;
  }
}

/* Location:
 * Qualified Name:     org.hibernate.validator.constraints.impl.MaxValidatorForString
 * Java Class Version: 5 (49.0)
 * JD-Core Version:    0.7.1
 */
package org.hibernate.validator.constraints.impl;

import java.math.BigDecimal;
import java.math.BigInteger;
import javax.validation.ConstraintValidator;
import javax.validation.ConstraintValidatorContext;
import javax.validation.constraints.Min;

public class MinValidatorForNumber
  implements ConstraintValidator<Min, Number>
{
  private long minValue;
  
  public void initialize(Min minValue)
  {
    this.minValue = minValue.value();
  }
  
  public boolean isValid(Number value, ConstraintValidatorContext constraintValidatorContext)
  {
    if (value == null) {
      return true;
    }
    if ((value instanceof BigDecimal)) {
      return ((BigDecimal)value).compareTo(BigDecimal.valueOf(minValue)) != -1;
    }
    if ((value instanceof BigInteger)) {
      return ((BigInteger)value).compareTo(BigInteger.valueOf(minValue)) != -1;
    }
    double doubleValue = value.doubleValue();
    return doubleValue >= minValue;
  }
}

/* Location:
 * Qualified Name:     org.hibernate.validator.constraints.impl.MinValidatorForNumber
 * Java Class Version: 5 (49.0)
 * JD-Core Version:    0.7.1
 */
package org.hibernate.validator.constraints.impl;

import java.math.BigDecimal;
import javax.validation.ConstraintValidator;
import javax.validation.ConstraintValidatorContext;
import javax.validation.constraints.Min;

public class MinValidatorForString
  implements ConstraintValidator<Min, String>
{
  private long minValue;
  
  public void initialize(Min minValue)
  {
    this.minValue = minValue.value();
  }
  
  public boolean isValid(String value, ConstraintValidatorContext constraintValidatorContext)
  {
    if (value == null) {
      return true;
    }
    try
    {
      return new BigDecimal(value).compareTo(BigDecimal.valueOf(minValue)) != -1;
    }
    catch (NumberFormatException nfe) {}
    return false;
  }
}

/* Location:
 * Qualified Name:     org.hibernate.validator.constraints.impl.MinValidatorForString
 * Java Class Version: 5 (49.0)
 * JD-Core Version:    0.7.1
 */
package org.hibernate.validator.constraints.impl;

import javax.validation.ConstraintValidator;
import javax.validation.ConstraintValidatorContext;
import javax.validation.constraints.NotNull;

public class NotNullValidator
  implements ConstraintValidator<NotNull, Object>
{
  public void initialize(NotNull parameters) {}
  
  public boolean isValid(Object object, ConstraintValidatorContext constraintValidatorContext)
  {
    return object != null;
  }
}

/* Location:
 * Qualified Name:     org.hibernate.validator.constraints.impl.NotNullValidator
 * Java Class Version: 5 (49.0)
 * JD-Core Version:    0.7.1
 */
package org.hibernate.validator.constraints.impl;

import javax.validation.ConstraintValidator;
import javax.validation.ConstraintValidatorContext;
import javax.validation.constraints.Null;

public class NullValidator
  implements ConstraintValidator<Null, Object>
{
  public void initialize(Null constraintAnnotation) {}
  
  public boolean isValid(Object object, ConstraintValidatorContext constraintValidatorContext)
  {
    return object == null;
  }
}

/* Location:
 * Qualified Name:     org.hibernate.validator.constraints.impl.NullValidator
 * Java Class Version: 5 (49.0)
 * JD-Core Version:    0.7.1
 */
package org.hibernate.validator.constraints.impl;

import java.util.Calendar;
import javax.validation.ConstraintValidator;
import javax.validation.ConstraintValidatorContext;
import javax.validation.constraints.Past;

public class PastValidatorForCalendar
  implements ConstraintValidator<Past, Calendar>
{
  public void initialize(Past constraintAnnotation) {}
  
  public boolean isValid(Calendar cal, ConstraintValidatorContext constraintValidatorContext)
  {
    if (cal == null) {
      return true;
    }
    return cal.before(Calendar.getInstance());
  }
}

/* Location:
 * Qualified Name:     org.hibernate.validator.constraints.impl.PastValidatorForCalendar
 * Java Class Version: 5 (49.0)
 * JD-Core Version:    0.7.1
 */
package org.hibernate.validator.constraints.impl;

import java.util.Date;
import javax.validation.ConstraintValidator;
import javax.validation.ConstraintValidatorContext;
import javax.validation.constraints.Past;

public class PastValidatorForDate
  implements ConstraintValidator<Past, Date>
{
  public void initialize(Past constraintAnnotation) {}
  
  public boolean isValid(Date date, ConstraintValidatorContext constraintValidatorContext)
  {
    if (date == null) {
      return true;
    }
    return date.before(new Date());
  }
}

/* Location:
 * Qualified Name:     org.hibernate.validator.constraints.impl.PastValidatorForDate
 * Java Class Version: 5 (49.0)
 * JD-Core Version:    0.7.1
 */
package org.hibernate.validator.constraints.impl;

import java.util.regex.Matcher;
import java.util.regex.PatternSyntaxException;
import javax.validation.ConstraintValidator;
import javax.validation.ConstraintValidatorContext;
import javax.validation.constraints.Pattern.Flag;

public class PatternValidator
  implements ConstraintValidator<javax.validation.constraints.Pattern, String>
{
  private java.util.regex.Pattern pattern;
  
  public void initialize(javax.validation.constraints.Pattern parameters)
  {
    Pattern.Flag[] flags = parameters.flags();
    int intFlag = 0;
    for (Pattern.Flag flag : flags) {
      intFlag |= flag.getValue();
    }
    try
    {
      pattern = java.util.regex.Pattern.compile(parameters.regexp(), intFlag);
    }
    catch (PatternSyntaxException e)
    {
      throw new IllegalArgumentException("Invalid regular expression.", e);
    }
  }
  
  public boolean isValid(String value, ConstraintValidatorContext constraintValidatorContext)
  {
    if (value == null) {
      return true;
    }
    Matcher m = pattern.matcher(value);
    return m.matches();
  }
}

/* Location:
 * Qualified Name:     org.hibernate.validator.constraints.impl.PatternValidator
 * Java Class Version: 5 (49.0)
 * JD-Core Version:    0.7.1
 */
package org.hibernate.validator.constraints.impl;

import java.lang.reflect.Array;
import javax.validation.ConstraintValidator;
import javax.validation.ConstraintValidatorContext;
import javax.validation.constraints.Size;

public class SizeValidatorForArray
  implements ConstraintValidator<Size, Object[]>
{
  private int min;
  private int max;
  
  public void initialize(Size parameters)
  {
    min = parameters.min();
    max = parameters.max();
    validateParameters();
  }
  
  public boolean isValid(Object[] array, ConstraintValidatorContext constraintValidatorContext)
  {
    if (array == null) {
      return true;
    }
    int length = Array.getLength(array);
    return (length >= min) && (length <= max);
  }
  
  private void validateParameters()
  {
    if (min < 0) {
      throw new IllegalArgumentException("The min parameter cannot be negative.");
    }
    if (max < 0) {
      throw new IllegalArgumentException("The max parameter cannot be negative.");
    }
    if (max < min) {
      throw new IllegalArgumentException("The length cannot be negative.");
    }
  }
}

/* Location:
 * Qualified Name:     org.hibernate.validator.constraints.impl.SizeValidatorForArray
 * Java Class Version: 5 (49.0)
 * JD-Core Version:    0.7.1
 */
package org.hibernate.validator.constraints.impl;

import java.lang.reflect.Array;
import javax.validation.ConstraintValidator;
import javax.validation.ConstraintValidatorContext;
import javax.validation.constraints.Size;

public class SizeValidatorForArraysOfBoolean
  extends SizeValidatorForArraysOfPrimitives
  implements ConstraintValidator<Size, boolean[]>
{
  public boolean isValid(boolean[] array, ConstraintValidatorContext constraintValidatorContext)
  {
    if (array == null) {
      return true;
    }
    int length = Array.getLength(array);
    return (length >= min) && (length <= max);
  }
}

/* Location:
 * Qualified Name:     org.hibernate.validator.constraints.impl.SizeValidatorForArraysOfBoolean
 * Java Class Version: 5 (49.0)
 * JD-Core Version:    0.7.1
 */
package org.hibernate.validator.constraints.impl;

import java.lang.reflect.Array;
import javax.validation.ConstraintValidator;
import javax.validation.ConstraintValidatorContext;
import javax.validation.constraints.Size;

public class SizeValidatorForArraysOfByte
  extends SizeValidatorForArraysOfPrimitives
  implements ConstraintValidator<Size, byte[]>
{
  public boolean isValid(byte[] array, ConstraintValidatorContext constraintValidatorContext)
  {
    if (array == null) {
      return true;
    }
    int length = Array.getLength(array);
    return (length >= min) && (length <= max);
  }
}

/* Location:
 * Qualified Name:     org.hibernate.validator.constraints.impl.SizeValidatorForArraysOfByte
 * Java Class Version: 5 (49.0)
 * JD-Core Version:    0.7.1
 */
package org.hibernate.validator.constraints.impl;

import java.lang.reflect.Array;
import javax.validation.ConstraintValidator;
import javax.validation.ConstraintValidatorContext;
import javax.validation.constraints.Size;

public class SizeValidatorForArraysOfChar
  extends SizeValidatorForArraysOfPrimitives
  implements ConstraintValidator<Size, char[]>
{
  public boolean isValid(char[] array, ConstraintValidatorContext constraintValidatorContext)
  {
    if (array == null) {
      return true;
    }
    int length = Array.getLength(array);
    return (length >= min) && (length <= max);
  }
}

/* Location:
 * Qualified Name:     org.hibernate.validator.constraints.impl.SizeValidatorForArraysOfChar
 * Java Class Version: 5 (49.0)
 * JD-Core Version:    0.7.1
 */
package org.hibernate.validator.constraints.impl;

import java.lang.reflect.Array;
import javax.validation.ConstraintValidator;
import javax.validation.ConstraintValidatorContext;
import javax.validation.constraints.Size;

public class SizeValidatorForArraysOfDouble
  extends SizeValidatorForArraysOfPrimitives
  implements ConstraintValidator<Size, double[]>
{
  public boolean isValid(double[] array, ConstraintValidatorContext constraintValidatorContext)
  {
    if (array == null) {
      return true;
    }
    int length = Array.getLength(array);
    return (length >= min) && (length <= max);
  }
}

/* Location:
 * Qualified Name:     org.hibernate.validator.constraints.impl.SizeValidatorForArraysOfDouble
 * Java Class Version: 5 (49.0)
 * JD-Core Version:    0.7.1
 */
package org.hibernate.validator.constraints.impl;

import java.lang.reflect.Array;
import javax.validation.ConstraintValidator;
import javax.validation.ConstraintValidatorContext;
import javax.validation.constraints.Size;

public class SizeValidatorForArraysOfFloat
  extends SizeValidatorForArraysOfPrimitives
  implements ConstraintValidator<Size, float[]>
{
  public boolean isValid(float[] array, ConstraintValidatorContext constraintValidatorContext)
  {
    if (array == null) {
      return true;
    }
    int length = Array.getLength(array);
    return (length >= min) && (length <= max);
  }
}

/* Location:
 * Qualified Name:     org.hibernate.validator.constraints.impl.SizeValidatorForArraysOfFloat
 * Java Class Version: 5 (49.0)
 * JD-Core Version:    0.7.1
 */
package org.hibernate.validator.constraints.impl;

import java.lang.reflect.Array;
import javax.validation.ConstraintValidator;
import javax.validation.ConstraintValidatorContext;
import javax.validation.constraints.Size;

public class SizeValidatorForArraysOfInt
  extends SizeValidatorForArraysOfPrimitives
  implements ConstraintValidator<Size, int[]>
{
  public boolean isValid(int[] array, ConstraintValidatorContext constraintValidatorContext)
  {
    if (array == null) {
      return true;
    }
    int length = Array.getLength(array);
    return (length >= min) && (length <= max);
  }
}

/* Location:
 * Qualified Name:     org.hibernate.validator.constraints.impl.SizeValidatorForArraysOfInt
 * Java Class Version: 5 (49.0)
 * JD-Core Version:    0.7.1
 */
package org.hibernate.validator.constraints.impl;

import java.lang.reflect.Array;
import javax.validation.ConstraintValidator;
import javax.validation.ConstraintValidatorContext;
import javax.validation.constraints.Size;

public class SizeValidatorForArraysOfLong
  extends SizeValidatorForArraysOfPrimitives
  implements ConstraintValidator<Size, long[]>
{
  public boolean isValid(long[] array, ConstraintValidatorContext constraintValidatorContext)
  {
    if (array == null) {
      return true;
    }
    int length = Array.getLength(array);
    return (length >= min) && (length <= max);
  }
}

/* Location:
 * Qualified Name:     org.hibernate.validator.constraints.impl.SizeValidatorForArraysOfLong
 * Java Class Version: 5 (49.0)
 * JD-Core Version:    0.7.1
 */
package org.hibernate.validator.constraints.impl;

import javax.validation.constraints.Size;

public abstract class SizeValidatorForArraysOfPrimitives
{
  protected int min;
  protected int max;
  
  public void initialize(Size parameters)
  {
    min = parameters.min();
    max = parameters.max();
    validateParameters();
  }
  
  private void validateParameters()
  {
    if (min < 0) {
      throw new IllegalArgumentException("The min parameter cannot be negative.");
    }
    if (max < 0) {
      throw new IllegalArgumentException("The max parameter cannot be negative.");
    }
    if (max < min) {
      throw new IllegalArgumentException("The length cannot be negative.");
    }
  }
}

/* Location:
 * Qualified Name:     org.hibernate.validator.constraints.impl.SizeValidatorForArraysOfPrimitives
 * Java Class Version: 5 (49.0)
 * JD-Core Version:    0.7.1
 */
package org.hibernate.validator.constraints.impl;

import java.lang.reflect.Array;
import javax.validation.ConstraintValidator;
import javax.validation.ConstraintValidatorContext;
import javax.validation.constraints.Size;

public class SizeValidatorForArraysOfShort
  extends SizeValidatorForArraysOfPrimitives
  implements ConstraintValidator<Size, short[]>
{
  public boolean isValid(short[] array, ConstraintValidatorContext constraintValidatorContext)
  {
    if (array == null) {
      return true;
    }
    int length = Array.getLength(array);
    return (length >= min) && (length <= max);
  }
}

/* Location:
 * Qualified Name:     org.hibernate.validator.constraints.impl.SizeValidatorForArraysOfShort
 * Java Class Version: 5 (49.0)
 * JD-Core Version:    0.7.1
 */
package org.hibernate.validator.constraints.impl;

import java.util.Collection;
import javax.validation.ConstraintValidator;
import javax.validation.ConstraintValidatorContext;
import javax.validation.constraints.Size;

public class SizeValidatorForCollection
  implements ConstraintValidator<Size, Collection>
{
  private int min;
  private int max;
  
  public void initialize(Size parameters)
  {
    min = parameters.min();
    max = parameters.max();
    validateParameters();
  }
  
  public boolean isValid(Collection collection, ConstraintValidatorContext constraintValidatorContext)
  {
    if (collection == null) {
      return true;
    }
    int length = collection.size();
    return (length >= min) && (length <= max);
  }
  
  private void validateParameters()
  {
    if (min < 0) {
      throw new IllegalArgumentException("The min parameter cannot be negative.");
    }
    if (max < 0) {
      throw new IllegalArgumentException("The max parameter cannot be negative.");
    }
    if (max < min) {
      throw new IllegalArgumentException("The length cannot be negative.");
    }
  }
}

/* Location:
 * Qualified Name:     org.hibernate.validator.constraints.impl.SizeValidatorForCollection
 * Java Class Version: 5 (49.0)
 * JD-Core Version:    0.7.1
 */
package org.hibernate.validator.constraints.impl;

import java.util.Map;
import javax.validation.ConstraintValidator;
import javax.validation.ConstraintValidatorContext;
import javax.validation.constraints.Size;

public class SizeValidatorForMap
  implements ConstraintValidator<Size, Map>
{
  private int min;
  private int max;
  
  public void initialize(Size parameters)
  {
    min = parameters.min();
    max = parameters.max();
    validateParameters();
  }
  
  public boolean isValid(Map map, ConstraintValidatorContext constraintValidatorContext)
  {
    if (map == null) {
      return true;
    }
    int size = map.size();
    return (size >= min) && (size <= max);
  }
  
  private void validateParameters()
  {
    if (min < 0) {
      throw new IllegalArgumentException("The min parameter cannot be negative.");
    }
    if (max < 0) {
      throw new IllegalArgumentException("The max parameter cannot be negative.");
    }
    if (max < min) {
      throw new IllegalArgumentException("The length cannot be negative.");
    }
  }
}

/* Location:
 * Qualified Name:     org.hibernate.validator.constraints.impl.SizeValidatorForMap
 * Java Class Version: 5 (49.0)
 * JD-Core Version:    0.7.1
 */
package org.hibernate.validator.constraints.impl;

import javax.validation.ConstraintValidator;
import javax.validation.ConstraintValidatorContext;
import javax.validation.constraints.Size;

public class SizeValidatorForString
  implements ConstraintValidator<Size, String>
{
  private int min;
  private int max;
  
  public void initialize(Size parameters)
  {
    min = parameters.min();
    max = parameters.max();
    validateParameters();
  }
  
  public boolean isValid(String s, ConstraintValidatorContext constraintValidatorContext)
  {
    if (s == null) {
      return true;
    }
    int length = s.length();
    return (length >= min) && (length <= max);
  }
  
  private void validateParameters()
  {
    if (min < 0) {
      throw new IllegalArgumentException("The min parameter cannot be negative.");
    }
    if (max < 0) {
      throw new IllegalArgumentException("The max parameter cannot be negative.");
    }
    if (max < min) {
      throw new IllegalArgumentException("The length cannot be negative.");
    }
  }
}

/* Location:
 * Qualified Name:     org.hibernate.validator.constraints.impl.SizeValidatorForString
 * Java Class Version: 5 (49.0)
 * JD-Core Version:    0.7.1
 */
package org.hibernate.validator.constraints;

import java.lang.annotation.Annotation;
import java.lang.annotation.Documented;
import java.lang.annotation.Retention;
import java.lang.annotation.RetentionPolicy;
import java.lang.annotation.Target;
import javax.validation.Constraint;
import javax.validation.Payload;
import org.hibernate.validator.constraints.impl.LengthValidator;

@Documented
@Constraint(validatedBy={LengthValidator.class})
@Target({java.lang.annotation.ElementType.METHOD, java.lang.annotation.ElementType.FIELD, java.lang.annotation.ElementType.ANNOTATION_TYPE, java.lang.annotation.ElementType.CONSTRUCTOR, java.lang.annotation.ElementType.PARAMETER})
@Retention(RetentionPolicy.RUNTIME)
public @interface Length
{
  int min() default 0;
  
  int max() default Integer.MAX_VALUE;
  
  String message() default "{org.hibernate.validator.constraints.Length.message}";
  
  Class<?>[] groups() default {};
  
  Class<? extends Payload>[] payload() default {};
}

/* Location:
 * Qualified Name:     org.hibernate.validator.constraints.Length
 * Java Class Version: 5 (49.0)
 * JD-Core Version:    0.7.1
 */
package org.hibernate.validator.constraints;

import java.lang.annotation.Annotation;
import java.lang.annotation.Documented;
import java.lang.annotation.Retention;
import java.lang.annotation.RetentionPolicy;
import java.lang.annotation.Target;
import javax.validation.Constraint;
import javax.validation.Payload;
import javax.validation.ReportAsSingleViolation;
import javax.validation.constraints.NotNull;
import javax.validation.constraints.Size;

@Documented
@Constraint(validatedBy={})
@Target({java.lang.annotation.ElementType.METHOD, java.lang.annotation.ElementType.FIELD, java.lang.annotation.ElementType.ANNOTATION_TYPE, java.lang.annotation.ElementType.CONSTRUCTOR, java.lang.annotation.ElementType.PARAMETER})
@Retention(RetentionPolicy.RUNTIME)
@ReportAsSingleViolation
@NotNull
@Size(min=1)
public @interface NotEmpty
{
  String message() default "{org.hibernate.validator.constraints.NotEmpty.message}";
  
  Class<?>[] groups() default {};
  
  Class<? extends Payload>[] payload() default {};
}

/* Location:
 * Qualified Name:     org.hibernate.validator.constraints.NotEmpty
 * Java Class Version: 5 (49.0)
 * JD-Core Version:    0.7.1
 */
package org.hibernate.validator.constraints;

import java.lang.annotation.Annotation;
import java.lang.annotation.Documented;
import java.lang.annotation.Retention;
import java.lang.annotation.RetentionPolicy;
import java.lang.annotation.Target;
import javax.validation.Constraint;
import javax.validation.OverridesAttribute;
import javax.validation.Payload;
import javax.validation.ReportAsSingleViolation;
import javax.validation.constraints.Max;
import javax.validation.constraints.Min;

@Documented
@Constraint(validatedBy={})
@Target({java.lang.annotation.ElementType.METHOD, java.lang.annotation.ElementType.FIELD, java.lang.annotation.ElementType.ANNOTATION_TYPE, java.lang.annotation.ElementType.CONSTRUCTOR, java.lang.annotation.ElementType.PARAMETER})
@Retention(RetentionPolicy.RUNTIME)
@Min(0L)
@Max(Long.MAX_VALUE)
@ReportAsSingleViolation
public @interface Range
{
  @OverridesAttribute(constraint=Min.class, name="value")
  long min() default 0L;
  
  @OverridesAttribute(constraint=Max.class, name="value")
  long max() default Long.MAX_VALUE;
  
  String message() default "{org.hibernate.validator.constraints.Range.message}";
  
  Class<?>[] groups() default {};
  
  Class<? extends Payload>[] payload() default {};
}

/* Location:
 * Qualified Name:     org.hibernate.validator.constraints.Range
 * Java Class Version: 5 (49.0)
 * JD-Core Version:    0.7.1
 */
package org.hibernate.validator.engine;

import java.io.InputStream;
import java.util.List;
import java.util.Map;
import java.util.Map.Entry;
import java.util.Set;
import javax.validation.ConstraintValidatorFactory;
import javax.validation.MessageInterpolator;
import javax.validation.TraversableResolver;
import javax.validation.ValidationException;
import javax.validation.ValidationProviderResolver;
import javax.validation.ValidatorFactory;
import javax.validation.spi.BootstrapState;
import javax.validation.spi.ConfigurationState;
import javax.validation.spi.ValidationProvider;
import org.hibernate.validator.HibernateValidatorConfiguration;
import org.hibernate.validator.engine.resolver.DefaultTraversableResolver;
import org.hibernate.validator.util.LoggerFactory;
import org.hibernate.validator.util.Version;
import org.hibernate.validator.xml.ValidationBootstrapParameters;
import org.hibernate.validator.xml.ValidationXmlParser;
import org.slf4j.Logger;

public class ConfigurationImpl
  implements HibernateValidatorConfiguration, ConfigurationState
{
  static
  {
    Version.touch();
  }
  
  private static final Logger log = LoggerFactory.make();
  private final MessageInterpolator defaultMessageInterpolator = new ResourceBundleMessageInterpolator();
  private final TraversableResolver defaultTraversableResolver = new DefaultTraversableResolver();
  private final ConstraintValidatorFactory defaultConstraintValidatorFactory = new ConstraintValidatorFactoryImpl();
  private final ValidationProviderResolver providerResolver;
  private ValidationBootstrapParameters validationBootstrapParameters;
  private boolean ignoreXmlConfiguration = false;
  
  public ConfigurationImpl(BootstrapState state)
  {
    if (state.getValidationProviderResolver() == null) {
      providerResolver = state.getDefaultValidationProviderResolver();
    } else {
      providerResolver = state.getValidationProviderResolver();
    }
    validationBootstrapParameters = new ValidationBootstrapParameters();
  }
  
  public ConfigurationImpl(ValidationProvider provider)
  {
    if (provider == null) {
      throw new ValidationException("Assertion error: inconsistent ConfigurationImpl construction");
    }
    providerResolver = null;
    validationBootstrapParameters = new ValidationBootstrapParameters();
    validationBootstrapParameters.provider = provider;
  }
  
  public HibernateValidatorConfiguration ignoreXmlConfiguration()
  {
    ignoreXmlConfiguration = true;
    return this;
  }
  
  public ConfigurationImpl messageInterpolator(MessageInterpolator interpolator)
  {
    validationBootstrapParameters.messageInterpolator = interpolator;
    return this;
  }
  
  public ConfigurationImpl traversableResolver(TraversableResolver resolver)
  {
    validationBootstrapParameters.traversableResolver = resolver;
    return this;
  }
  
  public ConfigurationImpl constraintValidatorFactory(ConstraintValidatorFactory constraintValidatorFactory)
  {
    validationBootstrapParameters.constraintValidatorFactory = constraintValidatorFactory;
    return this;
  }
  
  public HibernateValidatorConfiguration addMapping(InputStream stream)
  {
    validationBootstrapParameters.mappings.add(stream);
    return this;
  }
  
  public HibernateValidatorConfiguration addProperty(String name, String value)
  {
    if (value != null) {
      validationBootstrapParameters.configProperties.put(name, value);
    }
    return this;
  }
  
  public ValidatorFactory buildValidatorFactory()
  {
    parseValidationXml();
    ValidatorFactory factory = null;
    if (isSpecificProvider())
    {
      factory = validationBootstrapParameters.provider.buildValidatorFactory(this);
    }
    else
    {
      Class<? extends ValidationProvider<?>> providerClass = validationBootstrapParameters.providerClass;
      if (providerClass != null)
      {
        for (ValidationProvider provider : providerResolver.getValidationProviders()) {
          if (providerClass.isAssignableFrom(provider.getClass()))
          {
            factory = provider.buildValidatorFactory(this);
            break;
          }
        }
        if (factory == null) {
          throw new ValidationException("Unable to find provider: " + providerClass);
        }
      }
      else
      {
        List<ValidationProvider<?>> providers = providerResolver.getValidationProviders();
        assert (providers.size() != 0);
        factory = ((ValidationProvider)providers.get(0)).buildValidatorFactory(this);
      }
    }
    validationBootstrapParameters = new ValidationBootstrapParameters();
    return factory;
  }
  
  public boolean isIgnoreXmlConfiguration()
  {
    return ignoreXmlConfiguration;
  }
  
  public MessageInterpolator getMessageInterpolator()
  {
    return validationBootstrapParameters.messageInterpolator;
  }
  
  public Set<InputStream> getMappingStreams()
  {
    return validationBootstrapParameters.mappings;
  }
  
  public ConstraintValidatorFactory getConstraintValidatorFactory()
  {
    return validationBootstrapParameters.constraintValidatorFactory;
  }
  
  public TraversableResolver getTraversableResolver()
  {
    return validationBootstrapParameters.traversableResolver;
  }
  
  public Map<String, String> getProperties()
  {
    return validationBootstrapParameters.configProperties;
  }
  
  public MessageInterpolator getDefaultMessageInterpolator()
  {
    return defaultMessageInterpolator;
  }
  
  public TraversableResolver getDefaultTraversableResolver()
  {
    return defaultTraversableResolver;
  }
  
  public ConstraintValidatorFactory getDefaultConstraintValidatorFactory()
  {
    return defaultConstraintValidatorFactory;
  }
  
  private boolean isSpecificProvider()
  {
    return validationBootstrapParameters.provider != null;
  }
  
  private void parseValidationXml()
  {
    if (ignoreXmlConfiguration)
    {
      log.info("Ignoring XML configuration.");
      if (validationBootstrapParameters.messageInterpolator == null) {
        validationBootstrapParameters.messageInterpolator = defaultMessageInterpolator;
      }
      if (validationBootstrapParameters.traversableResolver == null) {
        validationBootstrapParameters.traversableResolver = defaultTraversableResolver;
      }
      if (validationBootstrapParameters.constraintValidatorFactory == null) {
        validationBootstrapParameters.constraintValidatorFactory = defaultConstraintValidatorFactory;
      }
    }
    else
    {
      ValidationBootstrapParameters xmlParameters = new ValidationXmlParser().parseValidationXml();
      applyXmlSettings(xmlParameters);
    }
  }
  
  private void applyXmlSettings(ValidationBootstrapParameters xmlParameters)
  {
    validationBootstrapParameters.providerClass = providerClass;
    if (validationBootstrapParameters.messageInterpolator == null) {
      if (messageInterpolator != null) {
        validationBootstrapParameters.messageInterpolator = messageInterpolator;
      } else {
        validationBootstrapParameters.messageInterpolator = defaultMessageInterpolator;
      }
    }
    if (validationBootstrapParameters.traversableResolver == null) {
      if (traversableResolver != null) {
        validationBootstrapParameters.traversableResolver = traversableResolver;
      } else {
        validationBootstrapParameters.traversableResolver = defaultTraversableResolver;
      }
    }
    if (validationBootstrapParameters.constraintValidatorFactory == null) {
      if (constraintValidatorFactory != null) {
        validationBootstrapParameters.constraintValidatorFactory = constraintValidatorFactory;
      } else {
        validationBootstrapParameters.constraintValidatorFactory = defaultConstraintValidatorFactory;
      }
    }
    validationBootstrapParameters.mappings.addAll(mappings);
    for (Map.Entry<String, String> entry : configProperties.entrySet()) {
      if (validationBootstrapParameters.configProperties.get(entry.getKey()) == null) {
        validationBootstrapParameters.configProperties.put(entry.getKey(), entry.getValue());
      }
    }
  }
}

/* Location:
 * Qualified Name:     org.hibernate.validator.engine.ConfigurationImpl
 * Java Class Version: 5 (49.0)
 * JD-Core Version:    0.7.1
 */
package org.hibernate.validator.engine;

class ConstraintTree$1 {}

/* Location:
 * Qualified Name:     org.hibernate.validator.engine.ConstraintTree.1
 * Java Class Version: 5 (49.0)
 * JD-Core Version:    0.7.1
 */
package org.hibernate.validator.engine;

import javax.validation.ConstraintValidator;
import javax.validation.ConstraintValidatorFactory;

class ConstraintTree$ValidatorCacheKey
{
  private ConstraintValidatorFactory constraintValidatorFactory;
  private Class<? extends ConstraintValidator<?, ?>> validatorType;
  
  private ConstraintTree$ValidatorCacheKey(ConstraintValidatorFactory constraintValidatorFactory, Class<? extends ConstraintValidator<?, ?>> validatorType)
  {
    this.constraintValidatorFactory = constraintValidatorFactory;
    this.validatorType = validatorType;
  }
  
  public boolean equals(Object o)
  {
    if (this == o) {
      return true;
    }
    if ((o == null) || (getClass() != o.getClass())) {
      return false;
    }
    ValidatorCacheKey that = (ValidatorCacheKey)o;
    if (constraintValidatorFactory != null ? !constraintValidatorFactory.equals(constraintValidatorFactory) : constraintValidatorFactory != null) {
      return false;
    }
    if (validatorType != null ? !validatorType.equals(validatorType) : validatorType != null) {
      return false;
    }
    return true;
  }
  
  public int hashCode()
  {
    int result = constraintValidatorFactory != null ? constraintValidatorFactory.hashCode() : 0;
    result = 31 * result + (validatorType != null ? validatorType.hashCode() : 0);
    return result;
  }
}

/* Location:
 * Qualified Name:     org.hibernate.validator.engine.ConstraintTree.ValidatorCacheKey
 * Java Class Version: 5 (49.0)
 * JD-Core Version:    0.7.1
 */
package org.hibernate.validator.engine;

import java.lang.annotation.Annotation;
import java.lang.reflect.Type;
import java.util.ArrayList;
import java.util.HashSet;
import java.util.List;
import java.util.Map;
import java.util.Set;
import java.util.concurrent.ConcurrentHashMap;
import javax.validation.ConstraintValidator;
imp
1 2 3 4 5 6 7 8 9 10 11

Further reading...

For more information on Java 1.5 Tiger, you may find Java 1.5 Tiger, A developer's Notebook by D. Flanagan and B. McLaughlin from O'Reilly of interest.

New!JAR listings


Copyright 2006-2019. Infinite Loop Ltd