1 17 package org.apache.ws.jaxme.xs.xml.impl; 18 19 import org.apache.ws.jaxme.xs.xml.*; 20 import org.xml.sax.SAXException ; 21 22 23 56 public class XsTAllImpl extends XsTAnnotatedImpl implements XsTAll { 57 private final XsAGOccurs occurs; 58 private final XsGParticle particle; 59 60 protected XsTAllImpl(XsObject pParent) { 61 super(pParent); 62 occurs = getObjectFactory().newXsAGOccurs(this); 63 particle = getObjectFactory().newXsGParticle(this); 64 } 65 66 public void setName(XsNCName pName) { 67 throw new IllegalStateException ("Use of the 'name' attribute is prohibited in xs:explicitGroup"); 68 } 69 70 public XsNCName getName() { 71 throw new IllegalStateException ("Use of the 'name' attribute is prohibited in xs:explicitGroup"); 72 } 73 74 public void setRef(XsQName pRef) { 75 throw new IllegalStateException ("Use of the 'name' attribute is prohibited in xs:explicitGroup"); 76 } 77 78 public void setRef(String pRef) throws SAXException { 79 throw new IllegalStateException ("Use of the 'name' attribute is prohibited in xs:explicitGroup"); 80 } 81 82 public XsQName getRef() { 83 throw new IllegalStateException ("Use of the 'name' attribute is prohibited in xs:explicitGroup"); 84 } 85 86 public void setMaxOccurs(String pMaxOccurs) { 87 try { 88 if (Integer.parseInt(pMaxOccurs) != 1) { 89 throw new IllegalArgumentException (); 90 } 91 } catch (Exception e) { 92 throw new IllegalArgumentException ("Invalid value of the 'maxOccurs' attribute: " + pMaxOccurs + "; must be 1"); 93 } 94 } 95 96 public int getMaxOccurs() { 97 return 1; 98 } 99 100 public void setMinOccurs(int pMinOccurs) { 101 occurs.setMinOccurs(pMinOccurs); 102 } 103 104 public int getMinOccurs() { 105 return occurs.getMinOccurs(); 106 } 107 108 public XsTLocalElement createElement() { 109 return particle.createElement(); 110 } 111 112 public XsTGroupRef createGroup() { 113 return particle.createGroup(); 114 } 115 116 public XsTAll createAll() { 117 return particle.createAll(); 118 } 119 120 public XsESequence createSequence() { 121 return particle.createSequence(); 122 } 123 124 public XsEChoice createChoice() { 125 return particle.createChoice(); 126 } 127 128 public XsEAny createAny() { 129 return particle.createAny(); 130 } 131 132 public XsTParticle[] getParticles() { 133 return particle.getParticles(); 134 } 135 136 public void validate() throws SAXException { 137 super.validate(); 138 } 139 } 140 | Popular Tags |