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 package org.apache.ws.jaxme.generator.sg; 17 18 import org.apache.ws.jaxme.js.JavaSource; 19 import org.apache.ws.jaxme.xs.XSParticle; 20 import org.apache.ws.jaxme.xs.xml.XsQName; 21 import org.apache.ws.jaxme.generator.sg.Context; 22 import org.apache.ws.jaxme.generator.sg.ParticleSG; 23 import org.apache.ws.jaxme.generator.sg.SGItem; 24 import org.xml.sax.SAXException; 25 26 27 /** <p>Interface of a source generator for model groups.</p> 28 */ 29 public interface GroupSG extends SGItem { 30 /** <p>Returns whether the group is global.</p> 31 */ 32 public boolean isGlobal(); 33 34 /** If the group is global: Returns the groups name. 35 * @throws IllegalStateException The group isn't global. 36 * @see #isGlobal() 37 */ 38 public XsQName getName(); 39 40 /** <p>Returns whether the groups compositor is "all".</p> 41 */ 42 public boolean isAll(); 43 44 /** <p>Returns whether the groups compositor is "choice".</p> 45 */ 46 public boolean isChoice(); 47 48 /** <p>Returns whether the groups compositor is "sequence".</p> 49 */ 50 public boolean isSequence(); 51 52 /** <p>Returns the groups {@link Context}.</p> 53 */ 54 public Context getClassContext() throws SAXException; 55 56 /** <p>Returns the groups particles.</p> 57 */ 58 public ParticleSG[] getParticles() throws SAXException; 59 60 /** <p>Creates a new instance of 61 * {@link org.apache.ws.jaxme.generator.sg.ParticleSGChain} generating the 62 * given particle.</p> 63 * <p><em>Implementation note</em>: The type 64 * {@link org.apache.ws.jaxme.generator.sg.ParticleSGChain} 65 * must not be exposed in the interface, because the interface 66 * class is used to generate this type. In other words, this 67 * interface must be compilable without the 68 * {@link org.apache.ws.jaxme.generator.sg.ParticleSGChain} 69 * interface.</p> 70 */ 71 public Object newParticleSG(XSParticle pParticle) throws SAXException; 72 } 73