001/** 002 * 003 * Copyright the original author or authors 004 * 005 * Licensed under the Apache License, Version 2.0 (the "License"); 006 * you may not use this file except in compliance with the License. 007 * You may obtain a copy of the License at 008 * 009 * http://www.apache.org/licenses/LICENSE-2.0 010 * 011 * Unless required by applicable law or agreed to in writing, software 012 * distributed under the License is distributed on an "AS IS" BASIS, 013 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 014 * See the License for the specific language governing permissions and 015 * limitations under the License. 016 */ 017package org.jivesoftware.smackx.pubsub; 018 019import java.util.List; 020 021import org.jivesoftware.smack.packet.Packet; 022import org.jivesoftware.smack.packet.PacketExtension; 023import org.jivesoftware.smack.util.PacketParserUtils; 024 025/** 026 * This interface defines {@link PacketExtension} implementations that contain other 027 * extensions. This effectively extends the idea of an extension within one of the 028 * top level {@link Packet} types to consider any embedded element to be an extension 029 * of its parent. This more easily enables the usage of some of Smacks parsing 030 * utilities such as {@link PacketParserUtils#parsePacketExtension(String, String, org.xmlpull.v1.XmlPullParser)} to be used 031 * to parse any element of the XML being parsed. 032 * 033 * <p>Top level extensions have only one element, but they can have multiple children, or 034 * their children can have multiple children. This interface is a way of allowing extensions 035 * to be embedded within one another as a partial or complete one to one mapping of extension 036 * to element. 037 * 038 * @author Robin Collier 039 */ 040public interface EmbeddedPacketExtension extends PacketExtension 041{ 042 /** 043 * Get the list of embedded {@link PacketExtension} objects. 044 * 045 * @return List of embedded {@link PacketExtension} 046 */ 047 List<PacketExtension> getExtensions(); 048}