package org.seasar.jsf.template.impl;

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

import org.seasar.jsf.template.TagSelector;
import org.xml.sax.Attributes;

/**
 * @author higa
 *  
 */
public class TagSelectors {

	private List tagSelectors_ = new ArrayList();

	public TagSelectors() {
	}

	public TagSelector getTagSelector(String namespaceURI, String localName,
			String qName, Attributes attributes) {
		
		for (int i = 0; i < tagSelectors_.size(); ++i) {
			TagSelector selector = (TagSelector) tagSelectors_.get(i);
			if (selector.isSelectable(namespaceURI, localName,
					qName, attributes)) {

				return selector;
			}
		}
		return null;
	}

	public void addTagSelector(TagSelector tagSelector) {
		tagSelectors_.add(tagSelector);
	}
}