1
// -*- Mode: java; c-basic-offset: 2 -*-
3
// Serializer.java - Redland Java Serializer class
5
// $Id: Serializer.java 10591 2006-03-05 08:22:09Z cmdjb $
7
// Copyright (C) 2002-2004 David Beckett - http://purl.org/net/dajobe/
8
// Copyright (C) 2002-2004 University of Bristol - http://www.bristol.ac.uk/
10
// This package is Free Software or Open Source available under the
11
// following licenses (these are alternatives):
12
// 1. GNU Lesser General Public License (LGPL)
13
// 2. GNU General Public License (GPL)
14
// 3. Mozilla Public License (MPL)
16
// See LICENSE.html or LICENSE.txt at the top of this package for the
17
// full license terms.
22
package org.librdf.redland;
24
import org.librdf.redland.core;
25
import org.librdf.redland.World;
26
import org.librdf.redland.URI;
28
public class Serializer
33
public Serializer (World world, String name, String mime_type, URI type_uri)
36
long uri_object=(type_uri == null) ? 0 : type_uri.__get_object();
37
this.object=core.librdf_new_serializer(world.__get_object(), name, mime_type, uri_object);
40
public void finished()
42
if(this.object != 0) {
43
core.librdf_free_serializer(this.object);
50
public boolean serialize_to_file(String filename, URI base_uri, Model model)
52
int result=core.librdf_serializer_serialize_model_to_file(this.object, filename, base_uri.__get_object(), model.__get_object());
57
public Node getFeature(URI feature)
59
return new Node(this.world, core.librdf_serializer_get_feature(this.object, feature.__get_object()), true);
63
public int setFeature(URI feature, Node value)
65
return core.librdf_serializer_set_feature(this.object, feature.__get_object(), value.__get_object());