WARNING: Most of this content (with the exception of the Mozilla 1.9 XPCOM reference) is very old, and can be expected to be out of date and possibly obsolete. For better XUL documentation, please visit the XUL hub at the Mozilla Developer Center.

nsIRDFService

IID:BFD05261-834C-11d2-8EAC-00805F29F370
Inherits From:nsISupports

The RDF service interface. This is a singleton object which should be obtained from the nsServiceManager.

This interface is intended to be used as a service. To create an object implementing this interface:

var obj = Components.classes["@mozilla.org/rdf/rdf-service;1"].
            getService(Components.interfaces.nsIRDFService);

This interface is implemented by the following components:


Methods

nsIRDFResource GetAnonymousResource ( ) [noscript] nsIRDFBlob getBlobLiteral ( const_octet_ptr* value , PRInt32 length ) nsIRDFDataSource GetDataSource ( char* URI ) nsIRDFDataSource GetDataSourceBlocking ( char* URI ) nsIRDFDate GetDateLiteral ( PRInt64 value ) nsIRDFInt GetIntLiteral ( PRInt32 value ) nsIRDFLiteral GetLiteral ( PRUnichar* value ) nsIRDFResource GetResource ( AUTF8String URI ) nsIRDFResource GetUnicodeResource ( AString URI ) PRBool IsAnonymousResource ( nsIRDFResource resource ) void RegisterDataSource ( nsIRDFDataSource dataSource , PRBool replace ) void RegisterResource ( nsIRDFResource resource , PRBool replace ) void UnregisterDataSource ( nsIRDFDataSource dataSource ) void UnregisterResource ( nsIRDFResource resource )

nsIRDFResource GetAnonymousResource ( )


nsIRDFBlob getBlobLiteral ( const_octet_ptr* value , PRInt32 length )

Construct an RDF literal from a data blob

Arguments:
value
length

nsIRDFDataSource GetDataSource ( char* URI )

Get the named data source corresponding to the URI. If a data source has been registered via RegisterDataSource(), that data source will be returned.

If no data source is currently registered for the specified URI, and a data source constructor function has been registered via RegisterDatasourceConstructor(), the RDF service will call the constructor to attempt to construct a new data source. If construction is successful, the data source will be initialized via nsIRDFDataSource::Init().

Arguments:
URI

nsIRDFDataSource GetDataSourceBlocking ( char* URI )

Same as GetDataSource, but if a remote/XML data source needs to be constructed, then this method will issue a blocking Refresh call on that data source.

Arguments:
URI

nsIRDFDate GetDateLiteral ( PRInt64 value )

Construct an RDF literal from a PRTime.

Arguments:
value

nsIRDFInt GetIntLiteral ( PRInt32 value )

Construct an RDF literal from an int.

Arguments:
value

nsIRDFLiteral GetLiteral ( PRUnichar* value )

Construct an RDF literal from a Unicode string.

Arguments:
value

nsIRDFResource GetResource ( AUTF8String URI )

Construct an RDF resource from a single-byte URI. nsIRDFService caches resources that are in-use, so multiple calls to GetResource() for the same uri will return identical pointers. FindResource is used to find out whether there already exists a resource corresponding to that url.

Arguments:
URI

nsIRDFResource GetUnicodeResource ( AString URI )

Construct an RDF resource from a Unicode URI. This is provided as a convenience method, allowing automatic, in-line C++ conversion from nsString objects. The uri will be converted to a single-byte representation internally.

Arguments:
URI

PRBool IsAnonymousResource ( nsIRDFResource resource )

Arguments:
resource

void RegisterDataSource ( nsIRDFDataSource dataSource , PRBool replace )

Register a named data source. The RDF service will call nsIRDFDataSource::GetURI() to determine the URI under which to register the data source.

Arguments:
dataSource
replace

void RegisterResource ( nsIRDFResource resource , PRBool replace )

Registers a resource with the RDF system, making it unique w.r.t. GetResource.

An implementation of nsIRDFResource should call this in its Init() method if it wishes the resource to be globally unique (which is usually the case).

Arguments:
resource
replace

void UnregisterDataSource ( nsIRDFDataSource dataSource )

Unregister a named data source. The RDF service will call nsIRDFDataSource::GetURI() to determine the URI under which the data source was registered.

Arguments:
dataSource

void UnregisterResource ( nsIRDFResource resource )

Called to notify the resource manager that a resource is no longer in use. This method should only be called from the destructor of a "custom" resource implementation to notify the RDF service that the last reference to the resource has been released, so the resource is no longer valid.

Arguments:
resource

Reference documentation is generated from Mozilla's source.

Copyright © 1999-2006 XULPlanet.com