本文整理汇总了Java中org.ksoap2.serialization.SoapObject.getPropertyCount方法的典型用法代码示例。如果您正苦于以下问题:Java SoapObject.getPropertyCount方法的具体用法?Java SoapObject.getPropertyCount怎么用?Java SoapObject.getPropertyCount使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类org.ksoap2.serialization.SoapObject
的用法示例。
在下文中一共展示了SoapObject.getPropertyCount方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: TotalsForUser
import org.ksoap2.serialization.SoapObject; //导入方法依赖的package包/类
public Totals[] TotalsForUser(String szAuthToken, FlightQuery fq, Context c) {
SoapObject Request = setMethod("TotalsForUserWithQuery");
Request.addProperty("szAuthToken", szAuthToken);
Request.addProperty("fq", fq == null ? new FlightQuery() : fq);
Totals[] rgt = new Totals[0];
SoapObject result = (SoapObject) Invoke(c);
if (result == null)
setLastError("Error retrieving totals - " + getLastError());
else {
try {
rgt = new Totals[result.getPropertyCount()];
for (int i = 0; i < rgt.length; i++) {
rgt[i] = new Totals((SoapObject) result.getProperty(i));
}
} catch (Exception e) {
setLastError(getLastError() + e.getMessage());
}
}
return rgt;
}
示例2: ReadResults
import org.ksoap2.serialization.SoapObject; //导入方法依赖的package包/类
private CustomPropertyType[] ReadResults(SoapObject result) {
CustomPropertyType[] rgcptCached = getCachedPropertyTypes();
CustomPropertyType[] rgcpt;
try {
rgcpt = new CustomPropertyType[result.getPropertyCount()];
for (int i = 0; i < rgcpt.length; i++)
rgcpt[i] = new CustomPropertyType(
(SoapObject) result.getProperty(i));
// if we made it here, we have successfully retrieved new values.
// ONLY NOW should we update the cache AND only if we got at least as many
// as we had originally. (Could be the same # but favorites could have changed)
if (rgcpt.length >= rgcptCached.length)
updateCache(rgcpt);
} catch (Exception e) {
setLastError(getLastError() + e.getMessage());
rgcpt = rgcptCached;
}
return rgcpt;
}
示例3: PropertiesForFlight
import org.ksoap2.serialization.SoapObject; //导入方法依赖的package包/类
public FlightProperty[] PropertiesForFlight(String szAuthToken, int idFlight, Context c) {
SoapObject Request = setMethod("PropertiesForFlight");
Request.addProperty("szAuthUserToken", szAuthToken);
Request.addProperty("idFlight", idFlight);
FlightProperty[] rgfp = new FlightProperty[0];
SoapObject result = (SoapObject) Invoke(c);
if (result == null)
setLastError("Error getting properties for flight - " + getLastError());
else {
try {
rgfp = new FlightProperty[result.getPropertyCount()];
for (int i = 0; i < rgfp.length; i++)
rgfp[i] = new FlightProperty((SoapObject) result.getProperty(i));
} catch (Exception e) {
setLastError(getLastError() + e.getMessage());
}
}
return rgfp;
}
示例4: CurrencyForUser
import org.ksoap2.serialization.SoapObject; //导入方法依赖的package包/类
public CurrencyStatusItem[] CurrencyForUser(String szAuthToken, Context c) {
SoapObject Request = setMethod("GetCurrencyForUser");
Request.addProperty("szAuthToken", szAuthToken);
CurrencyStatusItem[] rgCsi = new CurrencyStatusItem[0];
SoapObject result = (SoapObject) Invoke(c);
if (result == null)
setLastError("Error retrieving currency - " + getLastError());
else {
try {
rgCsi = new CurrencyStatusItem[result.getPropertyCount()];
for (int i = 0; i < rgCsi.length; i++) {
rgCsi[i] = new CurrencyStatusItem((SoapObject) result.getProperty(i));
}
} catch (Exception e) {
setLastError(getLastError() + e.getMessage());
}
}
return rgCsi;
}
示例5: ReadResults
import org.ksoap2.serialization.SoapObject; //导入方法依赖的package包/类
private Aircraft[] ReadResults(SoapObject result, Boolean fFallbackToCache) {
Aircraft[] rgAc = new Aircraft[0];
try {
rgAc = new Aircraft[result.getPropertyCount()];
for (int i = 0; i < rgAc.length; i++)
rgAc[i] = new Aircraft((SoapObject) result.getProperty(i));
// if we made it here, we have successfully retrieved new values.
// ONLY NOW should we update the cache
updateCache(rgAc);
} catch (Exception e) {
setLastError(getLastError() + e.getMessage());
if (fFallbackToCache)
rgAc = getCachedAircraft();
}
return rgAc;
}
示例6: GetMakesAndModels
import org.ksoap2.serialization.SoapObject; //导入方法依赖的package包/类
public MakesandModels[] GetMakesAndModels(Context c) {
setMethod("MakesAndModels"); // no need to save the request, since nothing goes out
MakesandModels[] rgMM = new MakesandModels[0];
SoapObject result = (SoapObject) Invoke(c);
if (result == null)
setLastError("Error retrieving makes and models - " + getLastError());
else {
try {
rgMM = new MakesandModels[result.getPropertyCount()];
for (int i = 0; i < rgMM.length; i++) {
rgMM[i] = new MakesandModels((SoapObject) result.getProperty(i));
}
} catch (Exception e) {
setLastError(getLastError() + e.getMessage());
}
}
return rgMM;
}
示例7: FlightPathForFlight
import org.ksoap2.serialization.SoapObject; //导入方法依赖的package包/类
public LatLong[] FlightPathForFlight(String szAuthToken, int idFlight, Context c) {
LatLong[] rgll = new LatLong[0];
SoapObject Request = setMethod("FlightPathForFlight");
Request.addProperty("szAuthUserToken", szAuthToken);
Request.addProperty("idFlight", idFlight);
SoapObject result = (SoapObject) Invoke(c);
if (result == null)
setLastError("Failed to get path for flight - " + getLastError());
else {
try {
rgll = new LatLong[result.getPropertyCount()];
for (int i = 0; i < rgll.length; i++)
rgll[i] = new LatLong((SoapObject) result.getProperty(i));
} catch (Exception e) {
rgll = new LatLong[0];
setLastError(getLastError() + e.getMessage());
}
}
return rgll;
}
示例8: FromProperties
import org.ksoap2.serialization.SoapObject; //导入方法依赖的package包/类
@Override
public void FromProperties(SoapObject so) {
idPropType = Integer.parseInt(so.getProperty("PropTypeID").toString());
szTitle = so.getProperty("Title").toString();
szSortKey = so.getPropertySafelyAsString("SortKey");
szFormatString = so.getProperty("FormatString").toString();
szDescription = ReadNullableString(so, "Description");
cptType = CFPPropertyType.valueOf(so.getProperty("Type").toString());
cptFlag = Integer.parseInt(so.getProperty("Flags").toString());
IsFavorite = Boolean.parseBoolean(so.getProperty("IsFavorite").toString());
SoapObject PrevVals = (SoapObject) so.getProperty("PreviousValues");
int cVals = PrevVals.getPropertyCount();
PreviousValues = new String[cVals];
for (int i = 0; i < cVals; i++)
PreviousValues[i] = PrevVals.getPropertyAsString(i);
}
示例9: setIntArrayValue
import org.ksoap2.serialization.SoapObject; //导入方法依赖的package包/类
private static void setIntArrayValue(Object originalObjec, SoapObject sObj, Field f) {
try {
if (sObj!=null) {
int count = sObj.getPropertyCount();
if (count>0) {
Integer[] array = new Integer[count];
for (int i=0; i<count; i++) {
array[i] = Integer.valueOf(sObj.getProperty(i).toString());
}
f.set(originalObjec, array);
}
else {
f.set(originalObjec, null);
}
}
} catch (Exception e) {
e.printStackTrace();
}
}
示例10: setBooleanArrayValue
import org.ksoap2.serialization.SoapObject; //导入方法依赖的package包/类
private static void setBooleanArrayValue(Object originalObjec, SoapObject sObj, Field f) {
try {
if (sObj!=null) {
int count = sObj.getPropertyCount();
if (count>0) {
Boolean[] array = new Boolean[count];
for (int i=0; i<count; i++) {
array[i] = Boolean.valueOf(sObj.getProperty(i).toString());
}
f.set(originalObjec, array);
}
else {
f.set(originalObjec, null);
}
}
} catch (Exception e) {
e.printStackTrace();
}
}
示例11: setFloatArrayValue
import org.ksoap2.serialization.SoapObject; //导入方法依赖的package包/类
private static void setFloatArrayValue(Object originalObjec, SoapObject sObj, Field f) {
try {
if (sObj!=null) {
int count = sObj.getPropertyCount();
if (count>0) {
Float[] array = new Float[count];
for (int i=0; i<count; i++) {
array[i] = Float.valueOf(sObj.getProperty(i).toString());
}
f.set(originalObjec, array);
}
else {
f.set(originalObjec, null);
}
}
} catch (Exception e) {
e.printStackTrace();
}
}
示例12: setDoubleArrayValue
import org.ksoap2.serialization.SoapObject; //导入方法依赖的package包/类
private static void setDoubleArrayValue(Object originalObjec, SoapObject sObj, Field f) {
try {
if (sObj!=null) {
int count = sObj.getPropertyCount();
if (count>0) {
Double[] array = new Double[count];
for (int i=0; i<count; i++) {
array[i] = Double.valueOf(sObj.getProperty(i).toString());
}
f.set(originalObjec, array);
}
else {
f.set(originalObjec, null);
}
}
} catch (Exception e) {
e.printStackTrace();
}
}
示例13: setStringArrayValue
import org.ksoap2.serialization.SoapObject; //导入方法依赖的package包/类
private static void setStringArrayValue(Object originalObjec, SoapObject sObj, Field f) {
try {
if (sObj!=null) {
int count = sObj.getPropertyCount();
if (count>0) {
String[] array = new String[count];
for (int i=0; i<count; i++) {
array[i] = sObj.getProperty(i).toString();
}
f.set(originalObjec, array);
}
else {
f.set(originalObjec, null);
}
}
} catch (Exception e) {
e.printStackTrace();
}
}
示例14: setObjectArrayValue
import org.ksoap2.serialization.SoapObject; //导入方法依赖的package包/类
private static void setObjectArrayValue(Object originalObjec, SoapObject sObj, Field f) {
Class cl = f.getType().getComponentType();
try {
if (sObj!=null) {
int count = sObj.getPropertyCount();
if (count>0) {
Object array = Array.newInstance(cl, count);
for (int i=0; i<count; i++) {
Object o = cl.newInstance();
o = fromSoapObject(o,cl,(SoapObject) sObj.getProperty(i));
Array.set(array, i, o);
}
f.set(originalObjec, array);
}
else {
f.set(originalObjec, null);
}
}
} catch (Exception e) {
e.printStackTrace();
}
}
示例15: setObjectArrayValue
import org.ksoap2.serialization.SoapObject; //导入方法依赖的package包/类
private static void setObjectArrayValue(Object originalObjec, SoapObject sObj, Field f) {
Class cl = f.getType().getComponentType();
try {
if (sObj!=null) {
int count = sObj.getPropertyCount();
if (count>0) {
Object array = Array.newInstance(cl, count);
for (int i=0; i<count; i++) {
Object o = cl.newInstance();
o = fromSoapObject(o,cl,(SoapObject) sObj.getProperty(i));
Array.set(array, i, o);
}
f.set(originalObjec, array);
}
else {
f.set(originalObjec, null);
}
}
} catch (Exception e) {
e.printStackTrace();
}
}