package org.seasar.jsf.template.impl.html;

import javax.faces.component.UIComponent;
import javax.faces.component.html.HtmlOutputLink;

import org.seasar.jsf.JsfConstants;
import org.seasar.jsf.template.impl.AbstractUICommandBuilder;
import org.xml.sax.Attributes;

/**
 * @author higa
 *  
 */
public class HtmlOutputLinkBuilder extends AbstractUICommandBuilder {

	private static final String RENDERER_TYPE = "org.seasar.jsf.OutputLink";

	public HtmlOutputLinkBuilder(String namespaceURI, String localName,
			String qName, Attributes attributes) {

		super(namespaceURI, localName, qName, attributes);
		addCustomPropertyName(JsfConstants.ACTION_ATTR);
	}

	protected UIComponent createComponent() {
		HtmlOutputLink component = new HtmlOutputLink();
		component.setRendererType(RENDERER_TYPE);
		return component;
	}

	protected void renameProperties() {
		super.renameProperties();
		renameProperty(JsfConstants.HREF_ATTR, JsfConstants.VALUE_ATTR);
	}
}