Package sun.reflect.generics.reflectiveObjects

Examples of sun.reflect.generics.reflectiveObjects.ParameterizedTypeImpl


    public BaseEntityManager get() {
      Field field = InjectorContext.currentField();
      Class<?> clazz = String.class;
      Type genericType = field.getGenericType();
      if(genericType instanceof ParameterizedTypeImpl){
        ParameterizedTypeImpl pgType = (ParameterizedTypeImpl)genericType;
        Type[] actualTypeArguments = pgType.getActualTypeArguments();
        clazz = (Class<?>)actualTypeArguments[1];
      }
     
//    System.out.println("泛行的类型:"+clazz.getName());
View Full Code Here


      returnType = method.getReturnType();
      if (!returnType.getName().equals("void")) {
        resultClazz = returnType;
        final Type genericType = method.getGenericReturnType();
        if (genericType instanceof ParameterizedTypeImpl) {
          ParameterizedTypeImpl pgType = (ParameterizedTypeImpl) genericType;
          Type[] actualTypeArguments = pgType
              .getActualTypeArguments();
          resultClazz = (Class<?>) actualTypeArguments[0];
        }
      }
      if (resultClazz != Null.class) {
View Full Code Here

    protected ArgumentHolder(MethodParameter parameter, Object object) {
      Type genericType = parameter.getGenericParameterType();
      if (genericType instanceof Class<?>) {
        this.type = (Class<?>) genericType;
      } else {
        ParameterizedTypeImpl parameterizedType = (ParameterizedTypeImpl) genericType;
        this.type = parameterizedType.getRawType();
        Type[] actualTypeArguments = parameterizedType.getActualTypeArguments();
        this.actualArguments = new Class<?>[actualTypeArguments.length];
        for (int i = 0; i < actualTypeArguments.length; i++) {
          if (actualTypeArguments[i] instanceof Class<?>) {
            this.actualArguments[i] = (Class<?>) actualTypeArguments[i];
          } else {
View Full Code Here

    protected boolean match(Type parameterType) {
      if (parameterType instanceof Class<?>) {
        return !parameterType.equals(Object.class) && (((Class<?>) parameterType).isAssignableFrom(this.type));
      } else {
        ParameterizedTypeImpl parameterized = (ParameterizedTypeImpl) parameterType;
        if (parameterized.getRawType().isAssignableFrom(this.type)) {
          Type[] actualTypeArgumentsToTest = parameterized.getActualTypeArguments();
          for (int i = 0; i < actualTypeArgumentsToTest.length; i++) {
            if (actualTypeArgumentsToTest[i] instanceof Class<?>) {
              if (!actualArguments[i].isAssignableFrom((Class<?>) actualTypeArgumentsToTest[i])) {
                return false;
              }
View Full Code Here

                return null;
            }
            if (tipo[0].getClass().isAssignableFrom(Class.class)) {
                return (Class) tipo[0];
            } else {
                ParameterizedTypeImpl impl = (ParameterizedTypeImpl) tipo[0];
                return impl.getRawType();
            }
        } catch (Exception ex) {
            Logger.getLogger(Configuracoes.class.getName()).log(Level.SEVERE, null, ex);
            return null;
        }
View Full Code Here

      String genericSignature= (String) ScriptHelper.eval("declaringClass.$$$nativeClass.$$$$signatures[this.$$$signature]", this);
      genericSignature= genericSignature.replaceAll(".*<L", "");
      genericSignature= genericSignature.replaceAll(";>;", "");
      genericSignature= genericSignature.replaceAll("/", "_");

      return new ParameterizedTypeImpl(genericSignature);
    }
    else
      return getReturnType();
  }
View Full Code Here

TOP

Related Classes of sun.reflect.generics.reflectiveObjects.ParameterizedTypeImpl

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.