int count = names.size();
for (int i = 0; i < count; i++)
{
String name = (String) names.get(i);
IPropertySpecification ps = spec.getPropertySpecification(name);
String expression = ps.getInitialValue();
Object initialValue = null;
// If no initial value expression is provided, then read the current
// property of the expression. This may be null, or may be
// a value set in finishLoad() (via an abstract accessor).
try
{
if (Tapestry.isNull(expression))
{
initialValue = OgnlUtils.get(name, _resolver, component);
}
else
{
// Evaluate the expression and update the property.
initialValue = OgnlUtils.get(expression, _resolver, component);
OgnlUtils.set(name, _resolver, component, initialValue);
}
}
catch (Exception ex)
{
throw new ApplicationRuntimeException(
Tapestry.format(
"PageLoader.unable-to-initialize-property",
name,
component,
ex.getMessage()),
ps.getLocation(),
ex);
}
PageDetachListener initializer =
new PropertyInitializer(_resolver, component, name, initialValue);