KickJava   Java API By Example, From Geeks To Geeks.

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


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.generator.Generator;
20 import org.apache.ws.jaxme.xs.XSAny;
21 import org.apache.ws.jaxme.xs.XSElement;
22 import org.apache.ws.jaxme.xs.XSEnumeration;
23 import org.apache.ws.jaxme.xs.XSGroup;
24 import org.apache.ws.jaxme.xs.XSObjectFactory;
25 import org.apache.ws.jaxme.xs.XSParser;
26 import org.apache.ws.jaxme.xs.XSSchema;
27 import org.apache.ws.jaxme.xs.XSType;
28 import org.apache.ws.jaxme.xs.xml.XsObjectFactory;
29 import org.apache.ws.jaxme.xs.xml.XsQName;
30 import org.apache.ws.jaxme.generator.sg.Context;
31 import org.apache.ws.jaxme.generator.sg.Facet;
32 import org.apache.ws.jaxme.generator.sg.GroupSG;
33 import org.apache.ws.jaxme.generator.sg.ObjectSG;
34 import org.apache.ws.jaxme.generator.sg.SchemaSG;
35 import org.apache.ws.jaxme.generator.sg.TypeSG;
36 import org.xml.sax.SAXException JavaDoc;
37
38
39 /** <p>Interface of a factory for SG classes.</p>
40  *
41  * @author <a HREF="mailto:joe@ispsoft.de">Jochen Wiedmann</a>
42  */

