public Object postProcess(IContext context, Object object) { try { BDIXModel model = (BDIXModel)context.getRootObject(); MCapability mcapa = model.getCapability(); AReadContext ar = (AReadContext)context; Map<String, String> rawattrs = ar.getTopStackElement().getRawAttributes(); String service = rawattrs.get("class"); String method = rawattrs.get("method"); MGoal mgoal = (MGoal)ar.getStackElement(ar.getStackSize()-2).getObject(); Class<?> iface = SReflect.findClass(service, model.getAllImports(), ar.getClassLoader()); ClassInfo ci = new ClassInfo(iface.getName()); // Just use first method if no name is given if(method==null) method = iface.getDeclaredMethods()[0].getName(); mcapa.addGoalPublication(ci, mgoal, method); } catch(Exception e) { throw new RuntimeException(e); } return null; }
Class clazz = SReflect.classForName(clazzname, context.getClassLoader()); clazz = getCorrectAnonymousInnerClass(clazz, rawattributes, context.getClassLoader());
Class clazz = SReflect.classForName0(clazzname, context.getClassLoader()); if(clazz!=null)
Class clazz = SReflect.classForName0(clazzname, context.getClassLoader()); if(clazz!=null)
/** * Convert an object to another type of object. */ public Object convertContentObject(String value, QName tag, AReadContext context) throws Exception { Object ret = value; if(tag.getNamespaceURI().startsWith(SXML.PROTOCOL_TYPEINFO)) { String clazzname = tag.getNamespaceURI().substring(SXML.PROTOCOL_TYPEINFO.length())+"."+tag.getLocalPart(); Class clazz = SReflect.classForName0(clazzname, context.getClassLoader()); if(clazz!=null) { if(BasicTypeConverter.isBuiltInType(clazz)) { ret = BasicTypeConverter.getBasicStringConverter(clazz).convertString(value, context); } else { ret = null; context.getReporter().report("No converter known for: "+clazz, "content error", context, context.getLocation()); } } } return ret; }