2015-05-27 13:13:19 +00:00
|
|
|
/*
|
2015-10-01 15:23:40 +00:00
|
|
|
* The MIT License (MIT)
|
|
|
|
|
*
|
|
|
|
|
* Copyright (c) 2015 Ziver Koc
|
2013-05-28 19:29:24 +00:00
|
|
|
*
|
2011-07-13 17:53:17 +00:00
|
|
|
* Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
|
|
|
* of this software and associated documentation files (the "Software"), to deal
|
|
|
|
|
* in the Software without restriction, including without limitation the rights
|
|
|
|
|
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
|
|
|
* copies of the Software, and to permit persons to whom the Software is
|
|
|
|
|
* furnished to do so, subject to the following conditions:
|
2013-05-28 19:29:24 +00:00
|
|
|
*
|
2011-07-13 17:53:17 +00:00
|
|
|
* The above copyright notice and this permission notice shall be included in
|
|
|
|
|
* all copies or substantial portions of the Software.
|
2013-05-28 19:29:24 +00:00
|
|
|
*
|
2011-07-13 17:53:17 +00:00
|
|
|
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
|
|
|
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
|
|
|
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
|
|
|
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
|
|
|
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
|
|
|
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
|
|
|
|
|
* THE SOFTWARE.
|
2015-05-27 13:13:19 +00:00
|
|
|
*/
|
2013-05-28 19:29:24 +00:00
|
|
|
|
2011-02-15 19:37:35 +00:00
|
|
|
package zutil.net.ws;
|
2009-04-22 18:34:11 +00:00
|
|
|
|
2015-06-02 15:47:44 +00:00
|
|
|
import java.lang.annotation.ElementType;
|
|
|
|
|
import java.lang.annotation.Retention;
|
|
|
|
|
import java.lang.annotation.RetentionPolicy;
|
|
|
|
|
import java.lang.annotation.Target;
|
2009-04-22 18:34:11 +00:00
|
|
|
/**
|
|
|
|
|
*
|
2010-08-13 22:36:08 +00:00
|
|
|
* Specifies web service parameter names and other things.
|
2009-04-22 18:34:11 +00:00
|
|
|
* Example:
|
|
|
|
|
* <pre>
|
2010-08-13 22:36:08 +00:00
|
|
|
* private static class Test implements WSInterface{
|
2009-04-22 18:34:11 +00:00
|
|
|
* public Test(){}
|
|
|
|
|
*
|
2010-08-13 22:36:08 +00:00
|
|
|
* @WSDocumentation("blabla")
|
2009-04-22 18:34:11 +00:00
|
|
|
* @WSDLParamDocumentation("olle = an variable?")
|
|
|
|
|
* public void pubZ(
|
2010-08-13 22:36:08 +00:00
|
|
|
* @WSParamName("olle") int lol)
|
2009-04-22 18:34:11 +00:00
|
|
|
* throws Exception{
|
|
|
|
|
* ....
|
|
|
|
|
* }
|
|
|
|
|
*
|
2010-08-13 22:36:08 +00:00
|
|
|
* @WSReturnName("param")
|
2009-04-22 18:34:11 +00:00
|
|
|
* public String pubA(
|
2010-08-13 22:36:08 +00:00
|
|
|
* @WSParamName(value="lol", optional=true) String lol)
|
2009-04-22 18:34:11 +00:00
|
|
|
* throws Exception{
|
|
|
|
|
* ....
|
|
|
|
|
* }
|
|
|
|
|
*
|
2010-08-13 22:36:08 +00:00
|
|
|
* @WSDisabled()
|
2009-04-22 18:34:11 +00:00
|
|
|
* public void privaZ(....){
|
|
|
|
|
* ...
|
|
|
|
|
* }
|
|
|
|
|
* }
|
|
|
|
|
*
|
|
|
|
|
* </pre>
|
|
|
|
|
* @author Ziver
|
|
|
|
|
*/
|
2010-08-13 22:36:08 +00:00
|
|
|
public interface WSInterface {
|
2009-04-22 18:34:11 +00:00
|
|
|
/**
|
|
|
|
|
* Annotation that assigns a name to an parameters
|
|
|
|
|
* in an method.
|
|
|
|
|
*
|
|
|
|
|
* @author Ziver
|
|
|
|
|
*/
|
|
|
|
|
@Retention(RetentionPolicy.RUNTIME)
|
|
|
|
|
@Target(ElementType.PARAMETER)
|
2010-08-13 22:36:08 +00:00
|
|
|
public @interface WSParamName {
|
2009-04-22 18:34:11 +00:00
|
|
|
String value();
|
|
|
|
|
boolean optional() default false;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* Annotation that assigns a name to the return value
|
|
|
|
|
* in an method.
|
|
|
|
|
*
|
|
|
|
|
* @author Ziver
|
|
|
|
|
*/
|
|
|
|
|
@Retention(RetentionPolicy.RUNTIME)
|
|
|
|
|
@Target(ElementType.METHOD)
|
2010-08-13 22:36:08 +00:00
|
|
|
public @interface WSReturnName {
|
2009-04-22 18:34:11 +00:00
|
|
|
String value();
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/**
|
2010-08-13 22:36:08 +00:00
|
|
|
* Disables publication of the given method
|
2009-04-22 18:34:11 +00:00
|
|
|
*
|
|
|
|
|
* @author Ziver
|
|
|
|
|
*/
|
|
|
|
|
@Retention(RetentionPolicy.RUNTIME)
|
|
|
|
|
@Target(ElementType.METHOD)
|
2010-08-13 22:36:08 +00:00
|
|
|
public @interface WSDisabled { }
|
2009-04-22 18:34:11 +00:00
|
|
|
|
|
|
|
|
/**
|
2010-08-13 22:36:08 +00:00
|
|
|
* Method or Parameter comments for the WSDL.
|
|
|
|
|
* These comments are put in the message part of the WSDL
|
2009-04-22 18:34:11 +00:00
|
|
|
*
|
|
|
|
|
* @author Ziver
|
|
|
|
|
*/
|
|
|
|
|
@Retention(RetentionPolicy.RUNTIME)
|
2010-08-13 22:36:08 +00:00
|
|
|
public @interface WSDocumentation{
|
2009-04-22 18:34:11 +00:00
|
|
|
String value();
|
|
|
|
|
}
|
2010-08-13 22:36:08 +00:00
|
|
|
|
2009-04-22 18:34:11 +00:00
|
|
|
/**
|
|
|
|
|
* Parameter comments for the WSDL.
|
|
|
|
|
* These comments are put in the message part of the WSDL
|
|
|
|
|
*
|
|
|
|
|
* @author Ziver
|
|
|
|
|
*/
|
|
|
|
|
@Retention(RetentionPolicy.RUNTIME)
|
2010-08-13 22:36:08 +00:00
|
|
|
public @interface WSParamDocumentation{
|
2009-04-22 18:34:11 +00:00
|
|
|
String value();
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/**
|
2010-08-13 22:36:08 +00:00
|
|
|
* This method will be used in the header.
|
2009-04-22 18:34:11 +00:00
|
|
|
*
|
|
|
|
|
* @author Ziver
|
|
|
|
|
*/
|
|
|
|
|
@Retention(RetentionPolicy.RUNTIME)
|
|
|
|
|
@Target(ElementType.METHOD)
|
2010-08-13 22:36:08 +00:00
|
|
|
public @interface WSHeader { }
|
2010-04-15 20:52:34 +00:00
|
|
|
|
|
|
|
|
/**
|
2011-09-14 20:30:06 +00:00
|
|
|
* Specifies the name space for method.
|
2010-04-15 20:52:34 +00:00
|
|
|
*
|
|
|
|
|
* @author Ziver
|
|
|
|
|
*/
|
|
|
|
|
@Retention(RetentionPolicy.RUNTIME)
|
2011-09-14 20:30:06 +00:00
|
|
|
//@Target(ElementType.TYPE)
|
2010-08-13 22:36:08 +00:00
|
|
|
public @interface WSNamespace {
|
2010-04-15 20:52:34 +00:00
|
|
|
String value();
|
|
|
|
|
}
|
2009-04-22 18:34:11 +00:00
|
|
|
}
|