本文整理汇总了Java中org.jivesoftware.smack.packet.XMPPError.getExtension方法的典型用法代码示例。如果您正苦于以下问题:Java XMPPError.getExtension方法的具体用法?Java XMPPError.getExtension怎么用?Java XMPPError.getExtension使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类org.jivesoftware.smack.packet.XMPPError
的用法示例。
在下文中一共展示了XMPPError.getExtension方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: getSpecificErrorCondition
import org.jivesoftware.smack.packet.XMPPError; //导入方法依赖的package包/类
/**
* Returns the specific condition of the <code>error</code> or <tt>null</tt> if the
* error doesn't have any.
*
* @param error the error the get the specific condition from.
* @return the specific condition of this error, or null if it doesn't have
* any.
*/
public static SpecificErrorCondition getSpecificErrorCondition(XMPPError error) {
// This method is implemented to provide an easy way of getting a packet
// extension of the XMPPError.
for (SpecificErrorCondition condition : SpecificErrorCondition.values()) {
if (error.getExtension(condition.toString(),
AdHocCommandData.SpecificError.namespace) != null) {
return condition;
}
}
return null;
}
示例2: getSpecificErrorCondition
import org.jivesoftware.smack.packet.XMPPError; //导入方法依赖的package包/类
/**
* Returns the specific condition of the <code>error</code> or <tt>null</tt>
* if the error doesn't have any.
*
* @param error
* the error the get the specific condition from.
* @return the specific condition of this error, or null if it doesn't have
* any.
*/
public static SpecificErrorCondition getSpecificErrorCondition(
XMPPError error) {
// This method is implemented to provide an easy way of getting a packet
// extension of the XMPPError.
for (SpecificErrorCondition condition : SpecificErrorCondition.values()) {
if (error.getExtension(condition.toString(),
AdHocCommandData.SpecificError.namespace) != null) {
return condition;
}
}
return null;
}