1 19 20 package org.netbeans.modules.xml.wsdl.model.extensions.xsd.impl; 21 22 import java.util.List ; 23 import javax.xml.XMLConstants ; 24 import javax.xml.namespace.QName ; 25 import org.netbeans.modules.xml.schema.model.SchemaModel; 26 import org.netbeans.modules.xml.schema.model.SchemaModelFactory; 27 import org.netbeans.modules.xml.wsdl.model.WSDLComponent; 28 import org.netbeans.modules.xml.wsdl.model.WSDLModel; 29 import org.netbeans.modules.xml.wsdl.model.extensions.xsd.WSDLSchema; 30 import org.netbeans.modules.xml.wsdl.model.spi.GenericExtensibilityElement; 31 import org.netbeans.modules.xml.wsdl.model.visitor.WSDLVisitor; 32 import org.netbeans.modules.xml.xam.dom.DocumentModel; 33 import org.w3c.dom.Element ; 34 35 39 public class WSDLSchemaImpl extends GenericExtensibilityElement implements WSDLSchema { 40 public static final QName XSD_QNAME = new QName (XMLConstants.W3C_XML_SCHEMA_NS_URI, "schema", "xsd"); 41 42 private WSDLModel model; 43 private SchemaModel schemaModel; 44 45 public WSDLSchemaImpl(WSDLModel model, Element e) { 46 super(model, e); 47 this.model = model; 48 } 49 50 public WSDLSchemaImpl(WSDLModel model){ 51 this(model, createPrefixedElement(XSD_QNAME, model)); 52 } 53 54 public void accept(WSDLVisitor visitor) { 55 visitor.visit(this); 56 } 57 58 public SchemaModel getSchemaModel() { 59 if(schemaModel == null){ 60 schemaModel = SchemaModelFactory.getDefault().createEmbeddedSchemaModel(model, getPeer()); 61 schemaModel.getSchema().setForeignParent(getModel().getDefinitions().getTypes()); 62 } 63 return schemaModel; 64 } 65 66 public DocumentModel getEmbeddedModel() { 67 return getSchemaModel(); 68 } 69 70 protected void populateChildren(List <WSDLComponent> children) { 71 } 73 74 } 75 | Popular Tags |