/** * SPECIAL METHOD: accesses the internal data<br/> * Returns a field property object for any field (not limited to only complete fields) * * @param name the fieldName * @return the Property object which holds information about a field * @throws FieldnameNotFoundException if this fieldName is invalid */ public ClassProperty getClassProperty(String name) { ClassProperty cp = getAnyPropertyOrFail(name); return cp; }
/** * SPECIAL METHOD: accesses the internal data<br/> * Returns a field property object for any field (not limited to only complete fields) * * @param name the fieldName * @return the Property object which holds information about a field * @throws FieldnameNotFoundException if this fieldName is invalid */ public ClassProperty getClassProperty(String name) { ClassProperty cp = getAnyPropertyOrFail(name); return cp; }
/** * @param name the fieldName * @return the type of this field * @throws FieldnameNotFoundException if this fieldName is invalid */ public Class<?> getFieldType(String name) { ClassProperty cp = getAnyPropertyOrFail(name); Class<?> type = cp.getType(); return type; }
/** * Get all annotations on the field in the represented class * * @param name the fieldName * @return the set of all annotations on this field * @throws FieldnameNotFoundException if this fieldName is invalid */ public Set<Annotation> getFieldAnnotations(String name) { ClassProperty cp = getAnyPropertyOrFail(name); Collection<Annotation> annotes = cp.getAnnotationsCollection(); Set<Annotation> s = new HashSet<Annotation>(annotes); return s; }
/** * @param name the fieldName * @return the type of this field * @throws FieldnameNotFoundException if this fieldName is invalid */ public Class<?> getFieldType(String name) { ClassProperty cp = getAnyPropertyOrFail(name); Class<?> type = cp.getType(); return type; }
/** * Get all annotations on the field in the represented class * * @param name the fieldName * @return the set of all annotations on this field * @throws FieldnameNotFoundException if this fieldName is invalid */ public Set<Annotation> getFieldAnnotations(String name) { ClassProperty cp = getAnyPropertyOrFail(name); Collection<Annotation> annotes = cp.getAnnotationsCollection(); Set<Annotation> s = new HashSet<Annotation>(annotes); return s; }
/** * @param annotationType * the annotation type to look for on this field * @param name the fieldName * @return the annotation if found OR null if none found * @throws FieldnameNotFoundException if this fieldName is invalid */ @SuppressWarnings("hiding") public <T extends Annotation> T getFieldAnnotation(Class<T> annotationType, String name) { if (annotationType == null) { throw new IllegalArgumentException("annotationType must not be null"); } ClassProperty cp = getAnyPropertyOrFail(name); T a = cp.getAnnotation(annotationType); return a; }
/** * @param annotationType * the annotation type to look for on this field * @param name the fieldName * @return the annotation if found OR null if none found * @throws FieldnameNotFoundException if this fieldName is invalid */ @SuppressWarnings("hiding") public <T extends Annotation> T getFieldAnnotation(Class<T> annotationType, String name) { if (annotationType == null) { throw new IllegalArgumentException("annotationType must not be null"); } ClassProperty cp = getAnyPropertyOrFail(name); T a = cp.getAnnotation(annotationType); return a; }
/** * Checks if a field is valid for the given filter * * @param name the fieldName * @param filter (optional) indicates the fields to include in the check, can be null for defaults * @return true if this fieldName is valid, false otherwise */ public boolean isFieldNameValid(String name, FieldsFilter filter) { boolean valid = namesToProperties.containsKey(name); if (valid) { // the field is real so check to see if it is in this filter ClassProperty cp = getAnyPropertyOrFail(name); if ( isFieldInFilter(cp, filter) ) { valid = true; } else { valid = false; } } return valid; }
/** * Checks if a field is valid for the given filter * * @param name the fieldName * @param filter (optional) indicates the fields to include in the check, can be null for defaults * @return true if this fieldName is valid, false otherwise */ public boolean isFieldNameValid(String name, FieldsFilter filter) { boolean valid = namesToProperties.containsKey(name); if (valid) { // the field is real so check to see if it is in this filter ClassProperty cp = getAnyPropertyOrFail(name); if ( isFieldInFilter(cp, filter) ) { valid = true; } else { valid = false; } } return valid; }
try { String name = makeFieldNameFromMethod(method.getName()); ClassProperty cp = getAnyPropertyOrFail(name); Annotation[] annotations = method.getAnnotations(); for (Annotation annotation : annotations) { ClassProperty cp = getAnyPropertyOrFail(fieldName); if (cp.getField() == null) { ClassProperty cp = getAnyPropertyOrFail(fieldName); cp.transientField = true; } catch (FieldnameNotFoundException e) {
try { String name = makeFieldNameFromMethod(method.getName()); ClassProperty cp = getAnyPropertyOrFail(name); Annotation[] annotations = method.getAnnotations(); for (Annotation annotation : annotations) { ClassProperty cp = getAnyPropertyOrFail(fieldName); if (cp.getField() == null) { ClassProperty cp = getAnyPropertyOrFail(fieldName); cp.transientField = true; } catch (FieldnameNotFoundException e) {