Adds message element validation.
@param path
@param controlValue
@return
421357
public T validate(String path, Object controlValue) {
        if (JsonPathMessageValidationContext.isJsonPathExpression(path)) {
            getJsonPathValidationContext().getJsonPathExpressions().put(path, controlValue);
        } else {
            getXPathValidationContext().getXpathExpressions().put(path, controlValue);
        }

        return self;
    }
145872
private void validate(QPath path) throws RepositoryException, AccessDeniedException, ReferentialIntegrityException
   {

      List<ItemState> changes = changesLog.getAllStates();
      for (ItemState itemState : changes)
      {

         if (itemState.isInternallyCreated())
         {
            // skip internally created
            if (itemState.isMixinChanged())
            {
               // ...except of check of ACL correct size for internally created
               // items.
               // If no permissions in the list throw exception.
               if (itemState.isDescendantOf(path))
               {
                  if (((NodeData)itemState.getData()).getACL().getPermissionsSize() < 1)
                  {
                     throw new RepositoryException("Node " + itemState.getData().getQPath().getAsString()
                        + " has wrong formed ACL.");
                  }
               }
               validateMandatoryItem(itemState);
            }
         }
         else
         {
            if (itemState.isDescendantOf(path))
            {
               validateAccessPermissions(itemState);
               validateMandatoryItem(itemState);
            }

            if (path.isDescendantOf(itemState.getAncestorToSave()))
            {
               throw new ConstraintViolationException(path.getAsString()
                  + " is the same or descendant of either Session.move()'s destination or source node only "
                  + path.getAsString());
            }
         }
      }
   }
330689
public boolean containsValue(String path, Object value) {
        return JSONPath.containsValue(jsonObject, checkPath(path), value);
    }
236289
public static String getValueForPath(CmsEntity entity, String path) {

        String result = null;
        if (path.startsWith("/")) {
            path = path.substring(1);
        }
        String attributeName;
        if (path.contains("/")) {
            attributeName = path.substring(0, path.indexOf("/"));
            path = path.substring(path.indexOf("/"));
        } else {
            attributeName = path;
            path = null;
        }
        int index = org.opencms.acacia.shared.CmsContentDefinition.extractIndex(attributeName);
        if (index > 0) {
            index--;
        }
        attributeName = entity.getTypeName()
            + "/"
            + org.opencms.acacia.shared.CmsContentDefinition.removeIndex(attributeName);
        CmsEntityAttribute attribute = entity.getAttribute(attributeName);
        if (!((attribute == null) || (attribute.isComplexValue() && (path == null)))) {
            if (attribute.isSimpleValue()) {
                if ((path == null) && (attribute.getValueCount() > 0)) {
                    List<String> values = attribute.getSimpleValues();
                    result = values.get(index);
                }
            } else if (attribute.getValueCount() > (index)) {
                List<CmsEntity> values = attribute.getComplexValues();
                result = getValueForPath(values.get(index), path);
            }
        }
        return result;
    }
239611
public static void validatePath(String path) throws InvalidPathException {
    boolean invalid = (path == null || path.isEmpty());
    if (!OSUtils.isWindows()) {
      invalid = (invalid || !path.startsWith(AlluxioURI.SEPARATOR));
    }

    if (invalid) {
      throw new InvalidPathException(ExceptionMessage.PATH_INVALID.getMessage(path));
    }
  }
54551
public Javalin post(@NotNull String path, @NotNull Handler handler, @NotNull Set<Role> permittedRoles) {
        return addHandler(HandlerType.POST, path, handler, permittedRoles);
    }
1113344
private XpathMessageValidationContext getXPathMessageValidationContext(Element messageElement, XmlMessageValidationContext parentContext) {
        XpathMessageValidationContext context = new XpathMessageValidationContext();
        
        parseXPathValidationElements(messageElement, context);

        context.setControlNamespaces(parentContext.getControlNamespaces());
        context.setNamespaces(parentContext.getNamespaces());
        context.setIgnoreExpressions(parentContext.getIgnoreExpressions());
        context.setSchema(parentContext.getSchema());
        context.setSchemaRepository(parentContext.getSchemaRepository());
        context.setSchemaValidation(parentContext.isSchemaValidationEnabled());
        context.setDTDResource(parentContext.getDTDResource());

        return context;
    }
