Docjar: A Java Source and Docuemnt Enginecom.*    java.*    javax.*    org.*    all    new    plug-in

Quick Search    Search Deep

Source code: org/apache/axis/description/ElementDesc.java


1   /*
2    * Copyright 2002-2004 The Apache Software Foundation.
3    * 
4    * Licensed under the Apache License, Version 2.0 (the "License");
5    * you may not use this file except in compliance with the License.
6    * You may obtain a copy of the License at
7    * 
8    *      http://www.apache.org/licenses/LICENSE-2.0
9    * 
10   * Unless required by applicable law or agreed to in writing, software
11   * distributed under the License is distributed on an "AS IS" BASIS,
12   * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13   * See the License for the specific language governing permissions and
14   * limitations under the License.
15   */
16  package org.apache.axis.description;
17  
18  import javax.xml.namespace.QName;
19  import java.io.Serializable;
20  
21  /**
22   * An AttributeDesc is a FieldDesc for an Java field mapping to an
23   * XML element
24   *
25   * @author Glen Daniels (gdaniels@apache.org)
26   * @author Dominik Kacprzak (dominik@opentoolbox.com)
27   */
28  public class ElementDesc extends FieldDesc implements Serializable {
29      /** The minOccurs value from the schema */
30      private int minOccurs = 1;
31      /** The maxOccurs value from the schema */
32      private int maxOccurs = 1;
33      /** The nillable value from the schema.
34       * By default, element cannot be nillable. */
35      private boolean nillable = false;
36  
37      /** maxOccurs="unbounded" */
38      private boolean unbounded = false;
39  
40      /** If this is an array, this holds the array type */
41      private QName arrayType;
42      /** If this is a "wrapped" array, this tells us the inner QName */
43      private QName itemQName;
44  
45      public ElementDesc() {
46          super(true);
47      }
48  
49      public boolean isMinOccursZero() {
50          return minOccurs == 0;
51      }
52  
53      public int getMinOccurs() {
54          return minOccurs;
55      }
56  
57      public void setMinOccurs(int minOccurs) {
58          this.minOccurs = minOccurs;
59      }
60  
61      public int getMaxOccurs() {
62          return maxOccurs;
63      }
64  
65      public void setMaxOccurs(int maxOccurs) {
66          this.maxOccurs = maxOccurs;
67      }
68  
69      public void setMaxOccursUnbounded(boolean ubnd) {
70          this.unbounded = ubnd;
71      }
72  
73      public boolean isMaxOccursUnbounded() {
74          return unbounded;
75      }
76  
77      /**
78       * Returns value of nillable property.
79       *
80       * @return
81       */
82      public boolean isNillable() {
83          return nillable;
84      }
85  
86      /**
87       * Sets value of nillable property.  Default: <code>false</code>.
88       *
89       * @param nillable
90       */
91      public void setNillable(boolean nillable) {
92          this.nillable = nillable;
93      }
94  
95      public QName getArrayType() {
96          return arrayType;
97      }
98  
99      public void setArrayType(QName arrayType) {
100         this.arrayType = arrayType;
101     }
102 
103     public QName getItemQName() {
104         return itemQName;
105     }
106 
107     public void setItemQName(QName itemQName) {
108         this.itemQName = itemQName;
109     }
110 }