Class PendingReferenceRegistry
java.lang.Object
cz.cvut.kbss.jsonld.deserialization.reference.PendingReferenceRegistry
Registry of pending references.
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidaddPendingReference(String identifier, Object targetObject, Field targetField) Registers a pending reference with the specified identifier.voidaddPendingReference(String identifier, Collection targetObject) Registers a pending reference with the specified identifier.voidresolveReferences(String identifier, Object referencedObject) Resolves the pending references by replacing them with the specified full object.voidChecks whether any pending unresolved references are left.
-
Constructor Details
-
PendingReferenceRegistry
public PendingReferenceRegistry()
-
-
Method Details
-
addPendingReference
Registers a pending reference with the specified identifier.- Parameters:
identifier- Reference identifiertargetObject- Object which contains the referring attributetargetField- Field representing the target attribute
-
addPendingReference
Registers a pending reference with the specified identifier.- Parameters:
identifier- Reference identifiertargetObject- Collection referencing the object
-
resolveReferences
Resolves the pending references by replacing them with the specified full object.This method goes through the pending references and sets the specified
referencedObjecton the corresponding target objects.- Parameters:
identifier- Identifier of the referenced objectreferencedObject- The referenced object- Throws:
TargetTypeException- If thereferencedObjectcannot be assigned to a target field due to type mismatch
-
verifyNoUnresolvedReferencesExist
public void verifyNoUnresolvedReferencesExist()Checks whether any pending unresolved references are left.- Throws:
UnresolvedReferenceException- Thrown when pending references exist
-