1 | |
|
2 | |
|
3 | |
|
4 | |
|
5 | |
|
6 | |
|
7 | |
|
8 | |
package org.kuali.rice.core.api.criteria; |
9 | |
|
10 | |
import java.util.ArrayList; |
11 | |
import java.util.Collections; |
12 | |
import java.util.List; |
13 | |
|
14 | |
import javax.xml.bind.annotation.XmlAccessType; |
15 | |
import javax.xml.bind.annotation.XmlAccessorType; |
16 | |
import javax.xml.bind.annotation.XmlElement; |
17 | |
import javax.xml.bind.annotation.XmlElements; |
18 | |
import javax.xml.bind.annotation.XmlType; |
19 | |
|
20 | |
|
21 | |
|
22 | |
|
23 | |
|
24 | |
|
25 | |
|
26 | |
|
27 | |
|
28 | |
|
29 | |
@XmlAccessorType(XmlAccessType.NONE) |
30 | |
@XmlType(name = AbstractCompositeExpression.Constants.TYPE_NAME) |
31 | |
abstract class AbstractCompositeExpression extends AbstractExpression implements CompositeExpression { |
32 | |
|
33 | |
private static final long serialVersionUID = 6164560054223588779L; |
34 | |
|
35 | |
|
36 | |
|
37 | |
|
38 | |
|
39 | |
|
40 | |
|
41 | |
@XmlElements(value = { |
42 | |
@XmlElement(name = AndExpression.Constants.ROOT_ELEMENT_NAME, type = AndExpression.class, required = true), |
43 | |
@XmlElement(name = OrExpression.Constants.ROOT_ELEMENT_NAME, type = OrExpression.class, required = true), |
44 | |
@XmlElement(name = EqualExpression.Constants.ROOT_ELEMENT_NAME, type = EqualExpression.class, required = true), |
45 | |
@XmlElement(name = NotEqualExpression.Constants.ROOT_ELEMENT_NAME, type = NotEqualExpression.class, required = true), |
46 | |
@XmlElement(name = LikeExpression.Constants.ROOT_ELEMENT_NAME, type = LikeExpression.class, required = true), |
47 | |
@XmlElement(name = InExpression.Constants.ROOT_ELEMENT_NAME, type = InExpression.class, required = true), |
48 | |
@XmlElement(name = NotInExpression.Constants.ROOT_ELEMENT_NAME, type = NotInExpression.class, required = true), |
49 | |
@XmlElement(name = GreaterThanExpression.Constants.ROOT_ELEMENT_NAME, type = GreaterThanExpression.class, required = true), |
50 | |
@XmlElement(name = GreaterThanOrEqualExpression.Constants.ROOT_ELEMENT_NAME, type = GreaterThanOrEqualExpression.class, required = true), |
51 | |
@XmlElement(name = LessThanExpression.Constants.ROOT_ELEMENT_NAME, type = LessThanExpression.class, required = true), |
52 | |
@XmlElement(name = LessThanOrEqualExpression.Constants.ROOT_ELEMENT_NAME, type = LessThanOrEqualExpression.class, required = true), |
53 | |
@XmlElement(name = NullExpression.Constants.ROOT_ELEMENT_NAME, type = NullExpression.class, required = true), |
54 | |
@XmlElement(name = NotNullExpression.Constants.ROOT_ELEMENT_NAME, type = NotNullExpression.class, required = true) |
55 | |
}) |
56 | |
private final List<Expression> expressions; |
57 | |
|
58 | |
|
59 | |
|
60 | |
|
61 | |
|
62 | 20 | AbstractCompositeExpression() { |
63 | 20 | this.expressions = null; |
64 | 20 | } |
65 | |
|
66 | |
|
67 | |
|
68 | |
|
69 | |
|
70 | |
|
71 | |
|
72 | |
|
73 | 30 | AbstractCompositeExpression(final List<Expression> expressions) { |
74 | 30 | if (expressions == null) { |
75 | 4 | this.expressions = new ArrayList<Expression>(); |
76 | |
} else { |
77 | 26 | this.expressions = new ArrayList<Expression>(expressions); |
78 | |
} |
79 | 30 | } |
80 | |
|
81 | |
@Override |
82 | |
public List<Expression> getExpressions() { |
83 | 23 | return Collections.unmodifiableList(expressions); |
84 | |
} |
85 | |
|
86 | |
|
87 | |
|
88 | |
|
89 | 0 | static class Constants { |
90 | |
final static String TYPE_NAME = "CompositeExpressionType"; |
91 | |
} |
92 | |
|
93 | |
} |