1 17 package org.apache.ws.jaxme.xs.xml.impl; 18 19 import org.apache.ws.jaxme.xs.xml.*; 20 21 22 58 public class XsTNamedGroupImpl extends XsTAnnotatedImpl implements XsTNamedGroup { 59 private XsGAllModel all; 60 private XsTSimpleExplicitGroup sequence, choice; 61 private XsNCName name; 62 63 protected XsTNamedGroupImpl(XsObject pParent) { 64 super(pParent); 65 } 66 67 public void setName(XsNCName pName) { 68 name = pName; 69 } 70 71 public XsNCName getName() { 72 return name; 73 } 74 75 public XsGAllModel createAll() { 76 if (all != null) { 77 throw new IllegalStateException ("Multiple 'all' child elements are forbidden."); 78 } 79 if (choice != null) { 80 throw new IllegalStateException ("The 'choice' and 'all' child elements are mutually exclusive."); 81 } 82 if (sequence != null) { 83 throw new IllegalStateException ("The 'sequence' and 'all' child elements are mutually exclusive."); 84 } 85 return all = getObjectFactory().newXsGAllModel(this); 86 } 87 88 public XsGAllModel getAll() { 89 return all; 90 } 91 92 public XsTSimpleExplicitGroup createSequence() { 93 if (sequence != null) { 94 throw new IllegalStateException ("Multiple 'sequence' child elements are forbidden."); 95 } 96 if (all != null) { 97 throw new IllegalStateException ("The 'all' and 'sequence' child elements are mutually exclusive."); 98 } 99 if (choice != null) { 100 throw new IllegalStateException ("The 'all' and 'sequence' child elements are mutually exclusive."); 101 } 102 return sequence = getObjectFactory().newXsTSimpleExplicitGroup(this); 103 } 104 105 public XsTSimpleExplicitGroup getSequence() { 106 return sequence; 107 } 108 109 public XsTSimpleExplicitGroup createChoice() { 110 if (choice != null) { 111 throw new IllegalStateException ("Multiple 'choice' elements are forbidden."); 112 } 113 if (sequence != null) { 114 throw new IllegalStateException ("The 'sequence' and 'choice' elements are mutually exclusive."); 115 } 116 if (all != null) { 117 throw new IllegalStateException ("The 'all' and 'choice' elements are mutually exclusive."); 118 } 119 return choice = getObjectFactory().newXsTSimpleExplicitGroup(this); 120 } 121 122 public XsTSimpleExplicitGroup getChoice() { 123 return choice; 124 } 125 126 public void validate() { 127 XsGAllModel myAll = getAll(); 128 if (myAll == null) { 129 XsTSimpleExplicitGroup mySequence = getSequence(); 130 if (mySequence == null) { 131 XsTSimpleExplicitGroup myChoice = getChoice(); 132 if (myChoice == null) { 133 throw new NullPointerException ("Neither of the 'all', 'choice', or 'sequence' elements are given."); 134 } else { 135 } 136 } else { 137 } 138 } else { 139 } 140 } 141 } 142 | Popular Tags |