test_class.declarator: validator
test_class.modifier: private
test_class.original_string: private NodeTypeValidator validator;
test_class.type: NodeTypeValidator
test_class.var_name: validator
test_class.declarator: filter
test_class.modifier: private
test_class.original_string: private DefaultWorkspaceFilter filter;
test_class.type: DefaultWorkspaceFilter
test_class.var_name: filter
test_class.file: vault-validation/src/test/java/org/apache/jackrabbit/vault/validation/spi/impl/nodetype/NodeTypeValidatorTest.java
test_class.identifier: NodeTypeValidatorTest
test_case.body: @Test
      @Ignore
      public void testValidateComplexUnstructuredNodeTypes() throws IOException, RepositoryException, ParseException, ConfigurationException {
          NodeContext nodeContext = new NodeContextImpl("/apps/test/node4", Paths.get("node4"), Paths.get(""));
  
          Map<String, DocViewProperty> props = new HashMap<>();
          DocViewProperty property = new DocViewProperty("{}prop1", new String[] { "value1" }, false, PropertyType.STRING);
          props.put("{}prop1", property);
          props.put(NameConstants.JCR_PRIMARYTYPE.toString(), new DocViewProperty(NameConstants.JCR_PRIMARYTYPE.toString(),
                  new String[] { "nt:unstructured" }, false, PropertyType.STRING));
  
          // no primary type
          DocViewNode node = new DocViewNode("jcr:root", "jcr:root", null, props, null, "sling:Folder");
          Assert.assertNull(validator.validate(node, nodeContext, false));
  
          props.put(NameConstants.JCR_PRIMARYTYPE.toString(),
                  new DocViewProperty(NameConstants.JCR_PRIMARYTYPE.toString(), new String[] { "value1" }, false, PropertyType.STRING));
          node = new DocViewNode("test", "test", null, props, null, "nt:folder");
          ValidationExecutorTest.assertViolation(validator.validate(node, nodeContext, false),
                  new ValidationMessage(ValidationMessageSeverity.ERROR,
                          String.format(NodeTypeValidator.MESSAGE_PROPERTY_NOT_ALLOWED, property, "nt:folder",
                                  "No property definition found for name!")));
      }
