ohair@286: /* ohair@286: * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS HEADER. ohair@286: * ohair@286: * Copyright (c) 1997-2011 Oracle and/or its affiliates. All rights reserved. ohair@286: * ohair@286: * The contents of this file are subject to the terms of either the GNU ohair@286: * General Public License Version 2 only ("GPL") or the Common Development ohair@286: * and Distribution License("CDDL") (collectively, the "License"). You ohair@286: * may not use this file except in compliance with the License. You can ohair@286: * obtain a copy of the License at ohair@286: * https://glassfish.dev.java.net/public/CDDL+GPL_1_1.html ohair@286: * or packager/legal/LICENSE.txt. See the License for the specific ohair@286: * language governing permissions and limitations under the License. ohair@286: * ohair@286: * When distributing the software, include this License Header Notice in each ohair@286: * file and include the License file at packager/legal/LICENSE.txt. ohair@286: * ohair@286: * GPL Classpath Exception: ohair@286: * Oracle designates this particular file as subject to the "Classpath" ohair@286: * exception as provided by Oracle in the GPL Version 2 section of the License ohair@286: * file that accompanied this code. ohair@286: * ohair@286: * Modifications: ohair@286: * If applicable, add the following below the License Header, with the fields ohair@286: * enclosed by brackets [] replaced by your own identifying information: ohair@286: * "Portions Copyright [year] [name of copyright owner]" ohair@286: * ohair@286: * Contributor(s): ohair@286: * If you wish your version of this file to be governed by only the CDDL or ohair@286: * only the GPL Version 2, indicate your decision by adding "[Contributor] ohair@286: * elects to include this software in this distribution under the [CDDL or GPL ohair@286: * Version 2] license." If you don't indicate a single choice of license, a ohair@286: * recipient has the option to distribute your version of this file under ohair@286: * either the CDDL, the GPL Version 2 or to extend the choice of license to ohair@286: * its licensees as provided above. However, if you add GPL Version 2 code ohair@286: * and therefore, elected the GPL Version 2 license, then the option applies ohair@286: * only if the new code is made subject to such option by the copyright ohair@286: * holder. ohair@286: */ ohair@286: ohair@286: package com.sun.xml.internal.org.jvnet.ws; ohair@286: ohair@286: import java.lang.annotation.Retention; ohair@286: import java.lang.annotation.RetentionPolicy; ohair@286: ohair@286: import javax.xml.ws.http.HTTPBinding; ohair@286: import javax.xml.ws.soap.SOAPBinding; ohair@286: import javax.xml.ws.spi.WebServiceFeatureAnnotation; ohair@286: ohair@286: /** ohair@286: * The EnvelopeStyle annotation is used to specify the message envelope style(s) ohair@286: * for a web service endpoint implementation class. To smooth the migration from ohair@286: * the BindingType annotation to this EnvelopeStyle annotation, each of the ohair@286: * styles is mapped to a binding identifier defined in JAX-WS specification. ohair@286: * Though a binding identifier includes both the envelope style and transport, ohair@286: * an envelope style defined herein does NOT imply or mandate any transport protocol ohair@286: * to be use together; HTTP is the default transport. An implementation may ohair@286: * chose to support other transport with any of the envelope styles. ohair@286: * ohair@286: * This annotation may be overriden programmatically or via deployment ohair@286: * descriptors, depending on the platform in use. ohair@286: * ohair@286: * @author shih-chang.chen@oracle.com ohair@286: */ ohair@286: @WebServiceFeatureAnnotation(id="", bean=com.sun.xml.internal.org.jvnet.ws.EnvelopeStyleFeature.class) ohair@286: @Retention(RetentionPolicy.RUNTIME) ohair@286: public @interface EnvelopeStyle { ohair@286: ohair@286: /** ohair@286: * The envelope styles. If not specified, the default is the SOAP 1.1. ohair@286: * ohair@286: * @return The enveloping styles ohair@286: */ ohair@286: Style[] style() default { Style.SOAP11 }; ohair@286: ohair@286: public enum Style { ohair@286: ohair@286: /** ohair@286: * SOAP1.1. For JAX-WS, this is mapped from: ohair@286: * javax.xml.ws.soap.SOAPBinding.SOAP11HTTP_BINDING ohair@286: */ ohair@286: SOAP11(SOAPBinding.SOAP11HTTP_BINDING), ohair@286: ohair@286: /** ohair@286: * SOAP1.2. For JAX-WS, this is mapped from: ohair@286: * javax.xml.ws.soap.SOAPBinding.SOAP12HTTP_BINDING ohair@286: */ ohair@286: SOAP12(SOAPBinding.SOAP11HTTP_BINDING), ohair@286: ohair@286: /** ohair@286: * The raw XML. For JAX-WS, this is mapped from: ohair@286: * javax.xml.ws.http.HTTPBinding.HTTP_BINDING ohair@286: */ ohair@286: XML(HTTPBinding.HTTP_BINDING); ohair@286: ohair@286: /** ohair@286: * The BindingID used by the BindingType annotation. ohair@286: */ ohair@286: public final String bindingId; ohair@286: ohair@286: private Style(String id) { ohair@286: bindingId = id; ohair@286: } ohair@286: ohair@286: /** ohair@286: * Checks if the style is SOAP 1.1. ohair@286: * ohair@286: * @return true if the style is SOAP 1.1. ohair@286: */ ohair@286: public boolean isSOAP11() { return this.equals(SOAP11); } ohair@286: ohair@286: /** ohair@286: * Checks if the style is SOAP 1.2. ohair@286: * ohair@286: * @return true if the style is SOAP 1.2. ohair@286: */ ohair@286: public boolean isSOAP12() { return this.equals(SOAP12); } ohair@286: ohair@286: /** ohair@286: * Checks if the style is XML. ohair@286: * ohair@286: * @return true if the style is XML. ohair@286: */ ohair@286: public boolean isXML() { return this.equals(XML); } ohair@286: } ohair@286: }