Class DefaultItemWriter

java.lang.Object
dev.metaschema.core.metapath.item.DefaultItemWriter
All Implemented Interfaces:
IItemWriter, AutoCloseable

public class DefaultItemWriter extends Object implements IItemWriter
Produces a textual representation of a Metapath sequence.
  • Constructor Details

    • DefaultItemWriter

      public DefaultItemWriter(@NonNull PrintWriter writer)
      Construct a new item writer.

      This instance takes ownership of the provided writer and is responsible for managing its lifecycle.

      Parameters:
      writer - the writer to append text to. Ownership is transferred to this instance.
  • Method Details

    • writeSequence

      public void writeSequence(ISequence<?> sequence)
      Description copied from interface: IItemWriter
      Write the provided sequence instance.
      Specified by:
      writeSequence in interface IItemWriter
      Parameters:
      sequence - the instance to write
    • writeArray

      public void writeArray(IArrayItem<?> array)
      Description copied from interface: IItemWriter
      Write the provided array item instance.
      Specified by:
      writeArray in interface IItemWriter
      Parameters:
      array - the instance to write
    • writeMap

      public void writeMap(IMapItem<?> map)
      Description copied from interface: IItemWriter
      Write the provided map item instance.
      Specified by:
      writeMap in interface IItemWriter
      Parameters:
      map - the instance to write
    • writeNode

      public void writeNode(INodeItem node)
      Description copied from interface: IItemWriter
      Write the provided node item instance.
      Specified by:
      writeNode in interface IItemWriter
      Parameters:
      node - the instance to write
    • writeAtomicValue

      public void writeAtomicValue(IAnyAtomicItem node)
      Description copied from interface: IItemWriter
      Write the provided atomic item instance.
      Specified by:
      writeAtomicValue in interface IItemWriter
      Parameters:
      node - the instance to write
    • writeFunction

      public void writeFunction(IFunction function)
      Description copied from interface: IItemWriter
      Write the provided function item instance.
      Specified by:
      writeFunction in interface IItemWriter
      Parameters:
      function - the instance to write
    • writeCollectionValue

      protected void writeCollectionValue(@NonNull ICollectionValue value)
      Write the provided collection value.
      Parameters:
      value - the value to write
    • close

      public void close()
      Specified by:
      close in interface AutoCloseable