public static void checkName(String jcrName, boolean allowResidual) throws ConstraintViolationException { if (jcrName == null || !(allowResidual && "*".equals(jcrName) || validate(jcrName))) { throw new ConstraintViolationException("Not a valid JCR name '" + jcrName + '\''); } } }
public static void checkName(String jcrName, boolean allowResidual) throws ConstraintViolationException { if (jcrName == null || !(allowResidual && "*".equals(jcrName) || validate(jcrName))) { throw new ConstraintViolationException("Not a valid JCR name '" + jcrName + '\''); } } }
/** * Converts the given JCR name to the corresponding Oak name. Throws * a {@link ConstraintViolationException} if the name is {@code null} * or otherwise invalid. * * @param jcrName JCR name * @return Oak name * @throws ConstraintViolationException if name is invalid or {@code null} */ @Nonnull protected String getOakNameOrThrowConstraintViolation(@CheckForNull String jcrName) throws ConstraintViolationException { if (jcrName == null) { throw new ConstraintViolationException("Missing JCR name"); } String oakName = mapper.getOakNameOrNull(jcrName); if (oakName == null || !JcrNameParser.validate(jcrName)) { throw new ConstraintViolationException( "Invalid name: " + jcrName); } return oakName; }
/** * Converts the given JCR name to the corresponding Oak name. Throws * a {@link ConstraintViolationException} if the name is {@code null} * or otherwise invalid. * * @param jcrName JCR name * @return Oak name * @throws ConstraintViolationException if name is invalid or {@code null} */ @NotNull protected String getOakNameOrThrowConstraintViolation(@Nullable String jcrName) throws ConstraintViolationException { if (jcrName == null) { throw new ConstraintViolationException("Missing JCR name"); } String oakName = mapper.getOakNameOrNull(jcrName); if (oakName == null || !JcrNameParser.validate(jcrName)) { throw new ConstraintViolationException( "Invalid name: " + jcrName); } return oakName; }
/** * Converts the given JCR name to the corresponding Oak name. Throws * a {@link ConstraintViolationException} if the name is {@code null} * or otherwise invalid. * * @param jcrName JCR name * @return Oak name * @throws ConstraintViolationException if name is invalid or {@code null} */ @NotNull protected String getOakNameOrThrowConstraintViolation(@Nullable String jcrName) throws ConstraintViolationException { if (jcrName == null) { throw new ConstraintViolationException("Missing JCR name"); } String oakName = mapper.getOakNameOrNull(jcrName); if (oakName == null || !JcrNameParser.validate(jcrName)) { throw new ConstraintViolationException( "Invalid name: " + jcrName); } return oakName; }
} else if (name.startsWith("[") && !name.endsWith("]")) { return null; } else if (!JcrNameParser.validate(name)) { return null;
type != PropertyType.LONG && type != PropertyType.BOOLEAN && JcrNameParser.validate(value.getString());
} else if (name.startsWith("[") && !name.endsWith("]")) { return null; } else if (!JcrNameParser.validate(name)) { return null;
} else if (name.startsWith("[") && !name.endsWith("]")) { return null; } else if (!JcrNameParser.validate(name)) { return null;
type != PropertyType.LONG && type != PropertyType.BOOLEAN && JcrNameParser.validate(value.getString());
type != PropertyType.LONG && type != PropertyType.BOOLEAN && JcrNameParser.validate(value.getString());
case PropertyType.NAME: String oakName = namePathMapper.getOakNameOrNull(value); if (oakName == null || !JcrNameParser.validate(oakName)) { throw new ValueFormatException("Invalid name: " + value);
case PropertyType.NAME: String oakName = namePathMapper.getOakNameOrNull(value); if (oakName == null || !JcrNameParser.validate(oakName)) { throw new ValueFormatException("Invalid name: " + value);