public void transform(ClassTransformation transformation, MutableComponentModel model)
{
for (String fieldName : transformation.findFieldsWithAnnotation(Component.class))
{
Component annotation = transformation.getFieldAnnotation(fieldName, Component.class);
String id = annotation.id();
if (InternalUtils.isBlank(id)) id = InternalUtils.stripMemberPrefix(fieldName);
String type = transformation.getFieldType(fieldName);
Location location = new StringLocation(String.format("%s.%s", transformation
.getClassName(), fieldName), 0);
MutableEmbeddedComponentModel embedded = model.addEmbeddedComponent(id, annotation
.type(), type, annotation.inheritInformalParameters(), location);
addParameters(embedded, annotation.parameters());
transformation.makeReadOnly(fieldName);
String body = String.format("%s = (%s) %s.getEmbeddedComponent(\"%s\");", fieldName, type,
transformation.getResourcesFieldName(), id);