org.apache.tapestry5.ioc.internal
Class ValidatingOrderedConfigurationWrapper<T>

java.lang.Object
  extended by org.apache.tapestry5.ioc.internal.AbstractConfigurationImpl<T>
      extended by org.apache.tapestry5.ioc.internal.ValidatingOrderedConfigurationWrapper<T>
Type Parameters:
T -
All Implemented Interfaces:
OrderedConfiguration<T>

public class ValidatingOrderedConfigurationWrapper<T>
extends AbstractConfigurationImpl<T>
implements OrderedConfiguration<T>

Wraps a List as a OrderedConfiguration, implementing validation of values provided to an OrderedConfiguration.


Constructor Summary
ValidatingOrderedConfigurationWrapper(java.lang.Class<T> expectedType, ObjectLocator locator, Orderer<T> orderer, java.util.Map<java.lang.String,org.apache.tapestry5.ioc.internal.OrderedConfigurationOverride<T>> overrides, ContributionDef contribDef, java.lang.String serviceId)
           
 
Method Summary
 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.
 
Methods inherited from class org.apache.tapestry5.ioc.internal.AbstractConfigurationImpl
instantiate
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ValidatingOrderedConfigurationWrapper

public ValidatingOrderedConfigurationWrapper(java.lang.Class<T> expectedType,
                                             ObjectLocator locator,
                                             Orderer<T> orderer,
                                             java.util.Map<java.lang.String,org.apache.tapestry5.ioc.internal.OrderedConfigurationOverride<T>> overrides,
                                             ContributionDef contribDef,
                                             java.lang.String serviceId)
Method Detail

add

public void add(java.lang.String id,
                T object,
                java.lang.String... constraints)
Description copied from interface: OrderedConfiguration
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.

Specified by:
add in interface OrderedConfiguration<T>
Parameters:
id - a unique id for the object; the id will be fully qualified with the contributing module's id
constraints - used to order the object relative to other contributed objects

override

public void override(java.lang.String id,
                     T object,
                     java.lang.String... constraints)
Description copied from interface: OrderedConfiguration
Overrides a normally contributed object. Each override must match a single normally contributed object.

Specified by:
override in interface OrderedConfiguration<T>
Parameters:
id - identifies object to override
object - overriding object (may be null)
constraints - contrains for the overridden object, replacing constraints for the original object (even if omitted, in which case the override object will have no orderring contraints)

addInstance

public void addInstance(java.lang.String id,
                        java.lang.Class<? extends T> clazz,
                        java.lang.String... constraints)
Description copied from interface: OrderedConfiguration
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.

Specified by:
addInstance in interface OrderedConfiguration<T>
Parameters:
id - of contribution (used for ordering)
clazz - class to instantiate
constraints - used to order the object relative to other contributed objects

overrideInstance

public void overrideInstance(java.lang.String id,
                             java.lang.Class<? extends T> clazz,
                             java.lang.String... constraints)
Description copied from interface: OrderedConfiguration
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.

Specified by:
overrideInstance in interface OrderedConfiguration<T>
Parameters:
id - of object to override
clazz - to instantiate
constraints - override contraints


Copyright © 2006-2010 Apache Software Foundation. All Rights Reserved.