Package de.cxp.ocs.preprocessor.util
Class CategorySearchData
java.lang.Object
de.cxp.ocs.preprocessor.util.CategorySearchData
Takes a list of
/
separated category paths and splits them into
separate levels. Also saves all leaf paths.-
Field Summary
Fields -
Constructor Summary
ConstructorsConstructorDescriptionCreates a new instance and splits the category paths into levels and leafs. -
Method Summary
Modifier and TypeMethodDescriptionvoid
add
(Collection<String[]> categoryPaths) getCategory
(int lvl) Returns a category by level.Returns the leaf entries of each path.int
Returns the number of the deepest category level from the path list.void
toSourceItem
(Map<String, Object> sourceData, String categoryFieldName) Copies the data of this instance into the sourceData map.
-
Field Details
-
CATEGORY_LEAF_SUFFIX
- See Also:
-
CATEGORY_LVL_SUFFIX
- See Also:
-
PATH_SEPARATOR
- See Also:
-
-
Constructor Details
-
CategorySearchData
public CategorySearchData()Creates a new instance and splits the category paths into levels and leafs.
-
-
Method Details
-
add
-
getCategoryLvlDepth
public int getCategoryLvlDepth()Returns the number of the deepest category level from the path list.- Returns:
- the category depth.
-
getCategory
Returns a category by level.- Parameters:
lvl
- the level of the category to return.- Returns:
- the category.
- Throws:
IndexOutOfBoundsException
- if the level is lower than 0 or greater thangetCategoryLvlDepth()
-
getCategoryLeaf
Returns the leaf entries of each path.- Returns:
- the leaf entries.
-
toSourceItem
Copies the data of this instance into the sourceData map. The name of the category field is used as prefix, followed by either- _lvl_x
- _leaf
- Parameters:
sourceData
- the source item where the data will be stored.categoryFieldName
- the category field which is used to obtain the name of the stored fields.
-