/**
 * 
 */
package com.github.podd.api.file;

import java.util.ArrayList;
import java.util.List;

import org.semanticweb.owlapi.util.AbstractServiceLoader;

import com.github.podd.api.PoddProcessorStage;

/**
 * @author Peter Ansell p_ansell@yahoo.com
 * 
 */
public class PoddFileReferenceProcessorFactoryRegistry extends
        AbstractServiceLoader<String, PoddFileReferenceProcessorFactory>
{
    
    public PoddFileReferenceProcessorFactoryRegistry()
    {
        super(PoddFileReferenceProcessorFactory.class);
    }
    
    public final List<PoddFileReferenceProcessorFactory> getByStage(final PoddProcessorStage nextStage)
    {
        final List<PoddFileReferenceProcessorFactory> result = new ArrayList<PoddFileReferenceProcessorFactory>();
        for(final PoddFileReferenceProcessorFactory nextProcessor : this.getAll())
        {
            if(nextProcessor.canHandleStage(nextStage))
            {
                result.add(nextProcessor);
            }
        }
        
        return result;
    }
    
    /*
     * (non-Javadoc)
     * 
     * @see org.semanticweb.owlapi.util.AbstractServiceLoader#getKey(java.lang.Object)
     */
    @Override
    protected final String getKey(final PoddFileReferenceProcessorFactory nextFactory)
    {
        return nextFactory.getKey();
    }
    
}

@@ -203,16 +203,120 @@
 e;%0A%0A/**%0A
+ * A registry containing dynamically loaded instances of %7B@link PoddFileReferenceProcessorFactory%7D.%0A * %0A
  * @auth
@@ -496,16 +496,380 @@
 tory%3E%0A%7B%0A
+    private static final PoddFileReferenceProcessorFactoryRegistry instance =%0A            new PoddFileReferenceProcessorFactoryRegistry();%0A    %0A    /**%0A     * @return A static instance of this registry.%0A     */%0A    public static PoddFileReferenceProcessorFactoryRegistry getInstance()%0A    %7B%0A        return PoddFileReferenceProcessorFactoryRegistry.instance;%0A    %7D%0A
     %0A   

add getInstance to PoddFileReferenceProcessorFactoryRegistry