KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > apache > ws > jaxme > generator > sg > PropertySG


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.generator.sg;
18
19 import org.apache.ws.jaxme.js.DirectAccessible;
20 import org.apache.ws.jaxme.js.JavaField;
21 import org.apache.ws.jaxme.js.JavaMethod;
22 import org.apache.ws.jaxme.js.JavaQName;
23 import org.apache.ws.jaxme.js.JavaSource;
24 import org.apache.ws.jaxme.js.TypedValue;
25 import org.apache.ws.jaxme.generator.sg.SGlet;
26 import org.xml.sax.SAXException JavaDoc;
27
28 /**
29  * @author <a HREF="mailto:joe@ispsoft.de">Jochen Wiedmann</a>
30  */

31 public interface PropertySG {
32   /** <p>Initializes the <code>PropertySG</code>.</p>
33    */

34   public void init() throws SAXException JavaDoc;
35
36   /** <p>Returns whether the property has an "is set" method.</p>
37    */

38   public boolean hasIsSetMethod();
39
40   /** <p>Returns the properties collection type.</p>
41    */

42   public String JavaDoc getCollectionType();
43
44   /** <p>Returns the objects field name. By default, this is the
45    * property name with the prefix '_'.</p>
46    */

47   public String JavaDoc getXMLFieldName() throws SAXException JavaDoc;
48
49   /** <p>Returns the objects property name.</p>
50    */

51   public String JavaDoc getPropertyName() throws SAXException JavaDoc;
52
53   /** <p>Returns the objects getter name.</p>
54    */

55   public String JavaDoc getXMLGetMethodName() throws SAXException JavaDoc;
56
57   /** <p>Returns the objects setter name.</p>
58    */

59   public String JavaDoc getXMLSetMethodName() throws SAXException JavaDoc;
60
61   /** <p>Returns the name of the objects "isSet" method.</p>
62    */

63   public String JavaDoc getXMLIsSetMethodName() throws SAXException JavaDoc;
64
65   /** <p>Creates the Java field holding the objects property value.</p>
66    */

67   public JavaField getXMLField(JavaSource pSource) throws SAXException JavaDoc;
68
69   /** <p>Creates the getter returning the property value.</p>
70    */

71   public JavaMethod getXMLGetMethod(JavaSource pSource) throws SAXException JavaDoc;
72
73   /** <p>Creates the setter returning the property value.</p>
74    */

75   public JavaMethod getXMLSetMethod(JavaSource pSource) throws SAXException JavaDoc;
76
77   /** <p>Creates the isSet returning whether the property value is set or not.</p>
78    */

79   public JavaMethod getXMLIsSetMethod(JavaSource pSource) throws SAXException JavaDoc;
80
81   /** <p>Returns a piece of Java code with the property value.</p>
82    * @param pElement The element on which the value is being set or null for "this".
83    */

84   public Object JavaDoc getValue(DirectAccessible pElement) throws SAXException JavaDoc;
85
86   /** <p>Creates a piece of Java code setting the elements property value.
87    * In the case of an element with multiplicity > 1, the object must be
88    * a list or an array.</p>
89    *
90    * @param pMethod The method being generated.
91    * @param pElement The element on which the value is being set or null for "this".
92    * @param pType The values type, if a cast is required, or null, if the value
93    * is already casted.
94    */

95   public void setValue(JavaMethod pMethod, DirectAccessible pElement, Object JavaDoc pValue, JavaQName pType)
96     throws SAXException JavaDoc;
97
98   /** <p>Creates a piece of Java code adding an element value. In the case
99    * of an element with multiplicity > 1, the object must be the atomic
100    * value.</p>
101    * @param pElement The element on which the value is being set or null for "this".
102    * @param pType The values type, if a cast is required, or null, if the value
103    * is already casted.
104    */

105   public void addValue(JavaMethod pMethod, DirectAccessible pElement, TypedValue pValue, JavaQName pType)
106     throws SAXException JavaDoc;
107
108   /** <p>Invokes the given {@link org.apache.ws.jaxme.generator.sg.SGlet}
109    * for any value.</p>
110    * @param pElement The element on which the value is being set or null for "this".
111    */

112   public void forAllValues(JavaMethod pMethod, DirectAccessible pElement, SGlet pSGlet) throws SAXException JavaDoc;
113
114   /** <p>Invokes the given {@link org.apache.ws.jaxme.generator.sg.SGlet}
115    * for any non null value.</p>
116    * @param pElement The element on which the value is being set or null for "this".
117    */

118   public void forAllNonNullValues(JavaMethod pMethod, DirectAccessible pElement, SGlet pSGlet) throws SAXException JavaDoc;
119
120   /** <p>Generates the property setters and getters.</p>
121    */

122   public void generate(JavaSource pSource) throws SAXException JavaDoc;
123 }
124
Popular Tags