blob: af76986bec3262b16eb0245101d624df1c4b6079 [file] [log] [blame]
Shuyi Chend7955ce2013-05-22 14:51:55 -07001/**
2 * $Revision$
3 * $Date$
4 *
5 * Copyright 2003-2007 Jive Software.
6 *
7 * All rights reserved. Licensed under the Apache License, Version 2.0 (the "License");
8 * you may not use this file except in compliance with the License.
9 * You may obtain a copy of the License at
10 *
11 * http://www.apache.org/licenses/LICENSE-2.0
12 *
13 * Unless required by applicable law or agreed to in writing, software
14 * distributed under the License is distributed on an "AS IS" BASIS,
15 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
16 * See the License for the specific language governing permissions and
17 * limitations under the License.
18 */
19
20package org.jivesoftware.smackx.workgroup.packet;
21
22import java.util.List;
23import java.util.Map;
24
25import org.jivesoftware.smackx.workgroup.MetaData;
26import org.jivesoftware.smackx.workgroup.util.MetaDataUtils;
27
28import org.jivesoftware.smack.packet.PacketExtension;
29import org.jivesoftware.smack.provider.PacketExtensionProvider;
30
31import org.xmlpull.v1.XmlPullParser;
32
33/**
34 * This provider parses meta data if it's not contained already in a larger extension provider.
35 *
36 * @author loki der quaeler
37 */
38public class MetaDataProvider implements PacketExtensionProvider {
39
40 /**
41 * PacketExtensionProvider implementation
42 */
43 public PacketExtension parseExtension (XmlPullParser parser)
44 throws Exception {
45 Map<String, List<String>> metaData = MetaDataUtils.parseMetaData(parser);
46
47 return new MetaData(metaData);
48 }
49}