Search in sources :

Example 1 with PropertyImpl

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;
}
Also used : Entry(java.util.Map.Entry) TypeEntry(org.apache.axis.wsdl.symbolTable.TypeEntry) PhysicalClassLoader(lucee.commons.lang.PhysicalClassLoader) ArrayList(java.util.ArrayList) ClassException(lucee.commons.lang.ClassException) PropertyImpl(lucee.runtime.component.PropertyImpl) IOException(java.io.IOException) Property(lucee.runtime.component.Property) Key(lucee.runtime.type.Collection.Key)

Example 2 with PropertyImpl

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;
}
Also used : PropertyImpl(lucee.runtime.component.PropertyImpl)

Aggregations

PropertyImpl (lucee.runtime.component.PropertyImpl)2 IOException (java.io.IOException)1 ArrayList (java.util.ArrayList)1 Entry (java.util.Map.Entry)1 ClassException (lucee.commons.lang.ClassException)1 PhysicalClassLoader (lucee.commons.lang.PhysicalClassLoader)1 Property (lucee.runtime.component.Property)1 Key (lucee.runtime.type.Collection.Key)1 TypeEntry (org.apache.axis.wsdl.symbolTable.TypeEntry)1