Start line:  
End line:  

Snippet Preview

Snippet HTML Code

Stack Overflow Questions
Logback: the reliable, generic, fast and flexible logging framework. Copyright (C) 1999-2011, All rights reserved. This program and the accompanying materials are dual-licensed under either the terms of the Eclipse Public License v1.0 as published by the Eclipse Foundation or (per the licensee's choosing) under the terms of the GNU Lesser General Public License version 2.1 as published by the Free Software Foundation.
package ch.qos.logback.core.joran.conditional;
abstract public class ThenOrElseActionBase extends Action {
  public void begin(InterpretationContext icString nameAttributes attributes)
      throws ActionException {
    if(!weAreActive(ic)) return;
    ThenActionState state = new ThenActionState();
    if (ic.isListenerListEmpty()) {
      state.isRegistered = true;
    Object o = ic.peekObject();
    if(!(o instanceof IfAction)) return false;
    IfAction ifAction = (IfActiono;
    return ifAction.isActive();
  public void end(InterpretationContext icString namethrows ActionException {
    if(!weAreActive(ic)) return;
    ThenActionState state = .pop();
    if (state.isRegistered) {
      Object o = ic.peekObject();
      if (o instanceof IfAction) {
        IfAction ifAction = (IfActiono;
      } else {
        throw new IllegalStateException("Missing IfAction on top of stack");
  abstract void registerEventList(IfAction ifActionList<SaxEventeventList);
  void removeFirstAndLastFromList(List<SaxEventeventList) {
    eventList.remove(eventList.size() - 1);
class ThenActionState implements InPlayListener {
  boolean isRegistered = false;
  public void inPlay(SaxEvent event) {
New to GrepCode? Check out our FAQ X