Package com.im.commons.ui.beans
Class PropertyDescriptorBuilder
- java.lang.Object
-
- com.im.commons.ui.beans.PropertyDescriptorBuilder
-
public final class PropertyDescriptorBuilder extends java.lang.Object
Builds upPropertyDescriptor
instance using various options.
-
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description static PropertyDescriptorBuilder
createBooleanPropertyBuilder(java.lang.String propertyName, java.lang.Class<?> beanClass)
Creates newPropertyDescriptorBuilder
for boolean read-write properties.static PropertyDescriptorBuilder
createBooleanReadOnlyPropertyBuilder(java.lang.String propertyName, java.lang.Class<?> beanClass)
Creates newPropertyDescriptorBuilder
for boolean read-only properties.static PropertyDescriptorBuilder
createPropertyBuilder(java.lang.String propertyName, java.lang.Class<?> beanClass)
Creates newPropertyDescriptorBuilder
for non-boolean read-write properties.static PropertyDescriptorBuilder
createReadOnlyPropertyBuilder(java.lang.String propertyName, java.lang.Class<?> beanClass)
Creates newPropertyDescriptorBuilder
for non-boolean read-only properties.java.beans.PropertyDescriptor
getResult()
Gets constructedPropertyDescriptor
.void
setHidden(boolean hidden)
The "hidden" flag is used to identify features that are intended only for tool use, and which should not be exposed to humans.void
setLocalized(boolean localized)
-
-
-
Method Detail
-
createPropertyBuilder
public static PropertyDescriptorBuilder createPropertyBuilder(java.lang.String propertyName, java.lang.Class<?> beanClass) throws java.beans.IntrospectionException
Creates newPropertyDescriptorBuilder
for non-boolean read-write properties.- Parameters:
propertyName
- The programmatic name of the property.beanClass
- The Class object for the target bean.- Returns:
- new
PropertyDescriptorBuilder
instance. - Throws:
java.beans.IntrospectionException
- if an exception occurs during introspection
-
createReadOnlyPropertyBuilder
public static PropertyDescriptorBuilder createReadOnlyPropertyBuilder(java.lang.String propertyName, java.lang.Class<?> beanClass) throws java.beans.IntrospectionException
Creates newPropertyDescriptorBuilder
for non-boolean read-only properties. Resulting property will not be editable. No setter method is needed.- Parameters:
propertyName
- The programmatic name of the property.beanClass
- The Class object for the target bean.- Returns:
- new
PropertyDescriptorBuilder
instance. - Throws:
java.beans.IntrospectionException
- if an exception occurs during introspection
-
createBooleanPropertyBuilder
public static PropertyDescriptorBuilder createBooleanPropertyBuilder(java.lang.String propertyName, java.lang.Class<?> beanClass) throws java.beans.IntrospectionException
Creates newPropertyDescriptorBuilder
for boolean read-write properties. Resulting property isboolean
. In this case getter method must have prefixis
.- Parameters:
propertyName
- The programmatic name of the property.beanClass
- The Class object for the target bean.- Returns:
- new
PropertyDescriptorBuilder
instance. - Throws:
java.beans.IntrospectionException
- if an exception occurs during introspection
-
createBooleanReadOnlyPropertyBuilder
public static PropertyDescriptorBuilder createBooleanReadOnlyPropertyBuilder(java.lang.String propertyName, java.lang.Class<?> beanClass) throws java.beans.IntrospectionException
Creates newPropertyDescriptorBuilder
for boolean read-only properties. Resulting property isboolean
. In this case getter method must have prefixis
. Resulting property is not editable. No setter method is needed..- Parameters:
propertyName
- The programmatic name of the property.beanClass
- The Class object for the target bean.- Returns:
- new
PropertyDescriptorBuilder
instance. - Throws:
java.beans.IntrospectionException
- if an exception occurs during introspection
-
setLocalized
public void setLocalized(boolean localized)
-
setHidden
public void setHidden(boolean hidden)
The "hidden" flag is used to identify features that are intended only for tool use, and which should not be exposed to humans.- Parameters:
hidden
- True if this feature should be hidden from human users.
-
getResult
public java.beans.PropertyDescriptor getResult()
Gets constructedPropertyDescriptor
.- Returns:
PropertyDescriptor
instance
-
-