private Class<?> getRawType(JvmTypeReference ref) { Class<?> result = getRawType(ref.getType()); return result; }
private Class<?> getRawType(JvmTypeReference ref) { Class<?> result = getRawType(ref.getType()); return result; }
protected Class<?>[] getParamTypes(JvmExecutable exe) { List<JvmFormalParameter> parameters = exe.getParameters(); List<Class<?>> result = Lists.newArrayList(); for (JvmFormalParameter p : parameters) { result.add(getRawType(p.getParameterType())); } return result.toArray(new Class<?>[result.size()]); }
protected Class<?>[] getParamTypes(JvmExecutable exe) { List<JvmFormalParameter> parameters = exe.getParameters(); List<Class<?>> result = Lists.newArrayList(); for (JvmFormalParameter p : parameters) { result.add(getRawType(p.getParameterType())); } return result.toArray(new Class<?>[result.size()]); }
protected Object create(JvmType jvmType) { Class<?> class1 = reflectAccess.getRawType(jvmType); if (class1==null) throw new IllegalStateException("Couldn't find java.lang.Class for name '"+jvmType.getIdentifier()+"'"); try { return class1.newInstance(); } catch (Exception e) { throw new WrappedException(e); } }
/** * @return the {@link java.lang.reflect.Field} corresponding to the given {@link JvmField} or <code>null</code>. */ public Field getField(JvmField field) { Class<?> class1 = getRawType(field.getDeclaringType()); if (class1 == null) return null; try { return class1.getDeclaredField(field.getSimpleName()); } catch (Exception e) { if (log.isDebugEnabled()) log.debug(e.getMessage(), e); } return null; }
/** * @return the {@link Constructor} corresponding to the given {@link JvmConstructor} or <code>null</code>. */ public Constructor<?> getConstructor(JvmConstructor constructor) { Class<?> declaringType = getRawType(constructor.getDeclaringType()); if (declaringType == null) return null; Class<?>[] paramTypes = getParamTypes(constructor); try { return declaringType.getDeclaredConstructor(paramTypes); } catch (Exception e) { if (log.isDebugEnabled()) log.debug(e.getMessage(), e); } return null; }
/** * @return the {@link Constructor} corresponding to the given {@link JvmConstructor} or <code>null</code>. */ public Constructor<?> getConstructor(JvmConstructor constructor) { Class<?> declaringType = getRawType(constructor.getDeclaringType()); if (declaringType == null) return null; Class<?>[] paramTypes = getParamTypes(constructor); try { return declaringType.getDeclaredConstructor(paramTypes); } catch (Exception e) { if (log.isDebugEnabled()) log.debug(e.getMessage(), e); } return null; }
/** * @return the {@link java.lang.reflect.Field} corresponding to the given {@link JvmField} or <code>null</code>. */ public Field getField(JvmField field) { Class<?> class1 = getRawType(field.getDeclaringType()); if (class1 == null) return null; try { return class1.getDeclaredField(field.getSimpleName()); } catch (Exception e) { if (log.isDebugEnabled()) log.debug(e.getMessage(), e); } return null; }
/** * @return the {@link Method} corresponding to the given {@link JvmOperation} or <code>null</code>. */ public Method getMethod(JvmOperation operation) { Class<?> declaringType = getRawType(operation.getDeclaringType()); if (declaringType == null) return null; Class<?>[] paramTypes = getParamTypes(operation); try { return declaringType.getDeclaredMethod(operation.getSimpleName(), paramTypes); } catch (Exception e) { if (log.isDebugEnabled()) log.debug(e.getMessage(), e); } return null; }
/** * @return the {@link Method} corresponding to the given {@link JvmOperation} or <code>null</code>. */ public Method getMethod(JvmOperation operation) { Class<?> declaringType = getRawType(operation.getDeclaringType()); if (declaringType == null) return null; Class<?>[] paramTypes = getParamTypes(operation); try { return declaringType.getDeclaredMethod(operation.getSimpleName(), paramTypes); } catch (Exception e) { if (log.isDebugEnabled()) log.debug(e.getMessage(), e); } return null; }
Class<?> componentClass = getRawType(componentType); try { return getClassFinder().forName(componentClass.getName() + "[]"); for (JvmTypeConstraint jvmTypeConstraint : constraints) { if (jvmTypeConstraint instanceof JvmUpperBound) { return getRawType(jvmTypeConstraint.getTypeReference());
Class<?> componentClass = getRawType(componentType); try { return getClassFinder().forName(componentClass.getName() + "[]"); for (JvmTypeConstraint jvmTypeConstraint : constraints) { if (jvmTypeConstraint instanceof JvmUpperBound) { return getRawType(jvmTypeConstraint.getTypeReference());