当前位置: 首页>>代码示例>>Java>>正文


Java SoapObject.getAttribute方法代码示例

本文整理汇总了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();
        }
    }
}
 
开发者ID:moltak,项目名称:Rx-Soap,代码行数:18,代码来源:SoapDeserializer.java

示例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();
        }
    }
}
 
开发者ID:moltak,项目名称:Rx-Soap,代码行数:17,代码来源:SoapDeserializer.java

示例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();
        }
    }
}
 
开发者ID:moltak,项目名称:Rx-Soap,代码行数:17,代码来源:SoapDeserializer.java

示例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();
        }
    }
}
 
开发者ID:moltak,项目名称:Rx-Soap,代码行数:17,代码来源:SoapDeserializer.java

示例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();
        }
    }
}
 
开发者ID:moltak,项目名称:Rx-Soap,代码行数:17,代码来源:SoapDeserializer.java

示例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();
        }
    }
}
 
开发者ID:joaocruz04,项目名称:JSoap,代码行数:18,代码来源:SoapDeserializer.java

示例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();
        }
    }
}
 
开发者ID:joaocruz04,项目名称:JSoap,代码行数:17,代码来源:SoapDeserializer.java

示例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();
        }
    }
}
 
开发者ID:joaocruz04,项目名称:JSoap,代码行数:17,代码来源:SoapDeserializer.java

示例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();
        }
    }
}
 
开发者ID:joaocruz04,项目名称:JSoap,代码行数:17,代码来源:SoapDeserializer.java

示例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();
        }
    }
}
 
开发者ID:joaocruz04,项目名称:JSoap,代码行数:17,代码来源:SoapDeserializer.java

示例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();
        }
    }
}
 
开发者ID:joaocruz04,项目名称:JSoap,代码行数:18,代码来源:SOAPDeserializable.java

示例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();
        }
    }
}
 
开发者ID:joaocruz04,项目名称:JSoap,代码行数:17,代码来源:SOAPDeserializable.java

示例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();
        }
    }
}
 
开发者ID:joaocruz04,项目名称:JSoap,代码行数:17,代码来源:SOAPDeserializable.java

示例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();
        }
    }
}
 
开发者ID:joaocruz04,项目名称:JSoap,代码行数:17,代码来源:SOAPDeserializable.java

示例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();
        }
    }
}
 
开发者ID:joaocruz04,项目名称:JSoap,代码行数:17,代码来源:SOAPDeserializable.java


注:本文中的org.ksoap2.serialization.SoapObject.getAttribute方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。