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


Java SoapObject.hasProperty方法代码示例

本文整理汇总了Java中org.ksoap2.serialization.SoapObject.hasProperty方法的典型用法代码示例。如果您正苦于以下问题:Java SoapObject.hasProperty方法的具体用法?Java SoapObject.hasProperty怎么用?Java SoapObject.hasProperty使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在org.ksoap2.serialization.SoapObject的用法示例。


在下文中一共展示了SoapObject.hasProperty方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: FromProperties

import org.ksoap2.serialization.SoapObject; //导入方法依赖的package包/类
@Override
public void FromProperties(SoapObject so) {
    Comment = ReadNullableString(so, "Comment");
    VirtualPath = ReadNullableString(so, "VirtualPath");
    URLFullImage = ReadNullableString(so, "URLFullImage");
    ThumbnailFile = ReadNullableString(so, "ThumbnailFile");
    Width = Integer.parseInt(so.getProperty("Width").toString());
    Height = Integer.parseInt(so.getProperty("Height").toString());
    WidthThumbnail = Integer.parseInt(so.getProperty("WidthThumbnail").toString());
    HeightThumbnail = Integer.parseInt(so.getProperty("HeightThumbnail").toString());

    if (so.hasProperty("Location")) {
        SoapObject location = (SoapObject) so.getProperty("Location");
        Location = new LatLong();
        Location.FromProperties(location);
    }

    if (so.hasProperty("ImageType"))
        ImageType = ImageFileType.valueOf(so.getProperty("ImageType").toString());
}
 
开发者ID:ericberman,项目名称:MyFlightbookAndroid,代码行数:21,代码来源:MFBImageInfo.java

示例2: FromProperties

import org.ksoap2.serialization.SoapObject; //导入方法依赖的package包/类
public void FromProperties(SoapObject so) {
    Description = so.getProperty("Description").toString();
    Value = Double.parseDouble(so.getProperty("Value").toString());

    // Optional strings come through as "anyType" if they're not actually present, so check for that.
    Object o = so.getProperty("SubDescription");
    if (o != null && !o.toString().contains("anyType"))
        SubDescription = o.toString();

    NumericType = NumType.valueOf(so.getProperty("NumericType").toString());

    if (so.hasProperty("Query")) {
        SoapObject q = (SoapObject) so.getProperty("Query");
        Query = new FlightQuery();
        Query.FromProperties(q);
    }


}
 
开发者ID:ericberman,项目名称:MyFlightbookAndroid,代码行数:20,代码来源:Totals.java

示例3: parseObject

import org.ksoap2.serialization.SoapObject; //导入方法依赖的package包/类
private static void parseObject(SoapObject in, Object out) throws IllegalAccessException, InstantiationException {

        for(Field field : out.getClass().getDeclaredFields()){
            field.setAccessible(true);
            String fieldName = field.getName();

            // Ignore fields that doesn't exist in SoapObject
            if ( ! in.hasProperty(fieldName) ) continue;

            Object valueToParse = in.getProperty(fieldName);
            Class fieldClass = field.getType();

            // If the type of field is Object, primitive or immutable, assign it directly
            if ( canBeAssignedDirectly(fieldClass) ){
                field.set(out, getPrimitiveValue(fieldClass, valueToParse));
            }
            else if ( isCollection(fieldClass) ) {
                fieldClass = getSpecificCollectionClass(field);
                Collection c = (Collection) fieldClass.newInstance();
                parse((SoapObject) valueToParse,c);
                field.set(out, c);
            }
            else if ( isMap(fieldClass) ) {
                fieldClass = getSpecificMapClass(field);
                Map map = (Map) fieldClass.newInstance();
                parse((SoapObject) valueToParse,map);
                field.set(out, map);
            }
            else{
                Object fieldObject = fieldClass.newInstance();
                parse((SoapObject) valueToParse,fieldObject);
                field.set(out, fieldObject);
            }
        }
    }
 
开发者ID:prashant31191,项目名称:meets-android,代码行数:36,代码来源:SoapParser.java


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