If you think the Android project smsgateway-android listed in this page is inappropriate, such as containing malicious code/tools or violating the copyright, please email info at java2s dot com, thanks.
Java Source Code
/*
*//fromwww.java2s.com
* ((e)) emite: A pure gwt (Google Web Toolkit) xmpp (jabber) library
*
* (c) 2008-2009 The emite development team (see CREDITS for details)
* This file is part of emite.
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU Lesser General Public License as
* published by the Free Software Foundation, either version 3 of the
* License, or (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*
*/package com.calclab.emite.core.client.packet;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;
/**
* A substitute of null
*/publicclass NoPacket implements IPacket {
publicstaticfinal NoPacket INSTANCE = new NoPacket();
privatestaticfinal HashMap<String, String> EMPTY_ATTRIBUTTES = new HashMap<String, String>();
privatestaticfinal List<? extends IPacket> EMPTY_CHILDREN = new ArrayList<IPacket>();
private NoPacket() {
}
publicvoid addChild(final IPacket child) {
}
public IPacket addChild(final String nodeName, final String xmlns) {
returnthis;
}
public String getAttribute(final String name) {
return null;
}
public HashMap<String, String> getAttributes() {
return EMPTY_ATTRIBUTTES;
}
public List<? extends IPacket> getChildren() {
return EMPTY_CHILDREN;
}
public List<? extends IPacket> getChildren(final PacketMatcher filter) {
return EMPTY_CHILDREN;
}
public List<? extends IPacket> getChildren(final String name) {
return EMPTY_CHILDREN;
}
publicint getChildrenCount() {
return 0;
}
public IPacket getFirstChild(final PacketMatcher filter) {
returnthis;
}
public IPacket getFirstChild(final String childName) {
returnthis;
}
public String getName() {
return null;
}
public IPacket getParent() {
returnthis;
}
public String getText() {
return null;
}
publicboolean hasAttribute(final String name) {
return false;
}
publicboolean hasAttribute(final String name, final String value) {
return false;
}
publicboolean hasChild(final String name) {
return false;
}
publicboolean removeChild(final IPacket child) {
return false;
}
publicvoid render(final StringBuffer buffer) {
}
publicvoid setAttribute(final String name, final String value) {
}
publicvoid setText(final String text) {
}
public IPacket With(final IPacket child) {
returnthis;
}
public IPacket With(final String name, finallong value) {
returnthis;
}
public IPacket With(final String name, final String value) {
returnthis;
}
public IPacket WithText(final String text) {
returnthis;
}
}