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); } });
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 callPostProcessor() throws Exception { try { Object check = postprocs[fi].postProcess(readcontext, ftopse.getObject()); if(check!=null) { readcontext.getReporter().report("Object replacement only possible in first pass.", "postprocessor error", ftopse, ftopse.getLocation()); } } catch(Exception e) { // e.printStackTrace(); readcontext.getReporter().report("Error during postprocessing: "+e, "postprocessor error", stack, ftopse!=null ? ftopse.getLocation() : readcontext.getLocation()); } } });
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); } });
/** * 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); }
jadex.xml.stax.ILocation loc = readcontext.getStackSize()>0 ? readcontext.getTopStackElement().getLocation() : StaxLocationWrapper.fromLocation(parser.getLocation()); readcontext.getReporter().report(e.toString(), "XML error", readcontext, loc);
pos = " (line "+se.getLocation().getLineNumber()+", column "+se.getLocation().getColumnNumber()+")";
context.getReporter().report("Unknown attribute info: "+attrinfo, "attribute error", context, se.getLocation()); context.getReporter().report(e.toString(), "attribute error", context, se.getLocation()); context.getReporter().report("Unhandled attribute: "+object+", "+xmlattrname+", "+attrpath, "unhandled attribute", context, se.getLocation());
context.getReporter().report("Unknown attribute info: "+attrinfo, "attribute error", context, se.getLocation()); context.getReporter().report(e.toString(), "attribute error", context, se.getLocation()); context.getReporter().report("Unhandled attribute: "+object+", "+xmlattrname+", "+attrpath, "unhandled attribute", context, se.getLocation());
readcontext.getReporter().report("idref not contained: "+idref, "idref error", se, se.getLocation()); readcontext.getReporter().report("No element on stack for attributes", "stack error", se, se.getLocation());
topse = new StackElement(topse.getReaderHandler(), topse.getTag(), val, topse.getRawAttributes(), null, topse.getLocation()); readcontext.setStackElement(topse, readcontext.getStackSize()-1); readcontext.getReporter().report("No content mapping for: "+topse.getContent()+" tag="+topse.getTag(), "link error", se, se.getLocation()); readcontext.getReporter().report("Error during postprocessing: "+e, "postprocessor error", topse, topse.getLocation()); readcontext.getReporter().report("No parent object found for: "+SUtil.arrayToString(fullpath), "link error", se, se.getLocation());