protected String getManagedPropertyName(ManagedProperty managedProperty, Field field) { // Get the name of the managed-property from the @ManagedProperty annotation. String managedPropertyName = managedProperty.name(); // Since the name element of the @ManagedProperty annotation is optional, then if it is missing, use // the name of the field itself. if ((managedPropertyName == null) || (managedPropertyName.length() == 0)) { managedPropertyName = field.getName(); } return managedPropertyName; }
protected String getManagedPropertyName(ManagedProperty managedProperty, Field field) { // Get the name of the managed-property from the @ManagedProperty annotation. String managedPropertyName = managedProperty.name(); // Since the name element of the @ManagedProperty annotation is optional, then if it is missing, use // the name of the field itself. if ((managedPropertyName == null) || (managedPropertyName.length() == 0)) { managedPropertyName = field.getName(); } return managedPropertyName; }
protected String getManagedPropertyName(ManagedProperty managedProperty, Field field) { // Get the name of the managed-property from the @ManagedProperty annotation. String managedPropertyName = managedProperty.name(); // Since the name element of the @ManagedProperty annotation is optional, then if it is missing, use // the name of the field itself. if ((managedPropertyName == null) || (managedPropertyName.length() == 0)) { managedPropertyName = field.getName(); } return managedPropertyName; }
private void collectAnnotatedFields(Class<?> baseClass, Map<String,Field> annotatedFields) { Field[] fields = baseClass.getDeclaredFields(); for (Field field : fields) { ManagedProperty property = field.getAnnotation(ManagedProperty.class); if (property != null) { String propName = property.name(); if (propName == null || propName.length() == 0) { propName = field.getName(); } // if the field has already been collected, don't replace the existing // value as that value represents an override. if (!annotatedFields.containsKey(propName)) { annotatedFields.put(propName, field); } } } Class<?> superClass = baseClass.getSuperclass(); if (!Object.class.equals(superClass)) { collectAnnotatedFields(superClass, annotatedFields); } }
private void collectAnnotatedFields(Class<?> baseClass, Map<String,Field> annotatedFields) { Field[] fields = baseClass.getDeclaredFields(); for (Field field : fields) { ManagedProperty property = field.getAnnotation(ManagedProperty.class); if (property != null) { String propName = property.name(); if (propName == null || propName.length() == 0) { propName = field.getName(); } // if the field has already been collected, don't replace the existing // value as that value represents an override. if (!annotatedFields.containsKey(propName)) { annotatedFields.put(propName, field); } } } Class<?> superClass = baseClass.getSuperclass(); if (!Object.class.equals(superClass)) { collectAnnotatedFields(superClass, annotatedFields); } }
private void collectAnnotatedFields(Class<?> baseClass, Map<String,Field> annotatedFields) { Field[] fields = baseClass.getDeclaredFields(); for (Field field : fields) { ManagedProperty property = field.getAnnotation(ManagedProperty.class); if (property != null) { String propName = property.name(); if (propName == null || propName.length() == 0) { propName = field.getName(); } // if the field has already been collected, don't replace the existing // value as that value represents an override. if (!annotatedFields.containsKey(propName)) { annotatedFields.put(propName, field); } } } Class<?> superClass = baseClass.getSuperclass(); if (!Object.class.equals(superClass)) { collectAnnotatedFields(superClass, annotatedFields); } }
String name = property.name(); if ((name == null) || "".equals(name))
String name = property.name(); if ((name == null) || "".equals(name))
String name = property.name(); if ((name == null) || "".equals(name))