private static boolean hasAnnotation(CachedMethod method, Class<Internal> annotationClass) { return method.getCachedMethod().getAnnotation(annotationClass) != null; }
@Nullable public static Method toMethod(@Nullable MetaMethod metaMethod) { CachedMethod cachedMethod = ObjectUtil.asInstance(metaMethod, CachedMethod.class); return cachedMethod == null ? null : cachedMethod.getCachedMethod(); } }
public static Method methodFor(MetaMethod method) { if (method instanceof CachedMethod) return ((CachedMethod) method).getCachedMethod(); if (method instanceof ClosureMetaMethod) return ((ClosureMetaMethod) method).getDoCall().getCachedMethod(); if (method instanceof ReflectionMetaMethod) { try { return ((CachedMethod) ReflectionMetaMethod_method.get(method)).getCachedMethod(); } catch (IllegalAccessException e) { throw new UnreachableCodeError(e); } } // could try stunts for MixinInstanceMetaMethod and TransformMetaMethod or // even apply some general heuristics (e.g. look for field named "method" or // "metaMethod" (or with type Method/MetaMethod) and invoke methodFor() // recursively), but we won't do this for now return null; }
if (Modifier.isStatic(mod) && Modifier.isPublic(mod) && method.getCachedMethod().getAnnotation(Deprecated.class) == null) { CachedClass[] paramTypes = method.getParameterTypes(); if (paramTypes.length > 0) {
continue; if (method.getCachedMethod().getAnnotation(Deprecated.class) != null) continue;
isVargs = cm.isVargsMethod(); try { Method m = cm.getCachedMethod(); handle = correctClassForNameAndUnReflectOtherwise(m); if (LOG_ENABLED) LOG.info("successfully unreflected method");
continue; if (method instanceof CachedMethod && ((CachedMethod) method).getCachedMethod().isSynthetic()) continue;
protected void addBeanProperty(List<PropertyDescriptor> propertyDescriptors, MetaProperty property) { if(property instanceof MetaBeanProperty) { MetaBeanProperty beanProperty = (MetaBeanProperty) property; MetaMethod getter = beanProperty.getGetter(); MetaMethod setter = beanProperty.getSetter(); boolean isGetterCachedMethod = getter instanceof CachedMethod; if(isGetterCachedMethod && setter instanceof CachedMethod) { CachedMethod cachedGetter = (CachedMethod) getter; CachedMethod cachedSetter = (CachedMethod) setter; try { propertyDescriptors.add(new PropertyDescriptor(beanProperty.getName(), cachedGetter.getCachedMethod(), cachedSetter.getCachedMethod())); } catch (IntrospectionException e) { // ignore } } else if(isGetterCachedMethod) { CachedMethod cachedGetter = (CachedMethod) getter; try { propertyDescriptors.add(new PropertyDescriptor(beanProperty.getName(), cachedGetter.getCachedMethod(), null)); } catch (IntrospectionException e) { // ignore } } } }
public static final <T extends Annotation> T getAnnotation(MetaProperty mp, Class<T> annotationClass) { if(mp instanceof MetaBeanProperty) { MetaBeanProperty mbp = (MetaBeanProperty) mp; MetaMethod mm = mbp.getGetter(); if(mm instanceof CachedMethod) { CachedMethod cm = (CachedMethod) mm; T anno = cm.getCachedMethod().getAnnotation(annotationClass); if(anno!=null) { return anno; } } CachedField cf = mbp.getField(); if(cf != null) { return cf.field.getAnnotation(annotationClass); } } return null; }
public static final <T extends Annotation> T getAnnotation(MetaProperty mp, Class<T> annotationClass) { if(mp instanceof MetaBeanProperty) { MetaBeanProperty mbp = (MetaBeanProperty) mp; MetaMethod mm = mbp.getGetter(); if(mm instanceof CachedMethod) { CachedMethod cm = (CachedMethod) mm; T anno = cm.getCachedMethod().getAnnotation(annotationClass); if(anno!=null) { return anno; } } CachedField cf = mbp.getField(); if(cf != null) { return cf.field.getAnnotation(annotationClass); } } return null; }
if(getter instanceof CachedMethod && setter instanceof CachedMethod) { try { Method getterMethod = ((CachedMethod) getter).getCachedMethod(); Method setterMethod = ((CachedMethod) setter).getCachedMethod(); if(getterMethod.getReturnType().equals(setterMethod.getParameterTypes()[0])) { return new PropertyDescriptor(propertyName, getterMethod, setterMethod); return new PropertyDescriptor(propertyName, ((CachedMethod) getter).getCachedMethod(), null); } catch (IntrospectionException e) { return null;
MetaMethod mm = mbp.getGetter(); if(mm instanceof CachedMethod) { type = ((CachedMethod)mm).getCachedMethod().getGenericReturnType();
MetaMethod mm = mbp.getGetter(); if(mm instanceof CachedMethod) { type = ((CachedMethod)mm).getCachedMethod().getGenericReturnType();
if(getter instanceof CachedMethod) { CachedMethod cm = (CachedMethod)getter; ModelSkip skipAnn = cm.getCachedMethod().getAnnotation(ModelSkip.class); if(skipAnn!=null) { continue; continue; if(!cm.getCachedMethod().getDeclaringClass().equals(c)) { Method override = c.getDeclaredMethod(cm.getCachedMethod().getName(), cm.getCachedMethod().getParameterTypes()); if(override.getAnnotation(ModelSkip.class) !=null) { continue;
if(getter instanceof CachedMethod) { CachedMethod cm = (CachedMethod)getter; ModelSkip skipAnn = cm.getCachedMethod().getAnnotation(ModelSkip.class); if(skipAnn!=null) { continue; continue; if(!cm.getCachedMethod().getDeclaringClass().equals(c)) { Method override = c.getDeclaredMethod(cm.getCachedMethod().getName(), cm.getCachedMethod().getParameterTypes()); if(override.getAnnotation(ModelSkip.class) !=null) { continue;
if (Modifier.isStatic(mod) && Modifier.isPublic(mod) && method.getCachedMethod().getAnnotation(Deprecated.class) == null) { CachedClass[] paramTypes = method.getParameterTypes(); if (paramTypes.length > 0) {
continue; if (method.getCachedMethod().getAnnotation(Deprecated.class) != null) continue;
continue; if (method instanceof CachedMethod && ((CachedMethod)method).getCachedMethod().isSynthetic()) continue;
continue; if (method instanceof CachedMethod && ((CachedMethod) method).getCachedMethod().isSynthetic()) continue;
continue; if (method instanceof CachedMethod && ((CachedMethod)method).getCachedMethod().isSynthetic()) continue;