/** * */ package org.gcube.informationsystem.base.impl; import java.io.StringWriter; import java.util.List; import org.gcube.com.fasterxml.jackson.annotation.JsonTypeName; import org.gcube.informationsystem.base.reference.Element; import org.gcube.informationsystem.serialization.ElementMapper; import org.gcube.informationsystem.utils.TypeUtility; /** * @author Luca Frosini (ISTI - CNR) */ @JsonTypeName(value=Element.NAME) public class ElementImpl implements Element { /** * Generated Serial Version UID */ private static final long serialVersionUID = 7338083489551084860L; private List supertypes; @Override public String getTypeName() { return TypeUtility.getTypeName(this.getClass()); } @Override public List getSupertypes() { return this.supertypes; } @Override public String toString(){ StringWriter stringWriter = new StringWriter(); try { ElementMapper.marshal(this, stringWriter); return stringWriter.toString(); }catch(Exception e){ return super.toString(); } } }