/** * @return the class that this {@link ClassFields} object represents the fields for * @throws java.lang.Exception class loading exception, * if the class this refers to has been garbage collected */ public Class<T> getFieldClass() { return getStoredClass(); }
/** * @return the class that this {@link ClassFields} object represents the fields for * @throws java.lang.Exception class loading exception, * if the class this refers to has been garbage collected */ public Class<T> getFieldClass() { return getStoredClass(); }
@Override public String toString() { return "(" + getStoredClass().getName() + "):mode="+fieldFindMode.name()+":" + getFieldNames(FieldsFilter.ALL); }
@Override public String toString() { return "(" + getStoredClass().getName() + "):mode="+fieldFindMode.name()+":" + getFieldNames(FieldsFilter.ALL); }
/** * Get the types for fields in a class but filter the fields to get the types for * @param filter (optional) indicates the fields to return the types for, can be null for defaults * @return the map of fieldName -> field type */ public Map<String, Class<?>> getFieldTypes(FieldsFilter filter) { OrderedMap<String, Class<?>> fieldTypes = new ArrayOrderedMap<String, Class<?>>(); fieldTypes.setName(getStoredClass().getName()); for (Entry<String, ClassProperty> entry : namesToProperties.getEntries()) { String name = entry.getKey(); ClassProperty cp = entry.getValue(); if ( isFieldInFilter(cp, filter) ) { fieldTypes.put(name, cp.getType()); } } return fieldTypes; }
/** * Get the types for fields in a class but filter the fields to get the types for * @param filter (optional) indicates the fields to return the types for, can be null for defaults * @return the map of fieldName -> field type */ public Map<String, Class<?>> getFieldTypes(FieldsFilter filter) { OrderedMap<String, Class<?>> fieldTypes = new ArrayOrderedMap<String, Class<?>>(); fieldTypes.setName(getStoredClass().getName()); for (Entry<String, ClassProperty> entry : namesToProperties.getEntries()) { String name = entry.getKey(); ClassProperty cp = entry.getValue(); if ( isFieldInFilter(cp, filter) ) { fieldTypes.put(name, cp.getType()); } } return fieldTypes; }