// 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.custom.transform;

import javax.faces.component.UIComponent;
import javax.faces.el.ValueBinding;
import javax.faces.context.FacesContext;


// Generated from class org.apache.myfaces.custom.transform.AbstractXmlTransform.
//
// WARNING: This file was automatically generated. Do not edit it directly,
//          or you will lose your changes.
public class XmlTransformTag
    extends javax.faces.webapp.UIComponentTag
{
    public XmlTransformTag()
    {    
    }
    
    public String getComponentType()
    {
        return "org.apache.myfaces.tomahawk.XmlTransform";
    }

    public String getRendererType()
    {
        return null;
    }

 
    private String _content;
    
    public void setContent(String content)
    {
        _content = content;
    }
 
    private String _contentLocation;
    
    public void setContentLocation(String contentLocation)
    {
        _contentLocation = contentLocation;
    }
 
    private String _stylesheet;
    
    public void setStylesheet(String stylesheet)
    {
        _stylesheet = stylesheet;
    }
 
    private String _contentStream;
    
    public void setContentStream(String contentStream)
    {
        _contentStream = contentStream;
    }
 
    private String _stylesheetLocation;
    
    public void setStylesheetLocation(String stylesheetLocation)
    {
        _stylesheetLocation = stylesheetLocation;
    }
 
    private String _styleStream;
    
    public void setStyleStream(String styleStream)
    {
        _styleStream = styleStream;
    }

    protected void setProperties(UIComponent component)
    {
        if (!(component instanceof org.apache.myfaces.custom.transform.XmlTransform))
        {
            throw new IllegalArgumentException("Component "+
                component.getClass().getName() +" is no org.apache.myfaces.custom.transform.XmlTransform");
        }
        
        org.apache.myfaces.custom.transform.XmlTransform comp = (org.apache.myfaces.custom.transform.XmlTransform) component;
        
        super.setProperties(component);
        
        FacesContext context = getFacesContext();

        if (_content != null)
        {
            if (isValueReference(_content))
            {
                ValueBinding vb = context.getApplication().createValueBinding(_content);
                comp.setValueBinding("content", vb);
            }
            else
            {
                comp.getAttributes().put("content", _content);
            }
        } 
        if (_contentLocation != null)
        {
            if (isValueReference(_contentLocation))
            {
                ValueBinding vb = context.getApplication().createValueBinding(_contentLocation);
                comp.setValueBinding("contentLocation", vb);
            }
            else
            {
                comp.getAttributes().put("contentLocation", _contentLocation);
            }
        } 
        if (_stylesheet != null)
        {
            if (isValueReference(_stylesheet))
            {
                ValueBinding vb = context.getApplication().createValueBinding(_stylesheet);
                comp.setValueBinding("stylesheet", vb);
            }
            else
            {
                comp.getAttributes().put("stylesheet", _stylesheet);
            }
        } 
        if (_contentStream != null)
        {
            if (isValueReference(_contentStream))
            {
                ValueBinding vb = context.getApplication().createValueBinding(_contentStream);
                comp.setValueBinding("contentStream", vb);
            }
            else
            {
                comp.getAttributes().put("contentStream", _contentStream);
            }
        } 
        if (_stylesheetLocation != null)
        {
            if (isValueReference(_stylesheetLocation))
            {
                ValueBinding vb = context.getApplication().createValueBinding(_stylesheetLocation);
                comp.setValueBinding("stylesheetLocation", vb);
            }
            else
            {
                comp.getAttributes().put("stylesheetLocation", _stylesheetLocation);
            }
        } 
        if (_styleStream != null)
        {
            if (isValueReference(_styleStream))
            {
                ValueBinding vb = context.getApplication().createValueBinding(_styleStream);
                comp.setValueBinding("styleStream", vb);
            }
            else
            {
                comp.getAttributes().put("styleStream", _styleStream);
            }
        } 
    }

    public void release()
    {
        super.release();
        _content = null;
        _contentLocation = null;
        _stylesheet = null;
        _contentStream = null;
        _stylesheetLocation = null;
        _styleStream = null;
    }
}