Search in sources :

Example 1 with IAdaptingType

use of weborb.types.IAdaptingType in project Android-SDK by Backendless.

the class AdaptingResponder method responseHandler.

public final void responseHandler(Object adaptingType) {
    IAdaptingType type = (IAdaptingType) adaptingType;
    IAdaptingType bodyHolder = ((NamedObject) type).getTypedObject();
    if (((IAdaptingType) adaptingType).getDefaultType().equals(ErrMessage.class)) {
        if (nextResponder != null) {
            nextResponder.errorHandler(adaptFault((AnonymousObject) bodyHolder));
        }
    } else {
        IAdaptingType entity = (IAdaptingType) ((AnonymousObject) bodyHolder).getProperties().get("body");
        try {
            adaptingPolicy.adapt(clazz, entity, nextResponder);
        } catch (AdaptingException e) {
            errorHandler(new BackendlessFault(e));
        }
    }
}
Also used : AnonymousObject(weborb.reader.AnonymousObject) IAdaptingType(weborb.types.IAdaptingType) NamedObject(weborb.reader.NamedObject) AdaptingException(weborb.exceptions.AdaptingException) BackendlessFault(com.backendless.exceptions.BackendlessFault)

Aggregations

BackendlessFault (com.backendless.exceptions.BackendlessFault)1 AdaptingException (weborb.exceptions.AdaptingException)1 AnonymousObject (weborb.reader.AnonymousObject)1 NamedObject (weborb.reader.NamedObject)1 IAdaptingType (weborb.types.IAdaptingType)1