Package org.jrdf.writer

Examples of org.jrdf.writer.WriteException


            xmlStreamWriter.writeEndElement();
            xmlStreamWriter.writeCharacters(RdfWriter.NEW_LINE);
            xmlStreamWriter.flush();
        } catch (Exception e) {
            exception = null;
            throw new WriteException(e);
        }
    }
View Full Code Here


        }
    }

    public void visitNode(Node node) {
        checkNotNull(node);
        exception = new WriteException("Unknown object node type: " + node.getClass().getName());
    }
View Full Code Here

        exception = new WriteException("Unknown object node type: " + node.getClass().getName());
    }

    public void visitResource(Resource resource) {
        checkNotNull(resource);
        exception = new WriteException("Unknown object node type: " + resource.getClass().getName());
    }
View Full Code Here

        exception = new WriteException("Unknown object node type: " + resource.getClass().getName());
    }

    private void writePredicate(PredicateNode predicate) throws WriteException, XMLStreamException {
        if (!(predicate instanceof URIReference)) {
            throw new WriteException("Unknown predicate node type: " + predicate.getClass().getName());
        }
        String resourceName = names.replaceNamespace((URIReference) predicate);
        xmlStreamWriter.writeStartElement(resourceName);
    }
View Full Code Here

            if (exception != null) {
                throw exception;
            }
        } catch (Exception e) {
            exception = null;
            throw new WriteException(e);
        }
    }
View Full Code Here

        try {
            xmlStreamWriter.writeEndElement();
            xmlStreamWriter.writeCharacters(RdfWriter.NEW_LINE);
            xmlStreamWriter.flush();
        } catch (XMLStreamException e) {
            throw new WriteException(e);
        }
    }
View Full Code Here

    public void visitResource(Resource resource) {
        unknownType(resource);
    }

    private void unknownType(final Node node) {
        exception = new WriteException("Unknown SubjectNode type: " + node.getClass().getName());
    }
View Full Code Here

            write(graph, writer);
        } finally {
            try {
                writer.close();
            } catch (IOException e) {
                throw new WriteException(e);
            }
        }
    }
View Full Code Here

    public void write(Graph graph, Writer writer) throws WriteException, GraphException {
        printWriter = new PrintWriter(writer);
        try {
            write(graph, (String) null);
        } catch (XMLStreamException e) {
            throw new WriteException(e);
        } finally {
            printWriter.close();
        }
    }
View Full Code Here

            // TODO AN - Remove this is a hack!!!!
            try {
                xmlStreamWriter = FACTORY.createXMLStreamWriter(printWriter);
            } catch (XMLStreamException e) {
                throw new WriteException(e);
            }

            // header
            encoding = (encoding == null) ? ENCODING_DEFAULT : encoding;
            final RdfXmlDocument header = new RdfXmlDocumentImpl(encoding, names, xmlStreamWriter);
View Full Code Here

TOP

Related Classes of org.jrdf.writer.WriteException

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.