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
ConstructorsConstructorDescriptionCreates a snippet context with default values for type (Store.Type.PAGESTOREand release (false). -
Method Summary
Modifier and TypeMethodDescription@Nullable IDProviderProvide a FirstSpirit element to retrieve further information for snippet building.@Nullable FormDataProvide meta data to be used within a snippet definition.Provide the store type to create a snippet for.booleanIndicates, whether the snippet context is in release mode.voidsetElement(@Nullable IDProvider element) Sets the element to be used as context information source for snippet building.voidsetMetadata(@Nullable FormData metadata) Sets the meta data to be used for snippet building.voidsetRelease(boolean release) Sets the release type to be used for snippet building.voidsetStoreType(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.PAGESTOREand 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.Typeto 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
-