public void linkObject(Object object, Object parent, Object linkinfo, QName[] pathname, AReadContext context) throws Exception { // Exchange parent for OAV children of configuration object. Map user = (Map)context.getUserContext(); IOAVState state = (IOAVState)user.get(OAVObjectReaderHandler.CONTEXT_STATE); if(state.isIdentifier(object)) { parent = getOAVConfiguration(uri, parent, context, user, state); } context.getTopStackElement().getReaderHandler().linkObject(object, parent, linkinfo, pathname, context); } };
public void linkObject(Object object, Object parent, Object linkinfo, QName[] pathname, AReadContext context) throws Exception { // Exchange parent for OAV children of root object. Map user = (Map)context.getUserContext(); IOAVState state = (IOAVState)user.get(OAVObjectReaderHandler.CONTEXT_STATE); if(state.isIdentifier(object)) { parent = getOAVRoot(uri, context, user, state); } context.getTopStackElement().getReaderHandler().linkObject(object, parent, linkinfo, pathname, context); } };
public void linkObject(Object object, Object parent, Object linkinfo, QName[] pathname, AReadContext context) throws Exception { if(object instanceof MElementRef && pathname[0].getLocalPart().equals("goals")) { ((BDIXModel)parent).getCapability().addGoalReference(((MElementRef)object).getName(), ((MElementRef)object).getRef()); } else if(object instanceof MElementRef && pathname[0].getLocalPart().equals("events")) { ((BDIXModel)parent).getCapability().addEventReference(((MElementRef)object).getName(), ((MElementRef)object).getRef()); } else if(object instanceof MElementRef && pathname[0].getLocalPart().equals("expressions")) { ((BDIXModel)parent).getCapability().addExpressionReference(((MElementRef)object).getName(), ((MElementRef)object).getRef()); } else { if(object instanceof MBelief || object instanceof MGoal || object instanceof MPlan || object instanceof MMessageEvent || object instanceof MInternalEvent || object instanceof MCapabilityReference || object instanceof MElementRef || (object instanceof UnparsedExpression && pathname[pathname.length-1].getLocalPart().equals("expression")) // hack for bdi expressions || (object instanceof MCondition && pathname[pathname.length-1].getLocalPart().equals("condition"))) { parent = ((BDIXModel)parent).getCapability(); } context.getTopStackElement().getReaderHandler().linkObject(object, parent, linkinfo, pathname, context); } } };
public void linkObject(Object object, Object parent, Object linkinfo, QName[] pathname, AReadContext context) throws Exception { boolean done = false; if(pathname[pathname.length-1].getLocalPart().startsWith("initial") || pathname[pathname.length-1].getLocalPart().startsWith("end")) { String config = ((ConfigurationInfo)parent).getName(); BDIXModel model = (BDIXModel)context.getStackElement(pathname.length-2).getObject(); parent = model.getCapability().getConfiguration(config); if(parent==null) { MConfiguration mconf = new MConfiguration(config); model.getCapability().addConfiguration(mconf); parent = mconf; } // initial capabilities. if(object instanceof String) { ((MConfiguration)parent).addInitialCapability(context.getStackElement(context.getStackSize()-1).getRawAttributes().get("ref"), (String)object); done = true; } } if(!done) { context.getTopStackElement().getReaderHandler().linkObject(object, parent, linkinfo, pathname, context); } } };
if(handler==null) if(readcontext.getTopStackElement()!=null && readcontext.getTopStackElement().getReaderHandler()!=null) handler = readcontext.getTopStackElement().getReaderHandler();
val = topse.getReaderHandler().convertContentObject((String)val, localname, readcontext); topse = new StackElement(topse.getReaderHandler(), topse.getTag(), val, topse.getRawAttributes(), null, topse.getLocation()); readcontext.setStackElement(topse, readcontext.getStackSize()-1); topse.getReaderHandler().handleAttributeValue(topse.getObject(), null, null, topse.getContent(), typeinfo.getContentInfo(), readcontext); final IPostProcessor[] postprocs = topse.getReaderHandler().getPostProcessors(topse.getObject(), typeinfo); if(postprocs!=null && postprocs.length>0) if(childs!=null) IBulkObjectLinker linker = (IBulkObjectLinker)(typeinfo!=null && typeinfo.getLinker()!=null? typeinfo.getLinker(): topse.getReaderHandler()); linker.bulkLinkObjects(topse.getObject(), childs, readcontext); IObjectLinker linker = (IObjectLinker)(patypeinfo!=null && patypeinfo.getLinker()!=null? patypeinfo.getLinker(): pse.getReaderHandler()); linker.linkObject(topse.getObject(), pse.getObject(), linkinfo==null? null: linkinfo, pathname.toArray(new jadex.xml.stax.QName[pathname.size()]), readcontext);
context.getTopStackElement().getReaderHandler().linkObject(object, parent, linkinfo, pathname, context);