1284697
public static void validateValues(Object actualValue, Object expectedValue, String pathExpression, TestContext context)
            throws ValidationException {
        try {
            if (actualValue != null) {
                Assert.isTrue(expectedValue != null,
                        ValidationUtils.buildValueMismatchErrorMessage(
                                "Values not equal for element '" + pathExpression + "'", null, actualValue));

                if (expectedValue instanceof Matcher) {
                    Assert.isTrue(((Matcher) expectedValue).matches(actualValue),
                            ValidationUtils.buildValueMismatchErrorMessage(
                                    "Values not matching for element '" + pathExpression + "'", expectedValue, actualValue));
                    return;
                }

                if (!(expectedValue instanceof String)) {
                    Object converted = TypeConversionUtils.convertIfNecessary(actualValue, expectedValue.getClass());

                    if (converted == null) {
                        throw new CitrusRuntimeException(String.format("Failed to convert value '%s' to required type '%s'", actualValue, expectedValue.getClass()));
                    }

                    if (converted instanceof List) {
                        Assert.isTrue(converted.toString().equals(expectedValue.toString()),
                                ValidationUtils.buildValueMismatchErrorMessage(
                                        "Values not equal for element '" + pathExpression + "'", expectedValue.toString(), converted.toString()));
                    } else if (converted instanceof String[]) {
                        String convertedDelimitedString = StringUtils.arrayToCommaDelimitedString((String[]) converted);
                        String expectedDelimitedString = StringUtils.arrayToCommaDelimitedString((String[]) expectedValue);

                        Assert.isTrue(convertedDelimitedString.equals(expectedDelimitedString),
                                ValidationUtils.buildValueMismatchErrorMessage(
                                        "Values not equal for element '" + pathExpression + "'", expectedDelimitedString, convertedDelimitedString));
                    } else if (converted instanceof byte[]) {
                        String convertedBase64 = Base64.encodeBase64String((byte[]) converted);
                        String expectedBase64 = Base64.encodeBase64String((byte[]) expectedValue);

                        Assert.isTrue(convertedBase64.equals(expectedBase64),
                                ValidationUtils.buildValueMismatchErrorMessage(
                                        "Values not equal for element '" + pathExpression + "'", expectedBase64, convertedBase64));
                    } else {
                        Assert.isTrue(converted.equals(expectedValue),
                                ValidationUtils.buildValueMismatchErrorMessage(
                                        "Values not equal for element '" + pathExpression + "'", expectedValue, converted));
                    }
                } else {
                    String expectedValueString = expectedValue.toString();
                    String actualValueString;
                    if (List.class.isAssignableFrom(actualValue.getClass())) {
                        actualValueString = StringUtils.arrayToCommaDelimitedString(((List)actualValue).toArray(new Object[((List)actualValue).size()]));
                        expectedValueString = expectedValueString.replaceAll("^\\[", "").replaceAll("\\]$", "").replaceAll(",\\s", ",");
                    } else {
                        actualValueString = actualValue.toString();
                    }

                    if (ValidationMatcherUtils.isValidationMatcherExpression(String.valueOf(expectedValueString))) {
                        ValidationMatcherUtils.resolveValidationMatcher(pathExpression,
                                actualValueString,
                                String.valueOf(expectedValueString),
                                context);
                    } else {
                        Assert.isTrue(actualValueString.equals(expectedValueString),
                                ValidationUtils.buildValueMismatchErrorMessage(
                                        "Values not equal for element '" + pathExpression + "'", expectedValueString, actualValueString));
                    }
                }
            } else if (expectedValue != null) {
                if (expectedValue instanceof Matcher) {
                    Assert.isTrue(((Matcher) expectedValue).matches(null),
                            ValidationUtils.buildValueMismatchErrorMessage(
                                    "Values not matching for element '" + pathExpression + "'", expectedValue, null));
                } else if (expectedValue instanceof String) {
                    String expectedValueString = expectedValue.toString();

                    if (ValidationMatcherUtils.isValidationMatcherExpression(expectedValueString)) {
                        ValidationMatcherUtils.resolveValidationMatcher(pathExpression,
                                null,
                                expectedValueString,
                                context);
                    } else {
                        Assert.isTrue(!StringUtils.hasText(expectedValueString),
                                ValidationUtils.buildValueMismatchErrorMessage(
                                        "Values not equal for element '" + pathExpression + "'", expectedValueString, null));
                    }
                } else {
                    throw new ValidationException("Validation failed: " + ValidationUtils.buildValueMismatchErrorMessage(
                            "Values not equal for element '" + pathExpression + "'", expectedValue, null));
                }
            }
        } catch (IllegalArgumentException | AssertionError e) {
            throw new ValidationException("Validation failed:", e);
        }
    }
1198515
public void validate(String path, Schema schema, Object value, List<ValidationResult> results) {
		String name = path != null ? path : "value";
		Object value1 = ObjectReader.getProperty(value, _property1);
		Object value2 = ObjectReader.getProperty(value, _property2);

		if (!ObjectComparator.compare(value1, _operation, value2)) {
			results.add(new ValidationResult(path, ValidationResultType.Error, "PROPERTIES_NOT_MATCH",
					name + " must have " + _property1 + " " + _operation + " " + _property2, value2, value1));
		}
	}
