|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectcom.hp.hpl.jena.rdf.model.ResourceFactory
A Factory class for creating resources.
This class creates resources and properties and things of that ilk.
It is designed as a singleton. There are static convenience methods on this class itself, so the easy way to create resource is for example to do something like:
Resource r = ResourceFactory.createResource();
If a factory object is needed, then this can be obtained using
the getInstance
method on the class. The factory
object used may be changed using the setInstance
method.
Nested Class Summary | |
static interface |
ResourceFactory.Interface
the interface to resource factory objects. |
Method Summary | |
static Property |
createProperty(java.lang.String uriref)
create a new property. |
static Property |
createProperty(java.lang.String namespace,
java.lang.String localName)
create a new property. |
static Resource |
createResource()
create a new anonymous resource. |
static Resource |
createResource(java.lang.String uriref)
create a new resource. |
static Statement |
createStatement(Resource subject,
Property predicate,
RDFNode object)
create a new statement. |
static ResourceFactory.Interface |
getInstance()
get the current factory object. |
static ResourceFactory.Interface |
setInstance(ResourceFactory.Interface newInstance)
set the current factory object. |
Methods inherited from class java.lang.Object |
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Method Detail |
public static ResourceFactory.Interface getInstance()
public static ResourceFactory.Interface setInstance(ResourceFactory.Interface newInstance)
newInstance
- the new factory object
public static Resource createResource()
Uses the current factory object to create a new anonymous resource.
public static Resource createResource(java.lang.String uriref)
Uses the current factory object to create a new resource.
uriref
- URIREF of the resource
public static Property createProperty(java.lang.String uriref)
Uses the current factory object to create a new resource.
uriref
- URIREF of the property
public static Property createProperty(java.lang.String namespace, java.lang.String localName)
Uses the current factory object to create a new property.
namespace
- URIREF of the namespace of the propertylocalName
- localname of the property
public static Statement createStatement(Resource subject, Property predicate, RDFNode object)
subject
- the subject of the new statementpredicate
- the predicate of the new statementobject
- the objectof the new statement
|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |