com.evasion.common.security.component.Component Maven / Gradle / Ivy
/*
* To change this template, choose Tools | Templates
* and open the template in the editor.
*/
package com.evasion.common.security.component;
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.security.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);
}
}
}
}