Out out = method.getAnnotation(Out.class);
String name = toName( out.value(), method );
outAttributes.add( new BijectedMethod(name, method, out) );
//can't use Init.instance() here because of unit tests
Init init = (Init) applicationContext.get(Seam.getComponentName(Init.class));
init.initNamespaceForName(name, true);
}
if ( method.isAnnotationPresent(Unwrap.class) )
{
if ( unwrapMethod!=null && !unwrapMethod.getName().equals( method.getName() ) )
{
throw new IllegalStateException("component has two @Unwrap methods: " + name);
}
if (unwrapMethod==null )
{
unwrapMethod = method;
}
}
if ( method.isAnnotationPresent(DataModel.class) ) //TODO: generalize
{
checkDataModelScope( method.getAnnotation(DataModel.class) );
}
if ( method.isAnnotationPresent(org.jboss.seam.annotations.Factory.class) )
{
//can't use Init.instance() here because of unit tests
Init init = (Init) applicationContext.get(Seam.getComponentName(Init.class));
String contextVariable = toName( method.getAnnotation(org.jboss.seam.annotations.Factory.class).value(), method );
init.addFactoryMethod(contextVariable, method, this);
if ( method.getAnnotation(org.jboss.seam.annotations.Factory.class).autoCreate() )
{
init.addAutocreateVariable(contextVariable);
}
}
if ( method.isAnnotationPresent(Observer.class) )
{
//can't use Init.instance() here because of unit tests
Init init = (Init) applicationContext.get(Seam.getComponentName(Init.class));
Observer observer = method.getAnnotation(Observer.class);
for ( String eventType : observer.value() )
{
if ( eventType.length()==0 ) eventType = method.getName(); //TODO: new defaulting rule to map @Observer onFooEvent() -> event type "fooEvent"
init.addObserverMethod( eventType, method, this, observer.create() );
}
}
if ( method.isAnnotationPresent(RequestParameter.class) )
{