// WARNING: This file was automatically generated. Do not edit it directly,
//          or you will lose your changes.
/*
 *  Licensed to the Apache Software Foundation (ASF) under one
 *  or more contributor license agreements.  See the NOTICE file
 *  distributed with this work for additional information
 *  regarding copyright ownership.  The ASF licenses this file
 *  to you under the Apache License, Version 2.0 (the
 *  "License"); you may not use this file except in compliance
 *  with the License.  You may obtain a copy of the License at
 * 
 *  http://www.apache.org/licenses/LICENSE-2.0
 * 
 *  Unless required by applicable law or agreed to in writing,
 *  software distributed under the License is distributed on an
 *  "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
 *  KIND, either express or implied.  See the License for the
 *  specific language governing permissions and limitations
 *  under the License.
 */
package org.apache.myfaces.shared_tomahawk.taglib.html;

import javax.faces.component.UIComponent;
import javax.faces.el.ValueBinding;
import javax.faces.context.FacesContext;
import javax.faces.convert.Converter;
import javax.faces.el.MethodBinding;


// Generated from class javax.faces.component.html.HtmlInputHidden.
//
// WARNING: This file was automatically generated. Do not edit it directly,
//          or you will lose your changes.
public class HtmlInputHiddenTag
    extends javax.faces.webapp.UIComponentTag
{
    public HtmlInputHiddenTag()
    {    
    }
    
    public String getComponentType()
    {
        return "javax.faces.HtmlInputHidden";
    }

    public String getRendererType()
    {
        return "javax.faces.Hidden";
    }

 
    private String _validator;
    
    public void setValidator(String validator)
    {
        _validator = validator;
    }
 
    private String _valueChangeListener;
    
    public void setValueChangeListener(String valueChangeListener)
    {
        _valueChangeListener = valueChangeListener;
    }
 
    private String _immediate;
    
    public void setImmediate(String immediate)
    {
        _immediate = immediate;
    }
 
    private String _required;
    
    public void setRequired(String required)
    {
        _required = required;
    }
 
    private String _converter;
    
    public void setConverter(String converter)
    {
        _converter = converter;
    }
 
    private String _value;
    
    public void setValue(String value)
    {
        _value = value;
    }

    protected void setProperties(UIComponent component)
    {
        if (!(component instanceof javax.faces.component.html.HtmlInputHidden))
        {
            throw new IllegalArgumentException("Component "+
                component.getClass().getName() +" is no javax.faces.component.html.HtmlInputHidden");
        }
        
        javax.faces.component.html.HtmlInputHidden comp = (javax.faces.component.html.HtmlInputHidden) component;
        
        super.setProperties(component);
        
        FacesContext context = getFacesContext();

        if (_validator != null)
        {
            MethodBinding mb = context.getApplication().createMethodBinding(
                _validator, new Class[]{javax.faces.context.FacesContext.class,javax.faces.component.UIComponent.class,java.lang.Object.class,});
            comp.setValidator(mb);
        }
        if (_valueChangeListener != null)
        {
            MethodBinding mb = context.getApplication().createMethodBinding(
                _valueChangeListener, new Class[]{javax.faces.event.ValueChangeEvent.class,});
            comp.setValueChangeListener(mb);
        }
        if (_immediate != null)
        {
            if (isValueReference(_immediate))
            {
                ValueBinding vb = context.getApplication().createValueBinding(_immediate);
                comp.setValueBinding("immediate", vb);
            }
            else
            {
                comp.getAttributes().put("immediate", Boolean.valueOf(_immediate));
            }
        } 
        if (_required != null)
        {
            if (isValueReference(_required))
            {
                ValueBinding vb = context.getApplication().createValueBinding(_required);
                comp.setValueBinding("required", vb);
            }
            else
            {
                comp.getAttributes().put("required", Boolean.valueOf(_required));
            }
        } 
        if (_converter != null)
        {
            if (isValueReference(_converter))
            {
                ValueBinding vb = context.getApplication().createValueBinding(_converter);
                comp.setValueBinding("converter", vb);
            }
            else
            {
                Converter converter = getFacesContext().getApplication().createConverter(_converter);
                comp.setConverter(converter);
            }
        }
        if (_value != null)
        {
            if (isValueReference(_value))
            {
                ValueBinding vb = context.getApplication().createValueBinding(_value);
                comp.setValueBinding("value", vb);
            }
            else
            {
                comp.getAttributes().put("value", _value);
            }
        } 
    }

    public void release()
    {
        super.release();
        _validator = null;
        _valueChangeListener = null;
        _immediate = null;
        _required = null;
        _converter = null;
        _value = null;
    }
}