test_case.class_method_signature: NodeTypeValidatorTest.testValidateComplexUnstructuredNodeTypes()
test_case.full_signature: @Test @Ignore public void testValidateComplexUnstructuredNodeTypes()
test_case.identifier: testValidateComplexUnstructuredNodeTypes
test_case.invocations: get get put put toString toString assertNull validate put toString toString assertViolation validate format
test_case.modifiers: @Test @Ignore public
test_case.parameters: ()
test_case.return: void
test_case.signature: void testValidateComplexUnstructuredNodeTypes()
focal_class.declarator: MESSAGE_MANDATORY_CHILD_NODE_MISSING = "Mandatory child node missing: %s"
focal_class.modifier: static final
focal_class.original_string: static final String MESSAGE_MANDATORY_CHILD_NODE_MISSING = "Mandatory child node missing: %s";
focal_class.type: String
focal_class.var_name: MESSAGE_MANDATORY_CHILD_NODE_MISSING
focal_class.declarator: MESSAGE_PROPERTY_ERROR = "Error while retrieving property '%s': %s"
focal_class.modifier: static final
focal_class.original_string: static final String MESSAGE_PROPERTY_ERROR = "Error while retrieving property '%s': %s";
focal_class.type: String
focal_class.var_name: MESSAGE_PROPERTY_ERROR
focal_class.declarator: MESSAGE_UNKNOWN_NODE_TYPE_OR_NAMESPACE = "%s. Skip validation of nodes with that type/name"
focal_class.modifier: static final
focal_class.original_string: static final String MESSAGE_UNKNOWN_NODE_TYPE_OR_NAMESPACE = "%s. Skip validation of nodes with that type/name";
focal_class.type: String
focal_class.var_name: MESSAGE_UNKNOWN_NODE_TYPE_OR_NAMESPACE
focal_class.declarator: MESSAGE_MISSING_PRIMARY_TYPE = "Mandatory jcr:primaryType missing on node '%s'"
focal_class.modifier: static final
focal_class.original_string: static final String MESSAGE_MISSING_PRIMARY_TYPE = "Mandatory jcr:primaryType missing on node '%s'";
focal_class.type: String
focal_class.var_name: MESSAGE_MISSING_PRIMARY_TYPE
focal_class.declarator: MESSAGE_PROPERTY_NOT_ALLOWED = "Property '%s' is not allowed in node with types '[%s]': %s"
focal_class.modifier: static final
focal_class.original_string: static final String MESSAGE_PROPERTY_NOT_ALLOWED = "Property '%s' is not allowed in node with types '[%s]': %s";
focal_class.type: String
focal_class.var_name: MESSAGE_PROPERTY_NOT_ALLOWED
focal_class.declarator: MESSAGE_MANDATORY_PROPERTY_MISSING = "Mandatory property '%s' missing in node with types [%s]"
focal_class.modifier: static final
focal_class.original_string: static final String MESSAGE_MANDATORY_PROPERTY_MISSING = "Mandatory property '%s' missing in node with types [%s]";
focal_class.type: String
focal_class.var_name: MESSAGE_MANDATORY_PROPERTY_MISSING
focal_class.declarator: MESSAGE_CHILD_NODE_OF_NOT_CONTAINED_PARENT_POTENTIALLY_NOT_ALLOWED = "Node '%s' is not allowed as child of not contained node with potential default types '[%s]': %s"
focal_class.modifier: static final
focal_class.original_string: static final String MESSAGE_CHILD_NODE_OF_NOT_CONTAINED_PARENT_POTENTIALLY_NOT_ALLOWED = "Node '%s' is not allowed as child of not contained node with potential default types '[%s]': %s";
focal_class.type: String
focal_class.var_name: MESSAGE_CHILD_NODE_OF_NOT_CONTAINED_PARENT_POTENTIALLY_NOT_ALLOWED
focal_class.declarator: MESSAGE_CHILD_NODE_NOT_ALLOWED = "Node '%s' is not allowed as child of node with types '[%s]': %s"
focal_class.modifier: static final
focal_class.original_string: static final String MESSAGE_CHILD_NODE_NOT_ALLOWED = "Node '%s' is not allowed as child of node with types '[%s]': %s";
focal_class.type: String
focal_class.var_name: MESSAGE_CHILD_NODE_NOT_ALLOWED
focal_class.declarator: filter
focal_class.modifier: private final
focal_class.original_string: private final WorkspaceFilter filter;
focal_class.type: WorkspaceFilter
focal_class.var_name: filter
focal_class.declarator: defaultSeverity
focal_class.modifier: private final
focal_class.original_string: private final ValidationMessageSeverity defaultSeverity;
focal_class.type: ValidationMessageSeverity
focal_class.var_name: defaultSeverity
focal_class.declarator: severityForUnknownNodeTypes
focal_class.modifier: private final
focal_class.original_string: private final ValidationMessageSeverity severityForUnknownNodeTypes;
focal_class.type: ValidationMessageSeverity
focal_class.var_name: severityForUnknownNodeTypes
focal_class.declarator: docViewPropertyValueFactory
focal_class.modifier: private final
focal_class.original_string: private final DocViewPropertyValueFactory docViewPropertyValueFactory;
focal_class.type: DocViewPropertyValueFactory
focal_class.var_name: docViewPropertyValueFactory
focal_class.declarator: ntManagerProvider
focal_class.modifier: private final
focal_class.original_string: private final NodeTypeManagerProvider ntManagerProvider;
focal_class.type: NodeTypeManagerProvider
focal_class.var_name: ntManagerProvider
focal_class.declarator: loggedUnknownNodeTypeMessages
focal_class.modifier: private final
focal_class.original_string: private final Set<String> loggedUnknownNodeTypeMessages;
focal_class.type: Set<String>
focal_class.var_name: loggedUnknownNodeTypeMessages
focal_class.declarator: defaultType
focal_class.modifier: private final
focal_class.original_string: private final EffectiveNodeType defaultType;
focal_class.type: EffectiveNodeType
focal_class.var_name: defaultType
focal_class.declarator: userManagement
focal_class.modifier: private final
focal_class.original_string: private final UserManagement userManagement;
focal_class.type: UserManagement
focal_class.var_name: userManagement
focal_class.declarator: aclManagement
focal_class.modifier: private final
focal_class.original_string: private final ACLManagement aclManagement;
focal_class.type: ACLManagement
focal_class.var_name: aclManagement
focal_class.declarator: protectedNodeContext
focal_class.modifier: private
focal_class.original_string: private NodeContext protectedNodeContext;
focal_class.type: NodeContext
focal_class.var_name: protectedNodeContext
focal_class.declarator: nodeTypePerPath
focal_class.modifier: private
focal_class.original_string: private Map<String, NodeNameAndType> nodeTypePerPath;
focal_class.type: Map<String, NodeNameAndType>
focal_class.var_name: nodeTypePerPath
focal_class.declarator: ALLOWED_PROTECTED_PROPERTIES = Arrays.asList(NameConstants.JCR_PRIMARYTYPE,
              NameConstants.JCR_MIXINTYPES)
