public abstract class AbstractBlueprintsHandler extends AbstractPersistenceHandler<BlueprintsPersistenceBackend>
PersistenceHandler specific to a Blueprints implementation.| Modifier and Type | Field and Description |
|---|---|
protected com.github.benmanes.caffeine.cache.Cache<Id,Vertex> |
verticesCache
|
DEFAULT_CACHE_SIZE| Constructor and Description |
|---|
AbstractBlueprintsHandler(BlueprintsPersistenceBackend backend)
Constructs a new
AbstractBlueprintsHandler on the given backend. |
| Modifier and Type | Method and Description |
|---|---|
protected void |
addAttribute(Id id,
String name,
int index,
boolean many,
Object value)
Adds a new attribute to the element identified by the given
id. |
protected void |
addElement(Id id,
String nsUri,
String name,
boolean root)
Adds a new element.
|
protected void |
addReference(Id id,
String name,
int index,
boolean many,
boolean containment,
Id idReference)
Adds a new reference to the element identified by the given
id. |
protected abstract Vertex |
createVertex(Id id)
Creates a
Vertex identified by the specified id. |
protected Id |
getId(String reference)
Returns the
Id of the given reference. |
protected abstract Vertex |
getVertex(Id id)
Returns the
Vertex which has the specified id. |
void |
processStartDocument()
Process the start of a document.
|
protected void |
setMetaClass(Id id,
Id metaClassId)
Defines the metaclass to the element identified by the given
id. |
createElement, getOrCreateMetaClass, getPersistenceBackend, processAttribute, processCharacters, processEndDocument, processEndElement, processReference, processStartElementpublic AbstractBlueprintsHandler(BlueprintsPersistenceBackend backend)
AbstractBlueprintsHandler on the given backend.backend - the back-end where to store dataprotected Id getId(String reference)
AbstractPersistenceHandlerId of the given reference.getId in class AbstractPersistenceHandler<BlueprintsPersistenceBackend>reference - the referenceIdprotected void addElement(Id id, String nsUri, String name, boolean root)
AbstractPersistenceHandleraddElement in class AbstractPersistenceHandler<BlueprintsPersistenceBackend>id - the identifier of the new elementnsUri - the URI of the new elementname - the name of the new elementroot - true if the new element is a root nodeprotected void addAttribute(Id id, String name, int index, boolean many, Object value)
AbstractPersistenceHandlerid.addAttribute in class AbstractPersistenceHandler<BlueprintsPersistenceBackend>id - the identifier of the elementname - the name of the attributeindex - the index of the attribute if it's a multi-valued attributemany - true if the attribute is multi-valuedvalue - the value of the attributeprotected void addReference(Id id, String name, int index, boolean many, boolean containment, Id idReference)
AbstractPersistenceHandlerid.addReference in class AbstractPersistenceHandler<BlueprintsPersistenceBackend>id - the identifier of the elementname - the name of the referenceindex - the index of the reference if it's a multi-valued referencemany - true if the reference is multi-valuedcontainment - true if the reference is a containmentidReference - the identifier of the referenced elementprotected void setMetaClass(Id id, Id metaClassId)
AbstractPersistenceHandlerid.setMetaClass in class AbstractPersistenceHandler<BlueprintsPersistenceBackend>id - the identifier of the elementmetaClassId - the identifier of the metaclasspublic void processStartDocument()
InputHandlerprocessStartDocument in interface InputHandlerprocessStartDocument in class AbstractPersistenceHandler<BlueprintsPersistenceBackend>InputNotifier.notifyStartDocument()protected abstract Vertex getVertex(Id id)
Vertex which has the specified id.id - the identifier of the vertexVertexNoSuchElementException - if no element is found with the idprotected abstract Vertex createVertex(Id id)
Vertex identified by the specified id.id - the identifier of the vertexVertexAlreadyExistingIdException - if the id is already used as primary key for another elementCopyright © 2013–2017 Atlanmod INRIA LINA Mines Nantes. All rights reserved.