Interface StructureGenerator.GenerationContext

All Superinterfaces:
StructureGenerator.Context
Enclosing interface:
StructureGenerator

@PublicApi public static interface StructureGenerator.GenerationContext extends StructureGenerator.Context
  • Method Details

    • addItemChangeFilter

      void addItemChangeFilter(ItemChangeFilter filter)
      Detect future changes those may affect the forest with ItemChangeFilter
      Parameters:
      filter - the filter to detect changes
    • addUpdateChecker

      void addUpdateChecker(UpdateChecker checker)
      Detect future changes those may affect the forest with UpdateChecker
      Parameters:
      checker - the checker to detect changes
    • previewForest

      @NotNull ItemForest previewForest()
      Returns the forest fragment currently processed by the generator.
    • inputForest

      @Nullable ItemForest inputForest()
      Returns the forest fragment generated before current generator call. Null if generator driver does not support this feature.
    • getForestSpecBeingTransformed

      @Nullable ForestSpec getForestSpecBeingTransformed()
      Returns:
      in case the generation is a transformation, returns forest spec of the forest source being transformed; returns null if the generation is not a transformation (in-structure generation). If multiple transformations take place, the generator running (N+1)th transformation will receive the spec for the result of the Nth transformation.
    • itemsUpdate

      @NotNull ItemVersionUpdate itemsUpdate()
      Returns the item version update since the last time the current forest was generated.
    • itemsUpdate

      @NotNull ItemVersionUpdate itemsUpdate(DataVersion sinceVersion)
      Returns the item version update since the given version.
      Parameters:
      sinceVersion - item data version
    • putObject

      void putObject(@Nullable Object key, @Nullable Object value)
      Associate an object with the current forest. The object will be kept with the generated forest and available to the current generator during future regenerations, unless the generated forest is evicted from cache or its internal caches are cleared.
      Parameters:
      key - the key
      value - the value
      See Also:
    • getObject

      @Nullable <T> T getObject(@Nullable Object key)
      Retrieves the object previously associated with the given forest by this generator. May return null if the generated forest was evicted from cache or its internal caches were cleared.
      Type Parameters:
      T - result type
      Parameters:
      key - the key
      See Also:
    • putTempObject

      void putTempObject(@Nullable Object key, @Nullable Object value)
      Associate an object with this context. Unlike putObject(Object, Object), the object will be available to this generator only during the current regeneration.
      Parameters:
      key - the key
      value - the value
      See Also:
    • getTempObject

      @Nullable <T> T getTempObject(@Nullable Object key)
      Retrieves the object previously associated with this context by this generator.
      Type Parameters:
      T - result type
      Parameters:
      key - the key
      See Also:
    • getForestSpec

      @NotNull ForestSpec getForestSpec()
      Returns the forest spec of the forest being generated.
    • isStopped

      boolean isStopped()
      Checks if current generation process is stopped
      Returns:
      true iff further generation shouldn't be continued, false otherwise