logback-android/src/main/java/ch/qos/logback/core/joran/action/AbstractEventEvaluatorAction.java
public void begin(InterpretationContext ec, String name, Attributes attributes) {
    // Let us forget about previous errors (in this instance)
    inError = false;
    evaluator = null;

    String className = attributes.getValue(CLASS_ATTRIBUTE);
    if (OptionHelper.isEmpty(className)) {
      className = defaultClassName();
      addInfo("Assuming default evaluator class [" + className + "]");
    }

    if (OptionHelper.isEmpty(className)) {
      className = defaultClassName();
      inError = true;
      addError("Mandatory \"" + CLASS_ATTRIBUTE
          + "\" attribute not set for <evaluator>");
      return;
    }

    String evaluatorName = attributes.getValue(Action.NAME_ATTRIBUTE);
    if (OptionHelper.isEmpty(evaluatorName)) {
      inError = true;
      addError("Mandatory \"" + NAME_ATTRIBUTE
          + "\" attribute not set for <evaluator>");
      return;
    }
    try {
      evaluator = (EventEvaluator<?>) OptionHelper.instantiateByClassName(
          className, ch.qos.logback.core.boolex.EventEvaluator.class, context);

      evaluator.setContext(this.context);
      evaluator.setName(evaluatorName);

      ec.pushObject(evaluator);
      addInfo("Adding evaluator named [" + evaluatorName
          + "] to the object stack");

    } catch (Exception oops) {
      inError = true;
      addError("Could not create evaluator of type " + className + "].", oops);
    }
  }
public void begin(InterpretationContext ec, String name, Attributes attributes) {
    // Let us forget about previous errors (in this instance)
    inError = false;
    evaluator = null;

    String className = attributes.getValue(CLASS_ATTRIBUTE);
    if (OptionHelper.isEmpty(className)) {
      className = defaultClassName();
      addInfo("Assuming default evaluator class [" + className + "]");
    }

    if (OptionHelper.isEmpty(className)) {
      className = defaultClassName();
      inError = true;
      addError("Mandatory \"" + CLASS_ATTRIBUTE
          + "\" attribute not set for <evaluator>");
      return;
    }

    String evaluatorName = attributes.getValue(Action.NAME_ATTRIBUTE);
    if (OptionHelper.isEmpty(evaluatorName)) {
      inError = true;
      addError("Mandatory \"" + NAME_ATTRIBUTE
          + "\" attribute not set for <evaluator>");
      return;
    }
    try {
      evaluator = (EventEvaluator<?>) OptionHelper.instantiateByClassName(
          className, ch.qos.logback.core.boolex.EventEvaluator.class, context);

      evaluator.setContext(this.context);
      evaluator.setName(evaluatorName);

      ec.pushObject(evaluator);
      addInfo("Adding evaluator named [" + evaluatorName
          + "] to the object stack");

    } catch (Exception oops) {
      inError = true;
      addError("Could not create evaluator of type " + className + "].", oops);
    }
  }
public void begin ( InterpretationContext ec , String name , Attributes attributes ) { // Let us forget about previous errors (in this instance) inError = false ; evaluator = null ; String className = attributes . getValue ( CLASS_ATTRIBUTE ) ; if ( OptionHelper . isEmpty ( className ) ) { className = defaultClassName ( ) ; addInfo ( "Assuming default evaluator class [" + className + "]" ) ; } if ( OptionHelper . isEmpty ( className ) ) { className = defaultClassName ( ) ; inError = true ; addError ( "Mandatory \"" + CLASS_ATTRIBUTE + "\" attribute not set for <evaluator>" ) ; return ; } String evaluatorName = attributes . getValue ( Action . NAME_ATTRIBUTE ) ; if ( OptionHelper . isEmpty ( evaluatorName ) ) { inError = true ; addError ( "Mandatory \"" + NAME_ATTRIBUTE + "\" attribute not set for <evaluator>" ) ; return ; } try { evaluator = ( EventEvaluator < ? > ) OptionHelper . instantiateByClassName ( className , ch . qos . logback . core . boolex . EventEvaluator . class , context ) ; evaluator . setContext ( this . context ) ; evaluator . setName ( evaluatorName ) ; ec . pushObject ( evaluator ) ; addInfo ( "Adding evaluator named [" + evaluatorName + "] to the object stack" ) ; } catch ( Exception oops ) { inError = true ; addError ( "Could not create evaluator of type " + className + "]." , oops ) ; } }
Instantiates an evaluator of the given class and sets its name.
Instantiates an evaluator of the given class and sets its name .