Search in sources :

Example 1 with DynamicAttributes

use of lucee.runtime.ext.tag.DynamicAttributes in project Lucee by lucee.

the class TagUtil method setAttributes.

public static void setAttributes(PageContext pc, Tag tag, Map<Key, Object> att, int attrType) throws PageException {
    Iterator<Entry<Key, Object>> it;
    Entry<Key, Object> e;
    // TagLibTag tlt=null;
    if (TagLibTag.ATTRIBUTE_TYPE_DYNAMIC == attrType) {
        DynamicAttributes da = (DynamicAttributes) tag;
        it = att.entrySet().iterator();
        while (it.hasNext()) {
            e = it.next();
            da.setDynamicAttribute(null, e.getKey(), e.getValue());
        }
    } else if (TagLibTag.ATTRIBUTE_TYPE_FIXED == attrType) {
        it = att.entrySet().iterator();
        while (it.hasNext()) {
            e = it.next();
            setAttribute(pc, false, true, tag, e.getKey().getLowerString(), e.getValue());
        }
    } else if (TagLibTag.ATTRIBUTE_TYPE_MIXED == attrType) {
        it = att.entrySet().iterator();
        while (it.hasNext()) {
            e = it.next();
            setAttribute(pc, true, true, tag, e.getKey().getLowerString(), e.getValue());
        }
    }
}
Also used : Entry(java.util.Map.Entry) Key(lucee.runtime.type.Collection.Key) DynamicAttributes(lucee.runtime.ext.tag.DynamicAttributes)

Aggregations

Entry (java.util.Map.Entry)1 DynamicAttributes (lucee.runtime.ext.tag.DynamicAttributes)1 Key (lucee.runtime.type.Collection.Key)1