001/** 002 * 003 * Copyright 2003-2007 Jive Software. 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 */ 017 018package org.jivesoftware.smack.packet; 019 020/** 021 * Interface to represent packet extensions. A packet extension is an XML subdocument 022 * with a root element name and namespace. Packet extensions are used to provide 023 * extended functionality beyond what is in the base XMPP specification. Examples of 024 * packet extensions include message events, message properties, and extra presence data. 025 * IQ packets cannot contain packet extensions. 026 * 027 * @see DefaultPacketExtension 028 * @see org.jivesoftware.smack.provider.PacketExtensionProvider 029 * @author Matt Tucker 030 */ 031public interface PacketExtension { 032 033 /** 034 * Returns the root element name. 035 * 036 * @return the element name. 037 */ 038 public String getElementName(); 039 040 /** 041 * Returns the root element XML namespace. 042 * 043 * @return the namespace. 044 */ 045 public String getNamespace(); 046 047 /** 048 * Returns the XML representation of the PacketExtension. 049 * 050 * @return the packet extension as XML. 051 */ 052 public CharSequence toXML(); 053}