org.neo4j.server.rest.repr
Class RepresentationFormat

java.lang.Object
  extended by org.neo4j.server.rest.repr.RepresentationFormat
All Implemented Interfaces:
InputFormat

public abstract class RepresentationFormat
extends Object
implements InputFormat

Implementations of this class must be stateless. Implementations of this class must have a public no arguments constructor.

Author:
Tobias Ivarsson , Andres Taylor

Constructor Summary
RepresentationFormat(javax.ws.rs.core.MediaType mediaType)
           
 
Method Summary
protected abstract  String complete(ListWriter serializer)
          Will be invoked (when serialization is done) with the result retrieved from invoking serializeList(String), it is therefore safe for this method to convert the ListWriter argument to the implementation class returned by serializeList(String).
protected abstract  String complete(MappingWriter serializer)
          Will be invoked (when serialization is done) with the result retrieved from invoking serializeMapping(String), it is therefore safe for this method to convert the MappingWriter argument to the implementation class returned by serializeMapping(String).
protected  Boolean convertBoolean(Object value)
           
protected  Byte convertByte(Object value)
           
protected  Character convertCharacter(Object value)
           
protected  Double convertDouble(Object value)
           
protected  Float convertFloat(Object value)
           
protected  Integer convertInteger(Object value)
           
protected  Long convertLong(Object value)
           
protected  Node convertNode(AbstractGraphDatabase graphDb, Object value)
           
protected  Relationship convertRelationship(AbstractGraphDatabase graphDb, Object value)
           
protected  Short convertShort(Object value)
           
protected  String convertString(Object value)
           
protected  URI convertURI(Object value)
           
protected  Node getNode(AbstractGraphDatabase graphDb, String value)
           
protected  Node getNode(AbstractGraphDatabase graphDb, URI uri)
           
protected  Relationship getRelationship(AbstractGraphDatabase graphDb, URI uri)
           
 ParameterList readParameterList(String input)
           
protected abstract  ListWriter serializeList(String type)
           
protected abstract  MappingWriter serializeMapping(String type)
           
protected abstract  String serializeValue(String type, Object value)
           
 String toString()
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 
Methods inherited from interface org.neo4j.server.rest.repr.InputFormat
readList, readMap, readUri, readValue
 

Constructor Detail

RepresentationFormat

public RepresentationFormat(javax.ws.rs.core.MediaType mediaType)
Method Detail

toString

public String toString()
Overrides:
toString in class Object

serializeValue

protected abstract String serializeValue(String type,
                                         Object value)

serializeList

protected abstract ListWriter serializeList(String type)

serializeMapping

protected abstract MappingWriter serializeMapping(String type)

complete

protected abstract String complete(ListWriter serializer)
Will be invoked (when serialization is done) with the result retrieved from invoking serializeList(String), it is therefore safe for this method to convert the ListWriter argument to the implementation class returned by serializeList(String).


complete

protected abstract String complete(MappingWriter serializer)
Will be invoked (when serialization is done) with the result retrieved from invoking serializeMapping(String), it is therefore safe for this method to convert the MappingWriter argument to the implementation class returned by serializeMapping(String).


readParameterList

public ParameterList readParameterList(String input)
                                throws BadInputException
Specified by:
readParameterList in interface InputFormat
Throws:
BadInputException

convertRelationship

protected Relationship convertRelationship(AbstractGraphDatabase graphDb,
                                           Object value)
                                    throws BadInputException
Throws:
BadInputException

convertNode

protected Node convertNode(AbstractGraphDatabase graphDb,
                           Object value)
                    throws BadInputException
Throws:
BadInputException

getNode

protected Node getNode(AbstractGraphDatabase graphDb,
                       String value)
                throws BadInputException,
                       NodeNotFoundException
Throws:
BadInputException
NodeNotFoundException

getNode

protected Node getNode(AbstractGraphDatabase graphDb,
                       URI uri)
                throws BadInputException,
                       NodeNotFoundException
Throws:
BadInputException
NodeNotFoundException

getRelationship

protected Relationship getRelationship(AbstractGraphDatabase graphDb,
                                       URI uri)
                                throws BadInputException,
                                       RelationshipNotFoundException
Throws:
BadInputException
RelationshipNotFoundException

convertURI

protected URI convertURI(Object value)
                  throws BadInputException
Throws:
BadInputException

convertString

protected String convertString(Object value)
                        throws BadInputException
Throws:
BadInputException

convertShort

protected Short convertShort(Object value)
                      throws BadInputException
Throws:
BadInputException

convertLong

protected Long convertLong(Object value)
                    throws BadInputException
Throws:
BadInputException

convertInteger

protected Integer convertInteger(Object value)
                          throws BadInputException
Throws:
BadInputException

convertFloat

protected Float convertFloat(Object value)
                      throws BadInputException
Throws:
BadInputException

convertDouble

protected Double convertDouble(Object value)
                        throws BadInputException
Throws:
BadInputException

convertCharacter

protected Character convertCharacter(Object value)
                              throws BadInputException
Throws:
BadInputException

convertByte

protected Byte convertByte(Object value)
                    throws BadInputException
Throws:
BadInputException

convertBoolean

protected Boolean convertBoolean(Object value)
                          throws BadInputException
Throws:
BadInputException


Copyright © 2002-2012 The Neo4j Graph Database Project. All Rights Reserved.