java.lang.Object
io.helidon.builder.processor.tools.BeanUtils

public class BeanUtils extends Object
Provides functions to aid with bean naming and parsing.
  • Method Details

    • isBooleanType

      public static boolean isBooleanType(String typeName)
      Returns true if the provided type name is a boolean type.
      Parameters:
      typeName - the type name
      Returns:
      true if the type name provided is boolean type
    • isBooleanType

      public static boolean isBooleanType(Class<?> type)
      Returns true if the provided type is a boolean type.
      Parameters:
      type - the type
      Returns:
      true if the type name provided is boolean type
    • isValidMethodType

      public static boolean isValidMethodType(String typeName)
      Returns true if the return type is valid for a bean (e.g., not void, etc.).
      Parameters:
      typeName - the return type name for the method, represented as a string
      Returns:
      true if valid
    • validateAndParseMethodName

      public static boolean validateAndParseMethodName(String methodName, String methodTypeName, boolean throwIfInvalid, AtomicReference<Optional<List<String>>> attributeNameRef)
      Validates the method, and will optionally throw if the throw message supplier is passed.
      Parameters:
      methodName - the method name
      methodTypeName - the method type
      throwIfInvalid - flag indicating if an exception should be raised if invalid
      attributeNameRef - the reference that will be populated to hold the attribute names - in preferred naming order
      Returns:
      true if the method name represents a valid bean getter/is method
      Throws:
      RuntimeException - if the throw message is used and the method name is invalid
    • isReservedWord

      public static boolean isReservedWord(String word)
      Returns true if the word provided is considered to be a reserved word and should otherwise be avoided from generation.
      Parameters:
      word - the word
      Returns:
      true if it appears to be a reserved word
    • isBuiltInJavaType

      public static boolean isBuiltInJavaType(TypeName type)
      Returns true if the given type is known to be a built-in java type (e.g., package name starts with "java").
      Parameters:
      type - the fully qualified type name
      Returns:
      true if the given type is definitely known to be built-in Java type