KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > netbeans > modules > xml > wsdlextui > template > SoapTemplateProvider


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-2007 Sun
17  * Microsystems, Inc. All Rights Reserved.
18  */

19
20 package org.netbeans.modules.xml.wsdlextui.template;
21
22 import java.io.InputStream JavaDoc;
23 import java.util.Collection JavaDoc;
24 import java.util.Iterator JavaDoc;
25 import java.util.List JavaDoc;
26 import org.netbeans.modules.xml.wsdl.model.Binding;
27 import org.netbeans.modules.xml.wsdl.model.BindingFault;
28 import org.netbeans.modules.xml.wsdl.model.BindingInput;
29 import org.netbeans.modules.xml.wsdl.model.BindingOperation;
30 import org.netbeans.modules.xml.wsdl.model.BindingOutput;
31 import org.netbeans.modules.xml.wsdl.model.ExtensibilityElement;
32 import org.netbeans.modules.xml.wsdl.model.Operation;
33 import org.netbeans.modules.xml.wsdl.model.Port;
34 import org.netbeans.modules.xml.wsdl.model.PortType;
35 import org.netbeans.modules.xml.wsdl.model.WSDLModel;
36 import org.netbeans.modules.xml.wsdl.model.extensions.soap.SOAPBinding;
37 import org.netbeans.modules.xml.wsdl.model.extensions.soap.SOAPBody;
38
39 import org.netbeans.modules.xml.wsdl.ui.spi.ExtensibilityElementTemplateProvider;
40 import org.netbeans.modules.xml.wsdl.ui.spi.ValidationInfo;
41 import org.netbeans.modules.xml.xam.Reference;
42 import org.openide.util.NbBundle;
43
44 public class SoapTemplateProvider extends ExtensibilityElementTemplateProvider {
45     
46     static final String JavaDoc soapTemplateUrl = "/org/netbeans/modules/xml/wsdlextui/template/template.xml";
47
48     
49     public InputStream JavaDoc getTemplateInputStream() {
50         return SoapTemplateProvider.class.getResourceAsStream(soapTemplateUrl);
51     }
52
53     
54     public String JavaDoc getLocalizedMessage(String JavaDoc str, Object JavaDoc[] objects) {
55         return NbBundle.getMessage(SoapTemplateProvider.class, str, objects);
56     }
57     
58     /**
59      * Do any post processing on Binding and its child elements based on
60      * the information available in corresponding PortType. This will be called
61      * when binding is about to be added to definition. Note this binding is not yet added to definition.
62      * @param wsdlTargetNamespace targetNamespace of wsdl where this binding will be added.
63      * @param binding Binding for portType
64      */

65     public void postProcess(String JavaDoc wsdlTargetNamespace, Binding binding) {
66         SoapBindingPostProcessor processor = new SoapBindingPostProcessor();
67         processor.postProcess(wsdlTargetNamespace, binding);
68     }
69     
70     public void postProcess(String JavaDoc wsdlTargetNamespace, Port port) {
71         SoapBindingPostProcessor processor = new SoapBindingPostProcessor();
72         processor.postProcess(wsdlTargetNamespace, port);
73     }
74     
75     /**
76      * validate Binding and its child elements based on
77      * the information available in corresponding PortType. This will be called
78      * when binding user goes from portType configuration wizard to binding
79      * configuration or when user changes subtype of binding in binding configuration.
80      * Note this binding is not yet added to definition.
81      * @param binding Binding for portType
82      */

83     public List JavaDoc<ValidationInfo> validate(Binding binding) {
84         SoapBindingValidator validator = new SoapBindingValidator();
85         return validator.validate(binding);
86     }
87
88     public List JavaDoc<ValidationInfo> validate(Port port) {
89         return null;
90     }
91     
92
93     
94     
95
96 }
97
Popular Tags