package org.seasar.jsf.selector;

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

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

	private static final String TAG_NAME = "selectOneMenu";

	public SelectOneMenuSelector() {
	}

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

		if (!JsfConstants.SELECT_ELEM.equalsIgnoreCase(qName)) {
			return false;
		}
		return attributes.getValue(JsfConstants.MULTIPLE_ATTR) == null;
	}

	public TagProcessor createProcessor() {
		return new SelectProcessor(getInject());
	}

	public String getInject() {
		return getS2JsfInject(TAG_NAME);
	}
}