01: /*
02: * Copyright 2006 Day Management AG, Switzerland. All rights reserved.
03: */
04: package javax.jcr.query.qom;
05:
06: /**
07: * Defines a column to include in the tabular view of query results.
08: * <p/>
09: * If {@link #getPropertyName property} is not specified, a column is included
10: * for each single-valued non-residual property of the node type specified by
11: * the <code>nodeType</code> attribute of {@link #getSelectorName selector}.
12: * <p/>
13: * If {@link #getPropertyName property} is specified,
14: * {@link #getColumnName columnName} is required and used to name the column
15: * in the tabular results. If {@link #getPropertyName property} is not
16: * specified, {@link #getColumnName columnName} must not be specified, and
17: * the included columns will be named
18: * "{@link #getSelectorName selector}.<i>propertyName</i>".
19: * <p/>
20: * The query is invalid if:
21: * <ul>
22: * <li>{@link #getSelectorName selector} is not the name of a selector in the
23: * query, or</li>
24: * <li>{@link #getPropertyName property} is specified but it not a a
25: * syntactically valid JCR name, or</li>
26: * <li>{@link #getPropertyName property} is specified but does not evaluate to
27: * a scalar value, or</li>
28: * <li>{@link #getPropertyName property} is specified but
29: * {@link #getColumnName columnName} is omitted, or</li>
30: * <li>{@link #getPropertyName property} is omitted but
31: * {@link #getColumnName columnName} is specified, or</li>
32: * <li>the columns in the tabular view are not uniquely named, whether those
33: * column names are specified by {@link #getColumnName columnName} (if
34: * {@link #getPropertyName property} is specified) or generated as
35: * described above (if {@link #getPropertyName property} is omitted).</li>
36: * </ul>
37: * If {@link #getPropertyName property} is specified but, for a node-tuple, the
38: * selector node does not have a property named {@link #getPropertyName property},
39: * the query is valid and the column has null value.
40: *
41: * @since JCR 2.0
42: */
43: public interface Column {
44: /**
45: * Gets the name of the selector.
46: *
47: * @return the selector name; non-null
48: */
49: public String getSelectorName();
50:
51: /**
52: * Gets the name of the property.
53: *
54: * @return the property name, or null to include a column for
55: * each single-value non-residual property of the
56: * selector's node type
57: */
58: public String getPropertyName();
59:
60: /**
61: * Gets the column name.
62: * <p/>
63: *
64: * @return the column name; must be null if
65: * <code>getPropertyName</code> is null and non-null
66: * otherwise
67: */
68: public String getColumnName();
69: }
70:
71: // EOF
|