1 17 package org.apache.ws.jaxme.xs.impl; 18 19 import org.apache.ws.jaxme.xs.XSAtomicType; 20 import org.apache.ws.jaxme.xs.XSListType; 21 import org.apache.ws.jaxme.xs.XSType; 22 import org.apache.ws.jaxme.xs.xml.XsELength; 23 import org.apache.ws.jaxme.xs.xml.XsEMaxLength; 24 import org.apache.ws.jaxme.xs.xml.XsEMinLength; 25 import org.apache.ws.jaxme.xs.xml.XsGSimpleRestrictionModel; 26 import org.xml.sax.SAXException ; 27 28 31 public class XSListTypeRestrictionImpl extends XSSimpleTypeRestrictionImpl implements XSListType { 32 private final XSListType listBaseType; 33 34 public XSListTypeRestrictionImpl(XSType pParent, 35 XSType pRestrictedType, XsGSimpleRestrictionModel pRestriction) 36 throws SAXException { 37 super(pParent, pRestrictedType, pRestriction); 38 listBaseType = pRestrictedType.getSimpleType().getListType(); 39 } 40 41 public boolean isList() { return true; } 42 43 public XSListType getListType() { 44 return this; 45 } 46 47 public XSType getItemType() { 48 return listBaseType.getItemType(); 49 } 50 51 public Long getLength() { 52 XsELength length = getRestriction().getLength(); 53 if (length == null) { 54 return listBaseType.getLength(); 55 } else { 56 return new Long (length.getValue()); 57 } 58 } 59 60 public Long getMinLength() { 61 XsEMinLength length = getRestriction().getMinLength(); 62 if (length == null) { 63 return listBaseType.getMinLength(); 64 } else { 65 return new Long (length.getValue()); 66 } 67 } 68 69 public Long getMaxLength() { 70 XsEMaxLength length = getRestriction().getMaxLength(); 71 if (length == null) { 72 return listBaseType.getMaxLength(); 73 } else { 74 return new Long (length.getValue()); 75 } 76 } 77 } 78 | Popular Tags |