net.sf.composite.extract.extractors
Class BaseComponentAccessor

java.lang.Object
  extended by net.sf.composite.extract.extractors.BaseComponentAccessor
All Implemented Interfaces:
ComponentAccessor
Direct Known Subclasses:
BasePropertyComponentAccessor

public abstract class BaseComponentAccessor
extends java.lang.Object
implements ComponentAccessor

A convenient base class for component extractors. This base class takes care of exception handling, argument validation and logging.

Since:
Mar 11, 2005
Author:
Matt Sgarlata

Field Summary
protected  org.apache.commons.logging.Log log
           
 
Constructor Summary
BaseComponentAccessor()
           
 
Method Summary
 java.util.List getComponents(java.lang.Object composite)
          Extracts the components from a composite.
protected abstract  java.util.List getComponentsImpl(java.lang.Object composite)
          Implementation of ComponentAccessor.getComponents(Object).
 void setComponents(java.lang.Object composite, java.util.List components)
          Sets the components in a composite.
protected abstract  void setComponentsImpl(java.lang.Object composite, java.util.List components)
          Implementation of ComponentAccessor#setComponents(SimpleComposite, Object[]).
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

log

protected final org.apache.commons.logging.Log log
Constructor Detail

BaseComponentAccessor

public BaseComponentAccessor()
Method Detail

getComponentsImpl

protected abstract java.util.List getComponentsImpl(java.lang.Object composite)
                                             throws java.lang.Exception
Implementation of ComponentAccessor.getComponents(Object).

Parameters:
composite - the composite from which the components will be extracted
Returns:
the components
Throws:
java.lang.Exception - if the components could not be extracted for some reason

getComponents

public final java.util.List getComponents(java.lang.Object composite)
Description copied from interface: ComponentAccessor
Extracts the components from a composite.

Specified by:
getComponents in interface ComponentAccessor
Parameters:
composite - the composite from which the components will be extracted
Returns:
the components

setComponentsImpl

protected abstract void setComponentsImpl(java.lang.Object composite,
                                          java.util.List components)
                                   throws java.lang.Exception
Implementation of ComponentAccessor#setComponents(SimpleComposite, Object[]).

Parameters:
composite - the composite for which the components will be set
components - the components
Throws:
java.lang.Exception - if the components could not be set for some reason

setComponents

public final void setComponents(java.lang.Object composite,
                                java.util.List components)
                         throws ComponentAccessorException
Description copied from interface: ComponentAccessor
Sets the components in a composite.

Specified by:
setComponents in interface ComponentAccessor
Parameters:
composite - the composite for which the components will be set
components - the components
Throws:
ComponentAccessorException - if the components could not be set for some reason


Copyright © 2005-2008.