/** * Attempts to obtain the given property value from the dynamic property map first, and then an actual bean property * via a getter * * @param propertyName * @return */ public Object getPropertyValue(String propertyName) { try { return getValues().containsKey(propertyName) ? getValues().get(propertyName) : BeanUtils.getProperty(this, propertyName); } catch (Exception e) { return null; } }
/** * Attempts to obtain the given property value from the dynamic property map first, and then an actual bean property * via a getter * * @param propertyName * @return */ public Object getPropertyValue(String propertyName) { if (getPageFields().containsKey(propertyName)) { return getPageFields().get(propertyName); } else if (getPageAttributes().containsKey(propertyName)) { return getPageAttributes().get(propertyName); } else { try { return BeanUtils.getProperty(this, propertyName); } catch (Exception e) { return null; } } }
cellValue = BeanUtils.getProperty(aData, exportItem.getField());
if ("".equals(cellValue)) { try { cellValue = BeanUtils.getProperty(data.get(i), exportItems.get(j).getField()); } catch (Exception e) { log.error(e.getMessage());
protected Object fetchData(Object object,String property){ try { return BeanUtils.getProperty(object, property); } catch (Exception e) { throw new RuleException(e); } }
for (Map<String, String> lineToken : line) { if (lineToken.get("isToken").equals(layoutToken)) { String tokenValue = BeanUtils.getProperty(personName, lineToken.get("codeName")); if (StringUtils.isNotBlank(tokenValue)) { hasToken = true;
@Before("aopPoint()") public Object doRoute(JoinPoint jp) throws Throwable { boolean result = true; Method method = this.getMethod(jp); DbRoute dbRoute = method.getAnnotation(DbRoute.class); String routeField = dbRoute.field(); // userId Object[] args = jp.getArgs(); if(args != null && args.length > 0) { for(int i = 0; i < args.length; ++i) { String routeFieldValue = BeanUtils.getProperty(args[i], routeField); if(StringUtils.isNotEmpty(routeFieldValue)) { if("userId".equals(routeField)) { this.dbRouter.route(routeField); } break; } } } return Boolean.valueOf(result); }
public static String getState(Object obj) { try { return BeanUtils.getProperty(obj, ObjectMetaDataManager.STATE_FIELD); } catch (IllegalAccessException e) { } catch (InvocationTargetException e) { } catch (NoSuchMethodException e) { } return null; }
@Override protected String getConfirmationMessage(DataAccessRule object) throws Exception{ return (String) BeanUtils.getProperty(object, "workspace") + "." + (String) BeanUtils.getProperty(object, "layer") + "." + (String) BeanUtils.getProperty(object, "accessMode") + "=" + (String) BeanUtils.getProperty(object, "roles"); }
@Override protected String getConfirmationMessage(DataAccessRule object) throws Exception{ return (String) BeanUtils.getProperty(object, "workspace") + "." + (String) BeanUtils.getProperty(object, "layer") + "." + (String) BeanUtils.getProperty(object, "accessMode") + "=" + (String) BeanUtils.getProperty(object, "roles"); }
String name(Object object){ try { return (String) BeanUtils.getProperty(object, "name"); } catch(Exception e) { throw new RuntimeException("A catalog object that does not have " + "a 'name' property has been used, this is unexpected", e); } }
@Override public Object execute(Object object) throws Exception { if (object != null) { return object.toString(); } return BeanUtils.getProperty(object, string); } }
String name(Object object) { try { return (String) BeanUtils.getProperty(object, "name"); } catch (Exception e) { throw new RuntimeException( "A catalog object that does not have " + "a 'name' property has been used, this is unexpected", e); } } }
public Object map(Object a) { try { return BeanUtils.getProperty(a, property); } catch (Exception e) { throw new ClassCastException("Object was not the expected class: " + a.getClass()); } } };
private boolean propertyContainsText( final T value, final String property, final String text) { try { final String searchText = StringUtils.isEmpty(text) ? "" : text.trim().toLowerCase(); final String propertyText = Optional.of(BeanUtils.getProperty(value, property)).orElse("").trim().toLowerCase(); return propertyText.contains(searchText); } catch (Exception e) { /*IGNORE*/ } return false; }
protected void set(Object obj, String property, Object value) { try { if (BeanUtils.getProperty(obj, property) == null) { BeanUtils.setProperty(obj, property, value); } } catch (IllegalAccessException e) { } catch (InvocationTargetException e) { } catch (NoSuchMethodException e) { } }
protected void set(Object obj, String property, Object value) { try { if (BeanUtils.getProperty(obj, property) == null) { BeanUtils.setProperty(obj, property, value); } } catch (IllegalAccessException e) { } catch (InvocationTargetException e) { } catch (NoSuchMethodException e) { } }
protected Object fetchData(Object object,String property){ try { return BeanUtils.getProperty(object, property); } catch (Exception e) { throw new RuleException(e); } }
private Object getPropertyValue(String pname) { try { return BeanUtils.getProperty(this, pname); } catch (NoSuchMethodException e) { throw new PaxmlRuntimeException("Propery '" + pname + "' has no getter in class: " + getClass().getName(), e); } catch (Exception e) { throw new PaxmlRuntimeException("Cannot get value for property '" + pname + "' from class: " + getClass().getName(), e); } }
/** * get the id value */ public String getId(T t) throws CBeanException { try { return BeanUtils.getProperty(t, cBeanType.getIdField().getName()); } catch (final Exception e) { throw new CBeanException(e); } }