-
Notifications
You must be signed in to change notification settings - Fork 214
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
#1136 - Async cannot serialize JSONMap and JSONList classes: "om.thou…
…ghtworks.xstream.converters.ConversionException: No converter available"
- Loading branch information
Showing
7 changed files
with
133 additions
and
2 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
31 changes: 31 additions & 0 deletions
31
javalite-async/src/main/java/org/javalite/async/xstream/JSONListConverter.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,31 @@ | ||
/* | ||
Copyright 2009-(CURRENT YEAR) Igor Polevoy | ||
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 org.javalite.async.xstream; | ||
|
||
import com.thoughtworks.xstream.converters.collections.CollectionConverter; | ||
import com.thoughtworks.xstream.mapper.Mapper; | ||
import org.javalite.json.JSONList; | ||
|
||
public class JSONListConverter extends CollectionConverter{ | ||
public JSONListConverter(Mapper mapper) { | ||
super(mapper); | ||
} | ||
|
||
@Override | ||
public boolean canConvert(Class type) { | ||
return type.equals(JSONList.class); | ||
} | ||
} |
31 changes: 31 additions & 0 deletions
31
javalite-async/src/main/java/org/javalite/async/xstream/JSONMapConverter.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,31 @@ | ||
/* | ||
Copyright 2009-(CURRENT YEAR) Igor Polevoy | ||
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 org.javalite.async.xstream; | ||
|
||
import com.thoughtworks.xstream.converters.collections.MapConverter; | ||
import com.thoughtworks.xstream.mapper.Mapper; | ||
import org.javalite.json.JSONMap; | ||
|
||
public class JSONMapConverter extends MapConverter { | ||
public JSONMapConverter(Mapper mapper) { | ||
super(mapper); | ||
} | ||
|
||
@Override | ||
public boolean canConvert(Class type) { | ||
return type.equals(JSONMap.class); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters