Examples of MetaClass


Examples of org.jboss.errai.codegen.meta.MetaClass

    if (method == null) {
      throw new GenerationException("Method 'getAssociatedType()' could not be found in the event ["
          + eventType.getName() + "]");
    }

    MetaClass returnType = method.getReturnType();
    if (returnType == null) {
      throw new GenerationException("The method 'getAssociatedType()' in the event [" + eventType.getName()
          + "] returns void.");
    }

    logger.fine("eventType: " + eventType.getClass() + " -- " + eventType);
    logger.fine("method: " + method.getClass() + " -- " + method);
    logger.fine("returnType: " + returnType.getClass() + " -- " + returnType);

    MetaParameterizedType parameterizedType = returnType.getParameterizedType();
    if (parameterizedType == null) {
      throw new GenerationException("The method 'getAssociatedType()' in the event [" + eventType.getName()
          + "] does not return Type<? extends EventHandler>..");
    }
View Full Code Here

Examples of org.jboss.errai.codegen.meta.MetaClass

    /*
     * In case of constructor injection, search for the data binder parameter annotated with @AutoBound
     */
    Statement dataBinderRef = null;
    MetaClass dataModelType = null;
    BeanMetric beanMetric = InjectUtil.analyzeBean(ctx.getInjectionContext(), ctx.getEnclosingType());
    MetaConstructor mc = beanMetric.getInjectorConstructor();
    if (mc != null) {
      for (MetaParameter mp : mc.getParameters()) {
        if (mp.getType().getErased().isAssignableTo(MetaClassFactory.get(DataBinder.class))
View Full Code Here

Examples of org.jboss.errai.codegen.meta.MetaClass

    return new HibernatePersistence().createEntityManagerFactory(persistenceUnits.iterator().next(), properties);
  }

  private String generateErraiEntityType(final EntityType<?> et, MethodBlockBuilder<?> pmm) {
    MetaClass met = MetaClassFactory.get(et.getJavaType());
    pmm.append(Stmt.codeComment(
            "**\n" +
                    "** EntityType for " + et.getJavaType().getName() + "\n" +
            "**"));
    String entityTypeVarName = entitySnapshotVarName(et.getJavaType());
View Full Code Here

Examples of org.jboss.errai.codegen.meta.MetaClass

      // standalone entity listeners
      EntityListeners entityListeners = entityType.getAnnotation(EntityListeners.class);
      if (entityListeners != null) {
        for (Class<?> listenerClass : entityListeners.value()) {
          MetaClass listenerMetaClass = MetaClassFactory.get(listenerClass);
          for (MetaMethod callback : listenerMetaClass.getMethodsAnnotatedWith(eventType)) {
            if (callback.getParameters().length != 1) {
              throw new GenerationException("JPA lifecycle listener method " + callback.getName() + " has " +
                      callback.getParameters().length + " parameters (expected 1)");
            }
            if (!callback.getParameters()[0].getType().isAssignableFrom(entityType)) {
View Full Code Here

Examples of org.jboss.errai.codegen.meta.MetaClass

            ClassStructureBuilder<?> containingClassBuilder) {
      SingularAttribute<?, ?> attr = (SingularAttribute<?, ?>) sourceObject;

      if (isGeneratedValue(getJavaMember(attr))) {

        MetaClass generatorDeclaredType;
        Class<? extends Iterator<?>> generatorType;

        if (attr.getJavaType() == Long.class || attr.getJavaType() == long.class) {
          generatorDeclaredType = MetaClassFactory.get(new TypeLiteral<Iterator<Long>>() {});
          generatorType = LongIdGenerator.class;
View Full Code Here

Examples of org.jboss.errai.ioc.rebind.ioc.codegen.meta.MetaClass

    MetaParameterizedType type = field.getType().getParameterizedType();
    if (type == null) {
      throw new RuntimeException("Event<?> must be parameterized");
    }

    MetaClass typeParm = (MetaClass) type.getTypeParameters()[0];
    String toSubject = CDI.getSubjectNameByType(typeParm.getFullyQualifiedName());
    Statement statement = Stmt.nestedCall(injectableInstance.getValueStatement())
            .invoke("registerConversation", Stmt.invokeStatic(CDI.class, "createConversation", toSubject));

    return statement;
  }
View Full Code Here

Examples of org.jruby.MetaClass

        // this is where we'll get connected when classes are opened using
        // package module syntax.
        packageModule.addClassProvider(JAVA_PACKAGE_CLASS_PROVIDER);

        parent.const_set(runtime.newSymbol(name), packageModule);
        MetaClass metaClass = (MetaClass) packageModule.getMetaClass();
        metaClass.setAttached(packageModule);
        return packageModule;
    }
View Full Code Here

Examples of org.kohsuke.stapler.MetaClass

    /**
     * Returns true if this descriptor has <tt>config.jelly</tt>.
     */
    public final boolean hasConfigScreen() {
        MetaClass c = WebApp.getCurrent().getMetaClass(getClass());
        try {
            JellyClassTearOff tearOff = c.loadTearOff(JellyClassTearOff.class);
            return tearOff.findScript(getConfigPage())!=null;
        } catch(JellyException e) {
            return false;
        }
    }
View Full Code Here

Examples of org.perl6.metamodel.MetaClass

        return new TestSuite(DispatcherTest.class);
    }

   
    public void testDispatcher () {
        MetaClass a = new MetaClass("A");
        MetaClass b = new MetaClass("B");
        ArrayList bsup = new ArrayList();
        bsup.add(a);
        b.superclasses(bsup);
       
        MetaClass c = new MetaClass("C");
        ArrayList csup = new ArrayList();
        csup.add(a);
        c.superclasses(csup);
        MetaClass d = new MetaClass("D");
        ArrayList dsup = new ArrayList();
        dsup.add(b);
        dsup.add(c);
        d.superclasses(dsup);

        Dispatcher dispatcher = d.dispatcher(":canonical");
       
        assertEquals(dispatcher.getClass().getName(), "org.perl6.metamodel.metaclass.Dispatcher");
       
        assertEquals(dispatcher.next(), d);
        assertEquals(dispatcher.next(), b);
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. 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.