focal_class.modifier: private static final
focal_class.original_string: private static final Collection<Name> ALLOWED_PROTECTED_PROPERTIES = Arrays.asList(NameConstants.JCR_PRIMARYTYPE,
              NameConstants.JCR_MIXINTYPES);
focal_class.type: Collection<Name>
focal_class.var_name: ALLOWED_PROTECTED_PROPERTIES
focal_class.declarator: IGNORED_MANDATORY_PROPERTIES_PER_NODE_TYPE = Stream.of(
              new SimpleEntry<>(NameConstants.NT_RESOURCE,
                      Arrays.asList(NameConstants.JCR_DATA)))
              .collect(Collectors.toMap(SimpleEntry::getKey, SimpleEntry::getValue))
focal_class.modifier: private static final
focal_class.original_string: private static final Map<Name, List<Name>> IGNORED_MANDATORY_PROPERTIES_PER_NODE_TYPE = Stream.of(
              new SimpleEntry<>(NameConstants.NT_RESOURCE,
                      Arrays.asList(NameConstants.JCR_DATA)))
              .collect(Collectors.toMap(SimpleEntry::getKey, SimpleEntry::getValue));
focal_class.type: Map<Name, List<Name>>
focal_class.var_name: IGNORED_MANDATORY_PROPERTIES_PER_NODE_TYPE
focal_class.file: vault-validation/src/main/java/org/apache/jackrabbit/vault/validation/spi/impl/nodetype/NodeTypeValidator.java
focal_class.identifier: NodeTypeValidator
focal_class.interfaces: implements DocumentViewXmlValidator, JcrPathValidator
focal_class.class_method_signature: NodeTypeValidator.NodeTypeValidator(@NotNull WorkspaceFilter filter, @NotNull NodeTypeManagerProvider ntManagerProvider,
              @NotNull EffectiveNodeType defaultEffectiveNodeType, @NotNull ValidationMessageSeverity defaultSeverity,
              @NotNull ValidationMessageSeverity severityForUnknownNodeTypes)
focal_class.full_signature: public  NodeTypeValidator(@NotNull WorkspaceFilter filter, @NotNull NodeTypeManagerProvider ntManagerProvider,
              @NotNull EffectiveNodeType defaultEffectiveNodeType, @NotNull ValidationMessageSeverity defaultSeverity,
              @NotNull ValidationMessageSeverity severityForUnknownNodeTypes)
