001: /*
002: * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS HEADER.
003: *
004: * Copyright 1997-2007 Sun Microsystems, Inc. All rights reserved.
005: *
006: * The contents of this file are subject to the terms of either the GNU
007: * General Public License Version 2 only ("GPL") or the Common
008: * Development and Distribution License("CDDL") (collectively, the
009: * "License"). You may not use this file except in compliance with the
010: * License. You can obtain a copy of the License at
011: * http://www.netbeans.org/cddl-gplv2.html
012: * or nbbuild/licenses/CDDL-GPL-2-CP. See the License for the
013: * specific language governing permissions and limitations under the
014: * License. When distributing the software, include this License Header
015: * Notice in each file and include the License file at
016: * nbbuild/licenses/CDDL-GPL-2-CP. Sun designates this
017: * particular file as subject to the "Classpath" exception as provided
018: * by Sun in the GPL Version 2 section of the License file that
019: * accompanied this code. If applicable, add the following below the
020: * License Header, with the fields enclosed by brackets [] replaced by
021: * your own identifying information:
022: * "Portions Copyrighted [year] [name of copyright owner]"
023: *
024: * Contributor(s):
025: *
026: * The Original Software is NetBeans. The Initial Developer of the Original
027: * Software is Sun Microsystems, Inc. Portions Copyright 1997-2007 Sun
028: * Microsystems, Inc. All Rights Reserved.
029: *
030: * If you wish your version of this file to be governed by only the CDDL
031: * or only the GPL Version 2, indicate your decision by adding
032: * "[Contributor] elects to include this software in this distribution
033: * under the [CDDL or GPL Version 2] license." If you do not indicate a
034: * single choice of license, a recipient has the option to distribute
035: * your version of this file under either the CDDL, the GPL Version 2 or
036: * to extend the choice of license to its licensees as provided above.
037: * However, if you add GPL Version 2 code and therefore, elected the GPL
038: * Version 2 license, then the option applies only if the new code is
039: * made subject to such option by the copyright holder.
040: */
041:
042: package org.netbeans.modules.xml.wsdl.bindingsupport.spi;
043:
044: import java.io.InputStream;
045: import java.util.Collections;
046: import java.util.List;
047: import org.netbeans.modules.xml.wsdl.model.Binding;
048: import org.netbeans.modules.xml.wsdl.model.Port;
049:
050: public abstract class ExtensibilityElementTemplateProvider {
051:
052: /**
053: * Get the template input stream.
054: *
055: * Create a input stream to the template xml document.
056: * Make sure that the xml is compliant to the templates.xsd
057: * defined in org.netbeans.modules.xml.wsdl.bindingsupport.template.xsd.templates.xsd
058: *
059: * @return the xml document inputstream
060: */
061: public abstract InputStream getTemplateInputStream();
062:
063: /**
064: * Get localized text for keys defined in the template xml document.
065: *
066: * @param key
067: * @param objects
068: * @return the localized message
069: */
070: public abstract String getLocalizedMessage(String key,
071: Object[] objects);
072:
073: /**
074: * Do any post processing on Binding and its child elements based on
075: * the information available in corresponding PortType. This will be called
076: * when binding is about to be added to definition. Note this binding is not yet added to definition.
077: * @param wsdlTargetNamespace targetNamespace of wsdl where this binding will be added.
078: * @param binding Binding for portType
079: */
080: public void postProcess(String wsdlTargetNamespace, Binding binding) {
081:
082: }
083:
084: /**
085: * Do any post processing on Service Port and its child elements based on
086: * the information available in corresponding Binding. This will be called
087: * when binding is about to be added to definition. Note this port is not yet added to Service.
088: * @param wsdlTargetNamespace targetNamespace of wsdl where this binding will be added.
089: * @param port port
090: */
091: public void postProcess(String wsdlTargetNamespace, Port port) {
092:
093: }
094:
095: /**
096: * validate Binding and its child elements based on
097: * the information available in corresponding PortType. This will be called
098: * when binding user goes from portType configuration wizard to binding
099: * configuration or when user changes subtype of binding in binding configuration.
100: * Note this binding is not yet added to definition.
101: * @param binding Binding for portType
102: * @return list of ValidationInfo
103: */
104: public List<ValidationInfo> validate(Binding binding) {
105: return Collections.EMPTY_LIST;
106: }
107:
108: /**
109: * validate Binding and its child elements based on
110: * the information available in corresponding PortType. This will be called
111: * when binding user goes from portType configuration wizard to binding
112: * configuration or when user changes subtype of binding in binding configuration.
113: * Note this port is not yet added to Service.
114: * @param port Port for a binding
115: * @return list of ValidationInfo
116: */
117: public List<ValidationInfo> validate(Port port) {
118: return Collections.EMPTY_LIST;
119: }
120:
121: }
|