Tapestry.format("SpecificationParser.both-type-and-copy-of", id),
getResourceLocation());
IComponentSpecification spec = (IComponentSpecification) digester.getRoot();
IContainedComponent source = spec.getComponent(copyOf);
if (source == null)
throw new DocumentParseException(
Tapestry.format("SpecificationParser.unable-to-copy", copyOf),
getResourceLocation());
IContainedComponent target = (IContainedComponent) digester.peek();
target.setType(source.getType());
target.setCopyOf(copyOf);
Iterator i = source.getBindingNames().iterator();
while (i.hasNext())
{
String bindingName = (String) i.next();
IBindingSpecification binding = source.getBinding(bindingName);
target.setBinding(bindingName, binding);
}
}