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 Summary
Modifier and TypeMethodDescriptionGets the BigDecimal value of the node.Gets the boolean value of the node.byte[]Gets the byte array value of the node.Gets the byte value of the node.getChildNode(String identifier) Gets a new parse node for the given identifier.getCollectionOfEnumValues(ValuedEnumParser<T> enumParser) Gets the collection of Enum values of the node.getCollectionOfObjectValues(ParsableFactory<T> factory) Gets the collection of object values of the node.<T> List<T> getCollectionOfPrimitiveValues(Class<T> targetClass) Gets the collection of primitive values of the node.Gets the Double value of the node.getEnumSetValue(ValuedEnumParser<T> enumParser) Gets the EnumSet value of the node.<T extends Enum<T>>
TgetEnumValue(ValuedEnumParser<T> enumParser) Gets the Enum value of the node.Gets the Float value of the node.Gets the Integer value of the node.Gets the LocalDate value of the node.Gets the LocalTime value of the node.Gets the Long value of the node.<T extends Parsable>
TgetObjectValue(ParsableFactory<T> factory) Gets the model object value of the node.Gets the OffsetDateTime value of the node.Gets the callback called after the node is deserialized.Gets the callback called before the node is deserialized.Gets the Period value of the node.Gets the short value of the node.Gets the string value of the node.Gets the UUID value of the node.voidSets the callback called after the node is deserialized.voidSets the callback called before the node is deserialized.
-
Method Details
-
getChildNode
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
Gets the string value of the node.- Returns:
- the string value of the node.
-
getBooleanValue
Gets the boolean value of the node.- Returns:
- the boolean value of the node.
-
getByteValue
Gets the byte value of the node.- Returns:
- the byte value of the node.
-
getShortValue
Gets the short value of the node.- Returns:
- the short value of the node.
-
getBigDecimalValue
Gets the BigDecimal value of the node.- Returns:
- the BigDecimal value of the node.
-
getIntegerValue
Gets the Integer value of the node.- Returns:
- the Integer value of the node.
-
getFloatValue
Gets the Float value of the node.- Returns:
- the Float value of the node.
-
getDoubleValue
Gets the Double value of the node.- Returns:
- the Double value of the node.
-
getLongValue
Gets the Long value of the node.- Returns:
- the Long value of the node.
-
getUUIDValue
Gets the UUID value of the node.- Returns:
- the UUID value of the node.
-
getOffsetDateTimeValue
Gets the OffsetDateTime value of the node.- Returns:
- the OffsetDateTime value of the node.
-
getLocalDateValue
Gets the LocalDate value of the node.- Returns:
- the LocalDate value of the node.
-
getLocalTimeValue
Gets the LocalTime value of the node.- Returns:
- the LocalTime value of the node.
-
getPeriodAndDurationValue
Gets the Period value of the node.- Returns:
- the Period value of the node.
-
getEnumValue
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
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
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
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
Gets the callback called before the node is deserialized.- Returns:
- the callback called before the node is deserialized.
-
getOnAfterAssignFieldValues
Gets the callback called after the node is deserialized.- Returns:
- the callback called after the node is deserialized.
-
setOnBeforeAssignFieldValues
Sets the callback called before the node is deserialized.- Parameters:
value- the callback called before the node is deserialized.
-
setOnAfterAssignFieldValues
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.
-