focal_class.identifier: NodeTypeValidator
focal_class.modifiers: public
focal_class.parameters: (@NotNull WorkspaceFilter filter, @NotNull NodeTypeManagerProvider ntManagerProvider,
              @NotNull EffectiveNodeType defaultEffectiveNodeType, @NotNull ValidationMessageSeverity defaultSeverity,
              @NotNull ValidationMessageSeverity severityForUnknownNodeTypes)
focal_class.signature:  NodeTypeValidator(@NotNull WorkspaceFilter filter, @NotNull NodeTypeManagerProvider ntManagerProvider,
              @NotNull EffectiveNodeType defaultEffectiveNodeType, @NotNull ValidationMessageSeverity defaultSeverity,
              @NotNull ValidationMessageSeverity severityForUnknownNodeTypes)
focal_class.class_method_signature: NodeTypeValidator.getDocViewNodeLabel(DocViewNode node)
focal_class.full_signature: static String getDocViewNodeLabel(DocViewNode node)
focal_class.identifier: getDocViewNodeLabel
focal_class.modifiers: static
focal_class.parameters: (DocViewNode node)
focal_class.return: String
focal_class.signature: String getDocViewNodeLabel(DocViewNode node)
focal_class.class_method_signature: NodeTypeValidator.validate(@NotNull DocViewNode node, @NotNull NodeContext nodeContext,
              boolean isRoot)
focal_class.full_signature: @Override public @Nullable Collection<ValidationMessage> validate(@NotNull DocViewNode node, @NotNull NodeContext nodeContext,
              boolean isRoot)
focal_class.identifier: validate
focal_class.modifiers: @Override public @Nullable
focal_class.parameters: (@NotNull DocViewNode node, @NotNull NodeContext nodeContext,
              boolean isRoot)
focal_class.return: Collection<ValidationMessage>
focal_class.signature: Collection<ValidationMessage> validate(@NotNull DocViewNode node, @NotNull NodeContext nodeContext,
              boolean isRoot)
focal_class.class_method_signature: NodeTypeValidator.validateEnd(@NotNull DocViewNode node, @NotNull NodeContext nodeContext,
              boolean isRoot)
focal_class.full_signature: @Override public @Nullable Collection<ValidationMessage> validateEnd(@NotNull DocViewNode node, @NotNull NodeContext nodeContext,
              boolean isRoot)
focal_class.identifier: validateEnd
focal_class.modifiers: @Override public @Nullable
focal_class.parameters: (@NotNull DocViewNode node, @NotNull NodeContext nodeContext,
              boolean isRoot)
focal_class.return: Collection<ValidationMessage>
focal_class.signature: Collection<ValidationMessage> validateEnd(@NotNull DocViewNode node, @NotNull NodeContext nodeContext,
              boolean isRoot)
focal_class.class_method_signature: NodeTypeValidator.validateJcrPath(@NotNull NodeContext nodeContext, boolean isFolder)
focal_class.full_signature: @Override public @Nullable Collection<ValidationMessage> validateJcrPath(@NotNull NodeContext nodeContext, boolean isFolder)
focal_class.identifier: validateJcrPath
focal_class.modifiers: @Override public @Nullable
focal_class.parameters: (@NotNull NodeContext nodeContext, boolean isFolder)
focal_class.return: Collection<ValidationMessage>
focal_class.signature: Collection<ValidationMessage> validateJcrPath(@NotNull NodeContext nodeContext, boolean isFolder)
focal_class.class_method_signature: NodeTypeValidator.effectiveNodeTypeToString(NameResolver nameResolver, EffectiveNodeType nodeType)
focal_class.full_signature: static String effectiveNodeTypeToString(NameResolver nameResolver, EffectiveNodeType nodeType)
focal_class.identifier: effectiveNodeTypeToString
focal_class.modifiers: static
focal_class.parameters: (NameResolver nameResolver, EffectiveNodeType nodeType)
focal_class.return: String
focal_class.signature: String effectiveNodeTypeToString(NameResolver nameResolver, EffectiveNodeType nodeType)
focal_class.class_method_signature: NodeTypeValidator.nodeDefinitionToString(NameResolver nameResolver, QNodeDefinition nodeDefinition)
focal_class.full_signature: static String nodeDefinitionToString(NameResolver nameResolver, QNodeDefinition nodeDefinition)
focal_class.identifier: nodeDefinitionToString
focal_class.modifiers: static
focal_class.parameters: (NameResolver nameResolver, QNodeDefinition nodeDefinition)
focal_class.return: String
focal_class.signature: String nodeDefinitionToString(NameResolver nameResolver, QNodeDefinition nodeDefinition)
focal_class.class_method_signature: NodeTypeValidator.joinAsQualifiedJcrName(NameResolver nameResolver, Name[] names)
focal_class.full_signature: private static String joinAsQualifiedJcrName(NameResolver nameResolver, Name[] names)
focal_class.identifier: joinAsQualifiedJcrName
focal_class.modifiers: private static
focal_class.parameters: (NameResolver nameResolver, Name[] names)
focal_class.return: String
focal_class.signature: String joinAsQualifiedJcrName(NameResolver nameResolver, Name[] names)
focal_class.class_method_signature: NodeTypeValidator.getPropertyDefinition(Name name, int type, EffectiveNodeType effectiveNodeType,
              ItemDefinitionProvider itemDefinitionProvider, boolean multiValued)
