Class RequiredPropertiesValidator

java.lang.Object
cool.klass.deserializer.json.RequiredPropertiesValidator
Direct Known Subclasses:
OutsideProjectionRequiredPropertiesValidator

public class RequiredPropertiesValidator extends Object
  • Field Details

    • klass

      @Nonnull protected final Klass klass
    • objectNode

      @Nonnull protected final com.fasterxml.jackson.databind.node.ObjectNode objectNode
    • operationMode

      @Nonnull protected final OperationMode operationMode
    • errors

      @Nonnull protected final org.eclipse.collections.api.list.MutableList<String> errors
    • warnings

      @Nonnull protected final org.eclipse.collections.api.list.MutableList<String> warnings
    • contextStack

      @Nonnull protected final org.eclipse.collections.api.stack.MutableStack<String> contextStack
    • pathHere

      @Nonnull protected final Optional<AssociationEnd> pathHere
    • isRoot

      protected final boolean isRoot
    • isInProjection

      protected final boolean isInProjection
  • Constructor Details

    • RequiredPropertiesValidator

      public RequiredPropertiesValidator(@Nonnull Klass klass, @Nonnull com.fasterxml.jackson.databind.node.ObjectNode objectNode, @Nonnull OperationMode operationMode, @Nonnull org.eclipse.collections.api.list.MutableList<String> errors, @Nonnull org.eclipse.collections.api.list.MutableList<String> warnings, @Nonnull org.eclipse.collections.api.stack.MutableStack<String> contextStack, @Nonnull Optional<AssociationEnd> pathHere, boolean isRoot, boolean isInProjection)
  • Method Details

    • validate

      public static void validate(@Nonnull Klass klass, @Nonnull com.fasterxml.jackson.databind.node.ObjectNode objectNode, @Nonnull OperationMode operationMode, @Nonnull org.eclipse.collections.api.list.MutableList<String> errors, @Nonnull org.eclipse.collections.api.list.MutableList<String> warnings)
    • validate

      public void validate()
    • handleDataTypeProperties

      protected void handleDataTypeProperties()
    • handleDataTypeProperty

      protected void handleDataTypeProperty(@Nonnull DataTypeProperty dataTypeProperty)
    • handleIdProperty

      protected void handleIdProperty(@Nonnull DataTypeProperty dataTypeProperty)
    • handleKeyProperty

      protected void handleKeyProperty(@Nonnull DataTypeProperty dataTypeProperty)
    • isForeignKeyMatchingRequiredNested

      protected boolean isForeignKeyMatchingRequiredNested(DataTypeProperty dataTypeProperty)
    • isToOneRequired

      protected boolean isToOneRequired(AssociationEnd associationEnd)
    • isForeignKeyMatchingKeyOnPath

      protected boolean isForeignKeyMatchingKeyOnPath(DataTypeProperty dataTypeProperty)
    • handleErrorIfPresent

      protected void handleErrorIfPresent(@Nonnull DataTypeProperty dataTypeProperty, String propertyKind)
    • handleWarnIfPresent

      protected void handleWarnIfPresent(@Nonnull DataTypeProperty dataTypeProperty, String propertyKind)
    • handleAnnotationIfPresent

      protected void handleAnnotationIfPresent(@Nonnull DataTypeProperty property, String propertyKind, org.eclipse.collections.api.list.MutableList<String> annotations, String severityString)
    • handleAnnotationIfPresent

      protected void handleAnnotationIfPresent(@Nonnull AssociationEnd property, String propertyKind)
    • handlePlainProperty

      protected void handlePlainProperty(@Nonnull DataTypeProperty property)
    • handleAssociationEnds

      protected void handleAssociationEnds()
    • handleAssociationEnd

      protected void handleAssociationEnd(AssociationEnd associationEnd)
    • handleToOne

      public void handleToOne(@Nonnull AssociationEnd associationEnd, com.fasterxml.jackson.databind.JsonNode jsonNode)
    • handleToMany

      public void handleToMany(@Nonnull AssociationEnd associationEnd, com.fasterxml.jackson.databind.JsonNode jsonNode)
    • handleAssociationEndOutsideProjection

      protected void handleAssociationEndOutsideProjection(AssociationEnd associationEnd)
    • handleToOneOutsideProjection

      protected void handleToOneOutsideProjection(@Nonnull AssociationEnd associationEnd, @Nonnull com.fasterxml.jackson.databind.JsonNode jsonNode)
    • handleToManyOutsideProjection

      protected void handleToManyOutsideProjection(@Nonnull AssociationEnd associationEnd, @Nonnull com.fasterxml.jackson.databind.JsonNode jsonNode)
    • handleErrorIfAbsent

      protected void handleErrorIfAbsent(@Nonnull AssociationEnd associationEnd, String propertyKind)
    • handleOwnedAssociationEnd

      protected void handleOwnedAssociationEnd(@Nonnull AssociationEnd associationEnd, @Nonnull com.fasterxml.jackson.databind.node.ObjectNode objectNode)
    • handleOwnedAssociationEnd

      protected void handleOwnedAssociationEnd(@Nonnull AssociationEnd associationEnd)
    • handleVersionAssociationEnd

      protected void handleVersionAssociationEnd(@Nonnull AssociationEnd associationEnd)
    • handleAuditAssociationEnd

      protected void handleAuditAssociationEnd(@Nonnull AssociationEnd associationEnd)
    • handlePlainAssociationEnd

      protected void handlePlainAssociationEnd(@Nonnull AssociationEnd associationEnd, @Nonnull com.fasterxml.jackson.databind.node.ObjectNode objectNode, @Nonnull OperationMode nextMode)
    • getNextMode

      @Nonnull protected OperationMode getNextMode(OperationMode operationMode, @Nonnull AssociationEnd associationEnd)
    • getContextString

      protected String getContextString()
    • getKeysFromJsonNode

      protected org.eclipse.collections.api.list.ImmutableList<Object> getKeysFromJsonNode(@Nonnull com.fasterxml.jackson.databind.JsonNode jsonNode, @Nonnull AssociationEnd associationEnd, @Nonnull com.fasterxml.jackson.databind.JsonNode parentJsonNode)
    • getKeyFromJsonNode

      protected Object getKeyFromJsonNode(@Nonnull DataTypeProperty keyProperty, @Nonnull com.fasterxml.jackson.databind.JsonNode jsonNode, @Nonnull AssociationEnd associationEnd, @Nonnull com.fasterxml.jackson.databind.JsonNode parentJsonNode)
    • isBackward

      protected boolean isBackward(@Nonnull AssociationEnd associationEnd)