Search in sources :

Example 1 with S3KeyFilter

use of com.amazonaws.services.s3.model.S3KeyFilter in project aws-sdk-android by aws-amplify.

the class S3KeyFilterStaxUnmarshaller method unmarshall.

@Override
public S3KeyFilter unmarshall(StaxUnmarshallerContext context) throws Exception {
    final int originalDepth = context.getCurrentDepth();
    int targetDepth = originalDepth + 1;
    if (context.isStartOfDocument()) {
        targetDepth += 1;
    }
    final S3KeyFilter filter = new S3KeyFilter();
    while (true) {
        final int xmlEvent = context.nextEvent();
        if (xmlEvent == XmlPullParser.END_DOCUMENT) {
            break;
        } else if (xmlEvent == XmlPullParser.START_TAG) {
            if (context.testExpression("FilterRule", targetDepth)) {
                filter.addFilterRule(FilterRuleStaxUnmarshaller.getInstance().unmarshall(context));
            }
        } else if (xmlEvent == XmlPullParser.END_TAG) {
            if (context.getCurrentDepth() < originalDepth) {
                return filter;
            }
        }
    }
    return filter;
}
Also used : S3KeyFilter(com.amazonaws.services.s3.model.S3KeyFilter)

Aggregations

S3KeyFilter (com.amazonaws.services.s3.model.S3KeyFilter)1