Class MetaDataUtils
java.lang.Object
org.jivesoftware.smackx.workgroup.util.MetaDataUtils
Utility class for meta-data parsing and writing.
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionparseMetaData
(XmlPullParser parser) Parses any available meta-data and returns it as a Map of String name/value pairs.static String
serializeMetaData
(Map<String, List<String>> metaData) Serializes a Map of String name/value pairs into the meta-data XML format.
-
Constructor Details
-
MetaDataUtils
public MetaDataUtils()
-
-
Method Details
-
parseMetaData
public static Map<String,List<String>> parseMetaData(XmlPullParser parser) throws XmlPullParserException, IOException Parses any available meta-data and returns it as a Map of String name/value pairs. The parser must be positioned at an opening meta-data tag, or the an empty map will be returned.- Parameters:
parser
- the XML parser positioned at an opening meta-data tag.- Returns:
- the meta-data.
- Throws:
XmlPullParserException
- if an error occurs while parsing the XML.IOException
- if an error occurs while parsing the XML.
-
serializeMetaData
Serializes a Map of String name/value pairs into the meta-data XML format.- Parameters:
metaData
- the Map of meta-data as Map<String, List<String>>- Returns:
- the meta-data values in XML form.
-