Class AccJsonBase

java.lang.Object
org.aksw.jenax.io.json.accumulator.AccJsonBase
All Implemented Interfaces:
AccJson
Direct Known Subclasses:
AccJsonFragmentHead, AccJsonLiteral, AccJsonObjectLikeBase, AccJsonProperty

public abstract class AccJsonBase extends Object implements AccJson
  • Field Details

    • parent

      protected AccJson parent
    • value

      protected RdfElement value
      The materialized value - requires materialization to be enabled in the context
    • oldSourceNode

      protected org.apache.jena.graph.Node oldSourceNode
    • hasBegun

      protected boolean hasBegun
    • currentSourceNode

      protected org.apache.jena.graph.Node currentSourceNode
    • skipOutput

      protected boolean skipOutput
  • Constructor Details

    • AccJsonBase

      public AccJsonBase()
  • Method Details

    • ensureBegun

      public void ensureBegun()
    • setParent

      public void setParent(AccJson parent)
      Description copied from interface: AccJson
      Sets the parent of this accumulator. Can only be called once. This method should never be called by application code.
      Specified by:
      setParent in interface AccJson
    • getParent

      public AccJson getParent()
      Description copied from interface: AccJson
      Get the parent of this accumulator. Null if there is none.
      Specified by:
      getParent in interface AccJson
    • getValue

      public RdfElement getValue()
      Description copied from interface: AccJson
      If cxt.isMaterialize is enabled then this method returns the json data assembled for the current node. It is only valid to call this method after end().
      Specified by:
      getValue in interface AccJson
    • getInternalValue

      public RdfElement getInternalValue()
      Description copied from interface: AccJson
      Internal method, mainly for processing fragments. Unchecked access to the current value under construction. Should hardly be used.
      Specified by:
      getInternalValue in interface AccJson
    • begin

      public void begin(org.apache.jena.graph.Node sourceNode, AccContextRdf cxt, boolean skipOutput) throws IOException
      Description copied from interface: AccJson
      Start accumulation based on a given node in the underlying graph. Calls cannot be nested.
      Specified by:
      begin in interface AccJson
      Parameters:
      sourceNode - The source node to which the next incoming edge(s) will connect to
      cxt - The context which holds the JSON serializers
      skipOutput - When output should be disabled (used e.g. to skip over lists of items where just one was expected)
      Throws:
      IOException
    • end

      public void end(AccContextRdf cxt) throws IOException
      Description copied from interface: AccJson
      End the accumulator's current node
      Specified by:
      end in interface AccJson
      Throws:
      IOException
    • hasBegun

      public boolean hasBegun()
      Description copied from interface: AccJson
      True after begin() and before end()
      Specified by:
      hasBegun in interface AccJson