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 { if(object instanceof MCondition) { MGoal mgoal = (MGoal)parent; String condtype = pathname[pathname.length-1].getLocalPart(); condtype = condtype.substring(0, condtype.length()-9); mgoal.addCondition(condtype, (MCondition)object); } else if(object instanceof String && parent instanceof MGoal && context.getStackElement(context.getStackSize()-4).getObject() instanceof BDIXModel) { BDIXModel model = (BDIXModel)context.getStackElement(context.getStackSize()-4).getObject(); model.getCapability().addGoalReference(MElement.internalName((String)object), ((MElement)parent).getName()); } else { context.getDefaultHandler().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); } } };
context.getTopStackElement().getReaderHandler().linkObject(object, parent, linkinfo, pathname, context);