001    /*
002     *  Licensed to the Apache Software Foundation (ASF) under one
003     *  or more contributor license agreements.  See the NOTICE file
004     *  distributed with this work for additional information
005     *  regarding copyright ownership.  The ASF licenses this file
006     *  to you under the Apache License, Version 2.0 (the
007     *  "License"); you may not use this file except in compliance
008     *  with the License.  You may obtain a copy of the License at
009     *  
010     *    http://www.apache.org/licenses/LICENSE-2.0
011     *  
012     *  Unless required by applicable law or agreed to in writing,
013     *  software distributed under the License is distributed on an
014     *  "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
015     *  KIND, either express or implied.  See the License for the
016     *  specific language governing permissions and limitations
017     *  under the License. 
018     *  
019     */
020    package org.apache.directory.shared.ldap.schema;
021    
022    
023    import javax.naming.NamingException;
024    
025    
026    
027    /**
028     * A syntax definition. Each attribute stored in a directory has a defined
029     * syntax (i.e. data type) which constrains the structure and format of its
030     * values. The description of each syntax specifies how attribute or assertion
031     * values conforming to the syntax are normally represented when transferred in
032     * LDAP operations. This representation is referred to as the LDAP-specific
033     * encoding to distinguish it from other methods of encoding attribute values.
034     * <p>
035     * According to ldapbis [MODELS]:
036     * </p>
037     * 
038     * <pre>
039     *  4.1.5. LDAP Syntaxes
040     *  
041     *    LDAP Syntaxes of (attribute and assertion) values are described in
042     *    terms of ASN.1 [X.680] and, optionally, have an octet string encoding
043     *    known as the LDAP-specific encoding.  Commonly, the LDAP-specific
044     *    encoding is constrained to string of Universal Character Set (UCS)
045     *    [ISO10646] characters in UTF-8 [UTF-8] form.
046     * 
047     *    Each LDAP syntax is identified by an object identifier (OID).
048     * 
049     *    LDAP syntax definitions are written according to the ABNF:
050     * 
051     *      SyntaxDescription = LPAREN WSP
052     *          numericoid                ; object identifier
053     *          [ SP &quot;DESC&quot; SP qdstring ] ; description
054     *          extensions WSP RPAREN     ; extensions
055     * 
056     *    where:
057     *      [numericoid] is object identifier assigned to this LDAP syntax;
058     *      DESC [qdstring] is a short descriptive string; and
059     *      [extensions] describe extensions.
060     * </pre>
061     * 
062     * @see <a href="http://www.faqs.org/rfcs/rfc2252.html"> RFC2252 Section 4.3.3</a>
063     * @see <a href=
064     *      "http://www.ietf.org/internet-drafts/draft-ietf-ldapbis-models-09.txt">
065     *      ldapbis [MODELS]</a>
066     * @see DescriptionUtils#getDescription(Syntax)
067     * @author <a href="mailto:dev@directory.apache.org">Apache Directory Project</a>
068     * @version $Rev: 437007 $
069     */
070    public interface Syntax extends SchemaObject
071    {
072        /**
073         * Gets whether or not the Syntax is human readable.
074         * 
075         * @return true if the syntax can be interpretted by humans, false otherwise
076         */
077        boolean isHumanReadable();
078    
079    
080        /**
081         * Gets the SyntaxChecker used to validate values in accordance with this
082         * Syntax.
083         * 
084         * @return the SyntaxChecker
085         */
086        SyntaxChecker getSyntaxChecker() throws NamingException;
087    }