001/*
002 * Licensed to the Apache Software Foundation (ASF) under one or more
003 * contributor license agreements.  The ASF licenses this file to You
004 * under the Apache License, Version 2.0 (the "License"); you may not
005 * use this file except in compliance with the License.
006 * You may obtain a copy of the License at
007 *
008 *     http://www.apache.org/licenses/LICENSE-2.0
009 *
010 * Unless required by applicable law or agreed to in writing, software
011 * distributed under the License is distributed on an "AS IS" BASIS,
012 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
013 * See the License for the specific language governing permissions and
014 * limitations under the License.  For additional information regarding
015 * copyright in this work, please see the NOTICE file in the top level
016 * directory of this distribution.
017 */
018package org.apache.directory.api.util.exception;
019
020
021import java.io.IOException;
022
023import org.apache.directory.api.i18n.I18n;
024
025
026/**
027 * Exception thrown when a Character is invalid
028 *
029 * @author <a href="mailto:dev@directory.apache.org">Apache Directory Project</a>
030 */
031public class InvalidCharacterException extends IOException
032{
033    private static final long serialVersionUID = 1L;
034    private final int input;
035
036
037    /**
038     * Creates a new instance of an InvalidCharacterException
039     * 
040     * @param input The char that has caused the exception
041     */
042    public InvalidCharacterException( int input )
043    {
044        this.input = input;
045    }
046
047
048    /**
049     * {@inheritDoc}
050     */
051    @Override
052    public String getMessage()
053    {
054        return I18n.err( I18n.ERR_04335, Integer.toHexString( input ) );
055    }
056}