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.ExtensionElement;
022import org.jivesoftware.smack.packet.Stanza;
023import org.jivesoftware.smack.packet.XmlElement;
024import org.jivesoftware.smack.util.PacketParserUtils;
025
026/**
027 * This interface defines {@link ExtensionElement} implementations that contain other
028 * extensions.  This effectively extends the idea of an extension within one of the
029 * top level {@link Stanza} types to consider any embedded element to be an extension
030 * of its parent.  This more easily enables the usage of some of Smacks parsing
031 * utilities such as {@link PacketParserUtils#parseExtensionElement(String, String, org.jivesoftware.smack.xml.XmlPullParser, org.jivesoftware.smack.packet.XmlEnvironment)} to be used
032 * to parse any element of the XML being parsed.
033 *
034 * <p>Top level extensions have only one element, but they can have multiple children, or
035 * their children can have multiple children.  This interface is a way of allowing extensions
036 * to be embedded within one another as a partial or complete one to one mapping of extension
037 * to element.
038 *
039 * @author Robin Collier
040 */
041public interface EmbeddedPacketExtension extends XmlElement {
042    /**
043     * Get the list of embedded {@link ExtensionElement} objects.
044     *
045     * @return List of embedded {@link ExtensionElement}
046     */
047    List<XmlElement> getExtensions();
048}