public class Mode extends Object
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.
Modifier and Type | Field and Description |
---|---|
static Mode |
ANY
Mode that permits existing objects to be reused and new objects to
be created.
|
static Mode |
CREATE
Mode that demands a new object be created and no existing object
should exist.
|
static Mode |
DEFAULT
Default mode; existing objects are reused, new objects are not created
|
static Mode |
REUSE
Mode that requires that objects should already exist; new objects cannot
be created.
|
Constructor and Description |
---|
Mode(boolean mayCreate,
boolean mayReuse) |
Modifier and Type | Method and Description |
---|---|
boolean |
permitCreateNew(Resource root,
String name)
Answer true if the object
root with the given name
can be created if it does not already exist. |
boolean |
permitUseExisting(Resource root,
String name)
Answer true if the existing object
root with the given
name can be reused. |
public static final Mode CREATE
public static final Mode DEFAULT
public static final Mode REUSE
public static final Mode ANY
Licenced under the Apache License, Version 2.0