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.xml; 18 19 20 /** <p>Interface of <code>xs:union</code>, following the 21 * specification below: 22 * <pre> 23 * <xs:element name="union" id="union"> 24 * <xs:complexType> 25 * <xs:annotation> 26 * <xs:documentation 27 * source="http://www.w3.org/TR/xmlschema-2/#element-union"> 28 * memberTypes attribute must be non-empty or there must be 29 * at least one simpleType child 30 * </xs:documentation> 31 * </xs:annotation> 32 * <xs:complexContent> 33 * <xs:extension base="xs:annotated"> 34 * <xs:sequence> 35 * <xs:element name="simpleType" type="xs:localSimpleType" 36 * minOccurs="0" maxOccurs="unbounded"/> 37 * </xs:sequence> 38 * <xs:attribute name="memberTypes" use="optional"> 39 * <xs:simpleType> 40 * <xs:list itemType="xs:QName"/> 41 * </xs:simpleType> 42 * </xs:attribute> 43 * </xs:extension> 44 * </xs:complexContent> 45 * </xs:complexType> 46 * </xs:element> 47 * </pre></p> 48 * 49 * @author <a HREF="mailto:joe@ispsoft.de">Jochen Wiedmann</a> 50 */ 51 public interface XsEUnion extends XsTAnnotated { 52 /** <p>Creates a new, local simple type as a member type of the union.</p> 53 */ 54 public XsTLocalSimpleType createSimpleType(); 55 56 /** <p>Returns an array of member types which have been 57 * created using {@link #createSimpleType()}.</p> 58 */ 59 public XsTLocalSimpleType[] getSimpleTypes(); 60 61 /** <p>Sets the qualified names of simple types being used as member 62 * types of the union.</p> 63 */ 64 public void setMemberTypes(XsQName[] pTypes); 65 66 /** <p>Returns an array of member types which have been added 67 * using {@link #setMemberTypes(XsQName[])}. This array may be null, 68 * if the method {@link #setMemberTypes(XsQName[])} wasn't invoked 69 * at all, or it may be the empty array, if an empty string was 70 * passed as argument to the method.</p> 71 */ 72 public XsQName[] getMemberTypes(); 73 } 74