01: /**
02: *
03: * Licensed to the Apache Software Foundation (ASF) under one or more
04: * contributor license agreements. See the NOTICE file distributed with
05: * this work for additional information regarding copyright ownership.
06: * The ASF licenses this file to You under the Apache License, Version 2.0
07: * (the "License"); you may not use this file except in compliance with
08: * the License. You may obtain a copy of the License at
09: *
10: * http://www.apache.org/licenses/LICENSE-2.0
11: *
12: * Unless required by applicable law or agreed to in writing, software
13: * distributed under the License is distributed on an "AS IS" BASIS,
14: * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
15: * See the License for the specific language governing permissions and
16: * limitations under the License.
17: */package org.apache.openejb.jee;
18:
19: import javax.xml.bind.annotation.XmlAccessType;
20: import javax.xml.bind.annotation.XmlAccessorType;
21: import javax.xml.bind.annotation.XmlAttribute;
22: import javax.xml.bind.annotation.XmlElement;
23: import javax.xml.bind.annotation.XmlID;
24: import javax.xml.bind.annotation.XmlType;
25: import javax.xml.bind.annotation.adapters.CollapsedStringAdapter;
26: import javax.xml.bind.annotation.adapters.XmlJavaTypeAdapter;
27: import java.util.ArrayList;
28: import java.util.List;
29:
30: /**
31: * The cmr-fieldType describes the bean provider's view of
32: * a relationship. It consists of an optional description, and
33: * the name and the class type of a field in the source of a
34: * role of a relationship. The cmr-field-name element
35: * corresponds to the name used for the get and set accessor
36: * methods for the relationship. The cmr-field-type element is
37: * used only for collection-valued cmr-fields. It specifies the
38: * type of the collection that is used.
39: */
40: @XmlAccessorType(XmlAccessType.FIELD)
41: @XmlType(name="cmr-fieldType",propOrder={"description","cmrFieldName","cmrFieldType"})
42: public class CmrField {
43:
44: @XmlElement(required=true)
45: protected List<Text> description;
46: @XmlElement(name="cmr-field-name",required=true)
47: protected String cmrFieldName;
48: @XmlElement(name="cmr-field-type")
49: protected CmrFieldType cmrFieldType;
50: @XmlAttribute
51: @XmlJavaTypeAdapter(CollapsedStringAdapter.class)
52: @XmlID
53: protected String id;
54:
55: public CmrField() {
56: }
57:
58: public CmrField(String cmrFieldName, CmrFieldType cmrFieldType) {
59: this .cmrFieldName = cmrFieldName;
60: this .cmrFieldType = cmrFieldType;
61: }
62:
63: public List<Text> getDescription() {
64: if (description == null) {
65: description = new ArrayList<Text>();
66: }
67: return this .description;
68: }
69:
70: public String getCmrFieldName() {
71: return cmrFieldName;
72: }
73:
74: public void setCmrFieldName(String value) {
75: this .cmrFieldName = value;
76: }
77:
78: public CmrFieldType getCmrFieldType() {
79: return cmrFieldType;
80: }
81:
82: public void setCmrFieldType(CmrFieldType value) {
83: this .cmrFieldType = value;
84: }
85:
86: public String getId() {
87: return id;
88: }
89:
90: public void setId(String value) {
91: this.id = value;
92: }
93:
94: }
|