void serialize( ListSerializer serializer ) { Iterator<? extends Representation> contentIterator = content.iterator(); try { while ( contentIterator.hasNext() ) { Representation repr = contentIterator.next(); repr.addTo( serializer ); } } finally { // Make sure we exhaust this iterator in case it has an internal close mechanism while ( contentIterator.hasNext() ) { contentIterator.next(); } } }
private RepresentationType getType( List<Representation> representations ) { if ( representations == null || representations.isEmpty() ) { return RepresentationType.STRING; } return representations.get( 0 ).getRepresentationType(); }
@Override Representation convert( Object obj ) { return Representation.emptyRepresentation(); } };
public String assemble( Representation representation ) { return representation.serialize( format, baseUri, extensions ); }
public final Response ok( Representation representation ) { if ( representation.isEmpty() ) { return noContent(); } return response( Response.ok(), representation ); }
void putTo( MappingSerializer serializer, ObjectRepresentation object, String key ) { Object value = get( object ); if ( value != null ) { ((Representation) value).putTo( serializer, key ); } }
public static void write( Representation representation, RepresentationFormat format, URI baseUri ) { representation.serialize( format, baseUri, null ); }
public final <REPR extends Representation & EntityRepresentation> Response okIncludeLocation( REPR representation ) { if ( representation.isEmpty() ) { return noContent(); } return response( Response.ok().header( HttpHeaders.LOCATION, uri( representation ) ), representation ); }
void putTo( MappingSerializer serializer, ObjectRepresentation object, String key ) { Object value = get( object ); if ( value != null ) { ((Representation) value).putTo( serializer, key ); } }
((Representation) val).addTo( serializer );
static RepresentationType getType( FirstItemIterable<Representation> representations ) { Representation representation = representations.getFirst(); if ( representation == null ) { return RepresentationType.STRING; } return representation.getRepresentationType(); }
@DELETE @Path( PATH_AUTO_INDEX_PROPERTY_DELETE ) public Response stopAutoIndexingProperty( @PathParam( "type" ) String type, @PathParam( "property" ) String property ) { actions.stopAutoIndexingProperty( type, property ); return output.ok( Representation.emptyRepresentation() ); }
try representation.serialize( outputStreamFormat, baseUri, extensions );
public final Response ok( Representation representation ) { if ( representation.isEmpty() ) { return noContent(); } return response( Response.ok(), representation ); }
void serialize( ListSerializer serializer ) { for ( Representation repr : content ) { repr.addTo( serializer ); } }
private RepresentationType getType( List<Representation> representations ) { if ( representations == null || representations.isEmpty() ) { return RepresentationType.STRING; } return representations.get( 0 ).getRepresentationType(); }
@POST @Path( PATH_AUTO_INDEXED_PROPERTIES ) public Response startAutoIndexingProperty( @PathParam( "type" ) String type, String property ) { actions.startAutoIndexingProperty( type, property ); return output.ok( Representation.emptyRepresentation() ); }
public static void write( Representation representation, RepresentationFormat format, URI baseUri ) { representation.serialize( format, baseUri, null ); }
public final <REPR extends Representation & EntityRepresentation> Response okIncludeLocation( REPR representation ) { if ( representation.isEmpty() ) { return noContent(); } return response( Response.ok().header( HttpHeaders.LOCATION, uri( representation ) ), representation ); }
void serialize( ListSerializer serializer ) { Iterator<? extends Representation> contentIterator = content.iterator(); try { while ( contentIterator.hasNext() ) { Representation repr = contentIterator.next(); repr.addTo( serializer ); } } finally { // Make sure we exhaust this iterator in case it has an internal close mechanism while ( contentIterator.hasNext() ) { contentIterator.next(); } } }