All Downloads are FREE. Search and download functionalities are using the official Maven repository.

com.evasion.common.Component Maven / Gradle / Ivy

/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package com.evasion.common;

import java.util.ArrayList;
import java.util.List;
import javax.el.ValueExpression;
import javax.faces.component.UIComponentBase;

/**
 *
 * @author sebastien.glon
 */
public abstract class Component extends UIComponentBase {

    private static final String OPTIMIZED_PACKAGE = "com.evasion.common.component.";

    protected void handleAttribute(String name, Object value) {
        List setAttributes = (List) this.getAttributes().get("javax.faces.component.UIComponentBase.attributesThatAreSet");
        if (setAttributes == null) {
            String cname = this.getClass().getName();
            if (cname != null && cname.startsWith(OPTIMIZED_PACKAGE)) {
                setAttributes = new ArrayList(6);
                this.getAttributes().put("javax.faces.component.UIComponentBase.attributesThatAreSet", setAttributes);
            }
        }
        if (setAttributes != null) {
            if (value == null) {
                ValueExpression ve = getValueExpression(name);
                if (ve == null) {
                    setAttributes.remove(name);
                }
            } else if (!setAttributes.contains(name)) {
                setAttributes.add(name);
            }
        }
    }
    
    private static final String FAMILY = "com.evasion";

    @Override
    public String getFamily() {
        return FAMILY;
    }
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy