Start line:  
End line:  

Snippet Preview

Snippet HTML Code

Stack Overflow Questions
 /*
  * Copyright (c) 2009 Mysema Ltd.
  * All rights reserved.
  * 
  */
 package com.mysema.rdfbean.sesame;
 
 import java.util.Set;
import  org.openrdf.model.Statement;
import  org.openrdf.rio.RDFFormat;
import  org.openrdf.rio.RDFHandlerException;
import  org.openrdf.rio.RDFWriter;
import  org.openrdf.rio.helpers.RDFHandlerWrapper;
RDFWriterAdapter provides

Author(s):
tiwe
Version:
$Id$
public class RDFWriterAdapter extends RDFHandlerWrapper implements RDFWriter {
    private final Set<Statement> statements = new TreeSet<Statement>(new StatementComparator());
    
    private final RDFWriter writer;
    public RDFWriterAdapter(RDFWriter writer) {
        super(writer);
        this. = Assert.notNull(writer);
    }
    
    @Override
    public void handleStatement(Statement stmtthrows RDFHandlerException{
        .add(stmt);
    }
    @Override
    public RDFFormat getRDFFormat() {
        return .getRDFFormat();
    }
    @Override
    public void setBaseURI(String arg0) {
        .setBaseURI(arg0);        
    }
    @Override
    public void endRDF() throws RDFHandlerException {
        for (Statement stmt : ){
            .handleStatement(stmt);
        }        
        .clear();
        .endRDF();                
    }
New to GrepCode? Check out our FAQ X