// Location might be null
String subexpression = expression;
int colonx = expression.indexOf(':');
BindingFactory factory = null;
if (colonx > 0)
{
String prefix = expression.substring(0, colonx);
factory = factories.get(prefix);
if (factory != null)
subexpression = expression.substring(colonx + 1);
}
if (factory == null)
factory = factories.get(defaultPrefix);
// And if that's null, what then? We assume that the default prefix is a valid prefix,
// or we'll get an NPE below and report it like any other error.
try
{
return factory.newBinding(description, container, component, subexpression, location);
}
catch (Exception ex)
{
throw new TapestryException(ServicesMessages.bindingSourceFailure(expression, ex),
location, ex);