Newer
Older
CactusServer / src / main / java / cactusServer / utils / MyParamConverter.java
package cactusServer.utils;

import java.lang.reflect.Type;

import javax.ws.rs.ext.ParamConverter;

import net.arnx.jsonic.JSON;

public class MyParamConverter implements ParamConverter<Object> {
	private Type type;

	public MyParamConverter(Type type) {
		this.type = type;
	}

	@Override
	public Object fromString(String value) {
		return JSON.decode(value, type);
	}

	@Override
	public String toString(Object obj) {
		return JSON.encode(obj);
	}
}