/** * Returns the JCR name of this template, or {@code null} if the name * has not yet been set. * * @return JCR name, or {@code null} */ @Nullable public String getName() { return getJcrNameAllowNull(oakName); }
/** * Returns the name of this template, or {@code null} if the name * has not yet been set. The special name "*" is used for residual * item definitions. * * @return JCR name, "*", or {@code null} */ @Override @CheckForNull public String getName() { if (residual) { return NodeTypeConstants.RESIDUAL_NAME; } else { return super.getName(); } }
/** * 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); }
protected NamedTemplate(@NotNull NameMapper mapper, @Nullable String jcrName) throws ConstraintViolationException { this(mapper); if (jcrName != null) { setName(jcrName); } }
protected NamedTemplate(@Nonnull NameMapper mapper, @Nullable String jcrName) throws ConstraintViolationException { this(mapper); if (jcrName != null) { setName(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); }
protected NamedTemplate(@NotNull NameMapper mapper, @Nullable String jcrName) throws ConstraintViolationException { this(mapper); if (jcrName != null) { setName(jcrName); } }
/** * Returns the JCR name of this template, or {@code null} if the name * has not yet been set. * * @return JCR name, or {@code null} */ @Nullable public String getName() { return getJcrNameAllowNull(oakName); }
/** * Returns the name of this template, or {@code null} if the name * has not yet been set. The special name "*" is used for residual * item definitions. * * @return JCR name, "*", or {@code null} */ @Override @Nullable public String getName() { if (residual) { return NodeTypeConstants.RESIDUAL_NAME; } else { return super.getName(); } }
/** * 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. Use the special name "*" for a residual * item definition. * * @param jcrName JCR name, or "*" * @throws ConstraintViolationException if the name is invalid */ @Override public void setName(@NotNull String jcrName) throws ConstraintViolationException { residual = NodeTypeConstants.RESIDUAL_NAME.equals(jcrName); if (!residual) { super.setName(jcrName); } }
/** * Returns the JCR name of this template, or {@code null} if the name * has not yet been set. * * @return JCR name, or {@code null} */ @CheckForNull public String getName() { return getJcrNameAllowNull(oakName); }
/** * Returns the name of this template, or {@code null} if the name * has not yet been set. The special name "*" is used for residual * item definitions. * * @return JCR name, "*", or {@code null} */ @Override @Nullable public String getName() { if (residual) { return NodeTypeConstants.RESIDUAL_NAME; } else { return super.getName(); } }
/** * 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); } }
/** * Sets the name of this template. Use the special name "*" for a residual * item definition. * * @param jcrName JCR name, or "*" * @throws ConstraintViolationException if the name is invalid */ @Override public void setName(@NotNull String jcrName) throws ConstraintViolationException { residual = NodeTypeConstants.RESIDUAL_NAME.equals(jcrName); if (!residual) { super.setName(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); } }
/** * Sets the name of this template. Use the special name "*" for a residual * item definition. * * @param jcrName JCR name, or "*" * @throws ConstraintViolationException if the name is invalid */ @Override public void setName(@Nonnull String jcrName) throws ConstraintViolationException { residual = NodeTypeConstants.RESIDUAL_NAME.equals(jcrName); if (!residual) { super.setName(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"); } }