1 17 package org.apache.ws.jaxme.xs.jaxb.impl; 18 19 import org.apache.ws.jaxme.xs.XSObject; 20 import org.apache.ws.jaxme.xs.impl.XSGroupImpl; 21 import org.apache.ws.jaxme.xs.impl.XSUtil; 22 import org.apache.ws.jaxme.xs.jaxb.JAXBClass; 23 import org.apache.ws.jaxme.xs.jaxb.JAXBGroup; 24 import org.apache.ws.jaxme.xs.jaxb.JAXBSchemaBindings; 25 import org.apache.ws.jaxme.xs.jaxb.JAXBXsSchema; 26 import org.apache.ws.jaxme.xs.parser.impl.LocSAXException; 27 import org.apache.ws.jaxme.xs.xml.XsEChoice; 28 import org.apache.ws.jaxme.xs.xml.XsESequence; 29 import org.apache.ws.jaxme.xs.xml.XsTAll; 30 import org.apache.ws.jaxme.xs.xml.XsTGroupRef; 31 import org.apache.ws.jaxme.xs.xml.XsTNamedGroup; 32 import org.xml.sax.SAXException ; 33 34 35 38 public class JAXBGroupImpl extends XSGroupImpl implements JAXBGroup { 39 private JAXBClass jaxbClass; 40 41 43 protected JAXBGroupImpl(XSObject pParent, XsTGroupRef pBaseGroup) 44 throws SAXException { 45 super(pParent, pBaseGroup); 46 } 47 48 50 protected JAXBGroupImpl(XSObject pParent, XsTNamedGroup pBaseGroup) 51 throws SAXException { 52 super(pParent, pBaseGroup); 53 } 54 55 57 protected JAXBGroupImpl(XSObject pParent, XsEChoice pChoice) 58 throws SAXException { 59 super(pParent, pChoice); 60 } 61 62 64 protected JAXBGroupImpl(XSObject pParent, XsESequence pSequence) 65 throws SAXException { 66 super(pParent, pSequence); 67 } 68 69 71 public JAXBGroupImpl(XSObject pParent, XsTAll pAll) 72 throws SAXException { 73 super(pParent, pAll); 74 } 75 76 public JAXBSchemaBindings getJAXBSchemaBindings() { 77 return ((JAXBXsSchema) getXsObject().getXsESchema()).getJAXBSchemaBindings(); 78 } 79 80 public JAXBClass getJAXBClass() { 81 return jaxbClass; 82 } 83 84 public void validate() throws SAXException { 85 if (isValidated()) { 86 return; 87 } 88 super.validate(); 89 jaxbClass = (JAXBClass) XSUtil.getSingleAppinfo(getAnnotations(), JAXBClass.class); 90 91 if (!isGlobal() && jaxbClass != null && jaxbClass.getImplClass() != null) { 92 throw new LocSAXException("The implClass attribute is valid for global groups only.", 93 jaxbClass.getLocator()); 94 } 95 } 96 } 97 | Popular Tags |