use of lucee.runtime.component.PropertyImpl in project Lucee by lucee.
the class AxisCaster method _toPojo.
private static Pojo _toPojo(PageContext pc, Pojo pojo, TypeMapping tm, TypeEntry typeEntry, QName type, Struct sct, Set<Object> done) throws PageException {
// print.ds();System.exit(0);
if (pojo == null) {
try {
PhysicalClassLoader cl = (PhysicalClassLoader) pc.getConfig().getRPCClassLoader(false);
pojo = (Pojo) ClassUtil.loadInstance(ComponentUtil.getStructPropertiesClass(pc, sct, cl));
} catch (ClassException e) {
throw Caster.toPageException(e);
} catch (IOException e) {
throw Caster.toPageException(e);
}
}
// initialize
List<Property> props = new ArrayList<Property>();
Iterator<Entry<Key, Object>> it = sct.entryIterator();
Entry<Key, Object> e;
PropertyImpl p;
while (it.hasNext()) {
e = it.next();
p = new PropertyImpl();
p.setAccess(Component.ACCESS_PUBLIC);
p.setName(e.getKey().getString());
p.setType(e.getValue() == null ? "any" : Caster.toTypeName(e.getValue()));
props.add(p);
}
_initPojo(pc, typeEntry, type, pojo, props.toArray(new Property[props.size()]), sct, null, tm, done);
return pojo;
}
use of lucee.runtime.component.PropertyImpl in project Lucee by lucee.
the class CreationImpl method createProperty.
@Override
public Property createProperty(String name, String type) {
PropertyImpl pi = new PropertyImpl();
pi.setName(name);
pi.setType(type);
return pi;
}
Aggregations