push(_elementName, null, STATE_NO_CONTENT);
}
private void enterParameter()
{
IParameterSpecification ps = _factory.createParameterSpecification();
String name = getValidatedAttribute(
"name",
PARAMETER_NAME_PATTERN,
"invalid-parameter-name");
String propertyName = getValidatedAttribute(
"property-name",
PROPERTY_NAME_PATTERN,
"invalid-property-name");
if (propertyName == null)
propertyName = name;
ps.setPropertyName(propertyName);
ps.setRequired(getBooleanAttribute("required", false));
// In the 3.0 DTD, default-value was always an OGNL expression.
// Starting with 4.0, it's like a binding (prefixed). For a 3.0
// DTD, we supply the "ognl:" prefix.
String defaultValue = getAttribute("default-value");
if (defaultValue != null && !_DTD_4_0)
defaultValue = BindingConstants.OGNL_PREFIX + ":" + defaultValue;
ps.setDefaultValue(defaultValue);
ps.setDefaultBindingType(getAttribute("default-binding"));
if (!_DTD_4_0)
{
String direction = getAttribute("direction");
ps.setCache(!"auto".equals(direction));
}
else
{
boolean cache = getBooleanAttribute("cache", true);
ps.setCache(cache);
}
// type will only be specified in a 3.0 DTD.
String type = getAttribute("type");
if (type != null)
ps.setType(type);
IComponentSpecification cs = (IComponentSpecification) peekObject();
cs.addParameter(name, ps);