focal_class.full_signature: private static QPropertyDefinition getPropertyDefinition(Name name, int type, EffectiveNodeType effectiveNodeType,
              ItemDefinitionProvider itemDefinitionProvider, boolean multiValued)
focal_class.identifier: getPropertyDefinition
focal_class.modifiers: private static
focal_class.parameters: (Name name, int type, EffectiveNodeType effectiveNodeType,
              ItemDefinitionProvider itemDefinitionProvider, boolean multiValued)
focal_class.return: QPropertyDefinition
focal_class.signature: QPropertyDefinition getPropertyDefinition(Name name, int type, EffectiveNodeType effectiveNodeType,
              ItemDefinitionProvider itemDefinitionProvider, boolean multiValued)
focal_class.class_method_signature: NodeTypeValidator.validateValueConstraints(Value value, QPropertyDefinition def, ValueFactory valueFactory,
              QValueFactory qValueFactory, NamePathResolver namePathResolver)
focal_class.full_signature: private static void validateValueConstraints(Value value, QPropertyDefinition def, ValueFactory valueFactory,
              QValueFactory qValueFactory, NamePathResolver namePathResolver)
focal_class.identifier: validateValueConstraints
focal_class.modifiers: private static
focal_class.parameters: (Value value, QPropertyDefinition def, ValueFactory valueFactory,
              QValueFactory qValueFactory, NamePathResolver namePathResolver)
focal_class.return: void
focal_class.signature: void validateValueConstraints(Value value, QPropertyDefinition def, ValueFactory valueFactory,
              QValueFactory qValueFactory, NamePathResolver namePathResolver)
focal_class.class_method_signature: NodeTypeValidator.getPropertyConstraintViolation(DocViewProperty property, EffectiveNodeType effectiveNodeType, boolean allowProtected)
focal_class.full_signature:  String getPropertyConstraintViolation(DocViewProperty property, EffectiveNodeType effectiveNodeType, boolean allowProtected)
focal_class.identifier: getPropertyConstraintViolation
focal_class.parameters: (DocViewProperty property, EffectiveNodeType effectiveNodeType, boolean allowProtected)
focal_class.return: String
focal_class.signature: String getPropertyConstraintViolation(DocViewProperty property, EffectiveNodeType effectiveNodeType, boolean allowProtected)
focal_class.class_method_signature: NodeTypeValidator.getPropertyConstraintViolation(Name name, Value value, EffectiveNodeType effectiveNodeType,
              ItemDefinitionProvider itemDefinitionProvider, ValueFactory valueFactory, QValueFactory qValueFactory,
              NamePathResolver namePathResolver, boolean allowProtected)
