@Test public void testUnmarshall() throws Exception { DataSet dataSet = sut.unmarshall(loadResource("/data/relative-managed-individuals.ttl")); assertThat(dataSet.numberOfIndividuals(),greaterThan(2)); assertThat(dataSet.individualOfId(NANDANA_ID),notNullValue()); assertThat(dataSet.individualOfId(NANDANA_ME_ID),notNullValue()); String data=sut.marshall(dataSet); assertThat(data,notNullValue()); }
public DataSet unmarshall(String entity) throws IOException { checkNotNull(entity,"Entity cannot be null"); checkNotNull(mediaType,MEDIA_TYPE_CANNOT_BE_NULL); LOGGER.trace("Raw entity to unmarshall: \n{}",entity); LOGGER.trace("Unmarshalling using base '{}'...",baseEndpoint()); try { DataSet result=null; if(this.permanent) { result=permanentUnmarshall(entity,baseEndpoint()); } else { result=surrogateUnmarshall(entity,baseEndpoint()); } LOGGER.trace("Unmarshalled data set: \n{}",result); return result; } catch (ContentTransformationException e) { throw new IOException("Entity cannot be parsed as '"+mediaType+"'",e); } }
DataTransformator { public DataSet unmarshall(String entity) throws IOException { checkNotNull(entity,"Entity cannot be null"); checkNotNull(mediaType,MEDIA_TYPE_CANNOT_BE_NULL); LOGGER.trace("Raw entity to unmarshall: \n{}",entity); LOGGER.trace("Unmarshalling using base '{}'...",baseEndpoint()); try { DataSet result=null; if(this.permanent) { result=permanentUnmarshall(entity,baseEndpoint()); } else { result=surrogateUnmarshall(entity,baseEndpoint()); } LOGGER.trace("Unmarshalled data set: \n{}",result); return result; } catch (ContentTransformationException e) { throw new IOException("Entity cannot be parsed as '"+mediaType+"'",e); } } }
DataTransformator { public DataSet unmarshall(String entity) throws IOException { checkNotNull(entity,"Entity cannot be null"); checkNotNull(mediaType,MEDIA_TYPE_CANNOT_BE_NULL); LOGGER.trace("Raw entity to unmarshall: \n{}",entity); LOGGER.trace("Unmarshalling using base '{}'...",baseEndpoint()); try { DataSet result=null; if(this.permanent) { result=permanentUnmarshall(entity,baseEndpoint()); } else { result=surrogateUnmarshall(entity,baseEndpoint()); } LOGGER.trace("Unmarshalled data set: \n{}",result); return result; } catch (ContentTransformationException e) { throw new IOException("Entity cannot be parsed as '"+mediaType+"'",e); } } private  DataTransformator(DataTransformator dataTransformation); private  DataTransformator(); }
DataTransformator { public DataSet unmarshall(String entity) throws IOException { checkNotNull(entity,"Entity cannot be null"); checkNotNull(mediaType,MEDIA_TYPE_CANNOT_BE_NULL); LOGGER.trace("Raw entity to unmarshall: \n{}",entity); LOGGER.trace("Unmarshalling using base '{}'...",baseEndpoint()); try { DataSet result=null; if(this.permanent) { result=permanentUnmarshall(entity,baseEndpoint()); } else { result=surrogateUnmarshall(entity,baseEndpoint()); } LOGGER.trace("Unmarshalled data set: \n{}",result); return result; } catch (ContentTransformationException e) { throw new IOException("Entity cannot be parsed as '"+mediaType+"'",e); } } private  DataTransformator(DataTransformator dataTransformation); private  DataTransformator(); DataTransformator permanentEndpoint(URI endpoint); DataTransformator surrogateEndpoint(URI endpoint); DataTransformator mediaType(MediaType mediaType); DataTransformator namespaces(Namespaces namespaces); DataTransformator enableResolution(ResourceResolver resourceResolver); DataTransformator disableResolution(); DataSet unmarshall(String entity); String marshall(DataSet representation); static Set<MediaType> supportedMediaTypes(); static boolean isSupported(MediaType mediaType); static DataTransformator create(URI applicationBase); }
DataTransformator { public DataSet unmarshall(String entity) throws IOException { checkNotNull(entity,"Entity cannot be null"); checkNotNull(mediaType,MEDIA_TYPE_CANNOT_BE_NULL); LOGGER.trace("Raw entity to unmarshall: \n{}",entity); LOGGER.trace("Unmarshalling using base '{}'...",baseEndpoint()); try { DataSet result=null; if(this.permanent) { result=permanentUnmarshall(entity,baseEndpoint()); } else { result=surrogateUnmarshall(entity,baseEndpoint()); } LOGGER.trace("Unmarshalled data set: \n{}",result); return result; } catch (ContentTransformationException e) { throw new IOException("Entity cannot be parsed as '"+mediaType+"'",e); } } private  DataTransformator(DataTransformator dataTransformation); private  DataTransformator(); DataTransformator permanentEndpoint(URI endpoint); DataTransformator surrogateEndpoint(URI endpoint); DataTransformator mediaType(MediaType mediaType); DataTransformator namespaces(Namespaces namespaces); DataTransformator enableResolution(ResourceResolver resourceResolver); DataTransformator disableResolution(); DataSet unmarshall(String entity); String marshall(DataSet representation); static Set<MediaType> supportedMediaTypes(); static boolean isSupported(MediaType mediaType); static DataTransformator create(URI applicationBase);  }