com.planetalia.dynject.injection
Interface IValueSource<T>

All Known Implementing Classes:
HttpRequestSource, MapSource, ObjectSource, ShellSource, StructuredContentSource, SwingSource, XMLContentSource

public interface IValueSource<T>

Interface that acts as a generic provider of values to the system

Author:
Alexander Hristov

Method Summary
 ClassPreferences getPropertyClass(java.lang.String propertyName)
          Returns the class preferences for a property
 java.util.Set<java.lang.String> getPropertyNames()
          Returns the set of all existing properties at the time of invocation.
 java.lang.Object getValue(java.lang.String propertyName)
          Provides the value of a specific property
 boolean propertyExists(java.lang.String propertyName)
          Checks whether a specific property exists.
 void setValue(java.lang.String propertyName, T value)
          Sets the value of a specific property.
 

Method Detail

getValue

java.lang.Object getValue(java.lang.String propertyName)
Provides the value of a specific property

Parameters:
propertyName - Name of the requested property. Assumed to exist.
Returns:
Property value

setValue

void setValue(java.lang.String propertyName,
              T value)
Sets the value of a specific property. It's the callers responsability to provide a correct data type for that property. This is an optional operation. Some sources do not support writing properties to them

Parameters:
propertyName - Name of the requested property.
value - Property value.

getPropertyNames

java.util.Set<java.lang.String> getPropertyNames()
Returns the set of all existing properties at the time of invocation.

Returns:
Set of property names

getPropertyClass

ClassPreferences getPropertyClass(java.lang.String propertyName)
Returns the class preferences for a property

Parameters:
propertyName - Name of the property
Returns:
List of class preferences for that property

propertyExists

boolean propertyExists(java.lang.String propertyName)
Checks whether a specific property exists. Not that a nonexistant property and a proprerty with a null value are not the same situation

Parameters:
propertyName - Name of the requested property
Returns:
True if the property exists, false otherwise