@Override public final void addPropertyChangeListener(final PropertyKey name, final PropertyChangeListener listener) throws NullPointerException { support.addPropertyChangeListener(name.toString(), listener); }
@Override public final void removePropertyChangeListener(final PropertyKey name, final PropertyChangeListener listener) throws NullPointerException { support.removePropertyChangeListener(name.toString(), listener); }
@Override public final PropertyDescriptor getDescriptor(final PropertyKey key) throws UnknownPropertyException { return getDescriptor(key.toString()); }
private static boolean isResolvementFailureOfPlaceholder( final PropertyValueResolveException e, final Property property) { return !property.getName().equals(e.getPropertyKey().toString()); }
private void checkValidPair(final PropertyDescriptor descriptor, final Property property) throws IllegalArgumentException { final String name = property.getName(); final String descriptorName = descriptor.getKey().toString(); if (!name.equals(descriptorName)) { throw new IllegalArgumentException("Property value with key '" + name + "' does not match the key '" + descriptorName + "' in the property descriptor."); } }
@Override public final DescribedProperty getProperty(final PropertyKey key) throws IllegalArgumentException, UnknownPropertyException { final PropertyDescriptor descriptor = getPropertyDescriptor(key.toString()); return getProperty(descriptor); }
@Override public final ValidatedProperty getValidatedProperty(final PropertyKey key, final Object defaultValue) throws IllegalArgumentException, UnknownPropertyException, PropertyValidationException { final PropertyDescriptor descriptor = getDescriptor(key.toString()); return getValidatedProperty(descriptor, defaultValue); }
@Override public final ValidatedProperty getValidatedProperty(final PropertyKey key, final Object defaultValue) throws IllegalArgumentException, UnknownPropertyException, PropertyValidationException, SecurityException { final PropertyDescriptor descriptor = getPropertyDescriptor(key.toString()); return getValidatedProperty(descriptor, defaultValue); }
@Override public final Object getPropertyValue(final PropertyKey key) throws IllegalArgumentException, UnknownPropertyException, PropertyValidationException { final PropertyDescriptor descriptor = getDescriptor(key.toString()); return getPropertyValue(descriptor); }
@Override public final Object getPropertyValue(final PropertyKey key) throws IllegalArgumentException, UnknownPropertyException, PropertyValidationException { final PropertyDescriptor descriptor = getPropertyDescriptor(key.toString()); return getPropertyValue(descriptor, null); }
@Override public final DescribedProperty getProperty(final PropertyKey key) throws IllegalArgumentException, UnknownPropertyException { final PropertyDescriptor descriptor = getDescriptor(key.toString()); return getProperty(descriptor); }
/** * Returns the unique title of the report within the space. * * @return the unique title of the report within the space. */ public String getTitle() { final String metadataValue = descriptor.getDocumentMetaData().getTitle(); if (StringUtils.isBlank(metadataValue)) { return descriptor.getKey().toString(); } return metadataValue; }
@Override public final Property setProperty(final PropertyKey key, final String value) throws NullPointerException, PropertyValidationException, ReadOnlyPropertyException { Arg.checkNotNull("key", key); checkWritable(key, value); final String name = key.toString(); return setPropertyAndFireEvent(name, value); }
@Override public final Property setProperty(final PropertyKey key, final String value) throws NullPointerException, PropertyValidationException, ReadOnlyPropertyException { final Property oldProperty = getDelegate().setProperty(key, value); final String stringKey = key.toString(); cache.removeFromCache(stringKey); return oldProperty; }
@Override public final Property unsetProperty(final PropertyKey key) throws NullPointerException, ReadOnlyPropertyException { final Property oldProperty = getDelegate().unsetProperty(key); final String stringKey = key.toString(); cache.removeFromCache(stringKey); return oldProperty; }
private DescribedProperty getPropertyInternal( final PropertyDescriptor descriptor) { final String name = descriptor.getKey().toString(); final Property property = getPropertyFromStore(name); // if (property == null || property.getValue() == null) // { // if alternative lookups have to be provided, the 'properties' have to // be updated on every change. // final Property alt = properties.getValue(name); // property = alt != null ? alt : property; // } final DescribedProperty describedProperty = new DescribedProperty(this.getKey(), descriptor, property); return describedProperty; }
@Override public final Property unsetProperty(final PropertyKey key) throws NullPointerException, ReadOnlyPropertyException { Arg.checkNotNull("key", key); checkWritable(key, null); final String name = key.toString(); final Property oldProperty = deletePropertyInStore(name); firePropertyChange(name, oldProperty.getValue(), null); return oldProperty; }
private void addProperties( final Map<Class<?>, List<PropertyDescriptor>> descriptorMap, final MultiSourceProperties compositeProperties) { final Properties properties = new Properties(); for (final Entry<Class<?>, List<PropertyDescriptor>> entry : descriptorMap .entrySet()) { final List<PropertyDescriptor> descriptors = entry.getValue(); for (final PropertyDescriptor descriptor : descriptors) { final String propertyKey = descriptor.getKey().toString(); final Property property = compositeProperties.getValue(propertyKey, true); if (property != null && property.getValue() != null) { properties.put(propertyKey, property); } } } final ConfigurationKey<?> key = compositeProperties.getConfigurationKey(); final ConfigurationPropertiesManagement configuration = factoryCache.ensureManagement(key); final PropertyProvider provider = new PropertiesPropertyProvider(key, new PropertyLocation( "classpath-various"), properties); configuration.addDefinitions(provider); }
@Override public void handle(final PropertyReportItem item) throws ReportException { super.handle(item); final PropertyDescriptor descriptor = item.getDescriptor(); final String key = descriptor.getKey().toString(); final PropertyExpression expression = descriptor.getDefaultExpression(); final String value = expression != null && expression.getExpression() != null ? expression .getExpression() : ""; currentProperties.setProperty(key, value); }
private void addProperties(final MultiSourceProperties compositeProperties) { final Properties properties = new Properties(); final Class<?> type = BootProperties.class; final PropertiesContext context = configuration.getContext(type); final PropertyMetaDataParser propertyDescriptorParser = PropertyMetaDataParser.create(context); final List<PropertyDescriptor> descriptors = propertyDescriptorParser.readDescriptors(type); for (final PropertyDescriptor descriptor : descriptors) { final String propertyKey = descriptor.getKey().toString(); final Property property = compositeProperties.getValue(propertyKey); if (property != null && property.getValue() != null) { properties.put(propertyKey, property); } else { properties.remove(propertyKey); } } configuration.addDescriptors(type); final PropertyProvider provider = new PropertiesPropertyProvider(configuration.getKey(), new PropertyLocation("boot-various"), properties); configuration.addDefinitions(provider); }