Class PendingReferenceRegistry
java.lang.Object
cz.cvut.kbss.jsonld.deserialization.reference.PendingReferenceRegistry
Registry of pending references.
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoid
addPendingReference
(String identifier, Object targetObject, Field targetField) Registers a pending reference with the specified identifier.void
addPendingReference
(String identifier, Collection targetObject) Registers a pending reference with the specified identifier.void
resolveReferences
(String identifier, Object referencedObject) Resolves the pending references by replacing them with the specified full object.void
Checks 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
referencedObject
on the corresponding target objects.- Parameters:
identifier
- Identifier of the referenced objectreferencedObject
- The referenced object- Throws:
TargetTypeException
- If thereferencedObject
cannot 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
-