focal_class.full_signature: static String getPropertyConstraintViolation(Name name, Value value, EffectiveNodeType effectiveNodeType,
              ItemDefinitionProvider itemDefinitionProvider, ValueFactory valueFactory, QValueFactory qValueFactory,
              NamePathResolver namePathResolver, boolean allowProtected)
focal_class.identifier: getPropertyConstraintViolation
focal_class.modifiers: static
focal_class.parameters: (Name name, Value value, EffectiveNodeType effectiveNodeType,
              ItemDefinitionProvider itemDefinitionProvider, ValueFactory valueFactory, QValueFactory qValueFactory,
              NamePathResolver namePathResolver, boolean allowProtected)
focal_class.return: String
focal_class.signature: String getPropertyConstraintViolation(Name name, Value value, EffectiveNodeType effectiveNodeType,
              ItemDefinitionProvider itemDefinitionProvider, ValueFactory valueFactory, QValueFactory qValueFactory,
              NamePathResolver namePathResolver, boolean allowProtected)
focal_class.class_method_signature: NodeTypeValidator.getPropertyConstraintViolation(Name name, Value[] values, EffectiveNodeType effectiveNodeType,
              ItemDefinitionProvider itemDefinitionProvider, ValueFactory valueFactory, QValueFactory qValueFactory,
              NamePathResolver namePathResolver, boolean allowProtected)
focal_class.full_signature: static String getPropertyConstraintViolation(Name name, Value[] values, EffectiveNodeType effectiveNodeType,
              ItemDefinitionProvider itemDefinitionProvider, ValueFactory valueFactory, QValueFactory qValueFactory,
              NamePathResolver namePathResolver, boolean allowProtected)
focal_class.identifier: getPropertyConstraintViolation
focal_class.modifiers: static
focal_class.parameters: (Name name, Value[] values, EffectiveNodeType effectiveNodeType,
              ItemDefinitionProvider itemDefinitionProvider, ValueFactory valueFactory, QValueFactory qValueFactory,
              NamePathResolver namePathResolver, boolean allowProtected)
focal_class.return: String
focal_class.signature: String getPropertyConstraintViolation(Name name, Value[] values, EffectiveNodeType effectiveNodeType,
              ItemDefinitionProvider itemDefinitionProvider, ValueFactory valueFactory, QValueFactory qValueFactory,
              NamePathResolver namePathResolver, boolean allowProtected)
focal_class.class_method_signature: NodeTypeValidator.getChildNodeConstraintViolation(DocViewNode node, EffectiveNodeType nodeType,
              NodeTypeDefinitionProvider nodeTypeDefinitionProvider,
              NameResolver nameResolver, ItemDefinitionProvider itemDefinitionProvider, boolean allowProtected)
focal_class.full_signature: static String getChildNodeConstraintViolation(DocViewNode node, EffectiveNodeType nodeType,
              NodeTypeDefinitionProvider nodeTypeDefinitionProvider,
              NameResolver nameResolver, ItemDefinitionProvider itemDefinitionProvider, boolean allowProtected)
focal_class.identifier: getChildNodeConstraintViolation
focal_class.modifiers: static
focal_class.parameters: (DocViewNode node, EffectiveNodeType nodeType,
              NodeTypeDefinitionProvider nodeTypeDefinitionProvider,
              NameResolver nameResolver, ItemDefinitionProvider itemDefinitionProvider, boolean allowProtected)
focal_class.return: String
focal_class.signature: String getChildNodeConstraintViolation(DocViewNode node, EffectiveNodeType nodeType,
              NodeTypeDefinitionProvider nodeTypeDefinitionProvider,
              NameResolver nameResolver, ItemDefinitionProvider itemDefinitionProvider, boolean allowProtected)
