Class BeanUtils
java.lang.Object
io.helidon.builder.processor.tools.BeanUtils
Provides functions to aid with bean naming and parsing.
-
Method Summary
Modifier and TypeMethodDescriptionstatic booleanisBooleanType(Class<?> type) Returns true if the provided type is a boolean type.static booleanisBooleanType(String typeName) Returns true if the provided type name is a boolean type.static booleanisBuiltInJavaType(TypeName type) Returns true if the given type is known to be a built-in java type (e.g., package name starts with "java").static booleanisReservedWord(String word) Returns true if the word provided is considered to be a reserved word and should otherwise be avoided from generation.static booleanisValidMethodType(String typeName) Returns true if the return type is valid for a bean (e.g., not void, etc.).static booleanvalidateAndParseMethodName(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.
-
Method Details
-
isBooleanType
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
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
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 namemethodTypeName- the method typethrowIfInvalid- flag indicating if an exception should be raised if invalidattributeNameRef- 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
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
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
-