Class AutomaticBean

    • Method Detail

      • finishLocalSetup

        protected abstract void finishLocalSetup()
                                          throws CheckstyleException
        Provides a hook to finish the part of this component's setup that was not handled by the bean introspection.

        The default implementation does nothing.

        Throws:
        CheckstyleException - if there is a configuration error.
      • createBeanUtilsBean

        private static org.apache.commons.beanutils.BeanUtilsBean createBeanUtilsBean()
        Creates a BeanUtilsBean that is configured to use type converters that throw a ConversionException instead of using the default value when something goes wrong.
        Returns:
        a configured BeanUtilsBean
      • registerIntegralTypes

        private static void registerIntegralTypes​(org.apache.commons.beanutils.ConvertUtilsBean cub)
        Register basic types of JDK like boolean, int, and String to use with BeanUtils. All these types are found in the java.lang package.
        Parameters:
        cub - Instance of ConvertUtilsBean to register types with.
      • registerCustomTypes

        private static void registerCustomTypes​(org.apache.commons.beanutils.ConvertUtilsBean cub)
        Register custom types of JDK like URI and Checkstyle specific classes to use with BeanUtils. None of these types should be found in the java.lang package.
        Parameters:
        cub - Instance of ConvertUtilsBean to register types with.
      • tryCopyProperty

        private void tryCopyProperty​(String key,
                                     Object value,
                                     boolean recheck)
                              throws CheckstyleException
        Recheck property and try to copy it.
        Parameters:
        key - key of value
        value - value
        recheck - whether to check for property existence before copy
        Throws:
        CheckstyleException - when property defined incorrectly
      • getConfiguration

        protected final Configuration getConfiguration()
        Returns the configuration that was used to configure this component.
        Returns:
        the configuration that was used to configure this component.