Package org.apache.jena.assembler
Class Mode
java.lang.Object
org.apache.jena.assembler.Mode
A Mode object controls whether persistent objects can be created or reused
by an assembler. Their methods are expected to be called when an
assembler is about to create a new object (because no object with the given
name exists) or reuse an existing one (because one does).
The default behaviour of the methods is dictated by booleans bound into the mode object. Subclasses of mode may exploit the ability to inspect the name of the object or its other RDF properties.
-
Field Summary
Modifier and TypeFieldDescriptionstatic final Mode
Mode that permits existing objects to be reused and new objects to be created.static final Mode
Mode that demands a new object be created and no existing object should exist.static final Mode
Default mode; existing objects are reused, new objects are not createdstatic final Mode
Mode that requires that objects should already exist; new objects cannot be created. -
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionboolean
permitCreateNew
(Resource root, String name) Answer true if the objectroot
with the givenname
can be created if it does not already exist.boolean
permitUseExisting
(Resource root, String name) Answer true if the existing objectroot
with the givenname
can be reused.
-
Field Details
-
CREATE
Mode that demands a new object be created and no existing object should exist. -
DEFAULT
Default mode; existing objects are reused, new objects are not created -
REUSE
Mode that requires that objects should already exist; new objects cannot be created. -
ANY
Mode that permits existing objects to be reused and new objects to be created.
-
-
Constructor Details
-
Mode
public Mode(boolean mayCreate, boolean mayReuse)
-
-
Method Details
-
permitCreateNew
Answer true if the objectroot
with the givenname
can be created if it does not already exist. -
permitUseExisting
Answer true if the existing objectroot
with the givenname
can be reused.
-