"You should not provide a type attribute in the template when defining an embedded component " +
"within the component class.",
embeddedId, embeddedType, modelType
);
throw new TapestryException(message, token, null);
}
embeddedType = modelType;
embeddedComponentClassName = embeddedModel.getComponentClassName();
}
String componentClassName = embeddedComponentClassName;
// This awkwardness is making me think that the page loader should resolve the component
// type before invoking this method (we would then remove the componentType parameter).
if (InternalUtils.isNonBlank(embeddedType))
{
// The type actually overrides the specified class name. The class name is defined
// by the type of the field. In many scenarios, the field type is a common
// interface,
// and the type is used to determine the concrete class to instantiate.
try
{
componentClassName = componentClassResolver.resolveComponentTypeToClassName(embeddedType);
}
catch (IllegalArgumentException ex)
{
throw new TapestryException(ex.getMessage(), token, ex);
}
}
// OK, now we can record an action to get it instantiated.