001 /*
002 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
003 *
004 * This code is free software; you can redistribute it and/or modify it
005 * under the terms of the GNU General Public License version 2 only, as
006 * published by the Free Software Foundation. Sun designates this
007 * particular file as subject to the "Classpath" exception as provided
008 * by Sun in the LICENSE file that accompanied this code.
009 *
010 * This code is distributed in the hope that it will be useful, but WITHOUT
011 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
012 * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
013 * version 2 for more details (a copy is included in the LICENSE file that
014 * accompanied this code).
015 *
016 * You should have received a copy of the GNU General Public License version
017 * 2 along with this work; if not, write to the Free Software Foundation,
018 * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
019 *
020 * Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara,
021 * CA 95054 USA or visit www.sun.com if you need additional information or
022 * have any questions.
023 */
024
025 /*
026 * Copyright (c) 2004 by BEA Systems, Inc. All Rights Reserved.
027 */
028
029 package javax.jws;
030
031 import java.lang.annotation.Retention;
032 import java.lang.annotation.RetentionPolicy;
033 import java.lang.annotation.Target;
034 import java.lang.annotation.ElementType;
035
036 /**
037 * Customizes the mapping of an individual parameter to a Web Service message part and XML element.
038 *
039 * @author Copyright (c) 2004 by BEA Systems, Inc. All Rights Reserved.
040 */
041 @Retention(value=RetentionPolicy.RUNTIME)
042 @Target(value={ElementType.PARAMETER})
043 public @interface WebParam {
044
045 /**
046 * The direction in which the parameter flows
047 */
048 public enum Mode {
049 IN, OUT, INOUT
050 };
051
052 /**
053 * Name of the parameter.
054 * <p>
055 * If the operation is rpc style and @WebParam.partName has not been specified, this is name of the wsdl:part
056 * representing the parameter.
057 * <br>
058 * If the operation is document style or the parameter maps to a header, this is the local name of the XML element
059 * representing the parameter.
060 * <p>
061 * A name MUST be specified if the operation is document style, the parameter style is BARE, and the mode is OUT
062 * or INOUT.
063 *
064 * @specdefault
065 * If the operation is document style and the parameter style is BARE, {@code @WebMethod.operationName}.<br>
066 * Otherwise, argN, where N represents the index of the parameter in the method signature (starting at arg0).
067 */
068 String name() default "";
069
070 /**
071 * The name of the wsdl:part representing this parameter.
072 * <p>
073 * This is only used if the operation is rpc style or if the operation is document style and the parameter style
074 * is BARE.
075 *
076 * @specdefault {@code @WebParam.name}
077 *
078 * @since 2.0
079 */
080 String partName() default "";
081
082 /**
083 * The XML namespace for the parameter.
084 * <p>
085 * Only used if the operation is document style or the paramater maps to a header.
086 * If the target namespace is set to "", this represents the empty namespace.
087 *
088 * @specdefault
089 * If the operation is document style, the parameter style is WRAPPED, and the parameter does not map to a
090 * header, the empty namespace.<br>
091 * Otherwise, the targetNamespace for the Web Service.
092 */
093 String targetNamespace() default "";
094
095 /**
096 * The direction in which the parameter is flowing (One of IN, OUT, or INOUT).
097 * <p>
098 * The OUT and INOUT modes may only be specified for parameter types that conform to the definition of Holder types
099 * (JAX-WS 2.0 [5], section 2.3.3). Parameters that are Holder Types MUST be OUT or INOUT.
100 *
101 * @specdefault
102 * INOUT if a Holder type.<br>
103 * IN if not a Holder type.
104 */
105 Mode mode() default Mode.IN;
106
107 /**
108 * If true, the parameter is pulled from a message header rather then the message body.
109 */
110 boolean header() default false;
111 };
|