BeanValidationException (install4j API)
Description: declaration: package: com.install4j.api.beaninfo, class: BeanValidationException

# Class BeanValidationException

java.lang.Object
java.lang.Throwable
java.lang.Exception
com.install4j.api.beaninfo.BeanValidationException

All Implemented Interfaces:
  `Serializable`

public class BeanValidationException extends Exception
Exception for notifying the user that a property value of a bean is not valid. Throw this exception in implementations of `BeanValidator.validateBean(com.install4j.api.beans.Bean)`. The user will be notified with a message constructed from the supplied information.

See Also:
  - Serialized Form

- ## Constructor Summary

  Constructors
  Constructor
  Description
  `BeanValidationException(String errorMessage)`
  Constructor with an error message.
  `BeanValidationException(String errorMessage, String propertyName)`
  Constructor with an error message and a property name.

- ## Method Summary

  Modifier and Type
  Method
  Description
  `String`
  `getCustomizerTabName()`
  Get the name of the customizer tab that was set with `setCustomizerTabName`.
  `String`
  `getPropertyName()`
  Get the name of the invalid property, or `null` if no property name was specified in the constructor.
  `void`
  `setCustomizerTabName(String customizerTabName)`
  Set the name of the customizer tab if the error message applies to a customizer.

  ### Methods inherited from class Throwable

  `addSuppressed, fillInStackTrace, getCause, getLocalizedMessage, getMessage, getStackTrace, getSuppressed, initCause, printStackTrace, printStackTrace, printStackTrace, setStackTrace, toString`

  ### Methods inherited from class Object

  `clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait`

- ## Constructor Details

  - ### BeanValidationException

    public BeanValidationException(String errorMessage)
    Constructor with an error message.
    Parameters:
      `errorMessage` - the error message

  - ### BeanValidationException

    public BeanValidationException(String errorMessage, String propertyName)
    Constructor with an error message and a property name. The specified property will be selected in the install4j GUI.
    Parameters:
      `errorMessage` - the error message
      `propertyName` - the name of the invalid property

- ## Method Details

  - ### getPropertyName

    public String getPropertyName()
    Get the name of the invalid property, or `null` if no property name was specified in the constructor.
    Returns:
      the property name

  - ### setCustomizerTabName

    public void setCustomizerTabName(String customizerTabName)
    Set the name of the customizer tab if the error message applies to a customizer. This is either the `name` property of the `javax.swing.JComponent` or, if the customizer is a `javax.swing.JTabbedPane`, the name of the tab.
    Parameters:
      `customizerTabName` - the name
    See Also:
      - `Install4JBeanInfo(String, String, String, boolean, boolean, Integer, Class, Class)`

  - ### getCustomizerTabName

    public String getCustomizerTabName()
    Get the name of the customizer tab that was set with `setCustomizerTabName`.
    Returns:
      the name
    See Also:
      - `setCustomizerTabName(String)`