public Object postProcess(IContext context, Object object) { MParameter mparam = (MParameter)object; mparam.setMulti(multi); // Init events. AReadContext ar = (AReadContext)context; MParameterElement pe = null; for(StackElement se: ar.getStack()) { if(se.getObject() instanceof MParameterElement) { pe = (MParameterElement)se.getObject(); } } mparam.initEvents(pe); return mparam; }
public Object postProcess(IContext context, Object object) { ConfigurationInfo app = (ConfigurationInfo)object; IModelInfo mapp = (IModelInfo)context.getRootObject(); UnparsedExpression[] margs = app.getArguments(); for(int i=0; i<margs.length; i++) { try { Argument arg = (Argument)mapp.getArgument(margs[i].getName()); if(arg==null) throw new RuntimeException("Overridden argument not declared in component type: "+margs[i].getName()); // Object val = overridenarg.getParsedValue().getValue(null); // arg.setDefaultValue(app.getName(), val); } catch(RuntimeException e) { Object se = new Tuple(((AReadContext)context).getStack()); MultiCollection report = (MultiCollection)context.getUserContext(); report.put(se, e.toString()); } } return null; }
public Object postProcess(IContext context, Object object) { ConfigurationInfo app = (ConfigurationInfo)object; IModelInfo mapp = (IModelInfo)context.getRootObject(); UnparsedExpression[] margs = app.getArguments(); for(int i=0; i<margs.length; i++) { try { Argument arg = (Argument)mapp.getArgument(margs[i].getName()); if(arg==null) throw new RuntimeException("Overridden argument not declared in component type: "+margs[i].getName()); // Object val = overridenarg.getParsedValue().getValue(null); // arg.setDefaultValue(app.getName(), val); } catch(RuntimeException e) { Tuple se = new Tuple(((AReadContext)context).getStack()); MultiCollection<Tuple, String> report = (MultiCollection<Tuple, String>)context.getUserContext(); report.add(se, e.toString()); } } return null; }
public void report(String msg, String type, Object info, ILocation location) throws XMLStreamException { // System.out.println("XML error: "+msg+", "+type+", "+info+", "+location); // Thread.dumpStack(); IContext context = (IContext)(info instanceof IContext ? info : AReader.READ_CONTEXT.get()); Tuple stack = new Tuple(info instanceof StackElement[] ? (StackElement[])info : ((AReadContext)context).getStack()); Map user = (Map)context.getUserContext(); MultiCollection<Tuple, String> report = (MultiCollection<Tuple, String>)user.get(CONTEXT_ENTRIES); String pos; if(stack.getEntities().length>0) { StackElement se = (StackElement)stack.get(stack.getEntities().length-1); pos = " (line "+se.getLocation().getLineNumber()+", column "+se.getLocation().getColumnNumber()+")"; } else { pos = " (line 0, column 0)"; } report.add(stack, msg+pos); } });
public void report(String msg, String type, Object info, ILocation location) throws Exception { // System.out.println("XML error: "+msg+", "+type+", "+info+", "+location); // Thread.dumpStack(); IContext context = (IContext)AReader.READ_CONTEXT.get(); Map user = (Map)context.getUserContext(); MultiCollection report = (MultiCollection)user.get(CONTEXT_ENTRIES); String pos; Tuple stack = new Tuple(((AReadContext)context).getStack()); if(stack.getEntities().length>0) { StackElement se = (StackElement)stack.get(stack.getEntities().length-1); pos = " (line "+se.getLocation().getLineNumber()+", column "+se.getLocation().getColumnNumber()+")"; } else { pos = " (line 0, column 0)"; } report.put(stack, msg+pos); } });
public void report(String msg, String type, Object info, ILocation location) throws XMLStreamException { // System.out.println("XML error: "+msg+", "+type+", "+info+", "+location); // Thread.dumpStack(); IContext context = (IContext)(info instanceof IContext ? info : AReader.READ_CONTEXT.get()); Tuple stack = new Tuple(info instanceof StackElement[] ? (StackElement[])info : ((AReadContext)context).getStack()); Map user = (Map)context.getUserContext(); MultiCollection report = (MultiCollection)user.get(CONTEXT_ENTRIES); String pos; if(stack.getEntities().length>0) { StackElement se = (StackElement)stack.get(stack.getEntities().length-1); pos = " (line "+se.getLocation().getLineNumber()+", column "+se.getLocation().getColumnNumber()+")"; } else { pos = " (line 0, column 0)"; } report.put(stack, msg+pos); } });
public void report(String msg, String type, Object info, ILocation location) throws Exception { // System.out.println("XML error: "+msg+", "+type+", "+info+", "+location); // Thread.dumpStack(); IContext context = (IContext)AReader.READ_CONTEXT.get(); Map user = (Map)context.getUserContext(); MultiCollection<Tuple, String> report = (MultiCollection<Tuple, String>)user.get(CONTEXT_ENTRIES); String pos; Tuple stack = new Tuple(((AReadContext)context).getStack()); if(stack.getEntities().length>0) { StackElement se = (StackElement)stack.get(stack.getEntities().length-1); pos = " (line "+se.getLocation().getLineNumber()+", column "+se.getLocation().getColumnNumber()+")"; } else { pos = " (line 0, column 0)"; } report.add(stack, msg+pos); } });
/** * Report an error including the line and column. */ protected static void reportError(IContext context, String error) { Map user = (Map)context.getUserContext(); MultiCollection report = (MultiCollection)user.get(ComponentXMLReader.CONTEXT_ENTRIES); String pos; Tuple stack = new Tuple(((AReadContext)context).getStack()); if(stack.getEntities().length>0) { StackElement se = (StackElement)stack.get(stack.getEntities().length-1); pos = " (line "+se.getLocation().getLineNumber()+", column "+se.getLocation().getColumnNumber()+")"; } else { pos = " (line 0, column 0)"; } report.add(stack, error+pos); }
/** * Report an error including the line and column. */ protected static void reportError(IContext context, String error) { Map ouc = (Map)context.getUserContext(); MultiCollection report = (MultiCollection)ouc.get(ComponentXMLReader.CONTEXT_ENTRIES); String pos; Tuple stack = new Tuple(((AReadContext)context).getStack()); if(stack.getEntities().length>0) { StackElement se = (StackElement)stack.get(stack.getEntities().length-1); pos = " (line "+se.getLocation().getLineNumber()+", column "+se.getLocation().getColumnNumber()+")"; } else { pos = " (line 0, column 0)"; } report.put(stack, error+pos); }
Map<String, String> externals = (Map<String, String>)user.get(CONTEXT_EXTERNALS); String pos; Tuple stack = new Tuple(((AReadContext)context).getStack()); if(stack.getEntities().length>0)
for(StackElement se: ar.getStack())