net.sf.composite.specialize
Interface Specializer

All Known Implementing Classes:
BaseSpecializer, CachingSpecializerProxy, CloningSpecializer, Jdk13ProxySpecializer

public interface Specializer

Constructs specialized instances of a composite using its components. The specialized instance is constructed by gathering all the components of the original composite that are of the designated specialization type. The specialized instance may be a subtype of the original composite.

Since:
Mar 11, 2005
Author:
Matt Sgarlata

Method Summary
 boolean isSpecializable(java.lang.Object composite, java.lang.Class specializedType)
          Determines whether the components in the composite can be used to create a specialized version of the composite that implements specializedType.
 java.lang.Object specialize(java.lang.Object composite, java.lang.Class specializedType)
          Uses the components in the composite to create a composite that implements specializedType and is composed only those
 

Method Detail

isSpecializable

boolean isSpecializable(java.lang.Object composite,
                        java.lang.Class specializedType)
                        throws SpecializationException
Determines whether the components in the composite can be used to create a specialized version of the composite that implements specializedType.

Parameters:
composite - the composite from which the components will be extracted
specializedType - the type to be exposed
Throws:
SpecializationException - if the new, specialized, composite could not be created

specialize

java.lang.Object specialize(java.lang.Object composite,
                            java.lang.Class specializedType)
                            throws SpecializationException
Uses the components in the composite to create a composite that implements specializedType and is composed only those

Parameters:
composite - the composite from which the components will be extracted
specializedType - the type to be exposed
Throws:
SpecializationException - if the new, specialized, composite could not be created


Copyright © 2005-2008.