Package cool.klass.deserializer.json
Class RequiredPropertiesValidator
java.lang.Object
cool.klass.deserializer.json.RequiredPropertiesValidator
- Direct Known Subclasses:
OutsideProjectionRequiredPropertiesValidator
-
Field Summary
FieldsModifier and TypeFieldDescriptionprotected final org.eclipse.collections.api.stack.MutableStack<String>protected final org.eclipse.collections.api.list.MutableList<String>protected final booleanprotected final booleanprotected final Klassprotected final com.fasterxml.jackson.databind.node.ObjectNodeprotected final OperationModeprotected final Optional<AssociationEnd>protected final org.eclipse.collections.api.list.MutableList<String> -
Constructor Summary
ConstructorsConstructorDescriptionRequiredPropertiesValidator(Klass klass, com.fasterxml.jackson.databind.node.ObjectNode objectNode, OperationMode operationMode, org.eclipse.collections.api.list.MutableList<String> errors, org.eclipse.collections.api.list.MutableList<String> warnings, org.eclipse.collections.api.stack.MutableStack<String> contextStack, Optional<AssociationEnd> pathHere, boolean isRoot, boolean isInProjection) -
Method Summary
Modifier and TypeMethodDescriptionprotected Stringprotected ObjectgetKeyFromJsonNode(DataTypeProperty keyProperty, com.fasterxml.jackson.databind.JsonNode jsonNode, AssociationEnd associationEnd, com.fasterxml.jackson.databind.JsonNode parentJsonNode) protected org.eclipse.collections.api.list.ImmutableList<Object>getKeysFromJsonNode(com.fasterxml.jackson.databind.JsonNode jsonNode, AssociationEnd associationEnd, com.fasterxml.jackson.databind.JsonNode parentJsonNode) protected OperationModegetNextMode(OperationMode operationMode, AssociationEnd associationEnd) protected voidhandleAnnotationIfPresent(AssociationEnd property, String propertyKind) protected voidhandleAnnotationIfPresent(DataTypeProperty property, String propertyKind, org.eclipse.collections.api.list.MutableList<String> annotations, String severityString) protected voidhandleAssociationEnd(AssociationEnd associationEnd) protected voidhandleAssociationEndOutsideProjection(AssociationEnd associationEnd) protected voidprotected voidhandleAuditAssociationEnd(AssociationEnd associationEnd) protected voidprotected voidhandleDataTypeProperty(DataTypeProperty dataTypeProperty) protected voidhandleErrorIfAbsent(AssociationEnd associationEnd, String propertyKind) protected voidhandleErrorIfPresent(DataTypeProperty dataTypeProperty, String propertyKind) protected voidhandleIdProperty(DataTypeProperty dataTypeProperty) protected voidhandleKeyProperty(DataTypeProperty dataTypeProperty) protected voidhandleOwnedAssociationEnd(AssociationEnd associationEnd) protected voidhandleOwnedAssociationEnd(AssociationEnd associationEnd, com.fasterxml.jackson.databind.node.ObjectNode objectNode) protected voidhandlePlainAssociationEnd(AssociationEnd associationEnd, com.fasterxml.jackson.databind.node.ObjectNode objectNode, OperationMode nextMode) protected voidhandlePlainProperty(DataTypeProperty property) voidhandleToMany(AssociationEnd associationEnd, com.fasterxml.jackson.databind.JsonNode jsonNode) protected voidhandleToManyOutsideProjection(AssociationEnd associationEnd, com.fasterxml.jackson.databind.JsonNode jsonNode) voidhandleToOne(AssociationEnd associationEnd, com.fasterxml.jackson.databind.JsonNode jsonNode) protected voidhandleToOneOutsideProjection(AssociationEnd associationEnd, com.fasterxml.jackson.databind.JsonNode jsonNode) protected voidhandleVersionAssociationEnd(AssociationEnd associationEnd) protected voidhandleWarnIfPresent(DataTypeProperty dataTypeProperty, String propertyKind) protected booleanisBackward(AssociationEnd associationEnd) protected booleanisForeignKeyMatchingKeyOnPath(DataTypeProperty dataTypeProperty) protected booleanisForeignKeyMatchingRequiredNested(DataTypeProperty dataTypeProperty) protected booleanisToOneRequired(AssociationEnd associationEnd) voidvalidate()static voidvalidate(Klass klass, com.fasterxml.jackson.databind.node.ObjectNode objectNode, OperationMode operationMode, org.eclipse.collections.api.list.MutableList<String> errors, org.eclipse.collections.api.list.MutableList<String> warnings)
-
Field Details
-
klass
-
objectNode
@Nonnull protected final com.fasterxml.jackson.databind.node.ObjectNode objectNode -
operationMode
-
errors
-
warnings
-
contextStack
-
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
-
handleIdProperty
-
handleKeyProperty
-
isForeignKeyMatchingRequiredNested
-
isToOneRequired
-
isForeignKeyMatchingKeyOnPath
-
handleErrorIfPresent
protected void handleErrorIfPresent(@Nonnull DataTypeProperty dataTypeProperty, String propertyKind) -
handleWarnIfPresent
-
handleAnnotationIfPresent
protected void handleAnnotationIfPresent(@Nonnull DataTypeProperty property, String propertyKind, org.eclipse.collections.api.list.MutableList<String> annotations, String severityString) -
handleAnnotationIfPresent
-
handlePlainProperty
-
handleAssociationEnds
protected void handleAssociationEnds() -
handleAssociationEnd
-
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
-
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
-
handleOwnedAssociationEnd
protected void handleOwnedAssociationEnd(@Nonnull AssociationEnd associationEnd, @Nonnull com.fasterxml.jackson.databind.node.ObjectNode objectNode) -
handleOwnedAssociationEnd
-
handleVersionAssociationEnd
-
handleAuditAssociationEnd
-
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
-
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
-