/ Published in: Java

Expand |
Embed | Plain Text
Copy this code and paste it in your HTML
/** * Gets value from object using reflection. * * @param object the object * @param fieldName the field * @return the value */ // get class Class clazz = object != null ? object.getClass() : null; if (clazz == null) { return null; } // get object value using reflection try { @SuppressWarnings("unchecked") return valueObject != null ? valueObject.toString() : ""; // ignore all reflection errors } return null; }
Comments
