public static Node[] parseNodes(final String line) throws ParseException { try { return parseNodesInternal(line); } catch (Exception e) { throw new ParseException(e); } }
private void processStatement(final Node... triple){ if(_con!=null){ _c.processStatement(new Node[]{triple[0],triple[1],triple[2],_con}); } else _c.processStatement(triple); }
public void endDocument () throws SAXException{ _c.endDocument(); }
public Iterator<Node[]> parse(BufferedReader br) { return parse(stringItFromBufferedReader(br)); }
public Iterator<Node[]> parse(Reader r) { return parse(new BufferedReader(r)); }
public String[] parseContextualBNode() throws ParseException { String d = _data.substring(PREFIX.length()); String[] uri = d.toString().split("xx"); if (uri.length != 2) { throw new ParseException("Not a valid context encoded BNode " + _data); } uri[0] = unescapeForBNode(uri[0]); uri[1] = unescapeForBNode(uri[1]); return uri; }
public void startDocument () throws SAXException{ _c.startDocument(); }
public Iterator<Node[]> parse(Iterator<String> iterator) { _stringIt = iterator; loadNext(); return this; }
@Override public boolean hasNext() { if (_nextIsFresh && _next != null) return true; else if (!_nextIsFresh) { if (_br == null) return false; loadNext(); if (_next != null) return true; else return false; } else return false; }
@Override public Node[] next() { if (_nextIsFresh) { _nextIsFresh = false; return _next; } else { if (hasNext()) return _next; else throw new NoSuchElementException(); } }
public void startDocument() { startDocumentInternal(); _openDocuments.incrementAndGet(); }
public void endDocument() { endDocumentInternal(); int i = _openDocuments.decrementAndGet(); if (i<0) throw new IllegalStateException("I don't have a document to end."); }
public void processStatement(Node[] nx) { if (_openDocuments.get()<1) throw new IllegalStateException("I don't have a document to write to."); else processStatementInternal(nx); }
public void parse(InputStream is, Charset cs) { parse(new BufferedReader(new InputStreamReader(is, cs))); }
public Iterator<Node[]> parse(Iterable<String> iterable) { return parse(iterable.iterator()); }
protected void emitTriple(int line, int column, Nodes triple) { _callback.processStatement(triple.getNodeArray()); }
public static String[] parseContextualBNode(BNode b) throws ParseException { String[] uri = b.toString().split("xx"); if (uri.length != 2) { throw new ParseException("Not a valid context encoded BNode " + b); } uri[0] = unescapeForBNode(uri[0]); uri[1] = unescapeForBNode(uri[1]); return uri; }
public Node[] next(){ if(next==null) throw new NoSuchElementException(); Node[] now = next; loadNext(); return now; }
public Iterator<Node[]> parse(InputStream is, Charset cs) { return parse(new BufferedReader(new InputStreamReader(is, cs))); }
public Iterator<Node[]> parse(InputStream is) { return parse(new BufferedReader(new InputStreamReader(is))); }