public class BeanInfoUtil extends Object
| Modifier and Type | Field and Description |
|---|---|
protected static Class[] |
EMPTY_CLASS_ARRAY
To save allocations.
|
protected static String[] |
EMPTY_STRING_ARRAY |
static String |
SCRIPT_VISIBILITY_MODIFIERS
A FeatureDescriptor value indicating its visibility to Gosu
|
| Constructor and Description |
|---|
BeanInfoUtil() |
| Modifier and Type | Method and Description |
|---|---|
protected static MethodDescriptor |
_buildMethodDescriptor(Class actionClass,
String methodName,
String[] parameterNames,
Class[] parameterTypes,
Class[] actualParameterTypes)
Builds a method descriptor with no explicit visibility.
|
protected static TypedPropertyDescriptor |
_buildPropertyDescriptor(String propertyName,
Class beanClass,
String getterName,
String setterName)
Builds a property descriptor with no explicit visibility.
|
static MethodDescriptor |
buildHiddenMethodDescriptor(Class actionClass,
String methodName,
String[] parameterNames,
Class[] parameterTypes)
Completely hides a method from scripting.
|
static MethodDescriptor |
buildMethodDescriptor(Class actionClass,
String methodName,
String[] parameterNames,
Class[] parameterTypes)
Deprecated.
To properly expose a method for scripting call buildScriptableMethodDescriptor() or a derivative of that.
|
static MethodDescriptor |
buildScriptableDeprecatedMethodDescriptor(Class actionClass,
String methodName,
String[] parameterNames,
Class[] parameterTypes)
Builds a deprecated method descriptor that is exposed for scripting everywhere.
|
static MethodDescriptor |
buildScriptableMethodDescriptor(Class actionClass,
String methodName,
String[] parameterNames,
Class[] parameterTypes)
Builds a method descriptor that is exposed for scripting everywhere.
|
static MethodDescriptor |
buildScriptableMethodDescriptorNoArgs(Class actionClass,
String methodName)
Builds a no-arg method descriptor that is exposed for scripting everywhere.
|
static TypedPropertyDescriptor |
buildScriptablePropertyDescriptor(String propertyName,
Class beanClass,
String getterName,
String setterName)
Builds a scriptable property descriptor with the given information.
|
static IScriptabilityModifier |
getVisibilityModifier(FeatureDescriptor descriptor) |
static boolean |
isDeprecated(FeatureDescriptor descriptor) |
static boolean |
isScriptable(FeatureDescriptor descriptor) |
static boolean |
isVisible(FeatureDescriptor descriptor,
IScriptabilityModifier constraint)
Determine if the descriptor is visible given a visibility constraint.
|
static FeatureDescriptor |
makeScriptable(FeatureDescriptor descriptor)
Expose the method/property descriptor for scripting.
|
static FeatureDescriptor |
makeScriptableDeprecated(FeatureDescriptor descriptor)
Expose the method/property descriptor for scripting, but mark it
deprecated.
|
static void |
setVisibilityModifier(FeatureDescriptor descriptor,
IScriptabilityModifier modifier) |
public static final String SCRIPT_VISIBILITY_MODIFIERS
protected static final Class[] EMPTY_CLASS_ARRAY
protected static final String[] EMPTY_STRING_ARRAY
public static MethodDescriptor buildScriptableMethodDescriptorNoArgs(Class actionClass, String methodName)
public static MethodDescriptor buildScriptableMethodDescriptor(Class actionClass, String methodName, String[] parameterNames, Class[] parameterTypes)
public static MethodDescriptor buildScriptableDeprecatedMethodDescriptor(Class actionClass, String methodName, String[] parameterNames, Class[] parameterTypes)
public static MethodDescriptor buildHiddenMethodDescriptor(Class actionClass, String methodName, String[] parameterNames, Class[] parameterTypes)
public static MethodDescriptor buildMethodDescriptor(Class actionClass, String methodName, String[] parameterNames, Class[] parameterTypes)
public static TypedPropertyDescriptor buildScriptablePropertyDescriptor(String propertyName, Class beanClass, String getterName, String setterName)
propertyName - name of the propertybeanClass - class of the bean on which the property is foundgetterName - name of the getter method, or null if write-onlypropertyName - name of the setter method, or null if read-onlypublic static FeatureDescriptor makeScriptable(FeatureDescriptor descriptor)
descriptor - A method or property descriptor.public static FeatureDescriptor makeScriptableDeprecated(FeatureDescriptor descriptor)
descriptor - A method or property descriptor.public static boolean isScriptable(FeatureDescriptor descriptor)
public static boolean isDeprecated(FeatureDescriptor descriptor)
public static boolean isVisible(FeatureDescriptor descriptor, IScriptabilityModifier constraint)
public static IScriptabilityModifier getVisibilityModifier(FeatureDescriptor descriptor)
descriptor - A method or property descriptor.public static void setVisibilityModifier(FeatureDescriptor descriptor, IScriptabilityModifier modifier)
descriptor - A method or property descriptor.modifier - The descriptor's associated visibility modifier.protected static MethodDescriptor _buildMethodDescriptor(Class actionClass, String methodName, String[] parameterNames, Class[] parameterTypes, Class[] actualParameterTypes)
protected static TypedPropertyDescriptor _buildPropertyDescriptor(String propertyName, Class beanClass, String getterName, String setterName)
Copyright © 2022. All rights reserved.