Moved the classes to create procedural web-services into a procedural package.
Moved IdTypeAdapter as an inner class of Id (Id.GsonTypeAdapter). Created a internal.util package to keep commonly used classes such as Preconditions. made common base classes such as ParamMap, ContentBody public.
This commit is contained in:
parent
c6a4f55d1a
commit
681281e772
|
@ -17,9 +17,9 @@ package com.google.gson.webservice.client;
|
||||||
|
|
||||||
import java.util.concurrent.BlockingQueue;
|
import java.util.concurrent.BlockingQueue;
|
||||||
|
|
||||||
import com.google.gson.webservice.definition.WebServiceCall;
|
|
||||||
import com.google.gson.webservice.definition.WebServiceResponse;
|
|
||||||
import com.google.gson.webservice.definition.WebServiceSystemException;
|
import com.google.gson.webservice.definition.WebServiceSystemException;
|
||||||
|
import com.google.gson.webservice.definition.procedural.WebServiceCall;
|
||||||
|
import com.google.gson.webservice.definition.procedural.WebServiceResponse;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* A consumer that executes in its own thread consuming queue entries and invoking web-service calls
|
* A consumer that executes in its own thread consuming queue entries and invoking web-service calls
|
||||||
|
|
|
@ -15,8 +15,8 @@
|
||||||
*/
|
*/
|
||||||
package com.google.gson.webservice.client;
|
package com.google.gson.webservice.client;
|
||||||
|
|
||||||
import com.google.gson.webservice.definition.WebServiceCallSpec;
|
import com.google.gson.webservice.definition.procedural.WebServiceCallSpec;
|
||||||
import com.google.gson.webservice.definition.WebServiceRequest;
|
import com.google.gson.webservice.definition.procedural.WebServiceRequest;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* A holder class for an entry stored in queue. It contains references to the request, callspec,
|
* A holder class for an entry stored in queue. It contains references to the request, callspec,
|
||||||
|
|
|
@ -25,9 +25,9 @@ import java.util.logging.Logger;
|
||||||
import com.google.gson.Gson;
|
import com.google.gson.Gson;
|
||||||
import com.google.gson.webservice.definition.HeaderMap;
|
import com.google.gson.webservice.definition.HeaderMap;
|
||||||
import com.google.gson.webservice.definition.HeaderMapSpec;
|
import com.google.gson.webservice.definition.HeaderMapSpec;
|
||||||
import com.google.gson.webservice.definition.RequestBody;
|
|
||||||
import com.google.gson.webservice.definition.WebServiceRequest;
|
|
||||||
import com.google.gson.webservice.definition.WebServiceSystemException;
|
import com.google.gson.webservice.definition.WebServiceSystemException;
|
||||||
|
import com.google.gson.webservice.definition.procedural.RequestBody;
|
||||||
|
import com.google.gson.webservice.definition.procedural.WebServiceRequest;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Class to send Web service requests on a {@link HttpURLConnection}.
|
* Class to send Web service requests on a {@link HttpURLConnection}.
|
||||||
|
|
|
@ -15,10 +15,10 @@
|
||||||
*/
|
*/
|
||||||
package com.google.gson.webservice.client;
|
package com.google.gson.webservice.client;
|
||||||
|
|
||||||
import com.google.gson.webservice.definition.WebServiceCall;
|
|
||||||
import com.google.gson.webservice.definition.WebServiceCallSpec;
|
|
||||||
import com.google.gson.webservice.definition.WebServiceRequest;
|
|
||||||
import com.google.gson.webservice.definition.WebServiceSystemException;
|
import com.google.gson.webservice.definition.WebServiceSystemException;
|
||||||
|
import com.google.gson.webservice.definition.procedural.WebServiceCall;
|
||||||
|
import com.google.gson.webservice.definition.procedural.WebServiceCallSpec;
|
||||||
|
import com.google.gson.webservice.definition.procedural.WebServiceRequest;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* A client-supplied callback to be used with {@link WebServiceClientAsync}. When a web-service
|
* A client-supplied callback to be used with {@link WebServiceClientAsync}. When a web-service
|
||||||
|
|
|
@ -28,11 +28,11 @@ import java.util.logging.Logger;
|
||||||
import com.google.gson.Gson;
|
import com.google.gson.Gson;
|
||||||
import com.google.gson.webservice.definition.HeaderMap;
|
import com.google.gson.webservice.definition.HeaderMap;
|
||||||
import com.google.gson.webservice.definition.HeaderMapSpec;
|
import com.google.gson.webservice.definition.HeaderMapSpec;
|
||||||
import com.google.gson.webservice.definition.ResponseBody;
|
|
||||||
import com.google.gson.webservice.definition.ResponseBodySpec;
|
|
||||||
import com.google.gson.webservice.definition.ResponseSpec;
|
|
||||||
import com.google.gson.webservice.definition.WebServiceResponse;
|
|
||||||
import com.google.gson.webservice.definition.WebServiceSystemException;
|
import com.google.gson.webservice.definition.WebServiceSystemException;
|
||||||
|
import com.google.gson.webservice.definition.procedural.ResponseBody;
|
||||||
|
import com.google.gson.webservice.definition.procedural.ResponseBodySpec;
|
||||||
|
import com.google.gson.webservice.definition.procedural.ResponseSpec;
|
||||||
|
import com.google.gson.webservice.definition.procedural.WebServiceResponse;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Receives a response coming on an {@link HttpURLConnection}.
|
* Receives a response coming on an {@link HttpURLConnection}.
|
||||||
|
|
|
@ -24,12 +24,12 @@ import java.util.logging.Logger;
|
||||||
|
|
||||||
import com.google.gson.Gson;
|
import com.google.gson.Gson;
|
||||||
import com.google.gson.GsonBuilder;
|
import com.google.gson.GsonBuilder;
|
||||||
import com.google.gson.webservice.definition.ResponseBody;
|
|
||||||
import com.google.gson.webservice.definition.WebServiceCallSpec;
|
|
||||||
import com.google.gson.webservice.definition.WebServiceRequest;
|
|
||||||
import com.google.gson.webservice.definition.WebServiceResponse;
|
|
||||||
import com.google.gson.webservice.definition.WebServiceSystemException;
|
import com.google.gson.webservice.definition.WebServiceSystemException;
|
||||||
import com.google.gson.webservice.typeadapters.ResponseBodyGsonConverter;
|
import com.google.gson.webservice.definition.procedural.ResponseBody;
|
||||||
|
import com.google.gson.webservice.definition.procedural.ResponseBodyGsonConverter;
|
||||||
|
import com.google.gson.webservice.definition.procedural.WebServiceCallSpec;
|
||||||
|
import com.google.gson.webservice.definition.procedural.WebServiceRequest;
|
||||||
|
import com.google.gson.webservice.definition.procedural.WebServiceResponse;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Main class used by clients to access a Gson Web service.
|
* Main class used by clients to access a Gson Web service.
|
||||||
|
|
|
@ -19,9 +19,9 @@ import java.util.concurrent.BlockingQueue;
|
||||||
import java.util.concurrent.LinkedBlockingQueue;
|
import java.util.concurrent.LinkedBlockingQueue;
|
||||||
import java.util.logging.Level;
|
import java.util.logging.Level;
|
||||||
|
|
||||||
import com.google.gson.webservice.definition.WebServiceCallSpec;
|
|
||||||
import com.google.gson.webservice.definition.WebServiceRequest;
|
|
||||||
import com.google.gson.webservice.definition.WebServiceSystemException;
|
import com.google.gson.webservice.definition.WebServiceSystemException;
|
||||||
|
import com.google.gson.webservice.definition.procedural.WebServiceCallSpec;
|
||||||
|
import com.google.gson.webservice.definition.procedural.WebServiceRequest;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* A client for invoking a JSON-based Web-service in an asynchronous manner. The call is queued,
|
* A client for invoking a JSON-based Web-service in an asynchronous manner. The call is queued,
|
||||||
|
|
|
@ -15,6 +15,7 @@
|
||||||
*/
|
*/
|
||||||
package com.google.gson.webservice.definition;
|
package com.google.gson.webservice.definition;
|
||||||
|
|
||||||
|
|
||||||
import java.util.Map;
|
import java.util.Map;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -24,9 +25,9 @@ import java.util.Map;
|
||||||
*
|
*
|
||||||
* @author inder
|
* @author inder
|
||||||
*/
|
*/
|
||||||
class ContentBody extends ParamMap {
|
public class ContentBody extends ParamMap {
|
||||||
|
|
||||||
ContentBody(ContentBodySpec spec, Map<String, Object> contents) {
|
public ContentBody(ContentBodySpec spec, Map<String, Object> contents) {
|
||||||
super(spec, contents);
|
super(spec, contents);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -15,6 +15,7 @@
|
||||||
*/
|
*/
|
||||||
package com.google.gson.webservice.definition;
|
package com.google.gson.webservice.definition;
|
||||||
|
|
||||||
|
|
||||||
import java.lang.reflect.Type;
|
import java.lang.reflect.Type;
|
||||||
import java.util.Collections;
|
import java.util.Collections;
|
||||||
import java.util.Map;
|
import java.util.Map;
|
||||||
|
|
|
@ -15,6 +15,7 @@
|
||||||
*/
|
*/
|
||||||
package com.google.gson.webservice.definition;
|
package com.google.gson.webservice.definition;
|
||||||
|
|
||||||
|
|
||||||
import java.lang.reflect.Type;
|
import java.lang.reflect.Type;
|
||||||
import java.util.Map;
|
import java.util.Map;
|
||||||
|
|
||||||
|
|
|
@ -15,6 +15,7 @@
|
||||||
*/
|
*/
|
||||||
package com.google.gson.webservice.definition;
|
package com.google.gson.webservice.definition;
|
||||||
|
|
||||||
|
|
||||||
import java.lang.reflect.Type;
|
import java.lang.reflect.Type;
|
||||||
import java.util.LinkedHashMap;
|
import java.util.LinkedHashMap;
|
||||||
import java.util.Map;
|
import java.util.Map;
|
||||||
|
|
|
@ -15,12 +15,14 @@
|
||||||
*/
|
*/
|
||||||
package com.google.gson.webservice.definition;
|
package com.google.gson.webservice.definition;
|
||||||
|
|
||||||
|
import com.google.gson.webservice.definition.internal.utils.Preconditions;
|
||||||
|
|
||||||
import java.lang.reflect.Type;
|
import java.lang.reflect.Type;
|
||||||
import java.util.LinkedHashMap;
|
import java.util.LinkedHashMap;
|
||||||
import java.util.Map;
|
import java.util.Map;
|
||||||
import java.util.Set;
|
import java.util.Set;
|
||||||
|
|
||||||
class ParamMap {
|
public class ParamMap {
|
||||||
|
|
||||||
public static class Builder<T extends ParamMapSpec> {
|
public static class Builder<T extends ParamMapSpec> {
|
||||||
protected final Map<String, Object> contents = new LinkedHashMap<String, Object>();
|
protected final Map<String, Object> contents = new LinkedHashMap<String, Object>();
|
||||||
|
|
|
@ -15,6 +15,7 @@
|
||||||
*/
|
*/
|
||||||
package com.google.gson.webservice.definition;
|
package com.google.gson.webservice.definition;
|
||||||
|
|
||||||
|
|
||||||
import java.lang.reflect.Type;
|
import java.lang.reflect.Type;
|
||||||
import java.util.Map;
|
import java.util.Map;
|
||||||
import java.util.Set;
|
import java.util.Set;
|
||||||
|
|
|
@ -15,6 +15,8 @@
|
||||||
*/
|
*/
|
||||||
package com.google.gson.webservice.definition;
|
package com.google.gson.webservice.definition;
|
||||||
|
|
||||||
|
import com.google.gson.webservice.definition.internal.utils.Preconditions;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* A typed key for use in a {@link ParamMap} or a {@link ParamMapSpec}.
|
* A typed key for use in a {@link ParamMap} or a {@link ParamMapSpec}.
|
||||||
*
|
*
|
||||||
|
|
|
@ -1,37 +0,0 @@
|
||||||
/*
|
|
||||||
* Copyright (C) 2008 Google Inc.
|
|
||||||
*
|
|
||||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
||||||
* you may not use this file except in compliance with the License.
|
|
||||||
* You may obtain a copy of the License at
|
|
||||||
*
|
|
||||||
* http://www.apache.org/licenses/LICENSE-2.0
|
|
||||||
*
|
|
||||||
* Unless required by applicable law or agreed to in writing, software
|
|
||||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
||||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
||||||
* See the License for the specific language governing permissions and
|
|
||||||
* limitations under the License.
|
|
||||||
*/
|
|
||||||
package com.google.gson.webservice.definition;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Base class for exceptions thrown to indicate a Web service external or application error
|
|
||||||
* condition. This can happen due to bad input, or illegal sequence of operations. This should
|
|
||||||
* never be thrown to indicate a System error condition. For that purpose, use
|
|
||||||
* {@link WebServiceSystemException} instead.
|
|
||||||
*
|
|
||||||
* @author inder
|
|
||||||
*/
|
|
||||||
public class WebServiceAppException extends RuntimeException {
|
|
||||||
|
|
||||||
private static final long serialVersionUID = 4422041697108937041L;
|
|
||||||
|
|
||||||
public WebServiceAppException(Exception cause) {
|
|
||||||
super(cause);
|
|
||||||
}
|
|
||||||
|
|
||||||
public WebServiceAppException(String msg, Exception cause) {
|
|
||||||
super(msg, cause);
|
|
||||||
}
|
|
||||||
}
|
|
|
@ -17,9 +17,8 @@ package com.google.gson.webservice.definition;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Base class for all exceptions thrown by the Web service to indicate a system error condition.
|
* Base class for all exceptions thrown by the Web service to indicate a system error condition.
|
||||||
* This should never be thrown to indicate bad user input. For that purpose, use
|
* This should never be thrown to indicate bad user input.
|
||||||
* {@link WebServiceAppException}.
|
*
|
||||||
*
|
|
||||||
* @author inder
|
* @author inder
|
||||||
*/
|
*/
|
||||||
public class WebServiceSystemException extends RuntimeException {
|
public class WebServiceSystemException extends RuntimeException {
|
||||||
|
|
|
@ -13,9 +13,9 @@
|
||||||
* See the License for the specific language governing permissions and
|
* See the License for the specific language governing permissions and
|
||||||
* limitations under the License.
|
* limitations under the License.
|
||||||
*/
|
*/
|
||||||
package com.google.gson.webservice.definition;
|
package com.google.gson.webservice.definition.internal.utils;
|
||||||
|
|
||||||
final class Preconditions {
|
public final class Preconditions {
|
||||||
|
|
||||||
public static void checkArgument(boolean condition) {
|
public static void checkArgument(boolean condition) {
|
||||||
if (!condition) {
|
if (!condition) {
|
|
@ -13,7 +13,12 @@
|
||||||
* See the License for the specific language governing permissions and
|
* See the License for the specific language governing permissions and
|
||||||
* limitations under the License.
|
* limitations under the License.
|
||||||
*/
|
*/
|
||||||
package com.google.gson.webservice.definition;
|
package com.google.gson.webservice.definition.procedural;
|
||||||
|
|
||||||
|
import com.google.gson.webservice.definition.ContentBody;
|
||||||
|
import com.google.gson.webservice.definition.ParamMap;
|
||||||
|
import com.google.gson.webservice.definition.TypedKey;
|
||||||
|
import com.google.gson.webservice.definition.ParamMap.Builder;
|
||||||
|
|
||||||
import java.lang.reflect.Type;
|
import java.lang.reflect.Type;
|
||||||
import java.util.Map;
|
import java.util.Map;
|
||||||
|
@ -24,7 +29,7 @@ import java.util.Map;
|
||||||
* {@link java.net.HttpURLConnection#getOutputStream()}) , and is read by the
|
* {@link java.net.HttpURLConnection#getOutputStream()}) , and is read by the
|
||||||
* javax.servlet.http.HttpServletRequest#getInputStream().
|
* javax.servlet.http.HttpServletRequest#getInputStream().
|
||||||
* This class omits the default constructor for use by Gson. Instead the user must use
|
* This class omits the default constructor for use by Gson. Instead the user must use
|
||||||
* {@link com.google.gson.webservice.typeadapters.RequestBodyGsonConverter}
|
* {@link com.google.gson.webservice.definition.procedural.RequestBodyGsonConverter}
|
||||||
*
|
*
|
||||||
* @author inder
|
* @author inder
|
||||||
*/
|
*/
|
|
@ -13,7 +13,7 @@
|
||||||
* See the License for the specific language governing permissions and
|
* See the License for the specific language governing permissions and
|
||||||
* limitations under the License.
|
* limitations under the License.
|
||||||
*/
|
*/
|
||||||
package com.google.gson.webservice.typeadapters;
|
package com.google.gson.webservice.definition.procedural;
|
||||||
|
|
||||||
import java.lang.reflect.Type;
|
import java.lang.reflect.Type;
|
||||||
import java.util.Map;
|
import java.util.Map;
|
||||||
|
@ -26,8 +26,6 @@ import com.google.gson.JsonObject;
|
||||||
import com.google.gson.JsonParseException;
|
import com.google.gson.JsonParseException;
|
||||||
import com.google.gson.JsonSerializationContext;
|
import com.google.gson.JsonSerializationContext;
|
||||||
import com.google.gson.JsonSerializer;
|
import com.google.gson.JsonSerializer;
|
||||||
import com.google.gson.webservice.definition.RequestBody;
|
|
||||||
import com.google.gson.webservice.definition.RequestBodySpec;
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Gson type adapter for {@link RequestBody}.
|
* Gson type adapter for {@link RequestBody}.
|
|
@ -13,7 +13,10 @@
|
||||||
* See the License for the specific language governing permissions and
|
* See the License for the specific language governing permissions and
|
||||||
* limitations under the License.
|
* limitations under the License.
|
||||||
*/
|
*/
|
||||||
package com.google.gson.webservice.definition;
|
package com.google.gson.webservice.definition.procedural;
|
||||||
|
|
||||||
|
|
||||||
|
import com.google.gson.webservice.definition.ContentBodySpec;
|
||||||
|
|
||||||
import java.lang.reflect.Type;
|
import java.lang.reflect.Type;
|
||||||
import java.util.LinkedHashMap;
|
import java.util.LinkedHashMap;
|
|
@ -13,7 +13,10 @@
|
||||||
* See the License for the specific language governing permissions and
|
* See the License for the specific language governing permissions and
|
||||||
* limitations under the License.
|
* limitations under the License.
|
||||||
*/
|
*/
|
||||||
package com.google.gson.webservice.definition;
|
package com.google.gson.webservice.definition.procedural;
|
||||||
|
|
||||||
|
import com.google.gson.webservice.definition.HeaderMapSpec;
|
||||||
|
import com.google.gson.webservice.definition.internal.utils.Preconditions;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Specification for a {@link WebServiceRequest}.
|
* Specification for a {@link WebServiceRequest}.
|
|
@ -13,7 +13,11 @@
|
||||||
* See the License for the specific language governing permissions and
|
* See the License for the specific language governing permissions and
|
||||||
* limitations under the License.
|
* limitations under the License.
|
||||||
*/
|
*/
|
||||||
package com.google.gson.webservice.definition;
|
package com.google.gson.webservice.definition.procedural;
|
||||||
|
|
||||||
|
import com.google.gson.webservice.definition.ContentBody;
|
||||||
|
import com.google.gson.webservice.definition.ParamMap;
|
||||||
|
import com.google.gson.webservice.definition.TypedKey;
|
||||||
|
|
||||||
import java.lang.reflect.Type;
|
import java.lang.reflect.Type;
|
||||||
import java.util.Map;
|
import java.util.Map;
|
||||||
|
@ -21,7 +25,7 @@ import java.util.Map;
|
||||||
/**
|
/**
|
||||||
* body of the response. This is written out as JSON to be sent out to the client.
|
* body of the response. This is written out as JSON to be sent out to the client.
|
||||||
* This class omits the default constructor for use by Gson. Instead the user must use
|
* This class omits the default constructor for use by Gson. Instead the user must use
|
||||||
* {@link com.google.gson.webservice.typeadapters.ResponseBodyGsonConverter}
|
* {@link com.google.gson.webservice.definition.procedural.ResponseBodyGsonConverter}
|
||||||
*
|
*
|
||||||
* @author inder
|
* @author inder
|
||||||
*/
|
*/
|
|
@ -13,7 +13,7 @@
|
||||||
* See the License for the specific language governing permissions and
|
* See the License for the specific language governing permissions and
|
||||||
* limitations under the License.
|
* limitations under the License.
|
||||||
*/
|
*/
|
||||||
package com.google.gson.webservice.typeadapters;
|
package com.google.gson.webservice.definition.procedural;
|
||||||
|
|
||||||
import java.lang.reflect.Type;
|
import java.lang.reflect.Type;
|
||||||
import java.util.Map;
|
import java.util.Map;
|
||||||
|
@ -26,8 +26,6 @@ import com.google.gson.JsonObject;
|
||||||
import com.google.gson.JsonParseException;
|
import com.google.gson.JsonParseException;
|
||||||
import com.google.gson.JsonSerializationContext;
|
import com.google.gson.JsonSerializationContext;
|
||||||
import com.google.gson.JsonSerializer;
|
import com.google.gson.JsonSerializer;
|
||||||
import com.google.gson.webservice.definition.ResponseBody;
|
|
||||||
import com.google.gson.webservice.definition.ResponseBodySpec;
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Gson type adapter for {@link ResponseBody}.
|
* Gson type adapter for {@link ResponseBody}.
|
|
@ -13,7 +13,9 @@
|
||||||
* See the License for the specific language governing permissions and
|
* See the License for the specific language governing permissions and
|
||||||
* limitations under the License.
|
* limitations under the License.
|
||||||
*/
|
*/
|
||||||
package com.google.gson.webservice.definition;
|
package com.google.gson.webservice.definition.procedural;
|
||||||
|
|
||||||
|
import com.google.gson.webservice.definition.ContentBodySpec;
|
||||||
|
|
||||||
import java.lang.reflect.Type;
|
import java.lang.reflect.Type;
|
||||||
import java.util.LinkedHashMap;
|
import java.util.LinkedHashMap;
|
|
@ -13,7 +13,10 @@
|
||||||
* See the License for the specific language governing permissions and
|
* See the License for the specific language governing permissions and
|
||||||
* limitations under the License.
|
* limitations under the License.
|
||||||
*/
|
*/
|
||||||
package com.google.gson.webservice.definition;
|
package com.google.gson.webservice.definition.procedural;
|
||||||
|
|
||||||
|
import com.google.gson.webservice.definition.HeaderMapSpec;
|
||||||
|
import com.google.gson.webservice.definition.internal.utils.Preconditions;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Specification for a {@link WebServiceResponse}.
|
* Specification for a {@link WebServiceResponse}.
|
|
@ -13,7 +13,8 @@
|
||||||
* See the License for the specific language governing permissions and
|
* See the License for the specific language governing permissions and
|
||||||
* limitations under the License.
|
* limitations under the License.
|
||||||
*/
|
*/
|
||||||
package com.google.gson.webservice.definition;
|
package com.google.gson.webservice.definition.procedural;
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* The data associated with a Web service call. This includes http request header parameters (form
|
* The data associated with a Web service call. This includes http request header parameters (form
|
|
@ -13,13 +13,18 @@
|
||||||
* See the License for the specific language governing permissions and
|
* See the License for the specific language governing permissions and
|
||||||
* limitations under the License.
|
* limitations under the License.
|
||||||
*/
|
*/
|
||||||
package com.google.gson.webservice.definition;
|
package com.google.gson.webservice.definition.procedural;
|
||||||
|
|
||||||
|
import com.google.gson.webservice.definition.CallPath;
|
||||||
|
import com.google.gson.webservice.definition.HeaderMapSpec;
|
||||||
|
import com.google.gson.webservice.definition.HttpMethod;
|
||||||
|
import com.google.gson.webservice.definition.TypedKey;
|
||||||
|
import com.google.gson.webservice.definition.internal.utils.Preconditions;
|
||||||
|
|
||||||
import java.util.Arrays;
|
import java.util.Arrays;
|
||||||
import java.util.LinkedHashSet;
|
import java.util.LinkedHashSet;
|
||||||
import java.util.Set;
|
import java.util.Set;
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Specification for a Json web service call. The call includes the relative path where the call
|
* Specification for a Json web service call. The call includes the relative path where the call
|
||||||
* is available, the specification of requests, and responses.
|
* is available, the specification of requests, and responses.
|
|
@ -13,7 +13,12 @@
|
||||||
* See the License for the specific language governing permissions and
|
* See the License for the specific language governing permissions and
|
||||||
* limitations under the License.
|
* limitations under the License.
|
||||||
*/
|
*/
|
||||||
package com.google.gson.webservice.definition;
|
package com.google.gson.webservice.definition.procedural;
|
||||||
|
|
||||||
|
import com.google.gson.webservice.definition.ContentBodySpec;
|
||||||
|
import com.google.gson.webservice.definition.HeaderMap;
|
||||||
|
import com.google.gson.webservice.definition.HttpMethod;
|
||||||
|
import com.google.gson.webservice.definition.TypedKey;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* The data associated with a Web service request. This includes HTTP request header parameters
|
* The data associated with a Web service request. This includes HTTP request header parameters
|
|
@ -13,7 +13,10 @@
|
||||||
* See the License for the specific language governing permissions and
|
* See the License for the specific language governing permissions and
|
||||||
* limitations under the License.
|
* limitations under the License.
|
||||||
*/
|
*/
|
||||||
package com.google.gson.webservice.definition;
|
package com.google.gson.webservice.definition.procedural;
|
||||||
|
|
||||||
|
import com.google.gson.webservice.definition.HeaderMap;
|
||||||
|
import com.google.gson.webservice.definition.TypedKey;
|
||||||
|
|
||||||
import java.lang.reflect.Type;
|
import java.lang.reflect.Type;
|
||||||
|
|
|
@ -13,7 +13,9 @@
|
||||||
* See the License for the specific language governing permissions and
|
* See the License for the specific language governing permissions and
|
||||||
* limitations under the License.
|
* limitations under the License.
|
||||||
*/
|
*/
|
||||||
package com.google.gson.webservice.definition;
|
package com.google.gson.webservice.definition.procedural;
|
||||||
|
|
||||||
|
import com.google.gson.webservice.definition.CallPathMap;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Specification of the Web service. This contains a specification of all the
|
* Specification of the Web service. This contains a specification of all the
|
|
@ -15,6 +15,15 @@
|
||||||
*/
|
*/
|
||||||
package com.google.gson.webservice.definition.rest;
|
package com.google.gson.webservice.definition.rest;
|
||||||
|
|
||||||
|
import com.google.gson.JsonDeserializationContext;
|
||||||
|
import com.google.gson.JsonDeserializer;
|
||||||
|
import com.google.gson.JsonElement;
|
||||||
|
import com.google.gson.JsonParseException;
|
||||||
|
import com.google.gson.JsonPrimitive;
|
||||||
|
import com.google.gson.JsonSerializationContext;
|
||||||
|
import com.google.gson.JsonSerializer;
|
||||||
|
import com.google.gson.webservice.definition.internal.utils.Preconditions;
|
||||||
|
|
||||||
import java.lang.reflect.ParameterizedType;
|
import java.lang.reflect.ParameterizedType;
|
||||||
import java.lang.reflect.Type;
|
import java.lang.reflect.Type;
|
||||||
import java.lang.reflect.WildcardType;
|
import java.lang.reflect.WildcardType;
|
||||||
|
@ -157,4 +166,32 @@ public final class Id<R> {
|
||||||
}
|
}
|
||||||
return type.toString();
|
return type.toString();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Type adapter for converting an Id to its serialized form
|
||||||
|
*
|
||||||
|
* @author inder
|
||||||
|
*
|
||||||
|
*/
|
||||||
|
public static final class GsonTypeAdapter implements JsonSerializer<Id<?>>,
|
||||||
|
JsonDeserializer<Id<?>> {
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public JsonElement serialize(Id<?> src, Type typeOfSrc, JsonSerializationContext context) {
|
||||||
|
return new JsonPrimitive(src.getValue());
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public Id<?> deserialize(JsonElement json, Type typeOfT, JsonDeserializationContext context)
|
||||||
|
throws JsonParseException {
|
||||||
|
if (!(typeOfT instanceof ParameterizedType)) {
|
||||||
|
throw new JsonParseException("Id of unknown type: " + typeOfT);
|
||||||
|
}
|
||||||
|
ParameterizedType parameterizedType = (ParameterizedType) typeOfT;
|
||||||
|
// Since Id takes only one TypeVariable, the actual type corresponding to the first
|
||||||
|
// TypeVariable is the Type we are looking for
|
||||||
|
Type typeOfId = parameterizedType.getActualTypeArguments()[0];
|
||||||
|
return Id.get(json.getAsLong(), typeOfId);
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -1,31 +0,0 @@
|
||||||
/*
|
|
||||||
* Copyright (C) 2010 Google Inc.
|
|
||||||
*
|
|
||||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
||||||
* you may not use this file except in compliance with the License.
|
|
||||||
* You may obtain a copy of the License at
|
|
||||||
*
|
|
||||||
* http://www.apache.org/licenses/LICENSE-2.0
|
|
||||||
*
|
|
||||||
* Unless required by applicable law or agreed to in writing, software
|
|
||||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
||||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
||||||
* See the License for the specific language governing permissions and
|
|
||||||
* limitations under the License.
|
|
||||||
*/
|
|
||||||
package com.google.gson.webservice.definition.rest;
|
|
||||||
|
|
||||||
final class Preconditions {
|
|
||||||
|
|
||||||
public static void checkArgument(boolean condition) {
|
|
||||||
if (!condition) {
|
|
||||||
throw new IllegalArgumentException();
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
public static void checkNotNull(Object obj) {
|
|
||||||
if (obj == null) {
|
|
||||||
throw new IllegalArgumentException();
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
|
@ -15,11 +15,12 @@
|
||||||
*/
|
*/
|
||||||
package com.google.gson.webservice.definition.rest;
|
package com.google.gson.webservice.definition.rest;
|
||||||
|
|
||||||
|
import com.google.gson.webservice.definition.CallPath;
|
||||||
|
import com.google.gson.webservice.definition.internal.utils.Preconditions;
|
||||||
|
|
||||||
import java.util.HashMap;
|
import java.util.HashMap;
|
||||||
import java.util.Map;
|
import java.util.Map;
|
||||||
|
|
||||||
import com.google.gson.webservice.definition.CallPath;
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* A {@link Map} of {@link CallPath} to {@link RestCallSpec}
|
* A {@link Map} of {@link CallPath} to {@link RestCallSpec}
|
||||||
*
|
*
|
||||||
|
|
|
@ -15,15 +15,16 @@
|
||||||
*/
|
*/
|
||||||
package com.google.gson.webservice.definition.rest;
|
package com.google.gson.webservice.definition.rest;
|
||||||
|
|
||||||
import java.lang.reflect.Type;
|
|
||||||
import java.util.Arrays;
|
|
||||||
import java.util.LinkedHashSet;
|
|
||||||
import java.util.Set;
|
|
||||||
|
|
||||||
import com.google.gson.webservice.definition.CallPath;
|
import com.google.gson.webservice.definition.CallPath;
|
||||||
import com.google.gson.webservice.definition.HeaderMapSpec;
|
import com.google.gson.webservice.definition.HeaderMapSpec;
|
||||||
import com.google.gson.webservice.definition.HttpMethod;
|
import com.google.gson.webservice.definition.HttpMethod;
|
||||||
import com.google.gson.webservice.definition.TypedKey;
|
import com.google.gson.webservice.definition.TypedKey;
|
||||||
|
import com.google.gson.webservice.definition.internal.utils.Preconditions;
|
||||||
|
|
||||||
|
import java.lang.reflect.Type;
|
||||||
|
import java.util.Arrays;
|
||||||
|
import java.util.LinkedHashSet;
|
||||||
|
import java.util.Set;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Specification for a REST service
|
* Specification for a REST service
|
||||||
|
|
|
@ -15,21 +15,21 @@
|
||||||
*/
|
*/
|
||||||
package com.google.gson.webservice.definition.rest;
|
package com.google.gson.webservice.definition.rest;
|
||||||
|
|
||||||
import java.lang.reflect.Type;
|
|
||||||
|
|
||||||
import com.google.gson.webservice.definition.ContentBodySpec;
|
|
||||||
import com.google.gson.webservice.definition.HeaderMap;
|
import com.google.gson.webservice.definition.HeaderMap;
|
||||||
import com.google.gson.webservice.definition.HttpMethod;
|
import com.google.gson.webservice.definition.HttpMethod;
|
||||||
import com.google.gson.webservice.definition.RequestBody;
|
|
||||||
import com.google.gson.webservice.definition.TypedKey;
|
import com.google.gson.webservice.definition.TypedKey;
|
||||||
|
|
||||||
|
import java.lang.reflect.Type;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* The data associated with a Web service request. This includes HTTP request header parameters
|
* The data associated with a Web service request. This includes HTTP request header parameters
|
||||||
* (form and URL parameters), and {@link RequestBody}.
|
* (form and URL parameters), and request body.
|
||||||
*
|
*
|
||||||
* @author inder
|
* @author inder
|
||||||
*/
|
*/
|
||||||
public final class RestRequest<R extends RestResource<R>> {
|
public final class RestRequest<R extends RestResource<R>> {
|
||||||
|
public static final String JSON_CONTENT_TYPE = "application/json";
|
||||||
|
|
||||||
private final HttpMethod method;
|
private final HttpMethod method;
|
||||||
private final HeaderMap headers;
|
private final HeaderMap headers;
|
||||||
private final R body;
|
private final R body;
|
||||||
|
@ -68,7 +68,7 @@ public final class RestRequest<R extends RestResource<R>> {
|
||||||
}
|
}
|
||||||
|
|
||||||
public String getContentType() {
|
public String getContentType() {
|
||||||
return ContentBodySpec.JSON_CONTENT_TYPE;
|
return JSON_CONTENT_TYPE;
|
||||||
}
|
}
|
||||||
|
|
||||||
public <T> T getHeader(TypedKey<T> key) {
|
public <T> T getHeader(TypedKey<T> key) {
|
||||||
|
|
|
@ -1,55 +0,0 @@
|
||||||
/*
|
|
||||||
* Copyright (C) 2010 Google Inc.
|
|
||||||
*
|
|
||||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
||||||
* you may not use this file except in compliance with the License.
|
|
||||||
* You may obtain a copy of the License at
|
|
||||||
*
|
|
||||||
* http://www.apache.org/licenses/LICENSE-2.0
|
|
||||||
*
|
|
||||||
* Unless required by applicable law or agreed to in writing, software
|
|
||||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
||||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
||||||
* See the License for the specific language governing permissions and
|
|
||||||
* limitations under the License.
|
|
||||||
*/
|
|
||||||
package com.google.gson.webservice.typeadapters;
|
|
||||||
|
|
||||||
import java.lang.reflect.ParameterizedType;
|
|
||||||
import java.lang.reflect.Type;
|
|
||||||
|
|
||||||
import com.google.gson.JsonDeserializationContext;
|
|
||||||
import com.google.gson.JsonDeserializer;
|
|
||||||
import com.google.gson.JsonElement;
|
|
||||||
import com.google.gson.JsonParseException;
|
|
||||||
import com.google.gson.JsonPrimitive;
|
|
||||||
import com.google.gson.JsonSerializationContext;
|
|
||||||
import com.google.gson.JsonSerializer;
|
|
||||||
import com.google.gson.webservice.definition.rest.Id;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Type adapter for converting an Id to its serialized form
|
|
||||||
*
|
|
||||||
* @author inder
|
|
||||||
*
|
|
||||||
*/
|
|
||||||
public final class IdTypeAdapter implements JsonSerializer<Id<?>>, JsonDeserializer<Id<?>> {
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public JsonElement serialize(Id<?> src, Type typeOfSrc, JsonSerializationContext context) {
|
|
||||||
return new JsonPrimitive(src.getValue());
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public Id<?> deserialize(JsonElement json, Type typeOfT, JsonDeserializationContext context)
|
|
||||||
throws JsonParseException {
|
|
||||||
if (!(typeOfT instanceof ParameterizedType)) {
|
|
||||||
throw new JsonParseException("Id of unknown type: " + typeOfT);
|
|
||||||
}
|
|
||||||
ParameterizedType parameterizedType = (ParameterizedType) typeOfT;
|
|
||||||
// Since Id takes only one TypeVariable, the actual type corresponding to the first
|
|
||||||
// TypeVariable is the Type we are looking for
|
|
||||||
Type typeOfId = parameterizedType.getActualTypeArguments()[0];
|
|
||||||
return Id.get(json.getAsLong(), typeOfId);
|
|
||||||
}
|
|
||||||
}
|
|
|
@ -13,7 +13,7 @@
|
||||||
* See the License for the specific language governing permissions and
|
* See the License for the specific language governing permissions and
|
||||||
* limitations under the License.
|
* limitations under the License.
|
||||||
*/
|
*/
|
||||||
package com.google.gson.webservice.typeadapters;
|
package com.google.gson.webservice.definition.rest;
|
||||||
|
|
||||||
import java.lang.reflect.Type;
|
import java.lang.reflect.Type;
|
||||||
import java.util.ArrayList;
|
import java.util.ArrayList;
|
||||||
|
@ -47,7 +47,7 @@ public class IdTypeAdapterTest extends TestCase {
|
||||||
@Override
|
@Override
|
||||||
protected void setUp() {
|
protected void setUp() {
|
||||||
gson = new GsonBuilder()
|
gson = new GsonBuilder()
|
||||||
.registerTypeAdapter(Id.class, new IdTypeAdapter())
|
.registerTypeAdapter(Id.class, new Id.GsonTypeAdapter())
|
||||||
.create();
|
.create();
|
||||||
course = new Course<HistoryCourse>(COURSE_ID, 4,
|
course = new Course<HistoryCourse>(COURSE_ID, 4,
|
||||||
new Assignment<HistoryCourse>(null, null), createList(STUDENT1, STUDENT2));
|
new Assignment<HistoryCourse>(null, null), createList(STUDENT1, STUDENT2));
|
|
@ -28,10 +28,10 @@ import com.google.gson.webservice.client.WebServiceClient;
|
||||||
import com.google.gson.webservice.client.WebServiceConfig;
|
import com.google.gson.webservice.client.WebServiceConfig;
|
||||||
import com.google.gson.webservice.definition.HeaderMap;
|
import com.google.gson.webservice.definition.HeaderMap;
|
||||||
import com.google.gson.webservice.definition.HttpMethod;
|
import com.google.gson.webservice.definition.HttpMethod;
|
||||||
import com.google.gson.webservice.definition.RequestBody;
|
import com.google.gson.webservice.definition.procedural.RequestBody;
|
||||||
import com.google.gson.webservice.definition.WebServiceCallSpec;
|
import com.google.gson.webservice.definition.procedural.WebServiceCallSpec;
|
||||||
import com.google.gson.webservice.definition.WebServiceRequest;
|
import com.google.gson.webservice.definition.procedural.WebServiceRequest;
|
||||||
import com.google.gson.webservice.definition.WebServiceResponse;
|
import com.google.gson.webservice.definition.procedural.WebServiceResponse;
|
||||||
|
|
||||||
public class ExampleClient {
|
public class ExampleClient {
|
||||||
|
|
||||||
|
|
|
@ -17,7 +17,7 @@ package com.google.gson.example.service;
|
||||||
import com.google.gson.example.model.TypedKeys;
|
import com.google.gson.example.model.TypedKeys;
|
||||||
import com.google.gson.webservice.definition.CallPath;
|
import com.google.gson.webservice.definition.CallPath;
|
||||||
import com.google.gson.webservice.definition.HttpMethod;
|
import com.google.gson.webservice.definition.HttpMethod;
|
||||||
import com.google.gson.webservice.definition.WebServiceCallSpec;
|
import com.google.gson.webservice.definition.procedural.WebServiceCallSpec;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* An example of a web-service definition
|
* An example of a web-service definition
|
||||||
|
|
|
@ -22,15 +22,15 @@ import com.google.gson.example.model.Order;
|
||||||
import com.google.gson.example.model.TypedKeys;
|
import com.google.gson.example.model.TypedKeys;
|
||||||
import com.google.gson.example.service.SampleJsonService;
|
import com.google.gson.example.service.SampleJsonService;
|
||||||
import com.google.gson.webservice.definition.HeaderMap;
|
import com.google.gson.webservice.definition.HeaderMap;
|
||||||
import com.google.gson.webservice.definition.RequestBody;
|
import com.google.gson.webservice.definition.procedural.RequestBody;
|
||||||
import com.google.gson.webservice.definition.RequestSpec;
|
import com.google.gson.webservice.definition.procedural.RequestBodyGsonConverter;
|
||||||
import com.google.gson.webservice.definition.ResponseBody;
|
import com.google.gson.webservice.definition.procedural.RequestSpec;
|
||||||
import com.google.gson.webservice.definition.ResponseSpec;
|
import com.google.gson.webservice.definition.procedural.ResponseBody;
|
||||||
import com.google.gson.webservice.definition.WebServiceCallSpec;
|
import com.google.gson.webservice.definition.procedural.ResponseBodyGsonConverter;
|
||||||
import com.google.gson.webservice.definition.WebServiceRequest;
|
import com.google.gson.webservice.definition.procedural.ResponseSpec;
|
||||||
import com.google.gson.webservice.definition.WebServiceResponse;
|
import com.google.gson.webservice.definition.procedural.WebServiceCallSpec;
|
||||||
import com.google.gson.webservice.typeadapters.RequestBodyGsonConverter;
|
import com.google.gson.webservice.definition.procedural.WebServiceRequest;
|
||||||
import com.google.gson.webservice.typeadapters.ResponseBodyGsonConverter;
|
import com.google.gson.webservice.definition.procedural.WebServiceResponse;
|
||||||
import com.google.gson.wsf.server.RequestReceiver;
|
import com.google.gson.wsf.server.RequestReceiver;
|
||||||
import com.google.gson.wsf.server.ResponseSender;
|
import com.google.gson.wsf.server.ResponseSender;
|
||||||
|
|
||||||
|
|
|
@ -15,8 +15,8 @@
|
||||||
*/
|
*/
|
||||||
package com.google.gson.wsf.inject;
|
package com.google.gson.wsf.inject;
|
||||||
|
|
||||||
import com.google.gson.webservice.definition.RequestBodySpec;
|
import com.google.gson.webservice.definition.procedural.RequestBodySpec;
|
||||||
import com.google.gson.webservice.definition.RequestSpec;
|
import com.google.gson.webservice.definition.procedural.RequestSpec;
|
||||||
import com.google.inject.Inject;
|
import com.google.inject.Inject;
|
||||||
import com.google.inject.Provider;
|
import com.google.inject.Provider;
|
||||||
|
|
||||||
|
|
|
@ -15,8 +15,8 @@
|
||||||
*/
|
*/
|
||||||
package com.google.gson.wsf.inject;
|
package com.google.gson.wsf.inject;
|
||||||
|
|
||||||
import com.google.gson.webservice.definition.RequestSpec;
|
import com.google.gson.webservice.definition.procedural.RequestSpec;
|
||||||
import com.google.gson.webservice.definition.WebServiceCallSpec;
|
import com.google.gson.webservice.definition.procedural.WebServiceCallSpec;
|
||||||
import com.google.inject.Inject;
|
import com.google.inject.Inject;
|
||||||
import com.google.inject.Provider;
|
import com.google.inject.Provider;
|
||||||
|
|
||||||
|
|
|
@ -16,8 +16,8 @@
|
||||||
package com.google.gson.wsf.inject;
|
package com.google.gson.wsf.inject;
|
||||||
|
|
||||||
import com.google.gson.webservice.definition.CallPath;
|
import com.google.gson.webservice.definition.CallPath;
|
||||||
import com.google.gson.webservice.definition.WebServiceCallSpec;
|
import com.google.gson.webservice.definition.procedural.WebServiceCallSpec;
|
||||||
import com.google.gson.webservice.definition.WebServiceSpec;
|
import com.google.gson.webservice.definition.procedural.WebServiceSpec;
|
||||||
import com.google.inject.Inject;
|
import com.google.inject.Inject;
|
||||||
import com.google.inject.Provider;
|
import com.google.inject.Provider;
|
||||||
|
|
||||||
|
|
|
@ -18,10 +18,10 @@ package com.google.gson.wsf.inject.server;
|
||||||
import javax.servlet.http.HttpServletRequest;
|
import javax.servlet.http.HttpServletRequest;
|
||||||
|
|
||||||
import com.google.gson.Gson;
|
import com.google.gson.Gson;
|
||||||
import com.google.gson.webservice.definition.WebServiceCall;
|
import com.google.gson.webservice.definition.procedural.WebServiceCall;
|
||||||
import com.google.gson.webservice.definition.WebServiceCallSpec;
|
import com.google.gson.webservice.definition.procedural.WebServiceCallSpec;
|
||||||
import com.google.gson.webservice.definition.WebServiceRequest;
|
import com.google.gson.webservice.definition.procedural.WebServiceRequest;
|
||||||
import com.google.gson.webservice.definition.WebServiceResponse;
|
import com.google.gson.webservice.definition.procedural.WebServiceResponse;
|
||||||
import com.google.gson.wsf.server.RequestReceiver;
|
import com.google.gson.wsf.server.RequestReceiver;
|
||||||
import com.google.gson.wsf.server.WebServiceCallServerBuilder;
|
import com.google.gson.wsf.server.WebServiceCallServerBuilder;
|
||||||
import com.google.inject.Inject;
|
import com.google.inject.Inject;
|
||||||
|
|
|
@ -29,11 +29,11 @@ import com.google.gson.JsonParseException;
|
||||||
import com.google.gson.webservice.definition.HeaderMap;
|
import com.google.gson.webservice.definition.HeaderMap;
|
||||||
import com.google.gson.webservice.definition.HeaderMapSpec;
|
import com.google.gson.webservice.definition.HeaderMapSpec;
|
||||||
import com.google.gson.webservice.definition.HttpMethod;
|
import com.google.gson.webservice.definition.HttpMethod;
|
||||||
import com.google.gson.webservice.definition.RequestBody;
|
|
||||||
import com.google.gson.webservice.definition.RequestBodySpec;
|
|
||||||
import com.google.gson.webservice.definition.RequestSpec;
|
|
||||||
import com.google.gson.webservice.definition.WebServiceRequest;
|
|
||||||
import com.google.gson.webservice.definition.WebServiceSystemException;
|
import com.google.gson.webservice.definition.WebServiceSystemException;
|
||||||
|
import com.google.gson.webservice.definition.procedural.RequestBody;
|
||||||
|
import com.google.gson.webservice.definition.procedural.RequestBodySpec;
|
||||||
|
import com.google.gson.webservice.definition.procedural.RequestSpec;
|
||||||
|
import com.google.gson.webservice.definition.procedural.WebServiceRequest;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Receives and parses a request at the server side on a {@link HttpServletRequest}.
|
* Receives and parses a request at the server side on a {@link HttpServletRequest}.
|
||||||
|
|
|
@ -15,9 +15,9 @@
|
||||||
*/
|
*/
|
||||||
package com.google.gson.wsf.server;
|
package com.google.gson.wsf.server;
|
||||||
|
|
||||||
import com.google.gson.webservice.definition.WebServiceCallSpec;
|
import com.google.gson.webservice.definition.procedural.WebServiceCallSpec;
|
||||||
import com.google.gson.webservice.definition.WebServiceRequest;
|
import com.google.gson.webservice.definition.procedural.WebServiceRequest;
|
||||||
import com.google.gson.webservice.definition.WebServiceResponse;
|
import com.google.gson.webservice.definition.procedural.WebServiceResponse;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* An interface describing a class that can build a response
|
* An interface describing a class that can build a response
|
||||||
|
|
|
@ -25,8 +25,8 @@ import javax.servlet.http.HttpServletResponse;
|
||||||
import com.google.gson.Gson;
|
import com.google.gson.Gson;
|
||||||
import com.google.gson.webservice.definition.HeaderMap;
|
import com.google.gson.webservice.definition.HeaderMap;
|
||||||
import com.google.gson.webservice.definition.HeaderMapSpec;
|
import com.google.gson.webservice.definition.HeaderMapSpec;
|
||||||
import com.google.gson.webservice.definition.ResponseBody;
|
import com.google.gson.webservice.definition.procedural.ResponseBody;
|
||||||
import com.google.gson.webservice.definition.WebServiceResponse;
|
import com.google.gson.webservice.definition.procedural.WebServiceResponse;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Sends a JSON web service response on {@link HttpServletResponse}.
|
* Sends a JSON web service response on {@link HttpServletResponse}.
|
||||||
|
|
|
@ -15,9 +15,9 @@
|
||||||
*/
|
*/
|
||||||
package com.google.gson.wsf.server;
|
package com.google.gson.wsf.server;
|
||||||
|
|
||||||
import com.google.gson.webservice.definition.WebServiceCallSpec;
|
import com.google.gson.webservice.definition.procedural.WebServiceCallSpec;
|
||||||
import com.google.gson.webservice.definition.WebServiceRequest;
|
import com.google.gson.webservice.definition.procedural.WebServiceRequest;
|
||||||
import com.google.gson.webservice.definition.WebServiceResponse.Builder;
|
import com.google.gson.webservice.definition.procedural.WebServiceResponse.Builder;
|
||||||
|
|
||||||
public class WebServiceCallServerBuilder {
|
public class WebServiceCallServerBuilder {
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue
Block a user