Class NullPopulator

java.lang.Object
com.googlecode.objectify.impl.translate.NullPopulator
All Implemented Interfaces:
Populator<Object>

public class NullPopulator
extends Object
implements Populator<Object>

Populator which does nothing.

Author:
Jeff Schnitzer
  • Field Summary

    Fields
    Modifier and Type
    Field
    Description
     
  • Constructor Summary

    Constructors
    Constructor
    Description
     
  • Method Summary

    Modifier and Type
    Method
    Description
    void
    load​(com.google.appengine.api.datastore.PropertyContainer node, LoadContext ctx, Path path, Object into)
    Loads the content of the specified datastore node, returning the pojo equivalent.
    void
    save​(Object pojo, boolean index, SaveContext ctx, Path path, com.google.appengine.api.datastore.PropertyContainer into)
    Translates a pojo (or some component thereof) into a format suitable for storage in the datastore.

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • Field Details

  • Constructor Details

    • NullPopulator

      public NullPopulator()
  • Method Details

    • load

      public void load(com.google.appengine.api.datastore.PropertyContainer node, LoadContext ctx, Path path, Object into)
      Description copied from interface: Populator

      Loads the content of the specified datastore node, returning the pojo equivalent.

      There is one special value for loading: If a Result is returned from a translator, the content of the Result will be used instead, but delayed until ctx.done() is called. This happens at the end of a "round" of load operations and is the magic trick that makes populating entity references work efficiently.

      Specified by:
      load in interface Populator<Object>
      Parameters:
      node - is the part of the native datastore entity tree we are transforming.
      ctx - holds state information during an entity load.
      path - is the current path to this translator
      into - is an optional parameter; sometimes we need to create an object at a higher level and pass it down through a stack of translators. Most translators will ignore this, but some will have special behavior, for example, this allows collections to be recycled.
    • save

      public void save(Object pojo, boolean index, SaveContext ctx, Path path, com.google.appengine.api.datastore.PropertyContainer into)
      Description copied from interface: Populator
      Translates a pojo (or some component thereof) into a format suitable for storage in the datastore.
      Specified by:
      save in interface Populator<Object>
      Parameters:
      pojo - is an object from the pojo entity graph; possibly the whole graph or possibly just a leaf field.
      index - is whether the instruction so far is to index or not index property values
      path - is the path that we have taken to get here, which could be long due to re-entrant translators (ie, an embedded pojo that also has a reference to the same class).