Package org.openrdf.query.resultio

Source Code of org.openrdf.query.resultio.TupleQueryResultParserBase

/*
* Copyright Aduna (http://www.aduna-software.com/) (c) 1997-2006.
*
* Licensed under the Aduna BSD-style license.
*/
package org.openrdf.query.resultio;

import org.openrdf.model.ValueFactory;
import org.openrdf.model.impl.ValueFactoryImpl;
import org.openrdf.query.TupleQueryResultHandler;

/**
* Base class for {@link TupleQueryResultParser}s offering common functionality
* for query result parsers.
*/
public abstract class TupleQueryResultParserBase implements TupleQueryResultParser {

  /*-----------*
   * Variables *
   *-----------*/

  /**
   * The ValueFactory to use for creating RDF model objects.
   */
  protected ValueFactory valueFactory;

  /**
   * The TupleQueryResultHandler that will handle the parsed query results.
   */
  protected TupleQueryResultHandler handler;

  /*--------------*
   * Constructors *
   *--------------*/

  /**
   * Creates a new parser base that, by default, will use an instance of
   * {@link ValueFactoryImpl} to create Value objects.
   */
  public TupleQueryResultParserBase() {
    this(new ValueFactoryImpl());
  }

  /**
   * Creates a new parser base that will use the supplied ValueFactory to
   * create Value objects.
   */
  public TupleQueryResultParserBase(ValueFactory valueFactory) {
    setValueFactory(valueFactory);
  }

  /*---------*
   * Methods *
   *---------*/

  public void setValueFactory(ValueFactory valueFactory) {
    this.valueFactory = valueFactory;
  }

  public void setTupleQueryResultHandler(TupleQueryResultHandler handler) {
    this.handler = handler;
  }
}
TOP

Related Classes of org.openrdf.query.resultio.TupleQueryResultParserBase

TOP
Copyright © 2018 www.massapi.com. 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.