package org.seasar.jsf.selector;

import org.seasar.jsf.JsfConstants;
import org.seasar.jsf.TagProcessor;
import org.seasar.jsf.processor.SelectItemProcessor;
import org.xml.sax.Attributes;

/**
 * @author higa
 *  
 */
public class RadioSelector extends AbstractTagSelector {

	private static final String TAG_NAME = "radio";
	
	public RadioSelector() {
	}

	public boolean isSelectable(String namespaceURI, String localName,
			String qName, Attributes attributes) {

        if (!JsfConstants.INPUT_ELEM.equalsIgnoreCase(qName)) {
            return false;
        }
        return JsfConstants.RADIO_VALUE.equalsIgnoreCase(attributes
                .getValue(JsfConstants.TYPE_ATTR));
	}

	public TagProcessor createProcessor() {
        return new SelectItemProcessor(getInject());
	}
	
	public String getInject() {
		return getS2JsfInject(TAG_NAME);
	}
}