Interface InstanceVisitor

All Known Implementing Classes:
JsonLdTreeBuilder

public interface InstanceVisitor
  • Method Details

    • visitIndividual

      void visitIndividual(SerializationContext<?> ctx)
      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

      boolean visitObject(SerializationContext<?> ctx)
      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

      void openObject(SerializationContext<?> ctx)
      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

      void closeObject(SerializationContext<?> ctx)
      Called when the graph traverser is done with traversing the current instance.
      Parameters:
      ctx - Current serialization context
      See Also:
    • visitAttribute

      void visitAttribute(SerializationContext<?> ctx)
      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 processing Properties, this method is invoked for each property in the map.

      Parameters:
      ctx - Current serialization context
    • visitIdentifier

      void visitIdentifier(SerializationContext<String> ctx)
      Called when the identifier of an instance (JSON-LD @id attribute) is encountered.

      This may be invoked out of order, at the beginning of processing an object.

      Parameters:
      ctx - Current serialization context
    • visitTypes

      void visitTypes(SerializationContext<Set<String>> ctx)
      Called when the types of an instance (JSON-LD @type attribute) are serialized.
      Parameters:
      ctx - Current serialization context
    • openCollection

      void openCollection(SerializationContext<? extends Collection<?>> ctx)
      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

      void closeCollection(SerializationContext<?> ctx)
      Called after the last collection item is processed.
      Parameters:
      ctx - Current serialization context
      See Also: