/** * Constructor for when you have descriptors and fields in arrays (if you have descriptors it is * easy to get the fields from the class using {@link Class#getFields()}), no arguments can be * null but the arrays can be empty * * @param fieldClass * this is the class whose fields are represented * @param descriptors * an array of descriptors, you can get these from * {@link BeanInfo#getPropertyDescriptors()} and you can get the {@link BeanInfo} * from {@link Introspector#getBeanInfo(Class)} * @param publicFields * array of public fields */ public ClassFields(Class<T> fieldClass, PropertyDescriptor[] descriptors, Field[] publicFields) { if (fieldClass == null || descriptors == null || publicFields == null) { throw new IllegalArgumentException("None of the params can be null"); } classData = new ClassData<T>(fieldClass); fieldFindMode = FieldFindMode.HYBRID; namesToProperties = new ArrayOrderedMap<String, ClassProperty>(descriptors.length + publicFields.length); populateProperties(descriptors); populateFields(publicFields); populateAnnotationsFields(); }
/** * Constructor for when you have descriptors and fields in arrays (if you have descriptors it is * easy to get the fields from the class using {@link Class#getFields()}), no arguments can be * null but the arrays can be empty * * @param fieldClass * this is the class whose fields are represented * @param descriptors * an array of descriptors, you can get these from * {@link BeanInfo#getPropertyDescriptors()} and you can get the {@link BeanInfo} * from {@link Introspector#getBeanInfo(Class)} * @param publicFields * array of public fields */ public ClassFields(Class<T> fieldClass, PropertyDescriptor[] descriptors, Field[] publicFields) { if (fieldClass == null || descriptors == null || publicFields == null) { throw new IllegalArgumentException("None of the params can be null"); } classData = new ClassData<T>(fieldClass); fieldFindMode = FieldFindMode.HYBRID; namesToProperties = new ArrayOrderedMap<String, ClassProperty>(descriptors.length + publicFields.length); populateProperties(descriptors); populateFields(publicFields); populateAnnotationsFields(); }
populateProperties(descriptors); populateFields(false); } else { useIntrospector = false; populateFields(true); } else { populateFields(false);
populateProperties(descriptors); populateFields(false); } else { useIntrospector = false; populateFields(true); } else { populateFields(false);
populateFields(publicFields); populateAnnotationsFields();
populateFields(publicFields); populateAnnotationsFields();