43 public interface SGFactory {
44   /** <p>Returns the {@link org.apache.ws.jaxme.generator.Generator}.</p>
45    */

46   public Generator getGenerator();
47
48   /** <p>Initializes the {@link SGFactory}.</p>
49    */

50   public void init();
51
52   /** <p>Creates a new instance of {@link org.apache.ws.jaxme.xs.xml.XsObjectFactory},
53    * used by the parser.</p>
54    */

55   public XsObjectFactory newXsObjectFactory() throws SAXException JavaDoc;
56
57   /** <p>Creates a new instance of {@link org.apache.ws.jaxme.xs.XSObjectFactory},
58    * used by the parser.</p>
59    */

60   public XSObjectFactory newXSObjectFactory() throws SAXException JavaDoc;
61
62   /** <p>Creates a new instance of {@link SchemaSG} generating the
63    * given schema.</p>
64    */

65   public Object JavaDoc newSchemaSG(XSSchema pSchema) throws SAXException JavaDoc;
66   /** <p>Returns an instance of {@link SchemaSG} generating the
67    * given schema.</p>
68    */

69   public SchemaSG getSchemaSG(XSSchema pSchema) throws SAXException JavaDoc;
70   /** <p>Returns the factorys instance of {@link SchemaSG}.</p>
71    * @throws IllegalStateException The factory has not yet created an
72    * instance of SchemaSG. In other words, the methods
73    * {@link #newSchemaSG(XSSchema)} and {@link #getSchemaSG(XSSchema)}
74    * have not yet been invoked.
75    */

76   public SchemaSG getSchemaSG();
77
78   /** <p>Creates a new instance of {@link ObjectSG} generating the
79    * given element.</p>
80    */

81   public Object JavaDoc newObjectSG(XSElement pElement) throws SAXException JavaDoc;
82
83   /** <p>Returns an instance of {@link ObjectSG} generating the
84    * given element.</p>
85    */

86   public ObjectSG getObjectSG(XSElement pElement) throws SAXException JavaDoc;
87
88   /** <p>Creates a new instance of {@link ObjectSG} generating the
89    * given element in the given context.</p>
90    */

91   public Object JavaDoc newObjectSG(XSElement pElement, Context pContext) throws SAXException JavaDoc;
92
93   /** <p>Returns an instance of {@link ObjectSG} generating the given
94    * element in the given context.</p>
95    */

96   public ObjectSG getObjectSG(XSElement pElement, Context pContext) throws SAXException JavaDoc;
97
98   /** <p>Creates a new instance of {@link ObjectSG} generating the given
99    * wildcard in the given context.</p>
100    */

101   public Object JavaDoc newObjectSG(XSAny any);
102
103   /** <p>Returns an instance of {@link ObjectSG} generating the given
104    * wildcard in the given context.</p>
105    */

106   public ObjectSG getObjectSG(XSAny pWildcard, Context pContext) throws SAXException JavaDoc;
107
108   /** <p>Creates a new instance of {@link GroupSG} generating the
109    * given schema.</p>
110    */

111   public GroupSG newGroupSG(XSGroup pGroup) throws SAXException JavaDoc;
112
113   /** <p>Returns an instance of {@link GroupSG} generating the
114    * given schema.</p>
115    */

116   public GroupSG getGroupSG(XSGroup pGroup) throws SAXException JavaDoc;
117
118   /** <p>Creates a new instance of {@link GroupSG}, which is embedded
119    * into the given {@link Context}.</p>
120    */

121   public GroupSG newGroupSG(XSGroup pGroup, Context pClassContext) throws SAXException JavaDoc;
122
123   /** <p>Returns an instance of {@link GroupSG}, which is embedded
124    * into the given {@link Context}.</p>
125    */

126   public GroupSG getGroupSG(XSGroup pGroup, Context pClassContext) throws SAXException JavaDoc;
127
128   /** <p>Creates a new, global instance of
129    * {@link org.apache.ws.jaxme.generator.sg.TypeSGChain}
130    * generating the given type.</p>
131    * <p><em>Implementation note</em>: The type
132    * {@link org.apache.ws.jaxme.generator.sg.TypeSGChain}
133    * must not be exposed in the interface, because the interface
134    * class is used to generate this type. In other words, this
135    * interface must be compilable without the
136    * {@link org.apache.ws.jaxme.generator.sg.TypeSGChain}
137    * interface.</p>
138    */

139   public Object JavaDoc newTypeSG(XSType pType) throws SAXException JavaDoc;
140
141   /** <p>Returns a global instance of {@link TypeSG} generating
142    * the given type.</p>
143    */

144   public TypeSG getTypeSG(XSType pType) throws SAXException JavaDoc;
145
146   /** <p>Creates a new, local instance of
147    * {@link org.apache.ws.jaxme.generator.sg.TypeSGChain},
148    * generating the given type within the given {@link Context}.
149    * <p><em>Implementation note</em>: The type
150    * {@link org.apache.ws.jaxme.generator.sg.TypeSGChain}
151    * must not be exposed in the interface, because the interface
152    * class is used to generate this type. In other words, this
153    * interface must be compilable without the
154    * {@link org.apache.ws.jaxme.generator.sg.TypeSGChain}
155    * interface.</p>
156    */

157   public Object JavaDoc newTypeSG(XSType pType, Context pClassContext, XsQName pName) throws SAXException JavaDoc;
158
159   /** <p>Returns a local instance of {@link TypeSG} generating
160    * the given type within the given {@link Context}.</p>
161    */

162   public TypeSG getTypeSG(XSType pType, Context pClassContext, XsQName pName) throws SAXException JavaDoc;
163
164   /** <p>Creates a new, local instance of
165    * {@link org.apache.ws.jaxme.generator.sg.TypeSGChain},
166    * as if it were a global type with the given name.</p>
167    * <p><em>Implementation note</em>: The type
168    * {@link org.apache.ws.jaxme.generator.sg.TypeSGChain}
169    * must not be exposed in the interface, because the interface
170    * class is used to generate this type. In other words, this
171    * interface must be compilable without the
172    * {@link org.apache.ws.jaxme.generator.sg.TypeSGChain}
173    * interface.</p>
174    */

175   public Object JavaDoc newTypeSG(XSType pType, XsQName pName) throws SAXException JavaDoc;
176
177   /** <p>Returns a new instance of {@link TypeSG} generating
178    * the given type, as if it were a global type with the
179    * given name.</p>
180    */

181   public TypeSG getTypeSG(XSType pType, XsQName pName) throws SAXException JavaDoc;
182
183   /** <p>Creates a new instance of {@link XSParser}.</p>
184    */

185   public XSParser newXSParser() throws SAXException JavaDoc;
186
187   /** <p>Creates a new enumeration facet.</p>
188    */

189   public Facet newFacet(XSType pType, XSEnumeration[] pEnumerations) throws SAXException JavaDoc;
190
191   /** <p>Returns an array of all groups created by the factory.</p>
192    */

193   public GroupSG[] getGroups();
194
195   /** <p>Returns an array of all types created by the factory.</p>
196    */

197   public TypeSG[] getTypes();
198
199   /** <p>Returns an array of all objects created by the factory.</p>
200    */

201   public ObjectSG[] getObjects();
202 }
203
Popular Tags