Package org.apache.deltaspike.core.util.metadata.builder

Examples of org.apache.deltaspike.core.util.metadata.builder.AnnotatedTypeBuilder


        Named namedAnnotation = beanClass.getAnnotation(Named.class);
        if (namedAnnotation != null &&
                namedAnnotation.value().length() > 0 &&
                Character.isUpperCase(namedAnnotation.value().charAt(0)))
        {
            AnnotatedTypeBuilder builder = new AnnotatedTypeBuilder();
            builder.readFromType(beanClass);

            String beanName = namedAnnotation.value();
            String newBeanName = beanName.substring(0, 1).toLowerCase() + beanName.substring(1);

            builder.removeFromClass(Named.class)
                    .addToClass(new NamedLiteral(newBeanName));

            processAnnotatedType.setAnnotatedType(builder.create());
        }
    }
View Full Code Here


 
  @SuppressWarnings("rawtypes")
  private void register(Class<?> component) {     
    try{
      if(ComponentFactory.class.isAssignableFrom(component)){     
        AnnotatedTypeBuilder builder = new ComponentFactoryAnnotatedTypeBuilderCreator().create(component);
        discovery.addAnnotatedType(builder.create());
      }
      else{
        discovery.addAnnotatedType(bm.createAnnotatedType(component));
      }
    }
View Full Code Here

  public ComponentFactoryAnnotatedTypeBuilderCreator(AnnotatedTypeBuilder builder) {
    this.builder = builder;
  }
 
  public ComponentFactoryAnnotatedTypeBuilderCreator(){
    this(new AnnotatedTypeBuilder());
  }
View Full Code Here

public class ModifyComponentExtension implements Extension {

  @SuppressWarnings("unchecked")
  public void processAnnotatedType(@Observes final ProcessAnnotatedType pat) {
    if(accept(pat)){
      AnnotatedTypeBuilder builder = new AnnotatedTypeBuilder();   
      builder.readFromType(pat.getAnnotatedType());
      AddInjectToConstructorExtension addInjectToConstructorExtension = new AddInjectToConstructorExtension(builder);
      ComponentExtension componentExtension = new ComponentExtension(builder);
      ComponentFactoryExtension componentFactoryExtension = new ComponentFactoryExtension(builder);
      addInjectToConstructorExtension.processAnnotatedType(pat);
      componentExtension.processAnnotatedType(pat);
      componentFactoryExtension.addProducesToComponentFactory(pat);
      pat.setAnnotatedType(builder.create());
    }
  }
View Full Code Here

     */
    protected void contextAwareness(@Observes ProcessAnnotatedType<? extends CamelContextAware> process) throws Exception {
        AnnotatedType at = process.getAnnotatedType();

        Method method = at.getJavaClass().getMethod("setCamelContext", CamelContext.class);
        AnnotatedTypeBuilder builder = new AnnotatedTypeBuilder<CamelContextAware>()
                .readFromType(at)
                .addToMethod(method, new InjectLiteral());
        process.setAnnotatedType(builder.create());

    }
View Full Code Here

TOP

Related Classes of org.apache.deltaspike.core.util.metadata.builder.AnnotatedTypeBuilder

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.