All Downloads are FREE. Search and download functionalities are using the official Maven repository.

org.libj.lang.AnnotationParameterException Maven / Gradle / Ivy

/* Copyright (c) 2017 LibJ
 *
 * Permission is hereby granted, free of charge, to any person obtaining a copy
 * of this software and associated documentation files (the "Software"), to deal
 * in the Software without restriction, including without limitation the rights
 * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
 * copies of the Software, and to permit persons to whom the Software is
 * furnished to do so, subject to the following conditions:
 *
 * The above copyright notice and this permission notice shall be included in
 * all copies or substantial portions of the Software.
 *
 * You should have received a copy of The MIT License (MIT) along with this
 * program. If not, see .
 */

package org.libj.lang;

import java.lang.annotation.Annotation;

/**
 * Thrown to indicate an exception in a parameter value of an annotation.
 */
public class AnnotationParameterException extends RuntimeException {
  private static final long serialVersionUID = -5403129096514741253L;

  private final Annotation annotation;

  /**
   * Creates an {@code AnnotationParameterException} for the specified
   * annotation.
   *
   * @param annotation The {@code Annotation} that is the subject of this
   *          exception.
   */
  public AnnotationParameterException(final Annotation annotation) {
    super();
    this.annotation = annotation;
  }

  /**
   * Creates an {@code AnnotationParameterException} for the specified
   * annotation.
   *
   * @param annotation The {@code Annotation} that is the subject of this
   *          exception.
   * @param message The detail message.
   */
  public AnnotationParameterException(final Annotation annotation, final String message) {
    super(message);
    this.annotation = annotation;
  }

  /**
   * Returns the {@code Annotation} that is the subject of this exception.
   *
   * @return The {@code Annotation} that is the subject of this exception.
   */
  public Annotation annotation() {
    return this.annotation;
  }
}




© 2015 - 2025 Weber Informatics LLC | Privacy Policy