001/*
002 * The contents of this file are subject to the terms of the Common Development and
003 * Distribution License (the License). You may not use this file except in compliance with the
004 * License.
005 *
006 * You can obtain a copy of the License at legal/CDDLv1.0.txt. See the License for the
007 * specific language governing permission and limitations under the License.
008 *
009 * When distributing Covered Software, include this CDDL Header Notice in each file and include
010 * the License file at legal/CDDLv1.0.txt. If applicable, add the following below the CDDL
011 * Header, with the fields enclosed by brackets [] replaced by your own identifying
012 * information: "Portions Copyright [year] [name of copyright owner]".
013 *
014 * Copyright 2006-2008 Sun Microsystems, Inc.
015 * Portions Copyright 2012-2016 ForgeRock AS.
016 */
017package org.opends.server.schema;
018
019import static org.opends.server.schema.SchemaConstants.*;
020
021import org.forgerock.opendj.ldap.schema.Schema;
022import org.forgerock.opendj.ldap.schema.Syntax;
023import org.forgerock.opendj.server.config.server.AttributeSyntaxCfg;
024import org.opends.server.api.AttributeSyntax;
025
026
027/**
028 * This class implements the printable string attribute syntax, which is simply
029 * a string of characters from a limited ASCII character set (uppercase and
030 * lowercase letters, numeric digits, the space, and a set of various symbols).
031 * By default, they will be treated in a case-insensitive manner, and equality,
032 * ordering, substring, and approximate matching will be allowed.
033 */
034public class PrintableStringSyntax
035       extends AttributeSyntax<AttributeSyntaxCfg>
036{
037
038  /**
039   * Creates a new instance of this syntax.  Note that the only thing that
040   * should be done here is to invoke the default constructor for the
041   * superclass.  All initialization should be performed in the
042   * <CODE>initializeSyntax</CODE> method.
043   */
044  public PrintableStringSyntax()
045  {
046    super();
047  }
048
049  /** {@inheritDoc} */
050  @Override
051  public Syntax getSDKSyntax(Schema schema)
052  {
053    return schema.getSyntax(SchemaConstants.SYNTAX_PRINTABLE_STRING_OID);
054  }
055
056  /**
057   * Retrieves the common name for this attribute syntax.
058   *
059   * @return  The common name for this attribute syntax.
060   */
061  @Override
062  public String getName()
063  {
064    return SYNTAX_PRINTABLE_STRING_NAME;
065  }
066
067  /**
068   * Retrieves the OID for this attribute syntax.
069   *
070   * @return  The OID for this attribute syntax.
071   */
072  @Override
073  public String getOID()
074  {
075    return SYNTAX_PRINTABLE_STRING_OID;
076  }
077
078  /**
079   * Retrieves a description for this attribute syntax.
080   *
081   * @return  A description for this attribute syntax.
082   */
083  @Override
084  public String getDescription()
085  {
086    return SYNTAX_PRINTABLE_STRING_DESCRIPTION;
087  }
088}
089