use of lucee.transformer.library.tag.TagLibTag in project Lucee by lucee.
the class AbstrCFMLScriptTransformer method getTag.
private final Tag getTag(ExprData data, Body parent, TagLibTag tlt, Position start, Position end) throws TemplateException {
try {
Tag tag = tlt.getTag(data.factory, start, end);
tag.setParent(parent);
return tag;
} catch (TagLibException e) {
throw new TemplateException(data.srcCode, e);
}
/*if(StringUtil.isEmpty(tlt.getTttClassName()))tag= new TagBase(line);
else {
try {
Class<Tag> clazz = ClassUtil.loadClass(tlt.getTttClassName());
Constructor<Tag> constr = clazz.getConstructor(new Class[]{Position.class});
tag = constr.newInstance(new Object[]{line});
}
catch (Exception e) {
SystemOut.printDate(e);
tag= new TagBase(line);
}
}*/
}
use of lucee.transformer.library.tag.TagLibTag in project Lucee by lucee.
the class ApplicationContextSupport method _initTagDefaultAttributeValues.
private static void _initTagDefaultAttributeValues(Config config, TagLib lib, Map<Collection.Key, Map<Collection.Key, Object>> tagDefaultAttributeValues, Struct sct, boolean checkNameSpace) {
if (sct == null)
return;
Iterator<Entry<Key, Object>> it = sct.entryIterator();
// loop tags
Struct attrs;
TagLibTag tag;
Iterator<Entry<Key, Object>> iit;
Entry<Key, Object> e;
Map<Collection.Key, Object> map;
TagLibTagAttr attr;
String name;
while (it.hasNext()) {
e = it.next();
attrs = Caster.toStruct(e.getValue(), null);
if (attrs != null) {
tag = null;
if (checkNameSpace) {
name = e.getKey().getLowerString();
if (StringUtil.startsWithIgnoreCase(name, lib.getNameSpaceAndSeparator())) {
name = name.substring(lib.getNameSpaceAndSeparator().length());
tag = lib.getTag(name);
}
} else
tag = lib.getTag(e.getKey().getLowerString());
if (tag != null) {
sct.removeEL(e.getKey());
map = new HashMap<Collection.Key, Object>();
iit = attrs.entryIterator();
while (iit.hasNext()) {
e = iit.next();
map.put(KeyImpl.init(e.getKey().getLowerString()), e.getValue());
}
tagDefaultAttributeValues.put(KeyImpl.init(tag.getFullName()), map);
}
}
}
}
use of lucee.transformer.library.tag.TagLibTag in project Lucee by lucee.
the class GetTagList method _call.
private static lucee.runtime.type.Struct _call(PageContext pc, int dialect) throws PageException {
Struct sct = new StructImpl();
// synchronized(sct) {
// hasSet=true;
TagLib[] tlds;
TagLibTag tag;
tlds = ((ConfigImpl) pc.getConfig()).getTLDs(dialect);
for (int i = 0; i < tlds.length; i++) {
String ns = tlds[i].getNameSpaceAndSeparator();
Map<String, TagLibTag> tags = tlds[i].getTags();
Iterator<String> it = tags.keySet().iterator();
Struct inner = new StructImpl();
sct.set(ns, inner);
while (it.hasNext()) {
Object n = it.next();
tag = tlds[i].getTag(n.toString());
if (tag.getStatus() != TagLib.STATUS_HIDDEN && tag.getStatus() != TagLib.STATUS_UNIMPLEMENTED)
inner.set(n.toString(), "");
}
}
// }
return sct;
}
Aggregations