本文整理汇总了Java中org.jivesoftware.smackx.commands.AdHocCommand.Action类的典型用法代码示例。如果您正苦于以下问题:Java Action类的具体用法?Java Action怎么用?Java Action使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
Action类属于org.jivesoftware.smackx.commands.AdHocCommand包,在下文中一共展示了Action类的13个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的Java代码示例。
示例1: parse
import org.jivesoftware.smackx.commands.AdHocCommand.Action; //导入依赖的package包/类
@Override
public AdHocCommandData parse(XmlPullParser parser, int initialDepth)
throws XmlPullParserException, IOException, SmackException {
boolean done = false;
AdHocCommandData adHocCommandData = new AdHocCommandData();
DataFormProvider dataFormProvider = new DataFormProvider();
int eventType;
String elementName;
String namespace;
adHocCommandData.setSessionID(parser.getAttributeValue("", "sessionid"));
adHocCommandData.setNode(parser.getAttributeValue("", "node"));
// Status
String status = parser.getAttributeValue("", "status");
if (AdHocCommand.Status.executing.toString().equalsIgnoreCase(status)) {
adHocCommandData.setStatus(AdHocCommand.Status.executing);
}
else if (AdHocCommand.Status.completed.toString().equalsIgnoreCase(status)) {
adHocCommandData.setStatus(AdHocCommand.Status.completed);
}
else if (AdHocCommand.Status.canceled.toString().equalsIgnoreCase(status)) {
adHocCommandData.setStatus(AdHocCommand.Status.canceled);
}
// Action
String action = parser.getAttributeValue("", "action");
if (action != null) {
Action realAction = AdHocCommand.Action.valueOf(action);
if (realAction == null || realAction.equals(Action.unknown)) {
adHocCommandData.setAction(Action.unknown);
}
else {
adHocCommandData.setAction(realAction);
}
}
while (!done) {
eventType = parser.next();
elementName = parser.getName();
namespace = parser.getNamespace();
if (eventType == XmlPullParser.START_TAG) {
if (parser.getName().equals("actions")) {
String execute = parser.getAttributeValue("", "execute");
if (execute != null) {
adHocCommandData.setExecuteAction(AdHocCommand.Action.valueOf(execute));
}
}
else if (parser.getName().equals("next")) {
adHocCommandData.addAction(AdHocCommand.Action.next);
}
else if (parser.getName().equals("complete")) {
adHocCommandData.addAction(AdHocCommand.Action.complete);
}
else if (parser.getName().equals("prev")) {
adHocCommandData.addAction(AdHocCommand.Action.prev);
}
else if (elementName.equals("x") && namespace.equals("jabber:x:data")) {
adHocCommandData.setForm((DataForm) dataFormProvider.parse(parser));
}
else if (parser.getName().equals("note")) {
AdHocCommandNote.Type type = AdHocCommandNote.Type.valueOf(
parser.getAttributeValue("", "type"));
String value = parser.nextText();
adHocCommandData.addNote(new AdHocCommandNote(type, value));
}
else if (parser.getName().equals("error")) {
XMPPError error = PacketParserUtils.parseError(parser);
adHocCommandData.setError(error);
}
}
else if (eventType == XmlPullParser.END_TAG) {
if (parser.getName().equals("command")) {
done = true;
}
}
}
return adHocCommandData;
}
开发者ID:TTalkIM,项目名称:Smack,代码行数:79,代码来源:AdHocCommandDataProvider.java
示例2: setAction
import org.jivesoftware.smackx.commands.AdHocCommand.Action; //导入依赖的package包/类
public void setAction(AdHocCommand.Action action) {
this.action = action;
}
开发者ID:TTalkIM,项目名称:Smack,代码行数:4,代码来源:AdHocCommandData.java
示例3: getActions
import org.jivesoftware.smackx.commands.AdHocCommand.Action; //导入依赖的package包/类
public List<Action> getActions() {
return actions;
}
开发者ID:TTalkIM,项目名称:Smack,代码行数:4,代码来源:AdHocCommandData.java
示例4: addAction
import org.jivesoftware.smackx.commands.AdHocCommand.Action; //导入依赖的package包/类
public void addAction(Action action) {
actions.add(action);
}
开发者ID:TTalkIM,项目名称:Smack,代码行数:4,代码来源:AdHocCommandData.java
示例5: setExecuteAction
import org.jivesoftware.smackx.commands.AdHocCommand.Action; //导入依赖的package包/类
public void setExecuteAction(Action executeAction) {
this.executeAction = executeAction;
}
开发者ID:TTalkIM,项目名称:Smack,代码行数:4,代码来源:AdHocCommandData.java
示例6: getExecuteAction
import org.jivesoftware.smackx.commands.AdHocCommand.Action; //导入依赖的package包/类
public Action getExecuteAction() {
return executeAction;
}
开发者ID:TTalkIM,项目名称:Smack,代码行数:4,代码来源:AdHocCommandData.java
示例7: parseIQ
import org.jivesoftware.smackx.commands.AdHocCommand.Action; //导入依赖的package包/类
public IQ parseIQ(XmlPullParser parser) throws Exception {
boolean done = false;
AdHocCommandData adHocCommandData = new AdHocCommandData();
DataFormProvider dataFormProvider = new DataFormProvider();
int eventType;
String elementName;
String namespace;
adHocCommandData.setSessionID(parser.getAttributeValue("", "sessionid"));
adHocCommandData.setNode(parser.getAttributeValue("", "node"));
// Status
String status = parser.getAttributeValue("", "status");
if (AdHocCommand.Status.executing.toString().equalsIgnoreCase(status)) {
adHocCommandData.setStatus(AdHocCommand.Status.executing);
}
else if (AdHocCommand.Status.completed.toString().equalsIgnoreCase(status)) {
adHocCommandData.setStatus(AdHocCommand.Status.completed);
}
else if (AdHocCommand.Status.canceled.toString().equalsIgnoreCase(status)) {
adHocCommandData.setStatus(AdHocCommand.Status.canceled);
}
// Action
String action = parser.getAttributeValue("", "action");
if (action != null) {
Action realAction = AdHocCommand.Action.valueOf(action);
if (realAction == null || realAction.equals(Action.unknown)) {
adHocCommandData.setAction(Action.unknown);
}
else {
adHocCommandData.setAction(realAction);
}
}
while (!done) {
eventType = parser.next();
elementName = parser.getName();
namespace = parser.getNamespace();
if (eventType == XmlPullParser.START_TAG) {
if (parser.getName().equals("actions")) {
String execute = parser.getAttributeValue("", "execute");
if (execute != null) {
adHocCommandData.setExecuteAction(AdHocCommand.Action.valueOf(execute));
}
}
else if (parser.getName().equals("next")) {
adHocCommandData.addAction(AdHocCommand.Action.next);
}
else if (parser.getName().equals("complete")) {
adHocCommandData.addAction(AdHocCommand.Action.complete);
}
else if (parser.getName().equals("prev")) {
adHocCommandData.addAction(AdHocCommand.Action.prev);
}
else if (elementName.equals("x") && namespace.equals("jabber:x:data")) {
adHocCommandData.setForm((DataForm) dataFormProvider.parseExtension(parser));
}
else if (parser.getName().equals("note")) {
AdHocCommandNote.Type type = AdHocCommandNote.Type.valueOf(
parser.getAttributeValue("", "type"));
String value = parser.nextText();
adHocCommandData.addNote(new AdHocCommandNote(type, value));
}
else if (parser.getName().equals("error")) {
XMPPError error = PacketParserUtils.parseError(parser);
adHocCommandData.setError(error);
}
}
else if (eventType == XmlPullParser.END_TAG) {
if (parser.getName().equals("command")) {
done = true;
}
}
}
return adHocCommandData;
}
开发者ID:ice-coffee,项目名称:EIM,代码行数:77,代码来源:AdHocCommandDataProvider.java
示例8: parseIQ
import org.jivesoftware.smackx.commands.AdHocCommand.Action; //导入依赖的package包/类
public IQ parseIQ(XmlPullParser parser) throws Exception {
boolean done = false;
AdHocCommandData adHocCommandData = new AdHocCommandData();
DataFormProvider dataFormProvider = new DataFormProvider();
int eventType;
String elementName;
String namespace;
adHocCommandData
.setSessionID(parser.getAttributeValue("", "sessionid"));
adHocCommandData.setNode(parser.getAttributeValue("", "node"));
// Status
String status = parser.getAttributeValue("", "status");
if (AdHocCommand.Status.executing.toString().equalsIgnoreCase(status)) {
adHocCommandData.setStatus(AdHocCommand.Status.executing);
} else if (AdHocCommand.Status.completed.toString().equalsIgnoreCase(
status)) {
adHocCommandData.setStatus(AdHocCommand.Status.completed);
} else if (AdHocCommand.Status.canceled.toString().equalsIgnoreCase(
status)) {
adHocCommandData.setStatus(AdHocCommand.Status.canceled);
}
// Action
String action = parser.getAttributeValue("", "action");
if (action != null) {
Action realAction = AdHocCommand.Action.valueOf(action);
if (realAction == null || realAction.equals(Action.unknown)) {
adHocCommandData.setAction(Action.unknown);
} else {
adHocCommandData.setAction(realAction);
}
}
while (!done) {
eventType = parser.next();
elementName = parser.getName();
namespace = parser.getNamespace();
if (eventType == XmlPullParser.START_TAG) {
if (parser.getName().equals("actions")) {
String execute = parser.getAttributeValue("", "execute");
if (execute != null) {
adHocCommandData.setExecuteAction(AdHocCommand.Action
.valueOf(execute));
}
} else if (parser.getName().equals("next")) {
adHocCommandData.addAction(AdHocCommand.Action.next);
} else if (parser.getName().equals("complete")) {
adHocCommandData.addAction(AdHocCommand.Action.complete);
} else if (parser.getName().equals("prev")) {
adHocCommandData.addAction(AdHocCommand.Action.prev);
} else if (elementName.equals("x")
&& namespace.equals("jabber:x:data")) {
adHocCommandData.setForm((DataForm) dataFormProvider
.parseExtension(parser));
} else if (parser.getName().equals("note")) {
AdHocCommandNote.Type type = AdHocCommandNote.Type
.valueOf(parser.getAttributeValue("", "type"));
String value = parser.nextText();
adHocCommandData.addNote(new AdHocCommandNote(type, value));
} else if (parser.getName().equals("error")) {
XMPPError error = PacketParserUtils.parseError(parser);
adHocCommandData.setError(error);
}
} else if (eventType == XmlPullParser.END_TAG) {
if (parser.getName().equals("command")) {
done = true;
}
}
}
return adHocCommandData;
}
开发者ID:ikantech,项目名称:xmppsupport_v2,代码行数:73,代码来源:AdHocCommandDataProvider.java
示例9: setAction
import org.jivesoftware.smackx.commands.AdHocCommand.Action; //导入依赖的package包/类
public void setAction(AdHocCommand.Action action) {
this.action = action;
}
开发者ID:ikantech,项目名称:xmppsupport_v2,代码行数:4,代码来源:AdHocCommandData.java
示例10: getActions
import org.jivesoftware.smackx.commands.AdHocCommand.Action; //导入依赖的package包/类
public List<Action> getActions() {
return actions;
}
开发者ID:ikantech,项目名称:xmppsupport_v2,代码行数:4,代码来源:AdHocCommandData.java
示例11: addAction
import org.jivesoftware.smackx.commands.AdHocCommand.Action; //导入依赖的package包/类
public void addAction(Action action) {
actions.add(action);
}
开发者ID:ikantech,项目名称:xmppsupport_v2,代码行数:4,代码来源:AdHocCommandData.java
示例12: setExecuteAction
import org.jivesoftware.smackx.commands.AdHocCommand.Action; //导入依赖的package包/类
public void setExecuteAction(Action executeAction) {
this.executeAction = executeAction;
}
开发者ID:ikantech,项目名称:xmppsupport_v2,代码行数:4,代码来源:AdHocCommandData.java
示例13: getExecuteAction
import org.jivesoftware.smackx.commands.AdHocCommand.Action; //导入依赖的package包/类
public Action getExecuteAction() {
return executeAction;
}
开发者ID:ikantech,项目名称:xmppsupport_v2,代码行数:4,代码来源:AdHocCommandData.java
注:本文中的org.jivesoftware.smackx.commands.AdHocCommand.Action类示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论