org.apache.tapestry.annotations
Class InitialValueAnnotationWorker

java.lang.Object
  extended by org.apache.tapestry.annotations.InitialValueAnnotationWorker
All Implemented Interfaces:
SecondaryAnnotationWorker

public class InitialValueAnnotationWorker
extends Object
implements SecondaryAnnotationWorker

Looks for InitialValue annotations on methods that don't have a Persist annotation (that's handled by PersistAnnotationWorker); adds an IPropertySpecification for the property, so that its initial value may be set.

Since:
4.0
Author:
Howard M. Lewis Ship

Constructor Summary
InitialValueAnnotationWorker()
           
 
Method Summary
 boolean canEnhance(Method method)
          Returns true if the method has the InitialValue annotation.
 void peformEnhancement(EnhancementOperation op, IComponentSpecification spec, Method method, org.apache.hivemind.Resource classResource)
          Invoked an all workers in the command chain, if any worker returns true from SecondaryAnnotationWorker.canEnhance(Method).
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

InitialValueAnnotationWorker

public InitialValueAnnotationWorker()
Method Detail

canEnhance

public boolean canEnhance(Method method)
Returns true if the method has the InitialValue annotation.

Specified by:
canEnhance in interface SecondaryAnnotationWorker
Parameters:
method - to check
Returns:
true if the worker should be invoked, false otherwise

peformEnhancement

public void peformEnhancement(EnhancementOperation op,
                              IComponentSpecification spec,
                              Method method,
                              org.apache.hivemind.Resource classResource)
Description copied from interface: SecondaryAnnotationWorker
Invoked an all workers in the command chain, if any worker returns true from SecondaryAnnotationWorker.canEnhance(Method).

Specified by:
peformEnhancement in interface SecondaryAnnotationWorker
Parameters:
op - enhancement operation
spec - specification for the component being enhanced
method - the method
classResource - a resource representing the class; combined with the method a Location can be created


Copyright © 2006-2008 Apache Software Foundation. All Rights Reserved.