Skip to content
Snippets Groups Projects
Commit 5cdd508c authored by Piotr Gawron's avatar Piotr Gawron
Browse files

unused code removed

parent 324ec02c
No related branches found
No related tags found
1 merge request!295Resolve "alternative to google maps api way of visualizing maps"
package lcsb.mapviewer.services.utils.gmap;
import org.primefaces.model.DefaultTreeNode;
import com.google.gson.ExclusionStrategy;
import com.google.gson.FieldAttributes;
/**
* This object imlements an exclusion strategy that forbides to serialize
* "Chebi Tree" like objects. This kind of objects are represented as
* {@link DefaultTreeNode} class.
*
* @author Piotr Gawron
*
*/
public class GsonExclusionChebiTreeStrategy implements ExclusionStrategy {
@Override
public boolean shouldSkipClass(Class<?> arg0) {
if (DefaultTreeNode.class.isAssignableFrom(arg0)) {
return true;
}
return false;
}
@Override
public boolean shouldSkipField(FieldAttributes fa) {
return false;
}
}
package lcsb.mapviewer.services.utils.gmap;
import com.google.gson.ExclusionStrategy;
import com.google.gson.FieldAttributes;
/**
* This object imlements an exclusion strategy that forbides to serialize parent
* objects. The main reason is to prevent cyclic serialization in a tree-like
* structures.
*
* @author Piotr Gawron
*
*/
public class GsonExclusionParentStrategy implements ExclusionStrategy {
@Override
public boolean shouldSkipClass(Class<?> arg0) {
return false;
}
@Override
public boolean shouldSkipField(FieldAttributes fa) {
// String className = fa.getDeclaringClass().getName();
String fieldName = fa.getName();
return fieldName.equals("parent");
}
}
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment