1 17 package org.apache.ws.jaxme.xs.xml.impl; 18 19 import java.util.ArrayList ; 20 import java.util.List ; 21 22 import org.apache.ws.jaxme.xs.parser.impl.LocSAXException; 23 import org.apache.ws.jaxme.xs.xml.*; 24 import org.xml.sax.SAXException ; 25 26 27 51 public class XsERedefineImpl extends XsTAnnotatedImpl implements XsERedefine { 52 protected XsERedefineImpl(XsObject pParent) { 53 super(pParent); 54 } 55 56 private List childs; 57 private XsAnyURI schemaLocation; 58 59 public void setSchemaLocation(XsAnyURI pSchemaLocation) { 60 schemaLocation = pSchemaLocation; 61 } 62 63 public XsAnyURI getSchemaLocation() { 64 return schemaLocation; 65 } 66 67 public XsEAnnotation createAnnotation() { 68 XsEAnnotation annotation = getObjectFactory().newXsEAnnotation(this); 69 if (childs == null) { 70 childs = new ArrayList (); 71 } 72 childs.add(annotation); 73 return annotation; 74 } 75 76 public XsETopLevelSimpleType createSimpleType() { 77 XsETopLevelSimpleType simpleType = getObjectFactory().newXsETopLevelSimpleType(this); 78 if (childs == null) { 79 childs = new ArrayList (); 80 } 81 childs.add(simpleType); 82 return simpleType; 83 } 84 85 public XsTComplexType createComplexType() { 86 XsTComplexType complexType = getObjectFactory().newXsTComplexType(this); 87 if (childs == null) { 88 childs = new ArrayList (); 89 } 90 childs.add(complexType); 91 return complexType; 92 } 93 94 public XsTGroup createGroup() { 95 XsTGroup group = getObjectFactory().newXsTGroup(this); 96 if (childs == null) { 97 childs = new ArrayList (); 98 } 99 childs.add(group); 100 return group; 101 } 102 103 public XsTAttributeGroup createAttributeGroup() { 104 XsTAttributeGroup attributeGroup = getObjectFactory().newXsTAttributeGroup(this); 105 if (childs == null) { 106 childs = new ArrayList (); 107 } 108 childs.add(attributeGroup); 109 return attributeGroup; 110 } 111 112 public Object [] getChilds() { 113 if (childs == null) { 114 return new Object [0]; 115 } 116 return childs.toArray(); 117 } 118 119 public void validate() throws SAXException { 120 super.validate(); 121 if (getSchemaLocation() == null) { 122 throw new LocSAXException("Missing attribute: 'schemaLocation'", getLocator()); 123 } 124 } 125 } 126 | Popular Tags |