Class Configurator

    • Field Detail

      • NO_PARAMS_TYPES

        public static final String[] NO_PARAMS_TYPES
        No parameter types
    • Constructor Detail

      • Configurator

        public Configurator()
    • Method Detail

      • toClass

        public static Class<?> toClass​(Type type)
        Turn type into class.
        Parameters:
        type - the type
        Returns:
        class
      • convertValue

        public static Object convertValue​(Class<?> clazz,
                                          Object value,
                                          boolean replaceProperties,
                                          boolean trim)
                                   throws Throwable
        Convert a value
        Parameters:
        clazz - the class
        value - the value
        replaceProperties - whether to replace system properties
        trim - whether to trim string value
        Returns:
        the value or null if there is no editor
        Throws:
        Throwable - for any error
      • getTypes

        public static String[] getTypes​(ValueConfig[] values)
        Get types from values.
        Parameters:
        values - the values
        Returns:
        the values' types
      • findMethod

        public static Method findMethod​(org.jboss.as.server.deployment.reflect.DeploymentReflectionIndex index,
                                        Class classInfo,
                                        String name,
                                        String[] paramTypes,
                                        boolean isStatic,
                                        boolean isPublic,
                                        boolean strict)
                                 throws IllegalArgumentException
        Find method info
        Parameters:
        index - the deployment reflection index
        classInfo - the class info
        name - the method name
        paramTypes - the parameter types
        isStatic - must the method be static
        isPublic - must the method be public
        strict - is strict about method modifiers
        Returns:
        the method info
        Throws:
        IllegalArgumentException - when no such method
      • equals

        public static boolean equals​(String[] typeNames,
                                     Class<?>[] typeInfos)
        Test whether type names are equal to type infos
        Parameters:
        typeNames - the type names
        typeInfos - the type infos
        Returns:
        true when they are equal
      • simpleCheck

        protected static boolean simpleCheck​(String[] typeNames,
                                             Class<?>[] typeInfos)
        A simple null and length check.
        Parameters:
        typeNames - the type names
        typeInfos - the type infos
        Returns:
        false if either argument is null or lengths differ, else true