protected static Object getPrimitiveValue(String name, Object value) { int index = name.indexOf("."); if (index != -1) { String[] names = name.split("\\."); name = name.substring(index + 1); if (value != null && !InjectionUtils.isPrimitive(value.getClass())) { try { String nextPart = names[1]; if (nextPart.length() == 1) { nextPart = nextPart.toUpperCase(); } else { nextPart = Character.toUpperCase(nextPart.charAt(0)) + nextPart.substring(1); } Method m = value.getClass().getMethod("get" + nextPart, new Class[]{}); value = m.invoke(value, new Object[]{}); } catch (Throwable ex) { throw new RuntimeException(); } } return getPrimitiveValue(name, value); } return value; } }
protected static Object getPrimitiveValue(String name, Object value) { int index = name.indexOf("."); if (index != -1) { String[] names = name.split("\\."); name = name.substring(index + 1); if (value != null && !InjectionUtils.isPrimitive(value.getClass())) { try { String nextPart = names[1]; if (nextPart.length() == 1) { nextPart = nextPart.toUpperCase(); } else { nextPart = Character.toUpperCase(nextPart.charAt(0)) + nextPart.substring(1); } Method m = value.getClass().getMethod("get" + nextPart, new Class[]{}); value = m.invoke(value, new Object[]{}); } catch (Throwable ex) { throw new RuntimeException(); } } return getPrimitiveValue(name, value); } return value; } }
protected static Object getPrimitiveValue(String name, Object value) { int index = name.indexOf("."); if (index != -1) { String[] names = name.split("\\."); name = name.substring(index + 1); if (value != null && !InjectionUtils.isPrimitive(value.getClass())) { try { String nextPart = names[1]; if (nextPart.length() == 1) { nextPart = nextPart.toUpperCase(); } else { nextPart = Character.toUpperCase(nextPart.charAt(0)) + nextPart.substring(1); } Method m = value.getClass().getMethod("get" + nextPart, new Class[]{}); value = m.invoke(value, new Object[]{}); } catch (Throwable ex) { throw new RuntimeException(); } } return getPrimitiveValue(name, value); } return value; } }
private Object getValue(String getter, T pojo) { String thePropertyName; int index = getter.indexOf("."); if (index != -1) { thePropertyName = getter.substring(0, index); } else { thePropertyName = getter; } Object value; try { if (beanspector != null) { value = beanspector.swap(pojo).getValue(thePropertyName.toLowerCase()); } else { value = ((SearchBean)pojo).get(getter); } return getPrimitiveValue(getter, value); } catch (Throwable e) { return null; } }
private Object getValue(String getter, T pojo) { String thePropertyName; int index = getter.indexOf("."); if (index != -1) { thePropertyName = getter.substring(0, index); } else { thePropertyName = getter; } Object value; try { if (beanspector != null) { value = beanspector.swap(pojo).getValue(thePropertyName.toLowerCase()); } else { value = ((SearchBean)pojo).get(getter); } return getPrimitiveValue(getter, value); } catch (Throwable e) { return null; } }
private Object getValue(String getter, T pojo) { String thePropertyName; int index = getter.indexOf("."); if (index != -1) { thePropertyName = getter.substring(0, index); } else { thePropertyName = getter; } Object value; try { if (beanspector != null) { value = beanspector.swap(pojo).getValue(thePropertyName.toLowerCase()); } else { value = ((SearchBean)pojo).get(getter); } return getPrimitiveValue(getter, value); } catch (Throwable e) { return null; } }
public boolean isMet(T pojo) { if (isPrimitive(pojo)) { return compare(pojo, cType, propertyValue); } Object lValue = getValue(propertyName, pojo); Object rValue = getPrimitiveValue(propertyName, propertyValue); return lValue == null ? false : compare(lValue, cType, rValue); }
public boolean isMet(T pojo) { if (isPrimitive(pojo)) { return compare(pojo, cType, propertyValue); } else { Object lValue = getValue(propertyName, pojo); Object rValue = getPrimitiveValue(propertyName, propertyValue); return lValue == null ? false : compare(lValue, cType, rValue); } }
public boolean isMet(T pojo) { if (isPrimitive(pojo)) { return compare(pojo, cType, propertyValue); } Object lValue = getValue(propertyName, pojo); Object rValue = getPrimitiveValue(propertyName, propertyValue); return lValue == null ? false : compare(lValue, cType, rValue); }