|  1 |     | 
     | 
  |  2 |     | 
     | 
  |  3 |     | 
     | 
  |  4 |     | 
     | 
  |  5 |     | 
     | 
  |  6 |     | 
     | 
  |  7 |     | 
     | 
  |  8 |     | 
     | 
  |  9 |     | 
     | 
  |  10 |     | 
     | 
  |  11 |     | 
     | 
  |  12 |     | 
     | 
  |  13 |     | 
     | 
  |  14 |     | 
     | 
  |  15 |     | 
     | 
  |  16 |     | 
   package org.kuali.rice.core.api.criteria;  | 
  |  17 |     | 
     | 
  |  18 |     | 
   import java.util.ArrayList;  | 
  |  19 |     | 
   import java.util.List;  | 
  |  20 |     | 
     | 
  |  21 |     | 
   import javax.xml.bind.annotation.XmlAccessType;  | 
  |  22 |     | 
   import javax.xml.bind.annotation.XmlAccessorType;  | 
  |  23 |     | 
   import javax.xml.bind.annotation.XmlAttribute;  | 
  |  24 |     | 
   import javax.xml.bind.annotation.XmlElement;  | 
  |  25 |     | 
   import javax.xml.bind.annotation.XmlElements;  | 
  |  26 |     | 
   import javax.xml.bind.annotation.XmlRootElement;  | 
  |  27 |     | 
   import javax.xml.bind.annotation.XmlType;  | 
  |  28 |     | 
     | 
  |  29 |     | 
   import org.apache.commons.lang.StringUtils;  | 
  |  30 |     | 
     | 
  |  31 |     | 
     | 
  |  32 |     | 
     | 
  |  33 |     | 
     | 
  |  34 |     | 
     | 
  |  35 |     | 
     | 
  |  36 |     | 
     | 
  |  37 |     | 
     | 
  |  38 |     | 
     | 
  |  39 |     | 
     | 
  |  40 |     | 
     | 
  |  41 |     | 
     | 
  |  42 |     | 
     | 
  |  43 |    0 |    @XmlRootElement(name = InExpression.Constants.ROOT_ELEMENT_NAME)  | 
  |  44 |     | 
   @XmlAccessorType(XmlAccessType.NONE)  | 
  |  45 |     | 
   @XmlType(name = InExpression.Constants.TYPE_NAME)  | 
  |  46 |     | 
   public final class InExpression extends AbstractExpression implements MultiValuedExpression { | 
  |  47 |     | 
             | 
  |  48 |     | 
           private static final long serialVersionUID = -1888858317314153374L;  | 
  |  49 |     | 
     | 
  |  50 |     | 
           @XmlAttribute(name = CriteriaSupportUtils.PropertyConstants.PROPERTY_PATH)  | 
  |  51 |     | 
           private final String propertyPath;  | 
  |  52 |     | 
           @XmlElements(value = { | 
  |  53 |     | 
               @XmlElement(name = CriteriaStringValue.Constants.ROOT_ELEMENT_NAME, type = CriteriaStringValue.class, required = true),  | 
  |  54 |     | 
               @XmlElement(name = CriteriaDateTimeValue.Constants.ROOT_ELEMENT_NAME, type = CriteriaDateTimeValue.class, required = true),  | 
  |  55 |     | 
               @XmlElement(name = CriteriaIntegerValue.Constants.ROOT_ELEMENT_NAME, type = CriteriaIntegerValue.class, required = true),  | 
  |  56 |     | 
               @XmlElement(name = CriteriaDecimalValue.Constants.ROOT_ELEMENT_NAME, type = CriteriaDecimalValue.class, required = true)  | 
  |  57 |     | 
           })  | 
  |  58 |     | 
           private final List<? extends CriteriaValue<?>> values;  | 
  |  59 |     | 
             | 
  |  60 |     | 
             | 
  |  61 |     | 
     | 
  |  62 |     | 
     | 
  |  63 |     | 
       @SuppressWarnings("unused") | 
  |  64 |    0 |        private InExpression() { | 
  |  65 |    0 |            this.propertyPath = null;  | 
  |  66 |    0 |            this.values = null;  | 
  |  67 |    0 |        }  | 
  |  68 |     | 
         | 
  |  69 |     | 
         | 
  |  70 |     | 
     | 
  |  71 |     | 
     | 
  |  72 |     | 
     | 
  |  73 |     | 
     | 
  |  74 |     | 
     | 
  |  75 |     | 
     | 
  |  76 |     | 
     | 
  |  77 |     | 
     | 
  |  78 |     | 
     | 
  |  79 |    0 |        InExpression(String propertyPath, List<? extends CriteriaValue<?>> values) { | 
  |  80 |    0 |                if (StringUtils.isBlank(propertyPath)) { | 
  |  81 |    0 |                            throw new IllegalArgumentException("Property path cannot be null or blank."); | 
  |  82 |     | 
                   }  | 
  |  83 |    0 |                CriteriaSupportUtils.validateValuesForMultiValuedExpression(values);  | 
  |  84 |    0 |                    this.propertyPath = propertyPath;  | 
  |  85 |    0 |                    this.values = values;  | 
  |  86 |    0 |        }  | 
  |  87 |     | 
         | 
  |  88 |     | 
       @Override  | 
  |  89 |     | 
       public String getPropertyPath() { | 
  |  90 |    0 |                return propertyPath;  | 
  |  91 |     | 
       }  | 
  |  92 |     | 
         | 
  |  93 |     | 
       @Override  | 
  |  94 |     | 
       public List<CriteriaValue<?>> getValues() { | 
  |  95 |    0 |                return new ArrayList<CriteriaValue<?>>(values);  | 
  |  96 |     | 
       }  | 
  |  97 |     | 
             | 
  |  98 |     | 
             | 
  |  99 |     | 
     | 
  |  100 |     | 
     | 
  |  101 |    0 |        static class Constants { | 
  |  102 |     | 
           final static String ROOT_ELEMENT_NAME = "in";  | 
  |  103 |     | 
           final static String TYPE_NAME = "InType";  | 
  |  104 |     | 
       }  | 
  |  105 |     | 
         | 
  |  106 |     | 
   }  |