@Override public void end(InterpretationContext ic, String name) throws ActionException { if (!ic.isEmpty() && (ic.peekObject() instanceof ConditionalIncludeAction.State)) { ConditionalIncludeAction.State state = (ConditionalIncludeAction.State)ic.popObject(); URL url = state.getUrl(); if (url != null) { addInfo("Path found [" + url.toString() + "]"); try { processInclude(ic, url); } catch (JoranException e) { addError("Failed to process include [" + url.toString() + "]", e); } } else { addInfo("No paths found from includes"); } } }
private URL peekPath(InterpretationContext ic) { if (!ic.isEmpty()) { Object topOfStack = ic.peekObject(); if (topOfStack instanceof State) { URL url = ((State)topOfStack).getUrl(); if (url != null) { return url; } } } return null; }