Example usage for com.google.gwt.core.ext.typeinfo JConstructor getEnclosingType

List of usage examples for com.google.gwt.core.ext.typeinfo JConstructor getEnclosingType

Introduction

In this page you can find the example usage for com.google.gwt.core.ext.typeinfo JConstructor getEnclosingType.

Prototype

JClassType getEnclosingType();

Source Link

Document

Gets the type in which this method or constructor was declared.

Usage

From source file:org.jboss.errai.codegen.meta.impl.gwt.GWTConstructor.java

License:Apache License

public GWTConstructor(final TypeOracle oracle, final JConstructor c) {
    this.constructor = c;
    this.annotations = AnnotationParser.parseAnnotations(c.getAnnotations());

    this.declaringClass = GWTClass.newInstance(oracle, c.getEnclosingType());
    this.oracle = oracle;
}

From source file:org.jboss.errai.ioc.rebind.ioc.codegen.meta.impl.gwt.GWTConstructor.java

License:Apache License

public GWTConstructor(JConstructor c) {
    this.constructor = c;
    this.declaringClass = MetaClassFactory.get(c.getEnclosingType());

    try {/* w w  w .jav  a2  s .  c om*/
        Class<?> cls = Class.forName(c.getEnclosingType().getQualifiedSourceName(), false,
                Thread.currentThread().getContextClassLoader());

        Constructor constr = cls.getConstructor(InjectUtil.jParmToClass(c.getParameters()));

        annotations = constr.getAnnotations();

    } catch (ClassNotFoundException e) {
        e.printStackTrace();
    } catch (NoSuchMethodException e) {
        e.printStackTrace();
    }
}