public class BeanUtils
extends Object
Utility methods for discovering and working with bean properties on ClassNode instances.
This utility supports JavaBean property conventions including:
@Property annotationCommonly used in AST transformation and type checking to analyze class structure and generate property access patterns.
| Type Params | Return Type | Name and description |
|---|---|---|
|
public static void |
addPseudoProperties(ClassNode origType, ClassNode cNode, List<PropertyNode> result, Set<String> names, boolean includeStatic, boolean includePseudoGetters, boolean includePseudoSetters)Adds pseudo-properties for getters and setters to a property list. |
|
public static void |
addPseudoProperties(ClassNode origType, ClassNode cNode, List<PropertyNode> result, Set<String> names, boolean includeStatic, boolean includePseudoGetters, boolean includePseudoSetters, boolean traverseSuperClasses)Adds pseudo-properties for getters and setters to a property list, optionally traversing superclasses. |
|
public static List<PropertyNode> |
getAllProperties(ClassNode type, boolean includeSuperProperties, boolean includeStatic, boolean includePseudoGetters)Discovers all properties in a class, optionally including inherited and pseudo-properties. |
|
public static List<PropertyNode> |
getAllProperties(ClassNode type, boolean includeSuperProperties, boolean includeStatic, boolean includePseudoGetters, boolean includePseudoSetters, boolean superFirst)Discovers all properties in a class, optionally including both getter and setter pseudo-properties. |
Adds pseudo-properties for getters and setters to a property list. Pseudo-properties are created from methods following JavaBean naming conventions but without corresponding field declarations.
origType - the original type being analyzed (used for access checks)cNode - the class node to scan for getter/setter methodsresult - the list to accumulate discovered pseudo-propertiesnames - a set tracking property names already discovered (to prevent duplicates)includeStatic - whether to include static methodsincludePseudoGetters - whether to add properties from getter methodsincludePseudoSetters - whether to add properties from setter methods Adds pseudo-properties for getters and setters to a property list, optionally traversing superclasses.
Pseudo-properties are created from methods following JavaBean naming conventions
but without corresponding field declarations. Methods marked with @Internal are skipped.
origType - the original type being analyzed (used for access checks)cNode - the class node to scan for getter/setter methodsresult - the list to accumulate discovered pseudo-propertiesnames - a set tracking property names already discovered (to prevent duplicates)includeStatic - whether to include static methodsincludePseudoGetters - whether to add properties from getXxx/isXxx getter methodsincludePseudoSetters - whether to add properties from setXxx setter methodstraverseSuperClasses - whether to include inherited methods from superclassesDiscovers all properties in a class, optionally including inherited and pseudo-properties. Pseudo-properties are derived from getter methods following JavaBean naming conventions.
type - the ClassNode to analyzeincludeSuperProperties - whether to include properties from superclassesincludeStatic - whether to include static propertiesincludePseudoGetters - whether to include pseudo-properties created from getXxx/isXxx methodsDiscovers all properties in a class, optionally including both getter and setter pseudo-properties. Pseudo-properties include JavaBean getters (getXxx/isXxx) and setters (setXxx) without corresponding fields.
type - the ClassNode to analyzeincludeSuperProperties - whether to include properties from superclassesincludeStatic - whether to include static propertiesincludePseudoGetters - whether to include pseudo-properties from getter methodsincludePseudoSetters - whether to include pseudo-properties from setter methodssuperFirst - whether to list superclass properties before current class properties