focal_class.class_method_signature: NodeTypeValidator.done()
focal_class.full_signature: @Override public @Nullable Collection<ValidationMessage> done()
focal_class.identifier: done
focal_class.modifiers: @Override public @Nullable
focal_class.parameters: ()
focal_class.return: Collection<ValidationMessage>
focal_class.signature: Collection<ValidationMessage> done()
focal_method.body: @Override
      public @Nullable Collection<ValidationMessage> validate(@NotNull DocViewNode node, @NotNull NodeContext nodeContext,
              boolean isRoot) {
  
          if (node.primary == null) {
              // only an issue if contained in the filter
              // if other properties are set this node is not only used for ordering purposes
              if (filter.contains(nodeContext.getNodePath()) && !node.props.isEmpty()) {
                  return Collections.singleton(
                          new ValidationMessage(defaultSeverity, String.format(MESSAGE_MISSING_PRIMARY_TYPE, nodeContext.getNodePath())));
              } else {
                  // order node only or outside filter
                  return null;
              }
          }
  
          // special handling for users and acls
          if (aclManagement.isACLNodeType(node.primary) || userManagement.isAuthorizableNodeType(node.primary)) {
              protectedNodeContext = nodeContext;
          }
  
          boolean allowProtectedSubNodesAndProperties = protectedNodeContext != null;
          Collection<ValidationMessage> messages = new LinkedList<>();
          String parentNodePath = Text.getRelativeParent(nodeContext.getNodePath(), 1);
          NodeNameAndType parentNodeNameAndType = nodeTypePerPath.get(parentNodePath);
          NodeNameAndType newNodeNameAndType = null;
          try {
              // check node itself against parent node type
              if (!aclManagement.isACLNodeType(node.primary)) {
                  final EffectiveNodeType parentNodeType;
                  final boolean useDefaultNodeType;
  
                  if (parentNodeNameAndType == null || !filter.contains(parentNodePath)) {
                      parentNodeType = defaultType;
                      useDefaultNodeType = true;
                  } else if (!parentNodeNameAndType.isUnknown()) {
                      parentNodeType = parentNodeNameAndType.getEffectiveNodeType();
                      useDefaultNodeType = false;
                  } else {
                      parentNodeType = null;
                      useDefaultNodeType = false;
                  }
  
                  if (parentNodeType != null) {
                      String constraintViolation = getChildNodeConstraintViolation(node, parentNodeType,
                              ntManagerProvider.getNodeTypeDefinitionProvider(),
                              ntManagerProvider.getNameResolver(), ntManagerProvider.getItemDefinitionProvider(),
                              allowProtectedSubNodesAndProperties);
                      if (constraintViolation != null) {
                          messages.add(new ValidationMessage(defaultSeverity,
                                  String.format(
                                          useDefaultNodeType ? MESSAGE_CHILD_NODE_OF_NOT_CONTAINED_PARENT_POTENTIALLY_NOT_ALLOWED
                                                  : MESSAGE_CHILD_NODE_NOT_ALLOWED,
                                          getDocViewNodeLabel(node),
                                          effectiveNodeTypeToString(ntManagerProvider.getNameResolver(), parentNodeType),
                                          constraintViolation)));
  
                      }
                  }
              }
  
              // get current node's node type and name and register in tree
              newNodeNameAndType = new NodeNameAndType(ntManagerProvider.getNameResolver(),
                      ntManagerProvider.getEffectiveNodeTypeProvider(), node);
              nodeTypePerPath.put(nodeContext.getNodePath(), newNodeNameAndType);
  
              // check all properties
              Collection<Name> foundProperties = new ArrayList<>(node.props.size());
              for (DocViewProperty property : node.props.values()) {
                  String constraintViolation = getPropertyConstraintViolation(property, newNodeNameAndType.getEffectiveNodeType(),
                          allowProtectedSubNodesAndProperties);
                  if (constraintViolation != null) {
                      messages.add(new ValidationMessage(defaultSeverity, String.format(MESSAGE_PROPERTY_NOT_ALLOWED, property,
                              effectiveNodeTypeToString(ntManagerProvider.getNameResolver(), newNodeNameAndType.getEffectiveNodeType()),
                              constraintViolation)));
                  }
                  foundProperties.add(NameFactoryImpl.getInstance().create(property.name));
              }
              // are all mandatory properties covered?
              for (QPropertyDefinition mandatoryPropertyDefinition : newNodeNameAndType.getEffectiveNodeType()
                      .getMandatoryQPropertyDefinitions()) {
                  // ignore auto-created properties as they are created on-demand
                  if (!mandatoryPropertyDefinition.isAutoCreated() && !foundProperties.contains(mandatoryPropertyDefinition.getName())) {
  
                      // ignore propertes which may be provided by the {@link FileArtifactHandler} (they are part of another file)
                      List<Name> ignoredProperties = IGNORED_MANDATORY_PROPERTIES_PER_NODE_TYPE
                              .get(mandatoryPropertyDefinition.getDeclaringNodeType());
                      if (ignoredProperties != null && ignoredProperties.contains(mandatoryPropertyDefinition.getName())) {
                          // TODO: skipping for now as validating those from other files requires major effort
                          continue;
                      }
                      messages.add(new ValidationMessage(defaultSeverity,
                              String.format(MESSAGE_MANDATORY_PROPERTY_MISSING, mandatoryPropertyDefinition.getName(),
                                      effectiveNodeTypeToString(ntManagerProvider.getNameResolver(),
                                              newNodeNameAndType.getEffectiveNodeType()))));
                  }
              }
  
          } catch (NoSuchNodeTypeException | IllegalNameException | NamespaceException e) {
              // log each unknown node type/namespace only once!
              if (!loggedUnknownNodeTypeMessages.contains(e.getMessage())) {
                  messages.add(new ValidationMessage(severityForUnknownNodeTypes,
                          String.format(MESSAGE_UNKNOWN_NODE_TYPE_OR_NAMESPACE, e.getMessage()), e));
                  loggedUnknownNodeTypeMessages.add(e.getMessage());
              }
              if (newNodeNameAndType == null) {
                  nodeTypePerPath.put(nodeContext.getNodePath(), NodeNameAndType.createUnknownNodeNameAndType(parentNodeNameAndType));
              }
          } catch (RepositoryException e) {
              throw new IllegalStateException("Could not validate nodes/properties against node types: " + e.getMessage(), e);
          }
          return messages;
      }
