KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > apache > ws > jaxme > xs > jaxb > impl > JAXBPropertyImpl


1 /*
2  * Copyright 2003, 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  */

17 package org.apache.ws.jaxme.xs.jaxb.impl;
18
19 import org.apache.ws.jaxme.xs.jaxb.JAXBJavaType;
20 import org.apache.ws.jaxme.xs.jaxb.JAXBJavadoc;
21 import org.apache.ws.jaxme.xs.jaxb.JAXBProperty;
22 import org.apache.ws.jaxme.xs.jaxb.JAXBXsObjectFactory;
23 import org.apache.ws.jaxme.xs.xml.XsObject;
24
25
26 /** <p>Implementation of the Property interface.</p>
27  *
28  * @author <a HREF="mailto:joe@ispsoft.de">Jochen Wiedmann</a>
29  * @version $Id: JAXBPropertyImpl.java,v 1.2 2004/02/16 23:39:56 jochen Exp $
30  */

31 public class JAXBPropertyImpl extends JAXBXsObjectImpl implements JAXBProperty {
32   public static class BaseTypeImpl extends JAXBXsObjectImpl implements JAXBProperty.BaseType {
33     /** <p>Creates a new instance of JAXBPropertyImpl.</p>
34      */

35     protected BaseTypeImpl(XsObject pParent) {
36       super(pParent);
37     }
38
39     private JAXBJavaType javaType;
40
41     public JAXBJavaType createJavaType() {
42       if (javaType != null) {
43         throw new IllegalStateException JavaDoc("Only one instance of javaType supported.");
44       }
45       javaType = ((JAXBXsObjectFactory) getObjectFactory()).newJAXBJavaType(this);
46       return javaType;
47     }
48
49     public JAXBJavaType getJavaType() {
50       return javaType;
51     }
52   }
53
54   private String JavaDoc name;
55   private String JavaDoc collectionType;
56   private Boolean JavaDoc fixedAttributeAsConstantProperty, generateIsSetMethod, enableFailFastCheck;
57   private JAXBJavadoc javadoc;
58   private BaseType baseType;
59
60   /** <p>Creates a new instance of JAXBPropertyImpl.</p>
61    */

62   protected JAXBPropertyImpl(XsObject pParent) {
63     super(pParent);
64   }
65
66   public void setName(String JavaDoc pName) {
67     name = pName;
68   }
69
70   public String JavaDoc getName() {
71     return name;
72   }
73
74   public void setCollectionType(String JavaDoc pType) throws ClassNotFoundException JavaDoc {
75     collectionType = pType;
76   }
77
78   public String JavaDoc getCollectionType() { return collectionType; }
79
80   public void setFixedAttributeAsConstantProperty(Boolean JavaDoc pFixedAttributeAsConstantProperty) {
81     fixedAttributeAsConstantProperty = pFixedAttributeAsConstantProperty;
82   }
83
84   public Boolean JavaDoc isFixedAttributeAsConstantProperty() {
85     return fixedAttributeAsConstantProperty;
86   }
87
88   public void setGenerateIsSetMethod(Boolean JavaDoc pGenerateIsSetMethod) {
89     generateIsSetMethod = pGenerateIsSetMethod;
90   }
91
92   public Boolean JavaDoc isGenerateIsSetMethod() {
93     return generateIsSetMethod;
94   }
95
96   public void setEnableFailFastCheck(Boolean JavaDoc pEnableFailFastCheck) {
97     enableFailFastCheck = pEnableFailFastCheck;
98   }
99
100   public Boolean JavaDoc isEnableFailFastCheck() {
101     return enableFailFastCheck;
102   }
103
104   public JAXBJavadoc createJavadoc() {
105     if (javadoc != null) {
106       throw new IllegalStateException JavaDoc("Multiple javadoc elements are not supported.");
107     }
108     javadoc = getJAXBXsObjectFactory().newJAXBJavadoc(this);
109     return javadoc;
110   }
111
112   public JAXBJavadoc getJavadoc() {
113     return javadoc;
114   }
115
116   public BaseType createBaseType() {
117     if (baseType != null) {
118       throw new IllegalStateException JavaDoc("Multiple instances of baseType are not supported.");
119     }
120     baseType = ((JAXBXsObjectFactory) getObjectFactory()).newBaseType(this);
121     return baseType;
122   }
123
124   public BaseType getBaseType() {
125     return baseType;
126   }
127 }
128
Popular Tags