@Override public void begin(InterpretationContext context, 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(context, name, getValue(source, defaultValue), scope); }
void loadAndSetProperties(InterpretationContext ec, InputStream istream, Scope scope) throws IOException { Properties props = new Properties(); props.load(istream); istream.close(); ActionUtil.setProperties(ec, props, scope); }
/** * Now property definer is initialized by all properties and we can put * property value to context */ public void end(InterpretationContext ec, String name) { if (inError) { return; } Object o = ec.peekObject(); if (o != definer) { addWarn("The object at the of the stack is not the property definer for property named [" + propertyName + "] pushed earlier."); } else { addInfo("Popping property definer for property named [" + propertyName + "] from the object stack"); ec.popObject(); // let's put defined property and value to context but only if it is // not null String propertyValue = definer.getPropertyValue(); if(propertyValue != null) { ActionUtil.setProperty(ec, propertyName, propertyValue, scope); } } } }
scopeStr = attributes.getValue(SCOPE_ATTRIBUTE); scope = ActionUtil.stringToScope(scopeStr); if (OptionHelper.isEmpty(propertyName)) { addError("Missing property name for property definer. Near [" + localName
/** * Now property definer is initialized by all properties and we can put * property value to context */ public void end(InterpretationContext ec, String name) { if (inError) { return; } Object o = ec.peekObject(); if (o != definer) { addWarn("The object at the of the stack is not the property definer for property named [" + propertyName + "] pushed earlier."); } else { addInfo("Popping property definer for property named [" + propertyName + "] from the object stack"); ec.popObject(); // let's put defined property and value to context but only if it is // not null String propertyValue = definer.getPropertyValue(); if (propertyValue != null) { ActionUtil.setProperty(ec, propertyName, propertyValue, scope); } } } }
scopeStr = attributes.getValue(SCOPE_ATTRIBUTE); scope = ActionUtil.stringToScope(scopeStr); if (OptionHelper.isEmpty(propertyName)) { addError("Missing property name for property definer. Near [" + localName + "] line " + getLineNumber(ec));
Scope scope = ActionUtil.stringToScope(scopeStr); } else { addInfo("Setting variable [" + asKey + "] to [" + envEntryValue + "] in [" + scope + "] scope"); ActionUtil.setProperty(ec, asKey, envEntryValue, scope);
/** * Now property definer is initialized by all properties and we can put * property value to context */ public void end(InterpretationContext ec, String name) { if (inError) { return; } Object o = ec.peekObject(); if (o != definer) { addWarn("The object at the of the stack is not the property definer for property named [" + propertyName + "] pushed earlier."); } else { addInfo("Popping property definer for property named [" + propertyName + "] from the object stack"); ec.popObject(); // let's put defined property and value to context but only if it is // not null String propertyValue = definer.getPropertyValue(); if (propertyValue != null) { ActionUtil.setProperty(ec, propertyName, propertyValue, scope); } } } }
scopeStr = attributes.getValue(SCOPE_ATTRIBUTE); scope = ActionUtil.stringToScope(scopeStr); if (OptionHelper.isEmpty(propertyName)) { addError("Missing property name for property definer. Near [" + localName
void loadAndSetProperties(InterpretationContext ec, InputStream istream, Scope scope) throws IOException { Properties props = new Properties(); props.load(istream); istream.close(); ActionUtil.setProperties(ec, props, scope); }
Scope scope = ActionUtil.stringToScope(scopeStr); ActionUtil.setProperty(ec, keyStr, val, scope);
/** * Now property definer is initialized by all properties and we can put * property value to context */ public void end(InterpretationContext ec, String name) { if (inError) { return; } Object o = ec.peekObject(); if (o != definer) { addWarn("The object at the of the stack is not the property definer for property named [" + propertyName + "] pushed earlier."); } else { addInfo("Popping property definer for property named [" + propertyName + "] from the object stack"); ec.popObject(); // let's put defined property and value to context but only if it is // not null String propertyValue = definer.getPropertyValue(); if(propertyValue != null) { ActionUtil.setProperty(ec, propertyName, propertyValue, scope); } } } }
scopeStr = attributes.getValue(SCOPE_ATTRIBUTE); scope = ActionUtil.stringToScope(scopeStr); if (OptionHelper.isEmpty(propertyName)) { addError("Missing property name for property definer. Near [" + localName + "] line " + getLineNumber(ec));
void loadAndSetProperties(InterpretationContext ec, InputStream istream, Scope scope) throws IOException { Properties props = new Properties(); props.load(istream); istream.close(); ActionUtil.setProperties(ec, props, scope); }
String scopeStr = attributes.getValue(SCOPE_ATTRIBUTE); Scope scope = ActionUtil.stringToScope(scopeStr); ActionUtil.setProperty(ec, name, value, scope);
/** * Now property definer is initialized by all properties and we can put * property value to context */ public void end(InterpretationContext ec, String name) { if (inError) { return; } Object o = ec.peekObject(); if (o != definer) { addWarn("The object at the of the stack is not the property definer for property named [" + propertyName + "] pushed earlier."); } else { addInfo("Popping property definer for property named [" + propertyName + "] from the object stack"); ec.popObject(); // let's put defined property and value to context but only if it is // not null String propertyValue = definer.getPropertyValue(); if (propertyValue != null) { ActionUtil.setProperty(ec, propertyName, propertyValue, scope); } } } }
scopeStr = attributes.getValue(SCOPE_ATTRIBUTE); scope = ActionUtil.stringToScope(scopeStr); if (OptionHelper.isEmpty(propertyName)) { addError("Missing property name for property definer. Near [" + localName + "] line " + getLineNumber(ec));
void loadAndSetProperties(InterpretationContext ec, InputStream istream, Scope scope) throws IOException { Properties props = new Properties(); props.load(istream); istream.close(); ActionUtil.setProperties(ec, props, scope); }
Scope scope = ActionUtil.stringToScope(scopeStr); } else { addInfo("Setting variable ["+asKey+"] to ["+envEntryValue+"] in ["+scope+"] scope"); ActionUtil.setProperty(ec, asKey, envEntryValue, scope);
/** * Now property definer is initialized by all properties and we can put * property value to context */ public void end(InterpretationContext ec, String name) { if (inError) { return; } Object o = ec.peekObject(); if (o != definer) { addWarn("The object at the of the stack is not the property definer for property named [" + propertyName + "] pushed earlier."); } else { addInfo("Popping property definer for property named [" + propertyName + "] from the object stack"); ec.popObject(); // let's put defined property and value to context but only if it is // not null String propertyValue = definer.getPropertyValue(); if(propertyValue != null) { ActionUtil.setProperty(ec, propertyName, propertyValue, scope); } } } }