jackrabbit-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Tobias Bocanegra (JIRA)" <j...@apache.org>
Subject [jira] Created: (JCR-2153) Introduce QValueConstraint and change return type of QPropertyDefinition.getValueConstraints()
Date Wed, 17 Jun 2009 10:30:08 GMT
Introduce QValueConstraint and change return type of QPropertyDefinition.getValueConstraints()
----------------------------------------------------------------------------------------------

                 Key: JCR-2153
                 URL: https://issues.apache.org/jira/browse/JCR-2153
             Project: Jackrabbit Content Repository
          Issue Type: Improvement
          Components: jackrabbit-spi
    Affects Versions: 2.0.0
            Reporter: Tobias Bocanegra
            Assignee: Tobias Bocanegra
             Fix For: 2.0.0


public interface QValueConstraint {
+
+    /**
+     * Empty array of <code>QValueConstraint</code>.
+     */
+    public static final QValueConstraint[] EMPTY_ARRAY = new QValueConstraint[0];
+
+    /**
+     * Check if the specified value matches this constraint.
+     *
+     * @param value The value to be tested.
+     * @throws ConstraintViolationException If the specified value is
+     * <code>null</code> or does not matches the constraint.
+     * @throws RepositoryException If another error occurs.
+     */
+    void check(QValue value) throws ConstraintViolationException, RepositoryException;
+
+    /**
+     * For constraints that are not namespace prefix mapping sensitive this
+     * method returns the same defined in
+     * <code>{@link PropertyDefinition#getValueConstraints()}</code>.
+     * <p/>
+     * Those that are namespace prefix mapping sensitive (e.g.
+     * <code>NameConstraint</code>, <code>PathConstraint</code> and
+     * <code>ReferenceConstraint</code>) return an expanded string.
+     *
+     * @return the expanded definition String
+     */
+    String getExpandedDefinition();
+
+}


+++ jackrabbit-spi/src/main/java/org/apache/jackrabbit/spi/QPropertyDefinition.java	(working
copy)
@@ -45,7 +45,7 @@
      *
      * @return the array of value constraints.
      */
-    public String[] getValueConstraints();
+    public QValueConstraint[] getValueConstraints();


-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


Mime
View raw message