/*
 * Copyright 2014 Red Hat, Inc. and/or its affiliates.
 *
 * Licensed under the Eclipse Public License version 1.0, available at
 * http://www.eclipse.org/legal/epl-v10.html
 */
package org.jboss.windup.addon.config.impl;

import javax.inject.Inject;

import org.jboss.forge.furnace.addons.AddonRegistry;
import org.jboss.windup.addon.config.selectables.Selectable;
import org.jboss.windup.addon.config.selectables.SelectableCondition;
import org.jboss.windup.addon.config.spi.SelectionFactory;

/**
 * @author <a href="mailto:lincolnbaxter@gmail.com">Lincoln Baxter, III</a>
 * 
 */
public class SelectionFactoryImpl implements SelectionFactory
{
    @Inject
    private AddonRegistry registry;

    @Override
    public <SELECTABLE extends Selectable<CONDITION, SELECTABLE>, CONDITION extends SelectableCondition<SELECTABLE, CONDITION>> CONDITION createQuery(
                Class<SELECTABLE> selectable, String var)
    {
        // TODO support scoping and name references
        SELECTABLE selectableInstance = registry.getServices(selectable).get();
        Class<CONDITION> conditionType = selectableInstance.getSelectableConditionType();
        CONDITION conditionInstance = registry.getServices(conditionType).get();
        return conditionInstance;
    }

    @Override
    public <SELECTABLE extends Selectable<CONDITION, SELECTABLE>, CONDITION extends SelectableCondition<SELECTABLE, CONDITION>> SELECTABLE get(
                Class<SELECTABLE> selectable, String var)
    {
        // TODO support scoping and name references
        SELECTABLE selectableInstance = registry.getServices(selectable).get();
        return selectableInstance;
    }

    @Override
    public <SELECTABLE extends Selectable<CONDITION, SELECTABLE>, CONDITION extends SelectableCondition<SELECTABLE, CONDITION>> SELECTABLE getCurrent(
                Class<SELECTABLE> selectable)
    {
        // TODO support scoping and name references
        SELECTABLE selectableInstance = registry.getServices(selectable).get();
        return selectableInstance;
    }

}

@@ -1258,32 +1258,340 @@
 nstance;%0A    %7D%0A%0A
+    @Override%0A    public %3CSELECTABLE extends Selectable%3CCONDITION, SELECTABLE%3E, CONDITION extends SelectableCondition%3CSELECTABLE, CONDITION%3E%3E Iterable%3CSELECTABLE%3E getQueryResult(%0A                Class%3CSELECTABLE%3E type, String var)%0A    %7B%0A        // TODO Auto-generated method stub%0A        return null;%0A    %7D%0A%0A
     @Override%0A  

Implement missing method