本文整理了Java中javax.enterprise.inject.spi.Decorator.getInjectionPoints()
方法的一些代码示例,展示了Decorator.getInjectionPoints()
的具体用法。这些代码示例主要来源于Github
/Stackoverflow
/Maven
等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。Decorator.getInjectionPoints()
方法的具体详情如下:
包路径:javax.enterprise.inject.spi.Decorator
类名称:Decorator
方法名:getInjectionPoints
暂无
代码示例来源:origin: com.caucho/resin
private static InjectionPoint getDelegate(Decorator<?> bean)
{
if (bean instanceof DecoratorBean)
return ((DecoratorBean) bean).getDelegateInjectionPoint();
for (InjectionPoint ip : bean.getInjectionPoints()) {
if (ip.isDelegate())
return ip;
}
throw new IllegalStateException(String.valueOf(bean));
}
代码示例来源:origin: org.jboss.cdi.tck/cdi-tck-impl
@Test
@SpecAssertions({ @SpecAssertion(section = INJECTION_POINT_CONFIGURATOR, id = "bc"),
@SpecAssertion(section = INJECTION_POINT_CONFIGURATOR, id = "be")
})
public void replaceQualifiersAndDelegate() {
List<Decorator<?>> vehicleDecorators = getCurrentManager().resolveDecorators(Collections.<Type>singleton(Car.class), Driving.DrivingLiteral.INSTANCE);
assertEquals(vehicleDecorators.size(), 1);
Decorator<Car> vehicleDecorator = (Decorator<Car>) vehicleDecorators.get(0);
assertEquals(vehicleDecorator.getInjectionPoints().size(), 1);
InjectionPoint vehicleIp = vehicleDecorator.getInjectionPoints().iterator().next();
assertEquals(vehicleIp.isDelegate(), true);
assertEquals(vehicleIp.getQualifiers(), Collections.singleton(Driving.DrivingLiteral.INSTANCE));
}
代码示例来源:origin: org.jboss.cdi.tck/cdi-tck-impl
@SuppressWarnings("unchecked")
@Test
@SpecAssertions({ @SpecAssertion(section = DELEGATE_ATTRIBUTE, id = "a"), @SpecAssertion(section = DECORATOR, id = "c") })
public void testDelegateInjectionPoint() {
List<Decorator<?>> decorators = getCurrentManager().resolveDecorators(Logger.TYPES);
assertEquals(decorators.size(), 1);
Decorator<?> decorator = decorators.get(0);
assertEquals(decorator.getInjectionPoints().size(), 1);
assertEquals(decorator.getInjectionPoints().iterator().next().getType(),Logger.class);
assertTrue(decorator.getInjectionPoints().iterator().next().getAnnotated().isAnnotationPresent(Delegate.class));
assertEquals(decorator.getDelegateType(), Logger.class);
assertEquals(decorator.getDelegateQualifiers().size(), 1);
assertAnnotationSetMatches(decorator.getDelegateQualifiers(), Default.class);
}
代码示例来源:origin: org.jboss.jsr299.tck/jsr299-tck-impl
@Test
@SpecAssertions({
@SpecAssertion(section="8.1.2", id="a"),
@SpecAssertion(section="11.1.1", id="c")
})
public void testDelegateInjectionPoint()
{
List<Decorator<?>> decorators = getCurrentManager().resolveDecorators(Logger.TYPES);
assert decorators.size() == 1;
Decorator<?> decorator = decorators.get(0);
assert decorator.getInjectionPoints().size() == 1;
assert decorator.getInjectionPoints().iterator().next().getType().equals(Logger.class);
assert decorator.getInjectionPoints().iterator().next().getAnnotated().isAnnotationPresent(Delegate.class);
assert decorator.getDelegateType().equals(Logger.class);
assert decorator.getDelegateQualifiers().size() == 1;
assert annotationSetMatches(decorator.getDelegateQualifiers(), Default.class);
}
代码示例来源:origin: weld/core
Decorators.findDelegateInjectionPoint(annotated, decorator.getInjectionPoints());
代码示例来源:origin: weld/core
Decorators.findDelegateInjectionPoint(annotated, decorator.getInjectionPoints());
代码示例来源:origin: org.jboss.cdi.tck/cdi-tck-impl
for (Decorator<?> animalDecorator : animalDecorators) {
assert animalDecorator.getInjectionPoints().size() == 2;
for (InjectionPoint injectionPoint : animalDecorator.getInjectionPoints()) {
if (injectionPoint.getType().equals(InjectionPoint.class)) {
assertFalse(injectionPoint.isDelegate());
代码示例来源:origin: weld/core
Decorators.findDelegateInjectionPoint(annotated, decorator.getInjectionPoints());
代码示例来源:origin: org.jboss.weld.se/weld-se
Decorators.findDelegateInjectionPoint(annotated, decorator.getInjectionPoints());
代码示例来源:origin: org.jboss.weld.se/weld-se-shaded
Decorators.findDelegateInjectionPoint(annotated, decorator.getInjectionPoints());
代码示例来源:origin: org.jboss.weld.servlet/weld-servlet-shaded
Decorators.findDelegateInjectionPoint(annotated, decorator.getInjectionPoints());
代码示例来源:origin: org.jboss.weld.se/weld-se
private void validateDecorators(BeanManagerImpl beanManager, DecorableBean<?> bean) {
if (!(beanManager.isPassivatingScope(bean.getScope()) || bean instanceof AbstractDecorableBuiltInBean<?>)) {
return;
}
List<Decorator<?>> decorators = bean.getDecorators();
if (decorators.isEmpty()) {
return;
}
for (Decorator<?> decorator : decorators) {
if (!Decorators.isPassivationCapable(decorator)) {
if (bean instanceof AbstractDecorableBuiltInBean<?>) {
throw ValidatorLogger.LOG.builtinBeanWithNonserializableDecorator(decorator, bean);
} else {
throw ValidatorLogger.LOG.passivatingBeanWithNonserializableDecorator(bean, decorator);
}
}
if (decorator instanceof DecoratorImpl) {
beanManager = ((DecoratorImpl<?>) decorator).getBeanManager();
}
for (InjectionPoint ij : decorator.getInjectionPoints()) {
if (!ij.isDelegate()) {
Bean<?> resolvedBean = beanManager.resolve(beanManager.getBeans(ij));
validateInterceptorDecoratorInjectionPointPassivationCapable(ij, resolvedBean, beanManager, bean);
}
}
}
}
代码示例来源:origin: weld/core
private void validateDecorators(BeanManagerImpl beanManager, DecorableBean<?> bean) {
if (!(beanManager.isPassivatingScope(bean.getScope()) || bean instanceof AbstractDecorableBuiltInBean<?>)) {
return;
}
List<Decorator<?>> decorators = bean.getDecorators();
if (decorators.isEmpty()) {
return;
}
for (Decorator<?> decorator : decorators) {
if (!Decorators.isPassivationCapable(decorator)) {
if (bean instanceof AbstractDecorableBuiltInBean<?>) {
throw ValidatorLogger.LOG.builtinBeanWithNonserializableDecorator(decorator, bean);
} else {
throw ValidatorLogger.LOG.passivatingBeanWithNonserializableDecorator(bean, decorator);
}
}
if (decorator instanceof DecoratorImpl) {
beanManager = ((DecoratorImpl<?>) decorator).getBeanManager();
}
for (InjectionPoint ij : decorator.getInjectionPoints()) {
if (!ij.isDelegate()) {
Bean<?> resolvedBean = beanManager.resolve(beanManager.getBeans(ij));
validateInterceptorDecoratorInjectionPointPassivationCapable(ij, resolvedBean, beanManager, bean);
}
}
}
}
代码示例来源:origin: weld/core
private void validateDecorators(BeanManagerImpl beanManager, DecorableBean<?> bean) {
if (!(beanManager.isPassivatingScope(bean.getScope()) || bean instanceof AbstractDecorableBuiltInBean<?>)) {
return;
}
List<Decorator<?>> decorators = bean.getDecorators();
if (decorators.isEmpty()) {
return;
}
for (Decorator<?> decorator : decorators) {
if (!Decorators.isPassivationCapable(decorator)) {
if (bean instanceof AbstractDecorableBuiltInBean<?>) {
throw ValidatorLogger.LOG.builtinBeanWithNonserializableDecorator(decorator, bean);
} else {
throw ValidatorLogger.LOG.passivatingBeanWithNonserializableDecorator(bean, decorator);
}
}
if (decorator instanceof DecoratorImpl) {
beanManager = ((DecoratorImpl<?>) decorator).getBeanManager();
}
for (InjectionPoint ij : decorator.getInjectionPoints()) {
if (!ij.isDelegate()) {
Bean<?> resolvedBean = beanManager.resolve(beanManager.getBeans(ij));
validateInterceptorDecoratorInjectionPointPassivationCapable(ij, resolvedBean, beanManager, bean);
}
}
}
}
代码示例来源:origin: weld/core
private void validateDecorators(BeanManagerImpl beanManager, DecorableBean<?> bean) {
if (!(beanManager.isPassivatingScope(bean.getScope()) || bean instanceof AbstractDecorableBuiltInBean<?>)) {
return;
}
List<Decorator<?>> decorators = bean.getDecorators();
if (decorators.isEmpty()) {
return;
}
for (Decorator<?> decorator : decorators) {
if (!Decorators.isPassivationCapable(decorator)) {
if (bean instanceof AbstractDecorableBuiltInBean<?>) {
throw ValidatorLogger.LOG.builtinBeanWithNonserializableDecorator(decorator, bean);
} else {
throw ValidatorLogger.LOG.passivatingBeanWithNonserializableDecorator(bean, decorator);
}
}
if (decorator instanceof DecoratorImpl) {
beanManager = ((DecoratorImpl<?>) decorator).getBeanManager();
}
for (InjectionPoint ij : decorator.getInjectionPoints()) {
if (!ij.isDelegate()) {
Bean<?> resolvedBean = beanManager.resolve(beanManager.getBeans(ij));
validateInterceptorDecoratorInjectionPointPassivationCapable(ij, resolvedBean, beanManager, bean);
}
}
}
}
代码示例来源:origin: org.jboss.weld.se/weld-se-shaded
private void validateDecorators(BeanManagerImpl beanManager, DecorableBean<?> bean) {
if (!(beanManager.isPassivatingScope(bean.getScope()) || bean instanceof AbstractDecorableBuiltInBean<?>)) {
return;
}
List<Decorator<?>> decorators = bean.getDecorators();
if (decorators.isEmpty()) {
return;
}
for (Decorator<?> decorator : decorators) {
if (!Decorators.isPassivationCapable(decorator)) {
if (bean instanceof AbstractDecorableBuiltInBean<?>) {
throw ValidatorLogger.LOG.builtinBeanWithNonserializableDecorator(decorator, bean);
} else {
throw ValidatorLogger.LOG.passivatingBeanWithNonserializableDecorator(bean, decorator);
}
}
if (decorator instanceof DecoratorImpl) {
beanManager = ((DecoratorImpl<?>) decorator).getBeanManager();
}
for (InjectionPoint ij : decorator.getInjectionPoints()) {
if (!ij.isDelegate()) {
Bean<?> resolvedBean = beanManager.resolve(beanManager.getBeans(ij));
validateInterceptorDecoratorInjectionPointPassivationCapable(ij, resolvedBean, beanManager, bean);
}
}
}
}
代码示例来源:origin: org.jboss.weld.servlet/weld-servlet-shaded
private void validateDecorators(BeanManagerImpl beanManager, DecorableBean<?> bean) {
if (!(beanManager.isPassivatingScope(bean.getScope()) || bean instanceof AbstractDecorableBuiltInBean<?>)) {
return;
}
List<Decorator<?>> decorators = bean.getDecorators();
if (decorators.isEmpty()) {
return;
}
for (Decorator<?> decorator : decorators) {
if (!Decorators.isPassivationCapable(decorator)) {
if (bean instanceof AbstractDecorableBuiltInBean<?>) {
throw ValidatorLogger.LOG.builtinBeanWithNonserializableDecorator(decorator, bean);
} else {
throw ValidatorLogger.LOG.passivatingBeanWithNonserializableDecorator(bean, decorator);
}
}
if (decorator instanceof DecoratorImpl) {
beanManager = ((DecoratorImpl<?>) decorator).getBeanManager();
}
for (InjectionPoint ij : decorator.getInjectionPoints()) {
if (!ij.isDelegate()) {
Bean<?> resolvedBean = beanManager.resolve(beanManager.getBeans(ij));
validateInterceptorDecoratorInjectionPointPassivationCapable(ij, resolvedBean, beanManager, bean);
}
}
}
}
内容来源于网络,如有侵权,请联系作者删除!