Home | History | Annotate | Download | only in pubsub
      1 /**
      2  * All rights reserved. Licensed under the Apache License, Version 2.0 (the "License");
      3  * you may not use this file except in compliance with the License.
      4  * You may obtain a copy of the License at
      5  *
      6  *     http://www.apache.org/licenses/LICENSE-2.0
      7  *
      8  * Unless required by applicable law or agreed to in writing, software
      9  * distributed under the License is distributed on an "AS IS" BASIS,
     10  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
     11  * See the License for the specific language governing permissions and
     12  * limitations under the License.
     13  */
     14 package org.jivesoftware.smackx.pubsub;
     15 
     16 import java.util.List;
     17 
     18 import org.jivesoftware.smack.packet.Packet;
     19 import org.jivesoftware.smack.packet.PacketExtension;
     20 import org.jivesoftware.smack.util.PacketParserUtils;
     21 
     22 /**
     23  * This interface defines {@link PacketExtension} implementations that contain other
     24  * extensions.  This effectively extends the idea of an extension within one of the
     25  * top level {@link Packet} types to consider any embedded element to be an extension
     26  * of its parent.  This more easily enables the usage of some of Smacks parsing
     27  * utilities such as {@link PacketParserUtils#parsePacketExtension(String, String, org.xmlpull.v1.XmlPullParser)} to be used
     28  * to parse any element of the XML being parsed.
     29  *
     30  * <p>Top level extensions have only one element, but they can have multiple children, or
     31  * their children can have multiple children.  This interface is a way of allowing extensions
     32  * to be embedded within one another as a partial or complete one to one mapping of extension
     33  * to element.
     34  *
     35  * @author Robin Collier
     36  */
     37 public interface EmbeddedPacketExtension extends PacketExtension
     38 {
     39 	/**
     40 	 * Get the list of embedded {@link PacketExtension} objects.
     41 	 *
     42 	 * @return List of embedded {@link PacketExtension}
     43 	 */
     44 	List<PacketExtension> getExtensions();
     45 }
     46