/** * Finds the best possible match for a method on the specified target class with a matching * name. * * <p> * The name matched will also try different combinations like <code>is + name, has + name, get + name, etc..</code> * </p> * * @param target * The class to find a matching method against. * @param name * The name of the method. * @return The most likely matching {@link Method}, or null if none could be found. */ public static Method getReadMethod(Class target, String name) { return getReadMethod(target, name, null); }
/** * Finds the best possible match for a method on the specified target class with a matching * name. * * <p> * The name matched will also try different combinations like <code>is + name, has + name, get + name, etc..</code> * </p> * * @param target * The class to find a matching method against. * @param name * The name of the method. * @return The most likely matching {@link Method}, or null if none could be found. */ public static Method getReadMethod(Class target, String name) { return getReadMethod(target, name, null); }
public Class getPropertyClass(OgnlContext context, Object target, Object index) { try { Method m = OgnlRuntime.getReadMethod(target.getClass(), index.toString()); if (m == null) { if (String.class.isAssignableFrom(index.getClass()) && !target.getClass().isArray()) { String indexStr = (String)index; String key = (indexStr.indexOf('"') >= 0)? indexStr.replaceAll("\"", "") : indexStr; try { Field f = target.getClass().getField(key); if (f != null) { return f.getType(); } } catch (NoSuchFieldException e) { return null; } } return null; } return m.getReturnType(); } catch (Throwable t) { throw OgnlOps.castToRuntime(t); } }
public Class getPropertyClass(OgnlContext context, Object target, Object index) { try { Method m = OgnlRuntime.getReadMethod(target.getClass(), index.toString()); if (m == null) { if (String.class.isAssignableFrom(index.getClass()) && !target.getClass().isArray()) { String indexStr = (String)index; String key = (indexStr.indexOf('"') >= 0)? indexStr.replaceAll("\"", "") : indexStr; try { Field f = target.getClass().getField(key); if (f != null) { return f.getType(); } } catch (NoSuchFieldException e) { return null; } } return null; } return m.getReturnType(); } catch (Throwable t) { throw OgnlOps.castToRuntime(t); } }
Method ret = OgnlRuntime.getReadMethod(target, "get" + name, argClasses); if (ret != null) return ret;
Method ret = OgnlRuntime.getReadMethod(target, "get" + name, argClasses); if (ret != null) return ret;
Method m = OgnlRuntime.getReadMethod(target.getClass(), methodName); m = OgnlRuntime.getReadMethod(target.getClass(), (currentObjectStr.indexOf('"') >= 0? currentObjectStr.replaceAll("\"", "") : currentObjectStr));
Method m = OgnlRuntime.getReadMethod(target.getClass(), methodName); m = OgnlRuntime.getReadMethod(target.getClass(), (currentObjectStr.indexOf('"') >= 0? currentObjectStr.replaceAll("\"", "") : currentObjectStr));
Method ret = OgnlRuntime.getReadMethod(target, "set" + name, argClasses); if (ret != null) return ret;
Method ret = OgnlRuntime.getReadMethod(target, "set" + name, argClasses); if (ret != null) return ret;
Method m = getGetMethod(context, (target == null) ? null : target.getClass() , propertyName); if (m == null) m = getReadMethod((target == null) ? null : target.getClass(), propertyName, null);
Method m = getGetMethod(context, (target == null) ? null : target.getClass() , propertyName); if (m == null) m = getReadMethod((target == null) ? null : target.getClass(), propertyName, null);
Method m = OgnlRuntime.getReadMethod(target.getClass(), indexStr);
Method m = OgnlRuntime.getReadMethod(target.getClass(), indexStr);
Class[] argumentClasses = getChildrenClasses(context, _children); if (m == null) m = OgnlRuntime.getReadMethod(target.getClass(), _methodName, argumentClasses);
Class[] argumentClasses = getChildrenClasses(context, _children); if (m == null) m = OgnlRuntime.getReadMethod(target.getClass(), _methodName, argumentClasses);
m = OgnlRuntime.getReadMethod(context.getCurrentObject().getClass(), name);
m = OgnlRuntime.getReadMethod(context.getCurrentObject().getClass(), name);