Class BiContext
- java.lang.Object
-
- org.symphonyoss.symphony.messageml.bi.BiContext
-
-
Field Summary
Fields Modifier and Type Field Description static StringLIBRARY_VERSION
-
Constructor Summary
Constructors Constructor Description BiContext()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidaddItem(BiItem item)Adds a specific item to the context.voidaddItemWithValue(String itemName, Object itemValue)Add a specific item to the context.List<BiItem>getItems()booleanisAttributeSet(String itemName, String attributeName)Used to check if an attribute is present in the BI context for a given item.voidupdateItemCount(String itemName)Used for simple messageML elements (like Paragraphs, Links, Headers) where we only want to keep the count of attributes found.voidupdateItemCount(String itemName, String attributeName)Used for simple messageML elements (like Paragraphs, Links, Headers) where we only want to keep the count of attributes found.voidupdateItemCount(String itemName, Map<String,Object> attributes)Used for elements where we want to increase attribute's value.voidupdateItemWithMaxValue(String itemName, Integer attributeValue)Used for messageML elements in which we want to keep track of the maximum value found inside the message (like max number of columns used for a table).
-
-
-
Field Detail
-
LIBRARY_VERSION
public static final String LIBRARY_VERSION
-
-
Method Detail
-
addItem
public void addItem(BiItem item)
Adds a specific item to the context. No check if an item with same name already exists, the item will be added in any case.- Parameters:
item- to be added
-
addItemWithValue
public void addItemWithValue(String itemName, Object itemValue)
Add a specific item to the context. Used for simple items where we want to keep track of the size/value of the entity- Parameters:
itemName- name of the item to be addeditemValue- value to be assigned
-
updateItemCount
public void updateItemCount(String itemName, String attributeName)
Used for simple messageML elements (like Paragraphs, Links, Headers) where we only want to keep the count of attributes found. It checks if the context already has an item for the element and if that's the case it will increase the count of the specific attribute found with attributeName. If context does not have the item it will create a new one with default values.- Parameters:
itemName- name of the element to be checkedattributeName- name of the attribute to be increased
-
updateItemCount
public void updateItemCount(String itemName)
Used for simple messageML elements (like Paragraphs, Links, Headers) where we only want to keep the count of attributes found. It checks if the context already has an item for the element and if that's the case it will increase the count of the specific attribute. If context does not have the item it will create a new one with default values.- Parameters:
itemName- name of the element to be checked
-
updateItemCount
public void updateItemCount(String itemName, Map<String,Object> attributes)
Used for elements where we want to increase attribute's value. If the element does not exist in the context yet, it is put. If the element exists in the context but no value found for the attribute, it is put. If the element and its attribute exist in the context, then the value is increased.- Parameters:
itemName- name of the element to be checkedattributes- map of attributes for the given element
-
updateItemWithMaxValue
public void updateItemWithMaxValue(String itemName, Integer attributeValue)
Used for messageML elements in which we want to keep track of the maximum value found inside the message (like max number of columns used for a table). It checks if the context already has an item for that element and if that's the case it will copute the max value and update the item accordingly. If context does not have the item it will create a new one with max value the one passed in input.- Parameters:
itemName- name of the element to be checked
-
-