KickJava   Java API By Example, From Geeks To Geeks.

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


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.JavaQName;
20 import org.apache.ws.jaxme.js.JavaSource;
21 import org.apache.ws.jaxme.xs.XSAttribute;
22 import org.apache.ws.jaxme.xs.XSWildcard;
23 import org.apache.ws.jaxme.generator.sg.AttributeSG;
24 import org.apache.ws.jaxme.generator.sg.Context;
25 import org.apache.ws.jaxme.generator.sg.ComplexContentSG;
26 import org.apache.ws.jaxme.generator.sg.SimpleContentSG;
27 import org.apache.ws.jaxme.generator.sg.TypeSG;
28 import org.xml.sax.Locator JavaDoc;
29 import org.xml.sax.SAXException JavaDoc;
30
31
32 /** <p>Interface of a source generator for complex types.</p>
33  *
34  * @author <a HREF="mailto:joe@ispsoft.de">Jochen Wiedmann</a>
35  */

36 public interface ComplexTypeSG {
37   /** <p>Initializes the instance.</p>
38    */

39   public void init() throws SAXException JavaDoc;
40
41   /** <p>Returns the {@link TypeSG} that created this instance.</p>
42    */

43   public TypeSG getTypeSG();
44
45   /** <p>Returns the types {@link Locator}.</p>
46    */

47   public Locator JavaDoc getLocator();
48
49   /** <p>Returns the datatypes runtime type, which is the binding
50    * interface.</p>
51    */

52   public Context getClassContext();
53
54   /** <p>Generates the types interface as a standalone class.
55    * This is used for global types.</p>
56    */

57   public JavaSource getXMLInterface() throws SAXException JavaDoc;
58
59   /** <p>Generates the types interface as an inner class of the given.</p>
60    */

61   public JavaSource getXMLInterface(JavaSource pSource) throws SAXException JavaDoc;
62
63   /** <p>Generates the types implementation as a standalone class.
64    * This is used for global types.</p>
65    */

66   public JavaSource getXMLImplementation() throws SAXException JavaDoc;
67
68   /** <p>Generates the types implementation as an inner class of the given.</p>
69    */

70   public JavaSource getXMLImplementation(JavaSource pSource) throws SAXException JavaDoc;
71
72   /** <p>Generates the types XML serializer as a standalone class.
73    * This is used for global types.</p>
74    */

75   public JavaSource getXMLSerializer() throws SAXException JavaDoc;
76
77   /** <p>Generates the types XML serializer as an inner class of the given.
78    * This is used for local types.</p>
79    */

80   public JavaSource getXMLSerializer(JavaSource pSource) throws SAXException JavaDoc;
81
82   /** <p>Generates the types XML handler as a standalone class.
83    * This is used for global types.</p>
84    */

85   public JavaSource getXMLHandler(JavaQName pQName) throws SAXException JavaDoc;
86
87   /** <p>Generates the types XML handler as an inner class of the given.
88    * This is used for local types.</p>
89    */

90   public JavaSource getXMLHandler(JavaSource pSource) throws SAXException JavaDoc;
91
92   /** <p>Returns whether the data type has attributes.</p>
93    */

94   public boolean hasAttributes();
95
96   /** <p>Creates a new instance of
97    * {@link org.apache.ws.jaxme.generator.sg.AttributeSGChain}
98    * generating the given attribute.</p>
99    */

100   public Object JavaDoc newAttributeSG(XSAttribute pAttribute) throws SAXException JavaDoc;
101
102   /** <p>Creates a new instance of
103    * {@link org.apache.ws.jaxme.generator.sg.AttributeSGChain}
104    * generating the given wildcard attributes.</p>
105    */

106   public Object JavaDoc newAttributeSG(XSWildcard pWildcard) throws SAXException JavaDoc;
107
108   /** <p>Adds the given {@link AttributeSG} to the list of attributes
109    * and invokes the method {@link org.apache.ws.jaxme.generator.sg.SGItem#init()}
110    * on it.</p>
111    */

112   public void addAttributeSG(AttributeSG pAttribute) throws SAXException JavaDoc;
113
114   /** <p>Returns the data types array of attributes.</p>
115    */

116   public AttributeSG[] getAttributes();
117
118   /** <p>Returns whether the data type has simple content.</p>
119    */

120   public boolean hasSimpleContent();
121
122   /** <p>If the complex type has simple content: Creates an instance of
123    * {@link org.apache.ws.jaxme.generator.sg.SimpleContentSGChain} generating the type.</p>
124    * <p><em>Implementation note</em>: The type
125    * {@link org.apache.ws.jaxme.generator.sg.SimpleContentSGChain}
126    * must not be exposed in the interface, because the interface
127    * class is used to generate this type. In other words, this
128    * interface must be compilable without the
129    * {@link org.apache.ws.jaxme.generator.sg.SimpleContentSGChain}
130    * interface.</p>
131    */

132   public Object JavaDoc newSimpleContentTypeSG() throws SAXException JavaDoc;
133
134   /** <p>If the data type has simple content: Returns an instance of
135    * {@link SimpleContentSG}. Uses {@link #newSimpleContentTypeSG()}
136    * internally.</p>
137    */

138   public SimpleContentSG getSimpleContentSG();
139
140   /** <p>If the complex type has complex content: Creates an instance of
141    * {@link org.apache.ws.jaxme.generator.sg.ComplexContentSGChain} generating the given complex type.</p>
142    * <p><em>Implementation note</em>: The type
143    * {@link org.apache.ws.jaxme.generator.sg.ComplexContentSGChain}
144    * must not be exposed in the interface, because the interface
145    * class is used to generate this type. In other words, this
146    * interface must be compilable without the
147    * {@link org.apache.ws.jaxme.generator.sg.ComplexContentSGChain}
148    * interface.</p>
149    */

150   public Object JavaDoc newComplexContentTypeSG() throws SAXException JavaDoc;
151
152   /** <p>If the data type has complex content: Returns an instance of
153    * {@link ComplexContentSG}. Uses {@link #newComplexContentTypeSG()}
154    * internally.</p>
155    */

156   public ComplexContentSG getComplexContentSG();
157 }
158
Popular Tags