Interface InstanceVisitor
- All Known Implementing Classes:
JsonLdTreeBuilder
public interface InstanceVisitor
-
Method Summary
Modifier and TypeMethodDescriptionvoidcloseCollection(SerializationContext<?> ctx) Called after the last collection item is processed.voidcloseObject(SerializationContext<?> ctx) Called when the graph traverser is done with traversing the current instance.voidopenCollection(SerializationContext<? extends Collection<?>> ctx) Called when a collection is encountered by the object traverser.voidopenObject(SerializationContext<?> ctx) Called when a new instance is discovered by the object graph traverser.voidvisitAttribute(SerializationContext<?> ctx) Called when an attribute is processed by the object graph traverser.voidCalled when the identifier of an instance (JSON-LD@idattribute) is encountered.voidvisitIndividual(SerializationContext<?> ctx) Visits an object that represents an individual, without any additional attributes.booleanvisitObject(SerializationContext<?> ctx) Visits the instance represented by the specified context.voidvisitTypes(SerializationContext<Set<String>> ctx) Called when the types of an instance (JSON-LD@typeattribute) are serialized.
-
Method Details
-
visitIndividual
Visits an object that represents an individual, without any additional attributes. This can be an identifier-based attribute value (e.g., URI), or an enum constant mapped to an individual.- Parameters:
ctx- Current serialization context
-
visitObject
Visits the instance represented by the specified context.Called before a new instance is open by the object graph traverser.
- Parameters:
ctx- Current serialization context- Returns:
- Whether the object should be processed or not
- See Also:
-
openObject
Called when a new instance is discovered by the object graph traverser.The instance attributes will be processed immediately after this method returns.
- Parameters:
ctx- Current serialization context
-
closeObject
Called when the graph traverser is done with traversing the current instance.- Parameters:
ctx- Current serialization context- See Also:
-
visitAttribute
Called when an attribute is processed by the object graph traverser.Note that identifiers (
Id) and types (Types) are processed separately and are not visited as attributes. Also, when processingProperties, this method is invoked for each property in the map.- Parameters:
ctx- Current serialization context
-
visitIdentifier
Called when the identifier of an instance (JSON-LD@idattribute) is encountered.This may be invoked out of order, at the beginning of processing an object.
- Parameters:
ctx- Current serialization context
-
visitTypes
Called when the types of an instance (JSON-LD@typeattribute) are serialized.- Parameters:
ctx- Current serialization context
-
openCollection
Called when a collection is encountered by the object traverser.This can be either when a top-level collection is discovered, or when an object's attribute is a collection.
- Parameters:
ctx- Current serialization context
-
closeCollection
Called after the last collection item is processed.- Parameters:
ctx- Current serialization context- See Also:
-