org.eclipse.jst.jsf.context.internal.provisional
Class AbstractDelegatingFactory

java.lang.Object
  extended byorg.eclipse.jst.jsf.context.internal.provisional.AbstractDelegatingFactory
All Implemented Interfaces:
IDelegatingFactory
Direct Known Subclasses:
StructuredDocumentSymbolResolverFactory

public abstract class AbstractDelegatingFactory
extends java.lang.Object
implements IDelegatingFactory

An abstract implementation of the IDelegatingFactory interface Clients may extend this class.


Field Summary
protected  java.util.List _delegates
          the list of registered factory delegates
 
Constructor Summary
protected AbstractDelegatingFactory(java.lang.Class[] supportedDelegateTypes)
           
 
Method Summary
 void addFactoryDelegate(org.eclipse.core.runtime.IAdaptable delegate)
          Adds delgate to the end of the list of factory delegates if the list does not already contain it.
 java.util.List getValidDelegateTypes()
           
 boolean isValidDelegate(org.eclipse.core.runtime.IAdaptable delegate)
          The return value of this method should conform to the following contract: Let v = getValidDelegates.
 boolean removeFactoryDelegate(org.eclipse.core.runtime.IAdaptable delegate)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

_delegates

protected final java.util.List _delegates
the list of registered factory delegates

Constructor Detail

AbstractDelegatingFactory

protected AbstractDelegatingFactory(java.lang.Class[] supportedDelegateTypes)
Parameters:
supportedDelegateTypes - -- populates the list of classes used by the isValidDelegate contract
Method Detail

addFactoryDelegate

public void addFactoryDelegate(org.eclipse.core.runtime.IAdaptable delegate)
Description copied from interface: IDelegatingFactory
Adds delgate to the end of the list of factory delegates if the list does not already contain it.

Specified by:
addFactoryDelegate in interface IDelegatingFactory
Parameters:
delegate -
See Also:
IDelegatingFactory.addFactoryDelegate(org.eclipse.core.runtime.IAdaptable)

removeFactoryDelegate

public boolean removeFactoryDelegate(org.eclipse.core.runtime.IAdaptable delegate)
Specified by:
removeFactoryDelegate in interface IDelegatingFactory
Parameters:
delegate -
Returns:
true if delegate was removed, false if delegate wasn't in the list of delegates
See Also:
IDelegatingFactory.removeFactoryDelegate(org.eclipse.core.runtime.IAdaptable)

getValidDelegateTypes

public java.util.List getValidDelegateTypes()
Specified by:
getValidDelegateTypes in interface IDelegatingFactory
Returns:
a list of Class objects that represent the interfaces that may be passed to addFactoryDelegate. Implementor should return at least one supported class.
See Also:
IDelegatingFactory.getValidDelegateTypes()

isValidDelegate

public boolean isValidDelegate(org.eclipse.core.runtime.IAdaptable delegate)
Description copied from interface: IDelegatingFactory
The return value of this method should conform to the following contract: Let v = getValidDelegates. Then isValidDelegate should return true only if the set of v contains a Class for which delegate.getAdapter(Class) returns a non-null value.

Specified by:
isValidDelegate in interface IDelegatingFactory
Parameters:
delegate -
Returns:
true if delegate is supported, false otherwise.
See Also:
IDelegatingFactory.isValidDelegate(org.eclipse.core.runtime.IAdaptable)