List of usage examples for org.apache.commons.lang.reflect FieldUtils getField
public static Field getField(Class cls, String fieldName)
Field
by name respecting scope. From source file:org.brushingbits.jnap.persistence.hsearch.FullTextDao.java
protected String[] getIndexedFields() { if (this.indexedFields == null) { PropertyDescriptor[] beanProperties = BeanUtils.getPropertyDescriptors(getEntityClass()); List<String> fields = new ArrayList<String>(); for (PropertyDescriptor propertyDescriptor : beanProperties) { Field field = ReflectionUtils.getAnnotation(Field.class, propertyDescriptor.getReadMethod()); if (field == null) { java.lang.reflect.Field propertyField = FieldUtils.getField(getEntityClass(), propertyDescriptor.getName()); if (propertyField != null && propertyField.isAnnotationPresent(Field.class)) { field = propertyField.getAnnotation(Field.class); }/*from w ww. j a v a 2s .com*/ } if (field != null) { String fieldName = propertyDescriptor.getName(); if (StringUtils.isNotBlank(fieldName)) { fieldName = field.name(); } fields.add(fieldName); } } } return this.indexedFields; }