1 /* 2 * $Id: QueryLanguage.java,v 1.2 2004/07/24 00:16:24 benjmestrallet Exp $ 3 * 4 * Copyright 2002-2004 Day Management AG, Switzerland. 5 * 6 * Licensed under the Day RI License, Version 2.0 (the "License"), 7 * as a reference implementation of the following specification: 8 * 9 * Content Repository API for Java Technology, revision 0.12 10 * <http://www.jcp.org/en/jsr/detail?id=170> 11 * 12 * You may not use this file except in compliance with the License. 13 * You may obtain a copy of the License files at 14 * 15 * http://www.day.com/content/en/licenses/day-ri-license-2.0 16 * http://www.apache.org/licenses/LICENSE-2.0 17 * 18 * Unless required by applicable law or agreed to in writing, software 19 * distributed under the License is distributed on an "AS IS" BASIS, 20 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 21 * See the License for the specific language governing permissions and 22 * limitations under the License. 23 */ 24 package javax.jcr.query; 25 26 /** 27 * The query languages supported by the JCR. 28 * <p/> 29 * This interface defines numeric constants for the following query languages: 30 * <ul> 31 * <li>JCRQL_SSES: A SQL-like query language adapted for use in the JCR and 32 * providing a "Simple Search Engine Syntax" (SSES) sub-language for 33 * full-text search which may be embedded in the SEARCH clause within 34 * the JCRQL query string. 35 * <li>XPath: An implementation of the XPath language used for element 36 * selection in XML documents. It works by seeing the JCR repository as 37 * an XML hierarchy. See the <i>XML Views</i> section of the 38 * specification. 39 * </ul> 40 * <p/> 41 * The JCR specification requires that at least one of the above query languages 42 * be supported. 43 * <p/> 44 * Discovery of supported query languages is done through 45 * <code>QueryManager.getSupportedQueryLanguages</code> which returns an array 46 * of object implementing this interface, <code>QueryLanguage</code>. 47 * <p/> 48 * Implementations may support additional query languages by providing an 49 * implementation of this interface that extends the number of languages. 50 * <p/> 51 * In particular, an implementation may choose to support a variant of JCRQL that 52 * embeds a full-text search language in the SEARCH clause other than SSES. 53 * In such cases, the implementor should adhere to the convention of designating 54 * the language "JCRQL_XYZ", where "XYZ" is the name of the embedded full-text 55 * search language. 56 * 57 * @author Peeter Piegaze 58 * @author Stefan Guggisberg 59 */ 60 public interface QueryLanguage { 61 62 /** 63 * The query languages defined by the JCR standard. 64 */ 65 public static final int JCRQL_SSES = 1; 66 public static final int XPATH = 2; 67 68 /** 69 * Returns the numerical constant identifying this query language. 70 * 71 * @return the numerical value 72 */ 73 public int getValue(); 74 75 /** 76 * Returns the descriptive name of query language. 77 * 78 * @return the name 79 */ 80 public String getName(); 81 } 82 83