1 17 package org.apache.ws.jaxme.xs.xml.impl; 18 19 import org.apache.ws.jaxme.xs.xml.XsObject; 20 21 22 25 public class XsTLocalAllElementImpl extends XsTLocalElementImpl { 26 protected XsTLocalAllElementImpl(XsObject pParent) { 27 super(pParent); 28 } 29 30 public void setMaxOccurs(String pValue) { 31 boolean valid = !"unbounded".equals(pValue); 32 if (valid) { 33 try { 34 int i = Integer.parseInt(pValue); 35 valid = i == 0 || i == 1; 36 } catch (Exception e) { 37 valid = false; 38 } 39 } 40 if (!valid) { 41 throw new IllegalArgumentException ("Invalid value for 'maxOccurs': " + pValue + "; must be 0 or 1"); 42 } 43 super.setMaxOccurs(pValue); 44 } 45 public void setMinOccurs(int pValue) { 46 if (pValue != 0 && pValue != 1) { 47 throw new IllegalArgumentException ("Invalid value for 'minOccurs': " + pValue + "; must be 0 or 1"); 48 } 49 super.setMinOccurs(pValue); 50 } 51 } 52 | Popular Tags |