01: /**
02: * Licensed to the Apache Software Foundation (ASF) under one or more
03: * contributor license agreements. See the NOTICE file distributed with
04: * this work for additional information regarding copyright ownership.
05: * The ASF licenses this file to You under the Apache License, Version 2.0
06: * (the "License"); you may not use this file except in compliance with
07: * the License. You may obtain a copy of the License at
08: *
09: * http://www.apache.org/licenses/LICENSE-2.0
10: *
11: * Unless required by applicable law or agreed to in writing, software
12: * distributed under the License is distributed on an "AS IS" BASIS,
13: * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14: * See the License for the specific language governing permissions and
15: * limitations under the License.
16: */package org.apache.openejb.jee.sun;
17:
18: import javax.xml.bind.annotation.XmlAccessType;
19: import javax.xml.bind.annotation.XmlAccessorType;
20: import javax.xml.bind.annotation.XmlAttribute;
21: import javax.xml.bind.annotation.XmlElement;
22: import javax.xml.bind.annotation.XmlType;
23: import javax.xml.bind.annotation.adapters.CollapsedStringAdapter;
24: import javax.xml.bind.annotation.adapters.NormalizedStringAdapter;
25: import javax.xml.bind.annotation.adapters.XmlJavaTypeAdapter;
26: import java.util.ArrayList;
27: import java.util.List;
28:
29: @XmlAccessorType(XmlAccessType.FIELD)
30: @XmlType(name="",propOrder={"constraintFieldValue"})
31: public class ConstraintField {
32: @XmlAttribute(required=true)
33: @XmlJavaTypeAdapter(NormalizedStringAdapter.class)
34: protected String name;
35: @XmlAttribute
36: @XmlJavaTypeAdapter(CollapsedStringAdapter.class)
37: protected String scope;
38: @XmlAttribute(name="cache-on-match")
39: @XmlJavaTypeAdapter(CollapsedStringAdapter.class)
40: protected String cacheOnMatch;
41: @XmlAttribute(name="cache-on-match-failure")
42: @XmlJavaTypeAdapter(CollapsedStringAdapter.class)
43: protected String cacheOnMatchFailure;
44: @XmlElement(name="constraint-field-value")
45: protected List<ConstraintFieldValue> constraintFieldValue;
46:
47: public String getName() {
48: return name;
49: }
50:
51: public void setName(String value) {
52: this .name = value;
53: }
54:
55: public String getScope() {
56: if (scope == null) {
57: return "request.parameter";
58: } else {
59: return scope;
60: }
61: }
62:
63: public void setScope(String value) {
64: this .scope = value;
65: }
66:
67: public String getCacheOnMatch() {
68: if (cacheOnMatch == null) {
69: return "true";
70: } else {
71: return cacheOnMatch;
72: }
73: }
74:
75: public void setCacheOnMatch(String value) {
76: this .cacheOnMatch = value;
77: }
78:
79: public String getCacheOnMatchFailure() {
80: if (cacheOnMatchFailure == null) {
81: return "false";
82: } else {
83: return cacheOnMatchFailure;
84: }
85: }
86:
87: public void setCacheOnMatchFailure(String value) {
88: this .cacheOnMatchFailure = value;
89: }
90:
91: public List<ConstraintFieldValue> getConstraintFieldValue() {
92: if (constraintFieldValue == null) {
93: constraintFieldValue = new ArrayList<ConstraintFieldValue>();
94: }
95: return this.constraintFieldValue;
96: }
97: }
|