/** * Get the default Java reader. * @return The Java reader. */ public static IObjectReaderHandler getObjectReaderHandler() { if(readerhandler==null) { synchronized(JavaReader.class) { if(readerhandler==null) { readerhandler = new BeanObjectReaderHandler(typeinfos); } } } return readerhandler; }
/** * Initiate the bulk link calls. */ protected void handleBulkLinking(List childs, Object parent, AReadContext context, QName[] pathname, List linkdatas, int startidx) throws Exception { if(childs.size()>1) { try { bulkLinkObjects(childs, parent, ((LinkData)linkdatas.get(startidx)).getLinkinfo(), pathname, context); } catch(Exception e) { context.getReporter().report("Warning. Bulk link initiated but not successful: "+childs+" "+parent+" "+e, "warning", context, context.getLocation()); for(int i=0; i<childs.size(); i++) { linkObject(childs.get(i), parent, ((LinkData)linkdatas.get(startidx+i)).getLinkinfo(), pathname, context); } } } else { linkObject(childs.get(0), parent, ((LinkData)linkdatas.get(startidx)).getLinkinfo(), pathname, context); } }
/** * Directly access a field for setting the objects. */ protected boolean setBulkField(String fieldname, Object parent, List objects, Object converter, AReadContext context, String idref) throws Exception { boolean set; try { Field field = parent.getClass().getField(fieldname); Class type = field.getType(); // object = convertAttributeValue(object, type, converter, root, classloader, idref, readobjects); Object arg = convertBulkValues(objects, type, converter, context, idref); field.set(parent, arg); set = true; } catch(Exception e) { // Ignore -> try other way of setting attribute set = false; } return set; }
if(ps.length==1) Object arg = convertBulkValues(vals, ps[0], converter, context, id); try Object arg = convertBulkValues(vals, f.getType(), converter, context, id); f.set(object, arg); set = true; set = setBulkField(fieldname, object, vals, converter, context, id); : xmlattrname.getLocalPart().substring(0,1).toUpperCase()+xmlattrname.getLocalPart().substring(1); set = invokeBulkSetMethod(new String[]{"set"}, postfix, vals, object, context, converter, id); if(prop!=null) Object arg = convertBulkValues(vals, prop.getSetterType(), null, context, null); set = setBulkField(fieldname, object, vals, converter, context, id); if(!set) set = setBulkField(plufieldname, object, vals, converter, context, id); set = invokeBulkSetMethod(new String[]{"set"}, postfix, vals, object, context, null, null); set = invokeBulkSetMethod(new String[]{"set"}, plupostfix, vals, object, context, null, null);
Object arg = convertValue(val, ps[1], converter, context, id); m.invoke(object, new Object[]{key, arg}); set = true; Object arg = convertValue(val, null, converter, context, id); ((Map)map).put(key, arg); set = true; Object arg = convertValue(val, null, converter, context, id); ((IReturnValueCommand)sh).execute(new Object[]{object, arg}); Object arg = convertValue(val, ps[1], converter, context, id); Object arg = convertValue(val, ps[0], converter, context, id); try Object arg = convertValue(val, f.getType(), converter, context, id); f.set(object, arg); set = true; Object arg = convertValue(val, null, converter, context, id); ((IReturnValueCommand)sh).execute(new Object[]{object, arg}); set = setField(fieldname, object, val, converter, context, id); set = invokeSetMethod(new String[]{"set", "add"}, postfix, val, object, context, converter, id); set = invokeSetMethod(new String[]{"set", "add"}, postfix, val, object, context, converter, id);
public void linkObject(Object object, Object parent, Object linkinfo, QName[] pathname, AReadContext context) throws Exception { if(object instanceof String && parent instanceof MBelief)// && context.getStackElement(context.getStackSize()-4).getObject() instanceof BDIXModel) { BDIXModel model = (BDIXModel)context.getStackElement(context.getStackSize()-4).getObject(); model.getCapability().addBeliefReference(MElement.internalName((String)object), ((MElement)parent).getName()); } // goals in condlinker else if(object instanceof String && parent instanceof MMessageEvent)// && context.getStackElement(context.getStackSize()-4).getObject() instanceof BDIXModel) { BDIXModel model = (BDIXModel)context.getStackElement(context.getStackSize()-4).getObject(); model.getCapability().addEventReference(MElement.internalName((String)object), ((MElement)parent).getName()); } else if(object instanceof String && parent instanceof MInternalEvent)// && context.getStackElement(context.getStackSize()-4).getObject() instanceof BDIXModel) { BDIXModel model = (BDIXModel)context.getStackElement(context.getStackSize()-4).getObject(); model.getCapability().addEventReference(MElement.internalName((String)object), ((MElement)parent).getName()); } else { super.linkObject(object, parent, linkinfo, pathname, context); } } };
/** * Directly access a field for setting/(adding) the object. */ protected boolean setField(String fieldname, Object parent, Object object, Object converter, AReadContext context, String idref) throws Exception { boolean set = false; try { Field field = parent.getClass().getField(fieldname); Class type = field.getType(); Object val = object; val = convertValue(object, type, converter, context, idref); if(SReflect.isSupertype(type, val.getClass())) { field.set(parent, val); set = true; } } catch(Exception e) { // Ignore -> try other way of setting attribute } return set; }
if(ps.length==1) Object arg = convertValue(value, ps[0], converter, context, idref); ms[j].invoke(object, new Object[]{arg}); set = true;
/** * Get the default Java reader. * @return The Java reader. */ public static IObjectReaderHandler getObjectHandler() { if(handler==null) { synchronized(JavaReader.class) { if(handler==null) { handler = new BeanObjectReaderHandler(getTypeInfos()); } } } return handler; } }
if(ps.length==1) Object arg = convertBulkValues(vals, ps[0], converter, context, idref);
handler = new BeanObjectReaderHandler(mappings);
handler = new BeanObjectReaderHandler(mappings);
typeinfosread.add(ti_ocp); return new Tuple2<TypeInfoPathManager, IObjectReaderHandler>(new TypeInfoPathManager(typeinfosread), new BeanObjectReaderHandler(typeinfosread));
typeinfosread.add(ti_ocp); return new Tuple2<TypeInfoPathManager, IObjectReaderHandler>(new TypeInfoPathManager(typeinfosread), new BeanObjectReaderHandler(typeinfosread));
typeinfosread.add(ti_ocp); return new Tuple2<TypeInfoPathManager, IObjectReaderHandler>(new TypeInfoPathManager(typeinfosread), new BeanObjectReaderHandler(typeinfosread));
new SubobjectInfo(new XMLInfo(new QName[]{new QName(uri, "property")}), new AccessInfo(new QName(uri, "property"), "property", null, null)),//, new BeanAccessInfo(putprop, null, "map", getname))), new SubobjectInfo(new XMLInfo(new QName[]{new QName(uri, "nfproperties"), new QName(uri, "nfproperty")}), new AccessInfo(new QName(uri, "nfproperty"), "NFProperty")), }), null, new BeanObjectReaderHandler())); new SubobjectInfo(new XMLInfo(new QName[]{new QName(uri, "steps"), new QName(uri, "initialstep")}), new AccessInfo(new QName(uri, "initialstep"), "initialStep")), new SubobjectInfo(new XMLInfo(new QName[]{new QName(uri, "steps"), new QName(uri, "endstep")}), new AccessInfo(new QName(uri, "endstep"), "endStep")), }), null, new BeanObjectReaderHandler())); new AttributeInfo[]{new AttributeInfo(new AccessInfo("class", "clazz"), new AttributeConverter(classconv, reclassconv))}, null), null, new BeanObjectReaderHandler())); new AttributeInfo[]{new AttributeInfo(new AccessInfo("class", "clazz"), new AttributeConverter(classconv, reclassconv))}, null), null, new BeanObjectReaderHandler())); types.add(new TypeInfo(new XMLInfo(new QName(uri, "import")), new ObjectInfo(String.class), null, null, new BeanObjectReaderHandler())); new MappingInfo(null, new AttributeInfo[]{ new AttributeInfo(new AccessInfo("autoshutdown", "autoShutdown")), }, null), null, new BeanObjectReaderHandler())); new MappingInfo(null, null, "value", new AttributeInfo[]{ new AttributeInfo(new AccessInfo("class", "type"), new AttributeConverter(classconv, reclassconv)), }, null), null, new BeanObjectReaderHandler())); types.add(new TypeInfo(new XMLInfo(new QName(uri, "implementation")), new ObjectInfo(ProvidedServiceImplementation.class, new ExpressionProcessor()), new MappingInfo(null, null, "value", new AttributeInfo[]{ }, new SubobjectInfo[]{ new SubobjectInfo(new XMLInfo(new QName[]{new QName(uri, "binding")}), new AccessInfo(new QName(uri, "binding"), "defaultBinding")), }), null, new BeanObjectReaderHandler())); types.add(new TypeInfo(new XMLInfo(new QName(uri, "binding")), new ObjectInfo(RequiredServiceBinding.class), new MappingInfo(null, null, null, new AttributeInfo[]{
new SubobjectInfo(new XMLInfo(new QName[]{new QName(uri, "componenttype")}), new AccessInfo(new QName(uri, "componenttype"), "subcomponentType")), new SubobjectInfo(new XMLInfo(new QName[]{new QName(uri, "property")}), new AccessInfo(new QName(uri, "property"), "property", null, null))//, new BeanAccessInfo(putprop, null, "map", getname))), }), null, new BeanObjectReaderHandler())); new SubobjectInfo(new XMLInfo(new QName[]{new QName(uri, "steps"), new QName(uri, "initialstep")}), new AccessInfo(new QName(uri, "initialstep"), "initialStep")), new SubobjectInfo(new XMLInfo(new QName[]{new QName(uri, "steps"), new QName(uri, "endstep")}), new AccessInfo(new QName(uri, "endstep"), "endStep")), }), null, new BeanObjectReaderHandler())); new AttributeInfo[]{new AttributeInfo(new AccessInfo("class", "clazz"), new AttributeConverter(classconv, reclassconv))}, null), null, new BeanObjectReaderHandler())); new AttributeInfo[]{new AttributeInfo(new AccessInfo("class", "clazz"), new AttributeConverter(classconv, reclassconv))}, null), null, new BeanObjectReaderHandler())); types.add(new TypeInfo(new XMLInfo(new QName(uri, "import")), new ObjectInfo(String.class), null, null, new BeanObjectReaderHandler())); new MappingInfo(null, new AttributeInfo[]{ new AttributeInfo(new AccessInfo("autoshutdown", "autoShutdown")), }, null), null, new BeanObjectReaderHandler())); new MappingInfo(null, null, "value", new AttributeInfo[]{ new AttributeInfo(new AccessInfo("class", "type"), new AttributeConverter(classconv, reclassconv)), }, null), null, new BeanObjectReaderHandler())); types.add(new TypeInfo(new XMLInfo(new QName(uri, "implementation")), new ObjectInfo(ProvidedServiceImplementation.class, new ExpressionProcessor()), new MappingInfo(null, null, "value", new AttributeInfo[]{ }, new SubobjectInfo[]{ new SubobjectInfo(new XMLInfo(new QName[]{new QName(uri, "binding")}), new AccessInfo(new QName(uri, "binding"), "defaultBinding")), }), null, new BeanObjectReaderHandler())); types.add(new TypeInfo(new XMLInfo(new QName(uri, "binding")), new ObjectInfo(RequiredServiceBinding.class), new MappingInfo(null, null, null, new AttributeInfo[]{
new SubobjectInfo(new XMLInfo(new QName[]{new QName(uri, "applications"), new QName(uri, "application")}), new AccessInfo(new QName(uri, "configuration"), "configuration", null, null))//, new BeanAccessInfo(putprop, null, "map", getname))), })); apptype.setReaderHandler(new BeanObjectReaderHandler()); types.add(apptype);
new SubobjectInfo(new AccessInfo("eAnnotations", "annotation")) })); diatype.setReaderHandler(new BeanObjectReaderHandler()); types.add(diatype);
new SubobjectInfo(new AccessInfo("eAnnotations", "annotation")) })); diatype.setReaderHandler(new BeanObjectReaderHandler()); types.add(diatype);