Search in sources :

Example 1 with StringLocation

use of org.apache.tapestry5.commons.internal.services.StringLocation in project tapestry-5 by apache.

the class ComponentWorker method transformField.

private void transformField(PlasticClass transformation, MutableComponentModel model, PlasticField field) {
    Component annotation = field.getAnnotation(Component.class);
    field.claim(annotation);
    String annotationId = annotation.id();
    String fieldName = field.getName();
    String id = InternalUtils.isNonBlank(annotationId) ? annotationId : InternalUtils.stripMemberName(fieldName);
    String type = field.getTypeName();
    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());
    updateModelWithPublishedParameters(embedded, annotation);
    convertAccessToField(field, id);
    addMixinClasses(field, embedded);
    addMixinTypes(field, embedded);
}
Also used : StringLocation(org.apache.tapestry5.commons.internal.services.StringLocation) Component(org.apache.tapestry5.annotations.Component) MutableEmbeddedComponentModel(org.apache.tapestry5.model.MutableEmbeddedComponentModel) StringLocation(org.apache.tapestry5.commons.internal.services.StringLocation) Location(org.apache.tapestry5.commons.Location)

Aggregations

Component (org.apache.tapestry5.annotations.Component)1 Location (org.apache.tapestry5.commons.Location)1 StringLocation (org.apache.tapestry5.commons.internal.services.StringLocation)1 MutableEmbeddedComponentModel (org.apache.tapestry5.model.MutableEmbeddedComponentModel)1