Package org.apache.tapestry5.commons
Interface OrderedConfiguration<T>
-
- All Known Implementing Classes:
ValidatingOrderedConfigurationWrapper
public interface OrderedConfiguration<T>
Object passed into a service contributor method that allows the method provide contributed values to the service's configuration. A service can collect contributions in three different ways:- As an un-ordered collection of values
- As an ordered list of values (where each value has a unique id, pre-requisites and post-requisites)
- As a map of keys and values
- See Also:
Contribute
,UsesConfiguration
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description void
add(java.lang.String id, T object, java.lang.String... constraints)
Adds an ordered object to a service's contribution.void
addInstance(java.lang.String id, java.lang.Class<? extends T> clazz, java.lang.String... constraints)
Adds an ordered object by instantiating (with dependencies) the indicated class.void
override(java.lang.String id, T object, java.lang.String... constraints)
Overrides a normally contributed object.void
overrideInstance(java.lang.String id, java.lang.Class<? extends T> clazz, java.lang.String... constraints)
Instantiates an object and adds it as an override.
-
-
-
Method Detail
-
add
void add(java.lang.String id, T object, java.lang.String... constraints)
Adds an ordered object to a service's contribution. Each object has an id (which must be unique). Optionally, pre-requisites (a list of ids that must precede this object) and post-requisites (ids that must follow) can be provided. If no constraints are supplied, then an implicit constraint is supplied: after the previously contributed id within the same contribution method.- Parameters:
id
- a unique id for the object; the id will be fully qualified with the contributing module's idconstraints
- used to order the object relative to other contributed objectsobject
- to add to the service's configuration
-
override
void override(java.lang.String id, T object, java.lang.String... constraints)
Overrides a normally contributed object. Each override must match a single normally contributed object.- Parameters:
id
- identifies object to overrideobject
- overriding object (may be null)constraints
- constraints for the overridden object, replacing constraints for the original object (even if omitted, in which case the override object will have no ordering constraints)- Since:
- 5.1.0.0
-
addInstance
void addInstance(java.lang.String id, java.lang.Class<? extends T> clazz, java.lang.String... constraints)
Adds an ordered object by instantiating (with dependencies) the indicated class. When the configuration type is an interface and the class to be contributed is a local file, then a reloadable proxy for the class will be created and contributed.- Parameters:
id
- of contribution (used for ordering)clazz
- class to instantiateconstraints
- used to order the object relative to other contributed objects- Since:
- 5.1.0.0
-
overrideInstance
void overrideInstance(java.lang.String id, java.lang.Class<? extends T> clazz, java.lang.String... constraints)
Instantiates an object and adds it as an override. When the configuration type is an interface and the class to be contributed is a local file, then a reloadable proxy for the class will be created and contributed.- Parameters:
id
- of object to overrideclazz
- to instantiateconstraints
- constraints for the overridden object, replacing constraints for the original object (even if omitted, in which case the override object will have no ordering constraints)- Since:
- 5.1.0.0
-
-