use of org.apache.tapestry5.plastic.PlasticClass in project tapestry-5 by apache.
the class ImportWorker method processClassAnnotationAtSetupRenderPhase.
private void processClassAnnotationAtSetupRenderPhase(PlasticClass componentClass, MutableComponentModel model) {
Import annotation = componentClass.getAnnotation(Import.class);
if (annotation != null) {
PlasticMethod setupRender = componentClass.introduceMethod(TransformConstants.SETUP_RENDER_DESCRIPTION);
decorateMethod(componentClass, model, setupRender, annotation);
model.addRenderPhase(SetupRender.class);
}
}
use of org.apache.tapestry5.plastic.PlasticClass in project tapestry-5 by apache.
the class ApplicationStateWorker method transform.
public void transform(PlasticClass plasticClass, TransformationSupport support, MutableComponentModel model) {
for (PlasticField field : plasticClass.getFieldsWithAnnotation(SessionState.class)) {
SessionState annotation = field.getAnnotation(SessionState.class);
transform(plasticClass, field, annotation.create());
field.claim(annotation);
}
}
use of org.apache.tapestry5.plastic.PlasticClass in project tapestry-5 by apache.
the class MetaWorkerImpl method transform.
public void transform(PlasticClass plasticClass, TransformationSupport support, MutableComponentModel model) {
for (Class c : configuration.keySet()) {
Annotation annotation = plasticClass.getAnnotation(c);
if (annotation != null) {
MetaDataExtractor extractor = configuration.get(c);
extractor.extractMetaData(model, annotation);
}
}
}
use of org.apache.tapestry5.plastic.PlasticClass in project tapestry-5 by apache.
the class MixinAfterWorkerTest method annotation_not_present.
@Test
public void annotation_not_present() {
PlasticClass pc = newMock(PlasticClass.class);
MutableComponentModel model = mockMutableComponentModel();
expect(pc.hasAnnotation(MixinAfter.class)).andReturn(false);
replay();
new MixinAfterWorker().transform(pc, null, model);
verify();
}
use of org.apache.tapestry5.plastic.PlasticClass in project tapestry-5 by apache.
the class CommitAfterWorker method transform.
@Override
public void transform(PlasticClass plasticClass, TransformationSupport support, MutableComponentModel model) {
for (final PlasticMethod method : plasticClass.getMethodsWithAnnotation(CommitAfter.class)) {
PersistenceContext annotation = method.getAnnotation(PersistenceContext.class);
method.addAdvice(methodAdvices.get(annotation == null ? null : annotation.unitName()));
}
}
Aggregations