+++ /dev/null
-/*--------------------------------------------------------------------------\r
- * Copyright 2007 Taro L. Saito\r
- *\r
- * Licensed under the Apache License, Version 2.0 (the "License");\r
- * you may not use this file except in compliance with the License.\r
- * You may obtain a copy of the License at\r
- *\r
- * http://www.apache.org/licenses/LICENSE-2.0\r
- *\r
- * Unless required by applicable law or agreed to in writing, software\r
- * distributed under the License is distributed on an "AS IS" BASIS,\r
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\r
- * See the License for the specific language governing permissions and\r
- * limitations under the License.\r
- *--------------------------------------------------------------------------*/\r
-//--------------------------------------\r
-// XerialJ Project\r
-//\r
-// JSONString.java\r
-// Since: Apr 4, 2007\r
-//\r
-// $URL: http://dev.utgenome.org/svn/utgb/trunk/common/src/org/utgenome/json/JSONString.java $ \r
-// $Author: leo $\r
-//--------------------------------------\r
-package org.xerial.json;\r
-\r
-import org.xerial.util.StringUtil;\r
-\r
-public class JSONString extends JSONValueBase\r
-{\r
-\r
- private String s;\r
-\r
- public JSONString()\r
- {}\r
-\r
- public JSONString(String s)\r
- {\r
- this.s = StringUtil.unquote(s);\r
- }\r
-\r
- public String toString()\r
- {\r
- return s;\r
- }\r
-\r
- public String toJSONString()\r
- {\r
- return toJSONString(s);\r
- }\r
-\r
- public static String toJSONString(String s)\r
- {\r
- return "\"" + s + "\"";\r
- }\r
-\r
- @Override\r
- public boolean equals(Object obj)\r
- {\r
- if (obj instanceof JSONString)\r
- {\r
- return s.equals(((JSONString) obj).s);\r
- }\r
- return false;\r
- }\r
-\r
- @Override\r
- public JSONString getJSONString()\r
- {\r
- return this;\r
- }\r
-\r
- public String getValue()\r
- {\r
- return s;\r
- }\r
-\r
- public JSONValueType getValueType()\r
- {\r
- return JSONValueType.String;\r
- }\r
-}\r