Пример #1
0
 @SuppressWarnings("unchecked")
 public <PROPERTY> PROPERTY analyzeOther(Class<PROPERTY> javaType) {
   final Object obj = getColumnValue();
   if (obj == null) {
     return null;
   }
   if (Classification.class.isAssignableFrom(javaType)) {
     final Class<?>[] argTypes = new Class[] {Object.class};
     final Method method = DfReflectionUtil.getPublicMethod(javaType, "codeOf", argTypes);
     return (PROPERTY) DfReflectionUtil.invokeStatic(method, new Object[] {obj});
   }
   return (PROPERTY) obj;
 }
Пример #2
0
 /** {@inheritDoc} */
 public List<ReferrerInfo> getReferrerInfoList() {
   if (_referrerInfoList != null) {
     return _referrerInfoList;
   }
   synchronized (this) {
     if (_referrerInfoList != null) {
       return _referrerInfoList;
     }
     final Method[] methods = this.getClass().getMethods();
     _referrerInfoList = newArrayList();
     final String prefix = "referrer";
     final Class<ReferrerInfo> returnType = ReferrerInfo.class;
     for (Method method : methods) {
       if (method.getName().startsWith(prefix) && returnType.equals(method.getReturnType())) {
         _referrerInfoList.add((ReferrerInfo) DfReflectionUtil.invoke(method, this, null));
       }
     }
     return _referrerInfoList;
   }
 }
Пример #3
0
 protected Method doFindPropertyMethod(Class<?> clazz, String methodName, Class<?>[] argTypes) {
   return DfReflectionUtil.getAccessibleMethod(clazz, methodName, argTypes);
 }