Class MessageMLParser
- java.lang.Object
-
- org.symphonyoss.symphony.messageml.MessageMLParser
-
public class MessageMLParser extends Object
Converts a string representation of the message and optional entity data into a MessageMLV2 document tree.
-
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidclearBiContext()ElementcreateElement(Element element, Element parent)Create a MessageML element based on the DOM element's name and attributes.Optional<Map<Class<? extends SplittableElement>,Map<String,String>>>getAllSplittableAttributes(String id)Returns all attributes corresponding to the id (used internally during parsing)Optional<Map<Class<? extends SplittableElement>,org.apache.commons.lang3.tuple.Pair<String,String>>>getAllSplittableValues(String id)Returns all values corresponding to the id (used internally during parsing)BiContextgetBiContext()FormatEnumgetMessageFormat()Optional<Map<String,String>>getSplittableAttributes(String id, Class<? extends SplittableElement> clazz)Returns the attributes corresponding to the id for a splittable element (used internally during parsing)voidloadElementId(String id)Loads the values of the "id" attribute of elements being parsed and verifies if these values are unique.
-
-
-
Method Detail
-
createElement
public Element createElement(Element element, Element parent) throws InvalidInputException
Create a MessageML element based on the DOM element's name and attributes. It can return null when the element must be not created (e.g. see label elementLabelableElementor tooltip elementTooltipableElement) that is PresentationML specific, but in MessageML is not an element, instead it is an attribute of another element) and it should be not considered an error; in case of a real error, an exception is thrown- Throws:
InvalidInputException
-
loadElementId
public void loadElementId(String id) throws InvalidInputException
Loads the values of the "id" attribute of elements being parsed and verifies if these values are unique.- Parameters:
id-- Throws:
InvalidInputException
-
getSplittableAttributes
public Optional<Map<String,String>> getSplittableAttributes(String id, Class<? extends SplittableElement> clazz) throws InvalidInputException
Returns the attributes corresponding to the id for a splittable element (used internally during parsing)- Throws:
InvalidInputException
-
getAllSplittableAttributes
public Optional<Map<Class<? extends SplittableElement>,Map<String,String>>> getAllSplittableAttributes(String id) throws InvalidInputException
Returns all attributes corresponding to the id (used internally during parsing)- Throws:
InvalidInputException
-
getAllSplittableValues
public Optional<Map<Class<? extends SplittableElement>,org.apache.commons.lang3.tuple.Pair<String,String>>> getAllSplittableValues(String id) throws InvalidInputException
Returns all values corresponding to the id (used internally during parsing)- Throws:
InvalidInputException
-
getMessageFormat
public FormatEnum getMessageFormat()
-
getBiContext
public BiContext getBiContext()
-
clearBiContext
public void clearBiContext()
-
-