Class SnippetContext

java.lang.Object
de.espirit.firstspirit.agency.SnippetContext

public class SnippetContext extends Object
A configuration definition to provide contextual information being used in snippet building.
Since:
5.2.201206
  • Constructor Details

    • SnippetContext

      public SnippetContext()
      Creates a snippet context with default values for type (Store.Type.PAGESTORE and release (false).
      Since:
      5.2.201206
  • Method Details

    • getStoreType

      @NotNull public Store.Type getStoreType()
      Provide the store type to create a snippet for.
      Returns:
      The store type.
      Since:
      5.2.201206
    • setStoreType

      public void setStoreType(@NotNull Store.Type storeType)
      Sets the store type to be used for snippet building.
      Parameters:
      storeType - The Store.Type to be used.
      Throws:
      NullPointerException - If the given argument is null.
      Since:
      5.2.201206
    • isRelease

      public boolean isRelease()
      Indicates, whether the snippet context is in release mode.
      Returns:
      true, if in release mode.
      Since:
      5.2.201206
    • setRelease

      public void setRelease(boolean release)
      Sets the release type to be used for snippet building.
      Parameters:
      release - true, for release mode, false, for current mode.
      Since:
      5.2.201206
    • getMetaData

      @Nullable public @Nullable FormData getMetaData()
      Provide meta data to be used within a snippet definition.
      Returns:
      Some meta data or null.
      Since:
      5.2.201206
    • setMetadata

      public void setMetadata(@Nullable @Nullable FormData metadata)
      Sets the meta data to be used for snippet building.
      Parameters:
      metadata - The meta data to be used.
      Since:
      5.2.201206
    • getContextualElement

      @Nullable public @Nullable IDProvider getContextualElement()
      Provide a FirstSpirit element to retrieve further information for snippet building.
      Returns:
      Some ID provider or null.
      Since:
      5.2.201206
    • setElement

      public void setElement(@Nullable @Nullable IDProvider element)
      Sets the element to be used as context information source for snippet building.
      Parameters:
      element - The element to be used.
      Since:
      5.2.201206