Package com.mchange.v2.codegen.bean
Class BeanInfoGen
- java.lang.Object
-
- com.mchange.v2.codegen.bean.BeanInfoGen
-
public final class BeanInfoGen extends java.lang.ObjectGenerates the Java source of an explicitjava.beans.BeanInfoclass for a bean class. By default the generatedBeanInfofully replicates the information that ordinary introspection would have produced in the absence of any explicitBeanInfofor the bean class -- its bean descriptor, property descriptors, event-set descriptors and method descriptors. Properties may be excluded from the generated property descriptors in two ways: by name (any property whose name appears inexcludedPropertyNames) and by type (any property whose type is assignable to one of theClassobjects inexcludedPropertyTypes). For an indexed property, exclusion by type considers both the array type and the element type, independent of which accessor convention defined the property (an array-valued accessor such asString[] getTags(), a single-index accessor such asString getTags(int), or both). Whichever of the two types the property descriptor does not directly report is derived from the other, and the property is excluded if either is assignable to an excluded type. Thus an indexed property with element typeStringis excluded whetherString.classorString[].classis given, and identically regardless of how it was declared. Because the generatedgetPropertyDescriptors()returns a non-null array, the JavaBeansIntrospectoruses it verbatim rather than rediscovering properties reflectively, so the accessor methods of an excluded property are no longer seen as constituting a JavaBeans property. The methods themselves remain ordinary public methods and are still reported among the method descriptors.
-
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static java.lang.StringexplicitBeanInfoClassSourceForBeanClass(java.lang.Class beanClass, java.util.Set excludedPropertyNames, java.util.Set excludedPropertyTypes)static voidmain(java.lang.String[] argv)
-
-
-
Method Detail
-
explicitBeanInfoClassSourceForBeanClass
public static java.lang.String explicitBeanInfoClassSourceForBeanClass(java.lang.Class beanClass, java.util.Set excludedPropertyNames, java.util.Set excludedPropertyTypes) throws java.beans.IntrospectionException, java.io.IOException- Throws:
java.beans.IntrospectionExceptionjava.io.IOException
-
main
public static void main(java.lang.String[] argv)
-
-