Class EventCommentParser
java.lang.Object
org.opencastproject.event.comment.EventCommentParser
Convenience implementation that supports serializing and deserializing comment catalogs.
-
Method Summary
Modifier and TypeMethodDescriptionstatic StringgetAsXml(Collection<EventComment> comments) Serializes a comment collection.static StringgetAsXml(EventComment comment) Serializes the comment.static StringgetAsXml(EventCommentReply reply) Serializes the comment reply.static EventCommentgetCommentFromXml(String xml, UserDirectoryService userDirectoryService) Parses the comment catalog and returns its object representation.
-
Method Details
-
getCommentFromXml
public static EventComment getCommentFromXml(String xml, UserDirectoryService userDirectoryService) throws EventCommentException Parses the comment catalog and returns its object representation.- Parameters:
xml- the serialized commentuserDirectoryService- the user directory service- Returns:
- the comment instance
- Throws:
EventCommentException- unable to parse comment from XML
-
getAsXml
Serializes a comment collection.- Parameters:
comments- the comment collection- Returns:
- the serialized comment collection
- Throws:
EventCommentException- unable to serialize comment collection to XML
-
getAsXml
Serializes the comment.- Parameters:
comment- the comment- Returns:
- the serialized comment
- Throws:
EventCommentException- unable to serialize comment to XML
-
getAsXml
Serializes the comment reply.- Parameters:
reply- the comment reply- Returns:
- the serialized comment reply
- Throws:
EventCommentException- unable to serialize comment reply to XML
-