use of weborb.reader.StringType in project Android-SDK by Backendless.
the class BackendlessFileFactory method createObject.
public Object createObject(IAdaptingType argument) {
if (argument instanceof NamedObject)
argument = ((NamedObject) argument).getTypedObject();
if (argument.getClass().getName().equals("weborb.reader.NullType"))
return null;
ReferenceCache refCache = ReferenceCache.getInstance();
if (refCache.hasObject(argument, BackendlessFile.class)) {
return refCache.getObject(argument, BackendlessFile.class);
} else {
if (argument instanceof StringType) {
StringType stringType = (StringType) argument;
BackendlessFile file;
if (Backendless.isAndroid())
file = new BackendlessFileAndroid(stringType.getValue());
else
file = new BackendlessFile(stringType.getValue());
refCache.addObject(argument, BackendlessFile.class, file);
return file;
} else
throw new RuntimeException("unknown type");
}
}
use of weborb.reader.StringType in project Android-SDK by Backendless.
the class AdaptingResponder method adaptFault.
public static BackendlessFault adaptFault(AnonymousObject bodyHolder) {
final StringType faultMessage = (StringType) bodyHolder.getProperties().get("faultString");
final StringType faultDetail = (StringType) bodyHolder.getProperties().get("faultDetail");
final StringType faultCode = (StringType) bodyHolder.getProperties().get("faultCode");
final AnonymousObject extendedData = (AnonymousObject) bodyHolder.getProperties().get("extendedData");
return new BackendlessFault(new Fault((String) faultMessage.defaultAdapt(), (String) faultDetail.defaultAdapt(), (String) faultCode.defaultAdapt()), (Map<String, Object>) extendedData.defaultAdapt());
}
Aggregations