focal_method.class_method_signature: NodeTypeValidator.validate(@NotNull DocViewNode node, @NotNull NodeContext nodeContext,
              boolean isRoot)
focal_method.full_signature: @Override public @Nullable Collection<ValidationMessage> validate(@NotNull DocViewNode node, @NotNull NodeContext nodeContext,
              boolean isRoot)
focal_method.identifier: validate
focal_method.invocations: contains getNodePath isEmpty singleton format getNodePath isACLNodeType isAuthorizableNodeType getRelativeParent getNodePath get isACLNodeType contains isUnknown getEffectiveNodeType getChildNodeConstraintViolation getNodeTypeDefinitionProvider getNameResolver getItemDefinitionProvider add format getDocViewNodeLabel effectiveNodeTypeToString getNameResolver getNameResolver getEffectiveNodeTypeProvider put getNodePath size values getPropertyConstraintViolation getEffectiveNodeType add format effectiveNodeTypeToString getNameResolver getEffectiveNodeType add create getInstance getMandatoryQPropertyDefinitions getEffectiveNodeType isAutoCreated contains getName get getDeclaringNodeType contains getName add format getName effectiveNodeTypeToString getNameResolver getEffectiveNodeType contains getMessage add format getMessage add getMessage put getNodePath createUnknownNodeNameAndType getMessage
focal_method.modifiers: @Override public @Nullable
focal_method.parameters: (@NotNull DocViewNode node, @NotNull NodeContext nodeContext,
              boolean isRoot)
focal_method.return: Collection<ValidationMessage>
focal_method.signature: Collection<ValidationMessage> validate(@NotNull DocViewNode node, @NotNull NodeContext nodeContext,
              boolean isRoot)