public static void checkSteroTypeRequirements(Component<?> component, Annotation[] anns, String errorMessage)
{
Annotation[] stereoTypes = getComponentStereoTypes(component);
for (Annotation stereoType : stereoTypes)
{
IStereoTypeModel model = StereoTypeManager.getInstance().getStereoTypeModel(stereoType.annotationType().getName());
Set<Class<?>> rtypes = model.getRestrictedTypes();
if (rtypes != null)
{
Iterator<Class<?>> itTypes = rtypes.iterator();
while (itTypes.hasNext())
{
if (!component.getTypes().contains(itTypes.next()))
{
throw new WebBeansConfigurationException(errorMessage + " must contains all supported api types in the @Stereotype annotation " + model.getName());
}
}
}
Set<Class<? extends Annotation>> suppScopes = model.getSupportedScopes();
if (suppScopes != null)
{
if (!suppScopes.isEmpty())
{
if (!suppScopes.contains(component.getScopeType()))
{
throw new WebBeansConfigurationException(errorMessage + " must contains all required scope types in the @Stereotype annotation " + model.getName());
}
}
}
}
}