Spring Data Graph

org.springframework.data.neo4j.support.typerepresentation
Class NoopNodeTypeRepresentationStrategy

java.lang.Object
  extended by org.springframework.data.neo4j.support.typerepresentation.NoopNodeTypeRepresentationStrategy
All Implemented Interfaces:
NodeTypeRepresentationStrategy, TypeRepresentationStrategy<org.neo4j.graphdb.Node,NodeBacked>

public class NoopNodeTypeRepresentationStrategy
extends Object
implements NodeTypeRepresentationStrategy


Constructor Summary
NoopNodeTypeRepresentationStrategy()
           
 
Method Summary
 long count(Class<? extends NodeBacked> entityClass)
           
<U extends NodeBacked>
U
createEntity(org.neo4j.graphdb.Node state)
          Instantiate the entity given its state.
<U extends NodeBacked>
U
createEntity(org.neo4j.graphdb.Node state, Class<U> type)
          Instantiate the entity given its state.
<U extends NodeBacked>
org.neo4j.helpers.collection.ClosableIterable<U>
findAll(Class<U> clazz)
           
 Class<? extends NodeBacked> getJavaType(org.neo4j.graphdb.Node state)
           
 void postEntityCreation(org.neo4j.graphdb.Node state, Class<? extends NodeBacked> type)
          Callback for setting up and/or storing type information after creation.
 void preEntityRemoval(org.neo4j.graphdb.Node state)
          Callback for cleaning up type information before removal.
<U extends NodeBacked>
U
projectEntity(org.neo4j.graphdb.Node state, Class<U> type)
          Instantiate the entity of the given type, with the given state as backing state.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

NoopNodeTypeRepresentationStrategy

public NoopNodeTypeRepresentationStrategy()
Method Detail

postEntityCreation

public void postEntityCreation(org.neo4j.graphdb.Node state,
                               Class<? extends NodeBacked> type)
Description copied from interface: TypeRepresentationStrategy
Callback for setting up and/or storing type information after creation.

Specified by:
postEntityCreation in interface TypeRepresentationStrategy<org.neo4j.graphdb.Node,NodeBacked>
Parameters:
state - Backing state of entity being created
type - Type of entity being created

findAll

public <U extends NodeBacked> org.neo4j.helpers.collection.ClosableIterable<U> findAll(Class<U> clazz)
Specified by:
findAll in interface TypeRepresentationStrategy<org.neo4j.graphdb.Node,NodeBacked>
Parameters:
clazz - Type whose instances should be iterated over
Returns:
lazy Iterable over all instances of the given type

count

public long count(Class<? extends NodeBacked> entityClass)
Specified by:
count in interface TypeRepresentationStrategy<org.neo4j.graphdb.Node,NodeBacked>
Returns:
number of instances of this class contained in the graph

preEntityRemoval

public void preEntityRemoval(org.neo4j.graphdb.Node state)
Description copied from interface: TypeRepresentationStrategy
Callback for cleaning up type information before removal. If state does not have any state associated, doesn't do anything.

Specified by:
preEntityRemoval in interface TypeRepresentationStrategy<org.neo4j.graphdb.Node,NodeBacked>
Parameters:
state - Backing state of entity being removed

getJavaType

public Class<? extends NodeBacked> getJavaType(org.neo4j.graphdb.Node state)
Specified by:
getJavaType in interface TypeRepresentationStrategy<org.neo4j.graphdb.Node,NodeBacked>
Returns:
java type that of the node entity of this node

createEntity

public <U extends NodeBacked> U createEntity(org.neo4j.graphdb.Node state)
Description copied from interface: TypeRepresentationStrategy
Instantiate the entity given its state. The type of the entity is inferred by the strategy from the state.

Specified by:
createEntity in interface TypeRepresentationStrategy<org.neo4j.graphdb.Node,NodeBacked>
Type Parameters:
U - Helper parameter for castless use
Parameters:
state - Backing state of entity to be instantiated
Returns:
Entity instance

createEntity

public <U extends NodeBacked> U createEntity(org.neo4j.graphdb.Node state,
                                             Class<U> type)
Description copied from interface: TypeRepresentationStrategy
Instantiate the entity given its state. The type of the desired entity is also specified. If the type is not compatible with what the strategy can infer from the state, IllegalArgumentException is thrown.

Specified by:
createEntity in interface TypeRepresentationStrategy<org.neo4j.graphdb.Node,NodeBacked>
Parameters:
state - Backing state of entity to be instantiated
type - Type of entity to be instantiated
Returns:
Entity instance

projectEntity

public <U extends NodeBacked> U projectEntity(org.neo4j.graphdb.Node state,
                                              Class<U> type)
Description copied from interface: TypeRepresentationStrategy
Instantiate the entity of the given type, with the given state as backing state. No checking is done by the strategy.

Specified by:
projectEntity in interface TypeRepresentationStrategy<org.neo4j.graphdb.Node,NodeBacked>
Parameters:
state - Backing state of entity to be instantiated
type - Type of entity to be instantiated
Returns:
Entity instance.

Spring Data Graph

Copyright © 2011 SpringSource. All Rights Reserved.