Interface ParseNode


public interface ParseNode
Interface for a deserialization node in a parse tree. This interface provides an abstraction layer over serialization formats, libraries and implementations.
  • Method Details

    • getChildNode

      @Nullable ParseNode getChildNode(@Nonnull String identifier)
      Gets a new parse node for the given identifier.
      Parameters:
      identifier - the identifier of the current node property.
      Returns:
      a new parse node for the given identifier.
    • getStringValue

      @Nullable String getStringValue()
      Gets the string value of the node.
      Returns:
      the string value of the node.
    • getBooleanValue

      @Nullable Boolean getBooleanValue()
      Gets the boolean value of the node.
      Returns:
      the boolean value of the node.
    • getByteValue

      @Nullable Byte getByteValue()
      Gets the byte value of the node.
      Returns:
      the byte value of the node.
    • getShortValue

      @Nullable Short getShortValue()
      Gets the short value of the node.
      Returns:
      the short value of the node.
    • getBigDecimalValue

      @Nullable BigDecimal getBigDecimalValue()
      Gets the BigDecimal value of the node.
      Returns:
      the BigDecimal value of the node.
    • getIntegerValue

      @Nullable Integer getIntegerValue()
      Gets the Integer value of the node.
      Returns:
      the Integer value of the node.
    • getFloatValue

      @Nullable Float getFloatValue()
      Gets the Float value of the node.
      Returns:
      the Float value of the node.
    • getDoubleValue

      @Nullable Double getDoubleValue()
      Gets the Double value of the node.
      Returns:
      the Double value of the node.
    • getLongValue

      @Nullable Long getLongValue()
      Gets the Long value of the node.
      Returns:
      the Long value of the node.
    • getUUIDValue

      @Nullable UUID getUUIDValue()
      Gets the UUID value of the node.
      Returns:
      the UUID value of the node.
    • getOffsetDateTimeValue

      @Nullable OffsetDateTime getOffsetDateTimeValue()
      Gets the OffsetDateTime value of the node.
      Returns:
      the OffsetDateTime value of the node.
    • getLocalDateValue

      @Nullable LocalDate getLocalDateValue()
      Gets the LocalDate value of the node.
      Returns:
      the LocalDate value of the node.
    • getLocalTimeValue

      @Nullable LocalTime getLocalTimeValue()
      Gets the LocalTime value of the node.
      Returns:
      the LocalTime value of the node.
    • getPeriodAndDurationValue

      @Nullable PeriodAndDuration getPeriodAndDurationValue()
      Gets the Period value of the node.
      Returns:
      the Period value of the node.
    • getEnumValue

      @Nullable <T extends Enum<T>> T getEnumValue(@Nonnull ValuedEnumParser<T> enumParser)
      Gets the Enum value of the node.
      Type Parameters:
      T - the type of the enum.
      Parameters:
      enumParser - the parser for Enums
      Returns:
      the Enum value of the node.
    • getEnumSetValue

      @Nullable <T extends Enum<T>> EnumSet<T> getEnumSetValue(@Nonnull ValuedEnumParser<T> enumParser)
      Gets the EnumSet value of the node.
      Type Parameters:
      T - the type of the enum.
      Parameters:
      enumParser - the parser for Enums
      Returns:
      the EnumSet value of the node.
    • getCollectionOfPrimitiveValues

      @Nullable <T> List<T> getCollectionOfPrimitiveValues(@Nonnull Class<T> targetClass)
      Gets the collection of primitive values of the node.
      Type Parameters:
      T - the type of the primitive.
      Parameters:
      targetClass - the class of the class.
      Returns:
      the collection of primitive values of the node.
    • getCollectionOfObjectValues

      @Nullable <T extends Parsable> List<T> getCollectionOfObjectValues(@Nonnull ParsableFactory<T> factory)
      Gets the collection of object values of the node.
      Type Parameters:
      T - the type of the model object.
      Parameters:
      factory - the factory to use to create the model object.
      Returns:
      the collection of object values of the node.
    • getCollectionOfEnumValues

      @Nullable <T extends Enum<T>> List<T> getCollectionOfEnumValues(@Nonnull ValuedEnumParser<T> enumParser)
      Gets the collection of Enum values of the node.
      Type Parameters:
      T - the type of the enum.
      Parameters:
      enumParser - the parser for Enums
      Returns:
      the collection of Enum values of the node.
    • getObjectValue

      @Nonnull <T extends Parsable> T getObjectValue(@Nonnull ParsableFactory<T> factory)
      Gets the model object value of the node.
      Type Parameters:
      T - the type of the model object.
      Parameters:
      factory - the factory to use to create the model object.
      Returns:
      the model object value of the node.
    • getOnBeforeAssignFieldValues

      @Nullable Consumer<Parsable> getOnBeforeAssignFieldValues()
      Gets the callback called before the node is deserialized.
      Returns:
      the callback called before the node is deserialized.
    • getOnAfterAssignFieldValues

      @Nullable Consumer<Parsable> getOnAfterAssignFieldValues()
      Gets the callback called after the node is deserialized.
      Returns:
      the callback called after the node is deserialized.
    • setOnBeforeAssignFieldValues

      void setOnBeforeAssignFieldValues(@Nullable Consumer<Parsable> value)
      Sets the callback called before the node is deserialized.
      Parameters:
      value - the callback called before the node is deserialized.
    • setOnAfterAssignFieldValues

      void setOnAfterAssignFieldValues(@Nullable Consumer<Parsable> value)
      Sets the callback called after the node is deserialized.
      Parameters:
      value - the callback called after the node is deserialized.
    • getByteArrayValue

      @Nullable byte[] getByteArrayValue()
      Gets the byte array value of the node.
      Returns:
      The byte array value of the node.