Member mem = ComponentUtil.toComponentAccess(cfc).getMember(Component.ACCESS_PRIVATE, KeyConstants._metadata,true,false);
if(mem!=null)meta = Caster.toStruct(mem.getValue(),null,false);
//}catch (PageException e) {e.printStackTrace();}
if(meta==null) return null;
TagLibTag tag=new TagLibTag(null);
// TAG
// type
String type=Caster.toString(meta.get(ATTRIBUTE_TYPE,"dynamic"),"dynamic");
if("fixed".equalsIgnoreCase(type))tag.setAttributeType(TagLibTag.ATTRIBUTE_TYPE_FIXED);
//else if("mixed".equalsIgnoreCase(type))tag.setAttributeType(TagLibTag.ATTRIBUTE_TYPE_MIXED);
//else if("noname".equalsIgnoreCase(type))tag.setAttributeType(TagLibTag.ATTRIBUTE_TYPE_NONAME);
else tag.setAttributeType(TagLibTag.ATTRIBUTE_TYPE_DYNAMIC);
if(!runtime){
// hint
String hint=Caster.toString(meta.get(KeyConstants._hint,null),null);
if(!StringUtil.isEmpty(hint))tag.setDescription(hint);
}
// ATTRIBUTES
Struct attributes=Caster.toStruct(meta.get(KeyConstants._ATTRIBUTES,null),null,false);
if(attributes!=null) {
Iterator<Entry<Key, Object>> it = attributes.entryIterator();
//Iterator it = attributes.entrySet().iterator();
Entry<Key, Object> entry;
TagLibTagAttr attr;
Struct sct;
String name;
Object defaultValue;
while(it.hasNext()){
entry=it.next();
name=Caster.toString(entry.getKey(),null);
if(StringUtil.isEmpty(name)) continue;
attr=new TagLibTagAttr(tag);
attr.setName(name);
sct=Caster.toStruct(entry.getValue(),null,false);
if(sct!=null){
attr.setRequired(Caster.toBooleanValue(sct.get(KeyConstants._required,Boolean.FALSE),false));
attr.setType(Caster.toString(sct.get(KeyConstants._type,"any"),"any"));
defaultValue= sct.get(KeyConstants._default,null);
if(defaultValue!=null)attr.setDefaultValue(defaultValue);
if(!runtime){
attr.setDescription(Caster.toString(sct.get(KeyConstants._hint,null),null));
attr.setRtexpr(Caster.toBooleanValue(sct.get(RT_EXPR_VALUE,Boolean.TRUE),true));
}
}
tag.setAttribute(attr);
}
}
return tag;
}