本文整理汇总了Java中org.ksoap2.serialization.SoapObject.getAttribute方法的典型用法代码示例。如果您正苦于以下问题:Java SoapObject.getAttribute方法的具体用法?Java SoapObject.getAttribute怎么用?Java SoapObject.getAttribute使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类org.ksoap2.serialization.SoapObject
的用法示例。
在下文中一共展示了SoapObject.getAttribute方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: setStringValue
import org.ksoap2.serialization.SoapObject; //导入方法依赖的package包/类
private static void setStringValue(Object originalObjec, SoapObject object, String name, Field f, boolean isAttribute) {
try {
SoapPrimitive trObj = isAttribute ? (SoapPrimitive) object.getAttribute(name) : (SoapPrimitive) object.getProperty(name);
if (trObj!=null) {
String res = trObj.toString();
f.set(originalObjec, res);
}
} catch (Exception e) {
if (!(e instanceof ClassCastException))
e.printStackTrace();
try {
f.set(originalObjec, null);
} catch (IllegalAccessException e1) {
e1.printStackTrace();
}
}
}
示例2: setBooleanValue
import org.ksoap2.serialization.SoapObject; //导入方法依赖的package包/类
private static void setBooleanValue(Object originalObjec, SoapObject object, String name, Field f, boolean isAttribute) {
try {
SoapPrimitive trObj = isAttribute ? (SoapPrimitive) object.getAttribute(name) : (SoapPrimitive) object.getProperty(name);
if (trObj!=null) {
boolean b = Boolean.valueOf(trObj.toString());
f.set(originalObjec, b);
}
} catch (Exception e) {
e.printStackTrace();
try {
f.set(originalObjec, false);
} catch (IllegalAccessException e1) {
e1.printStackTrace();
}
}
}
示例3: setDoubleValue
import org.ksoap2.serialization.SoapObject; //导入方法依赖的package包/类
private static void setDoubleValue(Object originalObjec, SoapObject object, String name, Field f, boolean isAttribute) {
try {
SoapPrimitive trObj = isAttribute ? (SoapPrimitive) object.getAttribute(name) : (SoapPrimitive) object.getProperty(name);
if (trObj!=null) {
double b = Double.valueOf(trObj.toString());
f.set(originalObjec, b);
}
} catch (Exception e) {
e.printStackTrace();
try {
f.set(originalObjec, 0);
} catch (IllegalAccessException e1) {
e1.printStackTrace();
}
}
}
示例4: setFloatValue
import org.ksoap2.serialization.SoapObject; //导入方法依赖的package包/类
private static void setFloatValue(Object originalObjec, SoapObject object, String name, Field f, boolean isAttribute) {
try {
SoapPrimitive trObj = isAttribute ? (SoapPrimitive) object.getAttribute(name) : (SoapPrimitive) object.getProperty(name);
if (trObj!=null) {
float b = Float.valueOf(trObj.toString());
f.set(originalObjec, b);
}
} catch (Exception e) {
e.printStackTrace();
try {
f.set(originalObjec, 0);
} catch (IllegalAccessException e1) {
e1.printStackTrace();
}
}
}
示例5: setIntValue
import org.ksoap2.serialization.SoapObject; //导入方法依赖的package包/类
private static void setIntValue(Object originalObjec, SoapObject object, String name, Field f, boolean isAttribute) {
try {
SoapPrimitive trObj = isAttribute ? (SoapPrimitive) object.getAttribute(name) : (SoapPrimitive) object.getProperty(name);
if (trObj!=null) {
int b = Integer.valueOf(trObj.toString());
f.set(originalObjec, b);
}
} catch (Exception e) {
e.printStackTrace();
try {
f.set(originalObjec, 0);
} catch (IllegalAccessException e1) {
e1.printStackTrace();
}
}
}
示例6: setStringValue
import org.ksoap2.serialization.SoapObject; //导入方法依赖的package包/类
private static void setStringValue(Object originalObjec, SoapObject object, String name, Field f, boolean isAttribute) {
try {
SoapPrimitive trObj = isAttribute ? (SoapPrimitive) object.getAttribute(name) : (SoapPrimitive) object.getProperty(name);
if (trObj!=null) {
String res = trObj.getValue().toString();
f.set(originalObjec, res);
}
} catch (Exception e) {
if (!(e instanceof ClassCastException))
e.printStackTrace();
try {
f.set(originalObjec, null);
} catch (IllegalAccessException e1) {
e1.printStackTrace();
}
}
}
示例7: setBooleanValue
import org.ksoap2.serialization.SoapObject; //导入方法依赖的package包/类
private static void setBooleanValue(Object originalObjec, SoapObject object, String name, Field f, boolean isAttribute) {
try {
SoapPrimitive trObj = isAttribute ? (SoapPrimitive) object.getAttribute(name) : (SoapPrimitive) object.getProperty(name);
if (trObj!=null) {
boolean b = Boolean.valueOf(trObj.getValue().toString());
f.set(originalObjec, b);
}
} catch (Exception e) {
e.printStackTrace();
try {
f.set(originalObjec, false);
} catch (IllegalAccessException e1) {
e1.printStackTrace();
}
}
}
示例8: setDoubleValue
import org.ksoap2.serialization.SoapObject; //导入方法依赖的package包/类
private static void setDoubleValue(Object originalObjec, SoapObject object, String name, Field f, boolean isAttribute) {
try {
SoapPrimitive trObj = isAttribute ? (SoapPrimitive) object.getAttribute(name) : (SoapPrimitive) object.getProperty(name);
if (trObj!=null) {
double b = Double.valueOf(trObj.getValue().toString());
f.set(originalObjec, b);
}
} catch (Exception e) {
e.printStackTrace();
try {
f.set(originalObjec, 0);
} catch (IllegalAccessException e1) {
e1.printStackTrace();
}
}
}
示例9: setFloatValue
import org.ksoap2.serialization.SoapObject; //导入方法依赖的package包/类
private static void setFloatValue(Object originalObjec, SoapObject object, String name, Field f, boolean isAttribute) {
try {
SoapPrimitive trObj = isAttribute ? (SoapPrimitive) object.getAttribute(name) : (SoapPrimitive) object.getProperty(name);
if (trObj!=null) {
float b = Float.valueOf(trObj.getValue().toString());
f.set(originalObjec, b);
}
} catch (Exception e) {
e.printStackTrace();
try {
f.set(originalObjec, 0);
} catch (IllegalAccessException e1) {
e1.printStackTrace();
}
}
}
示例10: setIntValue
import org.ksoap2.serialization.SoapObject; //导入方法依赖的package包/类
private static void setIntValue(Object originalObjec, SoapObject object, String name, Field f, boolean isAttribute) {
try {
SoapPrimitive trObj = isAttribute ? (SoapPrimitive) object.getAttribute(name) : (SoapPrimitive) object.getProperty(name);
if (trObj!=null) {
int b = Integer.valueOf(trObj.getValue().toString());
f.set(originalObjec, b);
}
} catch (Exception e) {
e.printStackTrace();
try {
f.set(originalObjec, 0);
} catch (IllegalAccessException e1) {
e1.printStackTrace();
}
}
}
示例11: setStringValue
import org.ksoap2.serialization.SoapObject; //导入方法依赖的package包/类
private void setStringValue(SoapObject object, String name, Field f, boolean isAttribute) {
try {
SoapPrimitive trObj = isAttribute ? (SoapPrimitive) object.getAttribute(name) : (SoapPrimitive) object.getProperty(name);
if (trObj!=null) {
String res = trObj.getValue().toString();
f.set(this, res);
}
} catch (Exception e) {
if (!(e instanceof ClassCastException))
e.printStackTrace();
try {
f.set(this, null);
} catch (IllegalAccessException e1) {
e1.printStackTrace();
}
}
}
示例12: setBooleanValue
import org.ksoap2.serialization.SoapObject; //导入方法依赖的package包/类
private void setBooleanValue(SoapObject object, String name, Field f, boolean isAttribute) {
try {
SoapPrimitive trObj = isAttribute ? (SoapPrimitive) object.getAttribute(name) : (SoapPrimitive) object.getProperty(name);
if (trObj!=null) {
boolean b = Boolean.valueOf(trObj.getValue().toString());
f.set(this, b);
}
} catch (Exception e) {
e.printStackTrace();
try {
f.set(this, false);
} catch (IllegalAccessException e1) {
e1.printStackTrace();
}
}
}
示例13: setDoubleValue
import org.ksoap2.serialization.SoapObject; //导入方法依赖的package包/类
private void setDoubleValue(SoapObject object, String name, Field f, boolean isAttribute) {
try {
SoapPrimitive trObj = isAttribute ? (SoapPrimitive) object.getAttribute(name) : (SoapPrimitive) object.getProperty(name);
if (trObj!=null) {
double b = Double.valueOf(trObj.getValue().toString());
f.set(this, b);
}
} catch (Exception e) {
e.printStackTrace();
try {
f.set(this, 0);
} catch (IllegalAccessException e1) {
e1.printStackTrace();
}
}
}
示例14: setFloatValue
import org.ksoap2.serialization.SoapObject; //导入方法依赖的package包/类
private void setFloatValue(SoapObject object, String name, Field f, boolean isAttribute) {
try {
SoapPrimitive trObj = isAttribute ? (SoapPrimitive) object.getAttribute(name) : (SoapPrimitive) object.getProperty(name);
if (trObj!=null) {
float b = Float.valueOf(trObj.getValue().toString());
f.set(this, b);
}
} catch (Exception e) {
e.printStackTrace();
try {
f.set(this, 0);
} catch (IllegalAccessException e1) {
e1.printStackTrace();
}
}
}
示例15: setIntValue
import org.ksoap2.serialization.SoapObject; //导入方法依赖的package包/类
private void setIntValue(SoapObject object, String name, Field f, boolean isAttribute) {
try {
SoapPrimitive trObj = isAttribute ? (SoapPrimitive) object.getAttribute(name) : (SoapPrimitive) object.getProperty(name);
if (trObj!=null) {
int b = Integer.valueOf(trObj.getValue().toString());
f.set(this, b);
}
} catch (Exception e) {
e.printStackTrace();
try {
f.set(this, 0);
} catch (IllegalAccessException e1) {
e1.printStackTrace();
}
}
}