76754
public static void assertXpathValuesNotEqual(String controlXpath,
                                                 String inControlXMLString,
                                                 String testXpath,
                                                 String inTestXMLString)
        throws SAXException, IOException,
               XpathException {
        assertXpathValuesNotEqual(controlXpath,
                                  XMLUnit.buildControlDocument(inControlXMLString),
                                  testXpath,
                                  XMLUnit.buildTestDocument(inTestXMLString));
    }
125323
public TrxMessageHeader addMessageProperties(TrxMessageHeader trxMessageHeader, MessageControl recMessageControl)
    {
        Map<String,Object> mapHeaderMessageInfo = trxMessageHeader.getMessageInfoMap();
        
        Map<String,Object> propMessageTransportInfo = ((PropertiesField)this.getField(MessageVersion.PROPERTIES)).loadProperties();
        if (mapHeaderMessageInfo != null)
            Utility.putAllIfNew(mapHeaderMessageInfo, propMessageTransportInfo);
        else
            mapHeaderMessageInfo = propMessageTransportInfo;
        if (mapHeaderMessageInfo == null)
            mapHeaderMessageInfo = new HashMap<String,Object>();
        if (!this.getField(MessageVersion.CODE).isNull())
            mapHeaderMessageInfo.put(VERSION, this.getField(MessageVersion.CODE).toString());
        if (!this.getField(MessageVersion.ID).isNull())
            mapHeaderMessageInfo.put(VERSION_ID, this.getField(MessageVersion.ID).toString());
        if (recMessageControl != null)
            if ((recMessageControl.getEditMode() == DBConstants.EDIT_CURRENT) || (recMessageControl.getEditMode() == DBConstants.EDIT_IN_PROGRESS))
                if (mapHeaderMessageInfo.get(TrxMessageHeader.SCHEMA_LOCATION) != null)
            {
                String strSchemaLocation = (String)mapHeaderMessageInfo.get(TrxMessageHeader.SCHEMA_LOCATION);
                if (strSchemaLocation.indexOf('/') == -1)
                {   // Need to get the full location
                    if (strSchemaLocation.indexOf('.') == -1)
                        strSchemaLocation = strSchemaLocation + ".xsd";
                strSchemaLocation = recMessageControl.getSchemaLocation(this, strSchemaLocation);
                mapHeaderMessageInfo.put(TrxMessageHeader.SCHEMA_LOCATION, strSchemaLocation);
                }
            }
        trxMessageHeader.setMessageInfoMap(mapHeaderMessageInfo);
        
        return trxMessageHeader;
    }
1369948
private void validateElementProperty(String propertyName, String controlValue, String resultValue, TestContext context) {
        if (StringUtils.hasText(controlValue)) {
            String control = context.replaceDynamicContentInString(controlValue);

            if (ValidationMatcherUtils.isValidationMatcherExpression(control)) {
                ValidationMatcherUtils.resolveValidationMatcher("payload", resultValue, control, context);
            } else {
                Assert.isTrue(control.equals(resultValue), String.format("Selenium web element validation failed, %s expected '%s', but was '%s'", propertyName, control, resultValue));
            }
        }
    }
773982
public void setMessageControlClassification(String value) {
        if (value != null) {
            getHdr2().setField(JsHdr2Access.MESSAGECONTROLCLASSIFICATION_DATA, value);
        }
        else {
            getHdr2().setChoiceField(JsHdr2Access.MESSAGECONTROLCLASSIFICATION, JsHdr2Access.IS_MESSAGECONTROLCLASSIFICATION_EMPTY);
        }
    }
957264
protected String getValueOfDE(String path) {
        String ret = null;

        for (ListIterator<SyntaxElement> i = elements.listIterator(); i.hasNext(); ) {
            SyntaxElement e = i.next();
            String ePath = e.getPath();
            if (path.equals(ePath) || path.startsWith(ePath + ".")) {
                ret = e.getValueOfDE(path);
                break;
            }
        }

        return ret;
    }
821825
public static String valueFromXPath(Document parsedXml, String path) {
		XPath xPath = XPathFactory.newInstance().newXPath();
		try {
			return xPath.evaluate(path, parsedXml.getDocumentElement());
		}
		catch (XPathExpressionException exception) {
			LOG.error("Incorrect xpath provided: " + path, exception);
			throw new IllegalArgumentException();
		}
	}
1285728
public void validate(String path, Schema schema, Object value, List<ValidationResult> results) {
		if (_rules == null)
			return;

		for (IValidationRule rule : _rules)
			rule.validate(path, schema, value, results);
	}
556392
@Override
    public ValidationResult validate(PMContext ctx) {
        final ValidationResult res = new ValidationResult();
        final String fieldvalue = (String) ctx.getFieldValue();
        res.setSuccessful(true);
        if (!isName(fieldvalue)) {
            res.setSuccessful(false);
            res.getMessages().add(MessageFactory.error(ctx.getEntity(), ctx.getField(), get("msg", "")));
        }
        return res;
    }