Package de.espirit.firstspirit.agency
Class SnippetContext
java.lang.Object
de.espirit.firstspirit.agency.SnippetContext
A configuration definition to provide contextual information being used in snippet building.
- Since:
- 5.2.201206
-
Constructor Summary
ConstructorDescriptionCreates a snippet context with default values for type (Store.Type.PAGESTORE
and release (false
). -
Method Summary
Modifier and TypeMethodDescription@Nullable IDProvider
Provide a FirstSpirit element to retrieve further information for snippet building.@Nullable FormData
Provide meta data to be used within a snippet definition.Provide the store type to create a snippet for.boolean
Indicates, whether the snippet context is in release mode.void
setElement
(@Nullable IDProvider element) Sets the element to be used as context information source for snippet building.void
setMetadata
(@Nullable FormData metadata) Sets the meta data to be used for snippet building.void
setRelease
(boolean release) Sets the release type to be used for snippet building.void
setStoreType
(Store.Type storeType) Sets the store type to be used for snippet building.
-
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
Provide the store type to create a snippet for.- Returns:
- The store type.
- Since:
- 5.2.201206
-
setStoreType
Sets the store type to be used for snippet building.- Parameters:
storeType
- TheStore.Type
to be used.- Throws:
NullPointerException
- If the given argument isnull
.- 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
Provide meta data to be used within a snippet definition.- Returns:
- Some meta data or
null
. - Since:
- 5.2.201206
-
setMetadata
Sets the meta data to be used for snippet building.- Parameters:
metadata
- The meta data to be used.- Since:
- 5.2.201206
-
getContextualElement
Provide a FirstSpirit element to retrieve further information for snippet building.- Returns:
- Some ID provider or
null
. - Since:
- 5.2.201206
-
setElement
Sets the element to be used as context information source for snippet building.- Parameters:
element
- The element to be used.- Since:
- 5.2.201206
-