KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > netbeans > modules > xml > wsdl > model > extensions > xsd > impl > WSDLSchemaImpl


1 /*
2  * The contents of this file are subject to the terms of the Common Development
3  * and Distribution License (the License). You may not use this file except in
4  * compliance with the License.
5  *
6  * You can obtain a copy of the License at http://www.netbeans.org/cddl.html
7  * or http://www.netbeans.org/cddl.txt.
8  *
9  * When distributing Covered Code, include this CDDL Header Notice in each file
10  * and include the License file at http://www.netbeans.org/cddl.txt.
11  * If applicable, add the following below the CDDL Header, with the fields
12  * enclosed by brackets [] replaced by your own identifying information:
13  * "Portions Copyrighted [year] [name of copyright owner]"
14  *
15  * The Original Software is NetBeans. The Initial Developer of the Original
16  * Software is Sun Microsystems, Inc. Portions Copyright 1997-2006 Sun
17  * Microsystems, Inc. All Rights Reserved.
18  */

19
20 package org.netbeans.modules.xml.wsdl.model.extensions.xsd.impl;
21
22 import java.util.List JavaDoc;
23 import javax.xml.XMLConstants JavaDoc;
24 import javax.xml.namespace.QName JavaDoc;
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 JavaDoc;
34
35 /**
36  *
37  * @author rico
38  */

39 public class WSDLSchemaImpl extends GenericExtensibilityElement implements WSDLSchema {
40     public static final QName JavaDoc XSD_QNAME = new QName JavaDoc(XMLConstants.W3C_XML_SCHEMA_NS_URI, "schema", "xsd");
41     
42     private WSDLModel model;
43     private SchemaModel schemaModel;
44     /** Creates a new instance of WSDLSchemaImpl */
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 JavaDoc<WSDLComponent> children) {
71         // just dummy node, make sure empty children
72
}
73     
74 }
75
Popular Tags