LOGGER.entering(invocation);
InvocationProcessingState resultingState = NO_STATE_CHANGE;
try {
switch (invocation.getMethodType()) {
case WRITE_START_ELEMENT:
if (filteringOn) {
depth++;
} else {
filteringOn = startFiltering(invocation, writer);
if (filteringOn) {
resultingState = START_FILTERING;
}
}
break;
case WRITE_END_ELEMENT:
if (filteringOn) {
if (depth == 0) {
filteringOn = false;
resultingState = STOP_FILTERING;
// return invocation.execute(mirrorWriter);
} else {
depth--;
}
}
break;
case CLOSE:
if (filteringOn) {
filteringOn = false;
resultingState = STOP_FILTERING;
}
default:
break;
}
return resultingState;
} finally {
LOGGER.exiting(resultingState);
}