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

META-INF.templates._attributes.ftl Maven / Gradle / Ivy

The newest version!
<#assign hasKeyword=false/>
    protected enum Properties {
        <@util.concat seq=generatedAttributes delimiter=",\n        "; attribute>${attribute.name}<#if utils.isKeyword(attribute.name)>Value("${attribute.name}")<#assign hasKeyword=true/>
        <#if hasKeyword>;
    String toString;

    Properties(String toString) {
        this.toString = toString;
    }

    Properties() {
    }

    public String toString() {
        return ((this.toString != null) ? this.toString : super.toString());
    }
    }
    <#assign passThroughCount=0>
    <#list generatedAttributes as attribute>
        <#if attribute.passThrough >
           <#assign passThroughCount=passThroughCount+1/>
        
        <#include "_attribute_accessors.ftl">
    
    <#if passThroughCount gt 0 >
    private static final String ATTRIBUTES_THAT_ARE_SET_KEY = "javax.faces.component.UIComponentBase.attributesThatAreSet";
    
    private void handleAttribute(String name, Object value) {
        List setAttributes = (List) this.getAttributes().get(ATTRIBUTES_THAT_ARE_SET_KEY);
        if (setAttributes == null) {
                setAttributes = new ArrayList(${passThroughCount});
                this.getAttributes().put(ATTRIBUTES_THAT_ARE_SET_KEY, setAttributes);
        }
        if (value == null) {
                ValueExpression ve = getValueExpression(name);
                if (ve == null) {
                    setAttributes.remove(name);
                }
            } else if (!setAttributes.contains(name)) {
                setAttributes.add(name);
        }
    }    
    




© 2015 - 2024 Weber Informatics LLC | Privacy Policy