use of lucee.runtime.component.Member in project Lucee by lucee.
the class StaticScope method _toDumpData.
DumpTable _toDumpData(ComponentImpl ci, PageContext pc, int maxlevel, DumpProperties dp, int access) {
maxlevel--;
DumpTable[] accesses = new DumpTable[4];
accesses[Component.ACCESS_PRIVATE] = new DumpTable("#ff6633", "#ff9966", "#000000");
accesses[Component.ACCESS_PRIVATE].setTitle("private");
accesses[Component.ACCESS_PRIVATE].setWidth("100%");
accesses[Component.ACCESS_PACKAGE] = new DumpTable("#ff9966", "#ffcc99", "#000000");
accesses[Component.ACCESS_PACKAGE].setTitle("package");
accesses[Component.ACCESS_PACKAGE].setWidth("100%");
accesses[Component.ACCESS_PUBLIC] = new DumpTable("#ffcc99", "#ffffcc", "#000000");
accesses[Component.ACCESS_PUBLIC].setTitle("public");
accesses[Component.ACCESS_PUBLIC].setWidth("100%");
Iterator<Entry<Key, Member>> it = all(new HashMap<Key, Member>()).entrySet().iterator();
Entry<Key, Member> e;
while (it.hasNext()) {
e = it.next();
int a = access(pc, e.getValue().getAccess());
DumpTable box = accesses[a];
Object o = e.getValue().getValue();
if (DumpUtil.keyValid(dp, maxlevel, e.getKey()))
box.appendRow(1, new SimpleDumpData(e.getKey().getString()), DumpUtil.toDumpData(o, pc, maxlevel, dp));
}
DumpTable table = new DumpTable("#ffffff", "#cccccc", "#000000");
if (!accesses[Component.ACCESS_PUBLIC].isEmpty()) {
table.appendRow(0, accesses[Component.ACCESS_PUBLIC]);
}
if (!accesses[Component.ACCESS_PACKAGE].isEmpty()) {
table.appendRow(0, accesses[Component.ACCESS_PACKAGE]);
}
if (!accesses[Component.ACCESS_PRIVATE].isEmpty()) {
table.appendRow(0, accesses[Component.ACCESS_PRIVATE]);
}
return table;
}
use of lucee.runtime.component.Member in project Lucee by lucee.
the class StaticScope method set.
@Override
public Object set(PageContext pc, Key key, Object value) throws PageException {
pc = ThreadLocalPageContext.get(pc);
Member m = _setIfExists(pc, key, value);
if (m != null)
return m.getValue();
// if not exists set to current
m = _set(pc, null, key, value);
if (m != null)
return m.getValue();
return null;
}
use of lucee.runtime.component.Member in project Lucee by lucee.
the class PropertyFactory method addGet.
public static void addGet(ComponentImpl comp, Property prop) throws ApplicationException {
Member m = comp.getMember(Component.ACCESS_PRIVATE, KeyImpl.getInstance("get" + prop.getName()), true, false);
if (!(m instanceof UDF)) {
UDF udf = new UDFGetterProperty(comp, prop);
comp.registerUDF(KeyImpl.init(udf.getFunctionName()), udf);
}
}
use of lucee.runtime.component.Member in project Lucee by lucee.
the class PropertyFactory method addAdd.
public static void addAdd(ComponentImpl comp, Property prop) throws ApplicationException {
Member m = comp.getMember(Component.ACCESS_PRIVATE, KeyImpl.getInstance("add" + getSingularName(prop)), true, false);
if (!(m instanceof UDF)) {
UDF udf = new UDFAddProperty(comp, prop);
comp.registerUDF(KeyImpl.init(udf.getFunctionName()), udf);
}
}
use of lucee.runtime.component.Member in project Lucee by lucee.
the class PropertyFactory method addRemove.
public static void addRemove(ComponentImpl comp, Property prop) throws ApplicationException {
Member m = comp.getMember(Component.ACCESS_PRIVATE, KeyImpl.getInstance("remove" + getSingularName(prop)), true, false);
if (!(m instanceof UDF)) {
UDF udf = new UDFRemoveProperty(comp, prop);
comp.registerUDF(KeyImpl.init(udf.getFunctionName()), udf);
}
}
Aggregations