AdGuard v3.6.45版本的 MD5 值为:ce30a13dcef92cf942973fffcc6d20fb
以下内容为反编译后的 AppenderRefAction.java 源代码,内容仅作参考
package ch.qos.logback.core.joran.action;
import ch.qos.logback.core.Appender;
import ch.qos.logback.core.joran.spi.InterpretationContext;
import ch.qos.logback.core.spi.AppenderAttachable;
import ch.qos.logback.core.util.OptionHelper;
import java.util.HashMap;
import org.xml.sax.Attributes;
public class AppenderRefAction<E> extends Action {
boolean inError = false;
@Override
public void begin(InterpretationContext interpretationContext, String str, Attributes attributes) {
this.inError = false;
Object peekObject = interpretationContext.peekObject();
if (!(peekObject instanceof AppenderAttachable)) {
this.inError = true;
addError("Could not find an AppenderAttachable at the top of execution stack. Near [" + str + "] line " + getLineNumber(interpretationContext));
return;
}
AppenderAttachable appenderAttachable = (AppenderAttachable) peekObject;
String subst = interpretationContext.subst(attributes.getValue(ActionConst.REF_ATTRIBUTE));
if (OptionHelper.isEmpty(subst)) {
this.inError = true;
addError("Missing appender ref attribute in <appender-ref> tag.");
return;
}
Appender<E> appender = (Appender) ((HashMap) interpretationContext.getObjectMap().get(ActionConst.APPENDER_BAG)).get(subst);
if (appender != null) {
addInfo("Attaching appender named [" + subst + "] to " + appenderAttachable);
appenderAttachable.addAppender(appender);
return;
}
this.inError = true;
addError("Could not find an appender named [" + subst + "]. Did you define it below instead of above in the configuration file?");
addError("See http://logback.qos.ch/codes.html#appender_order for more details.");
}
@Override
public void end(InterpretationContext interpretationContext, String str) {
}
}