Home | History | Annotate | Download | only in packet
      1 /**
      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 
     20 package org.jivesoftware.smackx.workgroup.packet;
     21 
     22 import java.util.List;
     23 import java.util.Map;
     24 
     25 import org.jivesoftware.smackx.workgroup.MetaData;
     26 import org.jivesoftware.smackx.workgroup.util.MetaDataUtils;
     27 
     28 import org.jivesoftware.smack.packet.PacketExtension;
     29 import org.jivesoftware.smack.provider.PacketExtensionProvider;
     30 
     31 import 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  */
     38 public 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 }