Component registration info - Parametric names vs annotations
A component that implements ParametricComponent may not have a name specified using the Component annotation.
This commit is contained in:
parent
b13db82be2
commit
d502d6f6b9
1 changed files with 3 additions and 0 deletions
|
@ -58,6 +58,9 @@ public final class NewComponentInfo< T >
|
|||
// Sets the new component's name
|
||||
final Component aComp = klass.getAnnotation( Component.class );
|
||||
if ( aComp != null && !"".equals( aComp.value( ) ) ) {
|
||||
if ( ParametricComponent.class.isAssignableFrom( klass ) ) {
|
||||
throw new ComponentDefinitionException( "parametric component can't be named" );
|
||||
}
|
||||
info.setName( aComp.value( ) );
|
||||
} else if ( !ParametricComponent.class.isAssignableFrom( klass ) ) {
|
||||
info.setName( klass.getSimpleName( ) );
|
||||
|
|
Loading…
Reference in a new issue