001/** 002 * Copyright 2014 Tampere University of Technology, Pori Department 003 * 004 * Licensed under the Apache License, Version 2.0 (the "License"); 005 * you may not use this file except in compliance with the License. 006 * You may obtain a copy of the License at 007 * 008 * http://www.apache.org/licenses/LICENSE-2.0 009 * 010 * Unless required by applicable law or agreed to in writing, software 011 * distributed under the License is distributed on an "AS IS" BASIS, 012 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 013 * See the License for the specific language governing permissions and 014 * limitations under the License. 015 */ 016package core.tut.pori.http; 017 018import javax.xml.bind.annotation.XmlAccessType; 019import javax.xml.bind.annotation.XmlAccessorType; 020import javax.xml.bind.annotation.XmlRootElement; 021 022import com.google.gson.annotations.SerializedName; 023 024import core.tut.pori.http.Response.Status; 025 026/** 027 * Extends the basic XML output provided by JAXB with support for GSON/JSON output. 028 * 029 * Note that when using JSONResponseData, one MUST use the JSONResponse class instead of Response to achieve properly formatted output. 030 */ 031@XmlRootElement 032@XmlAccessorType(XmlAccessType.NONE) 033public abstract class JSONResponseData extends ResponseData { 034 /** used by response serializer */ 035 @SerializedName(value=Definitions.JSON_METHOD) 036 protected String _method = null; 037 /** used by response serializer */ 038 @SerializedName(value=Definitions.JSON_MESSAGE) 039 protected String _message = null; 040 /** used by response serializer */ 041 @SerializedName(value=Definitions.JSON_SERVICE) 042 protected String _service = null; 043 /** used by response serializer */ 044 @SerializedName(value=Definitions.JSON_STATUS) 045 protected Status _stat = Status.OK; 046}