|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectnet.sf.composite.composites.BaseComposite
public class BaseComposite
A Convenient base class for composites that provides exception handling,
argument checking and default implementations of the methods defined in
ListableComposite,
StrictlyTypedComposite,
ValidatableComposite and
SpecializableComposite. The final interface is not
declared to be implemented by this class so that subclasses may choose to
expose the interface or not.
| Constructor Summary | |
|---|---|
BaseComposite()
Creates a new composite. |
|
BaseComposite(Component component)
Creates a new composite that is composed of only a single component. |
|
| Method Summary | |
|---|---|
boolean |
containsComponentOfType(java.lang.Class componentType)
Indicates whether one or more components of the given type make up this composite. |
java.lang.Object[] |
getComponents()
Returns the components that make up this composite. |
java.lang.Object[] |
getComponentsOfType(java.lang.Class componentType)
Returns the components that make up this composite that are of the given type. |
java.lang.Class |
getComponentType()
Indicates a type which must be implemented by each of the components of this composite |
ComponentValidator |
getComponentValidator()
|
Specializer |
getSpecializer()
|
protected void |
initializeImpl()
|
boolean |
isSpecializable(java.lang.Class type)
|
void |
setComponent(java.lang.Object component)
|
void |
setComponents(java.lang.Object[] components)
Sets the components that make up this composite. |
void |
setComponentValidator(ComponentValidator componentValidator)
|
void |
setSpecializer(Specializer specializer)
|
java.lang.Object |
specialize(java.lang.Class type)
|
void |
validate()
Validates that the internal state of this composite is valid. |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
|---|
public BaseComposite()
BaseComposite#setComponents(Component[]) or
BaseComposite#setComponent(Component).
public BaseComposite(Component component)
the - component that makes up this composite| Method Detail |
|---|
protected void initializeImpl()
public void validate()
throws ComponentValidationException
ValidatableComposite
validate in interface ValidatableCompositeComponentValidationException - if the composite is not validation or validation could not be
performed for some reason
public boolean containsComponentOfType(java.lang.Class componentType)
throws CompositeException
ListableComposite
containsComponentOfType in interface ListableCompositecomponentType - the type of component for which we are searching
true if one or more of the components of the given
type make up this composite or false, otherwise
CompositeException - if an error occurrs
public java.lang.Object[] getComponentsOfType(java.lang.Class componentType)
throws CompositeException
ListableComposite
getComponentsOfType in interface ListableCompositecomponentType - the type of component for which we are searching
CompositeException - if an error occurrsContainerUtils.getElementsOfType(Object[], Class)
public java.lang.Class getComponentType()
throws CompositeException
StrictlyTypedComposite
getComponentType in interface StrictlyTypedCompositeCompositeException - if an error occurrs
public boolean isSpecializable(java.lang.Class type)
throws SpecializationException
SpecializationException
public java.lang.Object specialize(java.lang.Class type)
throws SpecializationException
SpecializationExceptionpublic java.lang.Object[] getComponents()
SimpleComposite
getComponents in interface SimpleCompositepublic void setComponents(java.lang.Object[] components)
SimpleComposite
setComponents in interface SimpleCompositecomponents - the components that make up this compositepublic final void setComponent(java.lang.Object component)
public ComponentValidator getComponentValidator()
public void setComponentValidator(ComponentValidator componentValidator)
public Specializer getSpecializer()
public void setSpecializer(Specializer specializer)
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||