Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
C
csc-websocket-api
Overview
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
Wiki
Wiki
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Commits
Issue Boards
Open sidebar
TongZuu
csc-websocket-api
Commits
e8a707c6
Commit
e8a707c6
authored
Jun 06, 2016
by
TongZuu
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
resolve requestid for handle request is have double qoute
parent
f0d17541
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
26 additions
and
1 deletions
+26
-1
.gitignore
com/csc/library/gson/.gitignore
+1
-0
ArrayDeserializer.java
com/csc/library/gson/ArrayDeserializer.java
+6
-1
StringArrayRequestID.java
com/csc/library/gson/StringArrayRequestID.java
+19
-0
No files found.
com/csc/library/gson/.gitignore
View file @
e8a707c6
...
...
@@ -2,3 +2,4 @@
/ArrayDeserializer.class
/ByteBufferDeserialize.class
/ByteStringDeserialize.class
/StringArrayRequestID.class
com/csc/library/gson/ArrayDeserializer.java
View file @
e8a707c6
...
...
@@ -15,7 +15,12 @@ public class ArrayDeserializer implements JsonDeserializer<String[]>{
int
size
=
json
.
getAsJsonArray
().
size
();
String
[]
result
=
new
String
[
size
];
for
(
int
i
=
0
;
i
<
size
;
i
++){
result
[
i
]
=
json
.
getAsJsonArray
().
get
(
i
).
toString
();
if
(
json
.
getAsJsonArray
().
get
(
i
).
isJsonObject
()){
result
[
i
]
=
json
.
getAsJsonArray
().
get
(
i
).
toString
();
}
else
{
result
[
i
]
=
json
.
getAsJsonArray
().
get
(
i
).
getAsString
();
}
}
return
result
;
...
...
com/csc/library/gson/StringArrayRequestID.java
0 → 100644
View file @
e8a707c6
package
com
.
csc
.
library
.
gson
;
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
;
public
class
StringArrayRequestID
implements
JsonDeserializer
<
String
[]>{
@Override
public
String
[]
deserialize
(
JsonElement
json
,
Type
typeOfT
,
JsonDeserializationContext
context
)
throws
JsonParseException
{
String
[]
xx
=
new
String
[
2
];
return
xx
;
}
}
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment