/** * Sets the name of this template. * * @param jcrName JCR name * @throws ConstraintViolationException if the name is invalid */ public void setName(@Nonnull String jcrName) throws ConstraintViolationException { this.oakName = getOakNameOrThrowConstraintViolation(jcrName); }
/** * Sets the name of this template. * * @param jcrName JCR name * @throws ConstraintViolationException if the name is invalid */ public void setName(@NotNull String jcrName) throws ConstraintViolationException { this.oakName = getOakNameOrThrowConstraintViolation(jcrName); }
/** * Sets the name of this template. * * @param jcrName JCR name * @throws ConstraintViolationException if the name is invalid */ public void setName(@NotNull String jcrName) throws ConstraintViolationException { this.oakName = getOakNameOrThrowConstraintViolation(jcrName); }
/** * Like {@link #getOakNameOrThrowConstraintViolation(String)} but allows * the given JCR name to be {@code null}, in which case the return value * is also {@code null}. * * @param jcrName JCR name, or {@code null} * @return Oak name, or {@code null} * @throws ConstraintViolationException if the name is invalid */ @Nullable protected String getOakNameAllowNullOrThrowConstraintViolation(@Nullable String jcrName) throws ConstraintViolationException { if (jcrName == null) { return null; } else { return getOakNameOrThrowConstraintViolation(jcrName); } }
/** * Like {@link #getOakNameOrThrowConstraintViolation(String)} but allows * the given JCR name to be {@code null}, in which case the return value * is also {@code null}. * * @param jcrName JCR name, or {@code null} * @return Oak name, or {@code null} * @throws ConstraintViolationException if the name is invalid */ @Nullable protected String getOakNameAllowNullOrThrowConstraintViolation(@Nullable String jcrName) throws ConstraintViolationException { if (jcrName == null) { return null; } else { return getOakNameOrThrowConstraintViolation(jcrName); } }
/** * Like {@link #getOakNameOrThrowConstraintViolation(String)} but allows * the given JCR name to be {@code null}, in which case the return value * is also {@code null}. * * @param jcrName JCR name, or {@code null} * @return Oak name, or {@code null} * @throws ConstraintViolationException if the name is invalid */ @CheckForNull protected String getOakNameAllowNullOrThrowConstraintViolation(@CheckForNull String jcrName) throws ConstraintViolationException { if (jcrName == null) { return null; } else { return getOakNameOrThrowConstraintViolation(jcrName); } }
/** * Converts the given JCR names to corresponding Oak names. Throws * a {@link ConstraintViolationException} if the given array is * {@code null} or one of the contained JCR names is {@code null} * or otherwise invalid. * * @param jcrNames JCR names * @return Oak names * @throws ConstraintViolationException if names are invalid or {@code null} */ @NotNull protected String[] getOakNamesOrThrowConstraintViolation(@Nullable String[] jcrNames) throws ConstraintViolationException { if (jcrNames != null) { String[] oakNames = new String[jcrNames.length]; for (int i = 0; i < jcrNames.length; i++) { oakNames[i] = getOakNameOrThrowConstraintViolation(jcrNames[i]); } return oakNames; } else { throw new ConstraintViolationException("Missing JCR names"); } }
/** * Converts the given JCR names to corresponding Oak names. Throws * a {@link ConstraintViolationException} if the given array is * {@code null} or one of the contained JCR names is {@code null} * or otherwise invalid. * * @param jcrNames JCR names * @return Oak names * @throws ConstraintViolationException if names are invalid or {@code null} */ @Nonnull protected String[] getOakNamesOrThrowConstraintViolation(@CheckForNull String[] jcrNames) throws ConstraintViolationException { if (jcrNames != null) { String[] oakNames = new String[jcrNames.length]; for (int i = 0; i < jcrNames.length; i++) { oakNames[i] = getOakNameOrThrowConstraintViolation(jcrNames[i]); } return oakNames; } else { throw new ConstraintViolationException("Missing JCR names"); } }
/** * Converts the given JCR names to corresponding Oak names. Throws * a {@link ConstraintViolationException} if the given array is * {@code null} or one of the contained JCR names is {@code null} * or otherwise invalid. * * @param jcrNames JCR names * @return Oak names * @throws ConstraintViolationException if names are invalid or {@code null} */ @NotNull protected String[] getOakNamesOrThrowConstraintViolation(@Nullable String[] jcrNames) throws ConstraintViolationException { if (jcrNames != null) { String[] oakNames = new String[jcrNames.length]; for (int i = 0; i < jcrNames.length; i++) { oakNames[i] = getOakNameOrThrowConstraintViolation(jcrNames[i]); } return oakNames; } else { throw new ConstraintViolationException("Missing JCR names"); } }