protected Set<Property> createPropertySet(Class<? extends Object> type, BeanAccess bAccess) { Set<Property> properties = new TreeSet<Property>(); Collection<Property> props = getPropertiesMap(type, bAccess).values(); for (Property property : props) { if (property.isReadable() && (allowReadOnlyProperties || property.isWritable())) { properties.add(property); } } return properties; }
public Property getProperty(Class<? extends Object> type, String name, BeanAccess bAccess) { Map<String, Property> properties = getPropertiesMap(type, bAccess); Property property = properties.get(name); if (property == null && skipMissingProperties) { property = new MissingProperty(name); } if (property == null) { throw new YAMLException( "Unable to find property '" + name + "' on class: " + type.getName()); } return property; }
@Override protected Map<String, Property> getPropertiesMap(Class<?> type, BeanAccess bAccess) throws IntrospectionException { Map<String, Property> result = propertyMaps.get(type); return result != null ? result : super.getPropertiesMap(type, bAccess); }
@Override protected Map<String, Property> getPropertiesMap(Class<?> type, BeanAccess bAccess) throws IntrospectionException { Map<String, Property> result = propertyMaps.get(type); return result != null ? result : super.getPropertiesMap(type, bAccess); }
protected Set<Property> createPropertySet(Class<? extends Object> type, BeanAccess bAccess) { Set<Property> properties = new TreeSet<Property>(); Collection<Property> props = getPropertiesMap(type, bAccess).values(); for (Property property : props) { if (property.isReadable() && (allowReadOnlyProperties || property.isWritable())) { properties.add(property); } } return properties; }
protected Set<Property> createPropertySet(Class<? extends Object> type, BeanAccess bAccess) throws IntrospectionException { Set<Property> properties = new TreeSet<Property>(); Collection<Property> props = getPropertiesMap(type, bAccess).values(); for (Property property : props) { if (property.isReadable() && (allowReadOnlyProperties || property.isWritable())) { properties.add(property); } } return properties; }
protected Set<Property> createPropertySet(Class<? extends Object> type, BeanAccess bAccess) throws IntrospectionException { Set<Property> properties = new TreeSet<Property>(); Collection<Property> props = getPropertiesMap(type, bAccess).values(); for (Property property : props) { if (property.isReadable() && (allowReadOnlyProperties || property.isWritable())) { properties.add(property); } } return properties; }
public Property getProperty(Class<? extends Object> type, String name, BeanAccess bAccess) { Map<String, Property> properties = getPropertiesMap(type, bAccess); Property property = properties.get(name); if (property == null && skipMissingProperties) { property = new MissingProperty(name); } if (property == null) { throw new YAMLException( "Unable to find property '" + name + "' on class: " + type.getName()); } return property; }
public Property getProperty(Class<? extends Object> type, String name, BeanAccess bAccess) throws IntrospectionException { Map<String, Property> properties = getPropertiesMap(type, bAccess); Property property = properties.get(name); if (property == null && skipMissingProperties) { property = new MissingProperty(name); } if (property == null || !property.isWritable()) { throw new YAMLException("Unable to find property '" + name + "' on class: " + type.getName()); } return property; }
public Property getProperty(Class<? extends Object> type, String name, BeanAccess bAccess) throws IntrospectionException { Map<String, Property> properties = getPropertiesMap(type, bAccess); Property property = properties.get(name); if (property == null && skipMissingProperties) { property = new MissingProperty(name); } if (property == null || !property.isWritable()) { throw new YAMLException("Unable to find property '" + name + "' on class: " + type.getName()); } return property; }
@Override protected Map<String, Property> getPropertiesMap(Class<?> type, BeanAccess bAccess) throws IntrospectionException { Map<String, Property> newPropertyMap = new LinkedHashMap<>(); Map<String, Property> propertiesMap = super.getPropertiesMap(type, bAccess); for (Iterator<Map.Entry<String, Property>> iterator = propertiesMap.entrySet().iterator(); iterator.hasNext(); ) { Map.Entry<String, Property> entry = iterator.next(); boolean updated = false; if (entry.getValue() instanceof FieldProperty) { try { Field field = type.getDeclaredField(entry.getValue().getName()); Path path = field.getAnnotation(Path.class); if (path != null) { newPropertyMap.put(path.value(), new CustomNameFieldProperty(field, path.value())); updated = true; } } catch (NoSuchFieldException ignored) { } } if (!updated) { newPropertyMap.put(entry.getKey(), entry.getValue()); } } return newPropertyMap; }