Java 类ch.qos.logback.core.joran.action.ActionUtil 实例源码

项目:https-github.com-g0t4-jenkins2-course-spring-boot    文件:SpringPropertyAction.java   
@Override
public void begin(InterpretationContext ic, String elementName, Attributes attributes)
        throws ActionException {
    String name = attributes.getValue(NAME_ATTRIBUTE);
    String source = attributes.getValue(SOURCE_ATTRIBUTE);
    Scope scope = ActionUtil.stringToScope(attributes.getValue(SCOPE_ATTRIBUTE));
    String defaultValue = attributes.getValue(DEFAULT_VALUE_ATTRIBUTE);
    if (OptionHelper.isEmpty(name) || OptionHelper.isEmpty(source)) {
        addError(
                "The \"name\" and \"source\" attributes of <springProperty> must be set");
    }
    ActionUtil.setProperty(ic, name, getValue(source, defaultValue), scope);
}
项目:spring-boot-concourse    文件:SpringPropertyAction.java   
@Override
public void begin(InterpretationContext ic, String elementName, Attributes attributes)
        throws ActionException {
    String name = attributes.getValue(NAME_ATTRIBUTE);
    String source = attributes.getValue(SOURCE_ATTRIBUTE);
    Scope scope = ActionUtil.stringToScope(attributes.getValue(SCOPE_ATTRIBUTE));
    String defaultValue = attributes.getValue(DEFAULT_VALUE_ATTRIBUTE);
    if (OptionHelper.isEmpty(name) || OptionHelper.isEmpty(source)) {
        addError(
                "The \"name\" and \"source\" attributes of <springProperty> must be set");
    }
    ActionUtil.setProperty(ic, name, getValue(source, defaultValue), scope);
}
项目:contestparser    文件:SpringPropertyAction.java   
@Override
public void begin(InterpretationContext ic, String elementName, Attributes attributes)
        throws ActionException {
    String name = attributes.getValue(NAME_ATTRIBUTE);
    String source = attributes.getValue(SOURCE_ATTRIBUTE);
    Scope scope = ActionUtil.stringToScope(attributes.getValue(SCOPE_ATTRIBUTE));
    if (OptionHelper.isEmpty(name) || OptionHelper.isEmpty(source)) {
        addError(
                "The \"name\" and \"source\" attributes of <springProperty> must be set");
    }
    ActionUtil.setProperty(ic, name, getValue(source), scope);
}
项目:logback-access-spring-boot-starter    文件:LogbackAccessJoranConfigurator.java   
/** {@inheritDoc} */
@Override
public void begin(InterpretationContext ic, String name, Attributes attributes) throws ActionException {
    String key = attributes.getValue(NAME_ATTRIBUTE);
    Scope scope = ActionUtil.stringToScope(attributes.getValue(SCOPE_ATTRIBUTE));
    String source = attributes.getValue("source");
    String defaultValue = attributes.getValue("defaultValue");
    String value = environment.getProperty(source, defaultValue);
    ActionUtil.setProperty(ic, key, value, scope);
}