Class BeanInfoFactory
java.lang.Object
com.inductiveautomation.ignition.common.beans.BeanInfoFactory
A wrapper for the Introspector to return instances of BeanInfos.
 
This class also contains some convenience methods for getting access to BeanInfo specfic values for keys like "isContainer", "containerDelegate" and "proxyComponent"
Also contains some utility methods for using reflection to invoke methods.
- 
Field SummaryFields
- 
Constructor SummaryConstructors
- 
Method SummaryModifier and TypeMethodDescriptionstatic voidstatic ObjectexecuteMethod(String methodName, Object source) Helper method which uses reflection to search for the methodName on the target with no arguments.static ObjectexecuteMethod(String methodName, Object source, Object arg) Helper method which uses reflection to search for the methodName on the target with a single arg type as a parameter.static ObjectexecuteMethod(String methodName, Object source, Object arg, Class argType) Helper method which uses reflection to execute a method with a single argument.static ObjectgetBeanAttribute(Class type, String attribute) static BeanInfogetBeanInfo(Class cls) Retrieves the BeanInfo for a Classstatic BeanInfogetBeanInfo(Class cls, int flags) static ContainerReturns the container delegate for the object.static IconRetrieves the BeanInfo icon for the class.static PropertyDescriptorgetPropertyDescriptor(Class type, String propertyName) static ComponentgetProxyComponent(Object obj) Returns the visual proxy for the object A visual proxy is a visual component which represents a non visual component.static booleanisContainer(Object obj) Determines if the object is a Swing container like JScrollPanestatic voidsetBeanAttribute(Class type, String attribute, Object value) static voidsetPropertyAttribute(Class type, String property, String attribute, Object value) 
- 
Field Details- 
DISPLAY_ORDER_KEYWell known key for a property descriptor that should be an integer that represents the relative display order- See Also:
 
- 
CATEGORY_KEYWell known key for a property descriptor that holds the name of the category of the property.- See Also:
 
 
- 
- 
Constructor Details- 
BeanInfoFactorypublic BeanInfoFactory()
 
- 
- 
Method Details- 
addBeanInfoSearchPackage
- 
executeMethodHelper method which uses reflection to search for the methodName on the target with no arguments.
- 
executeMethodHelper method which uses reflection to search for the methodName on the target with a single arg type as a parameter. The Class hierarchy of the arg is traversed until the method is found.For example, we wish to execute Container.add(Component). The source object would be a Container instance, the argument would be an instance of a Component and the method name would be "add". If a JButton is used the component, the hierarchy will be walked: JButton to JComponent to Container to Component until the add method on Container is found. - Parameters:
- methodName- name of the method to execute
- source- object in which to invoke the method
- arg- object which is the argument
- Returns:
- the result of invocation or null if it hasn't been invoked or if the invocation produces a null result
 
- 
executeMethodHelper method which uses reflection to execute a method with a single argument. Once the method is found which satisfies the parameter, that method is stored in a cache.- Parameters:
- methodName- name of the method to execute
- source- object in which to invoke the method
- arg- object which is the argument
- argType- type of the argument object.
- Returns:
- the result of invocation or null if it hasn't been invoked or if the invocation produces a null result
 
- 
getBeanInfoRetrieves the BeanInfo for a Class
- 
getBeanInfo
- 
setBeanAttribute
- 
getBeanAttribute
- 
getPropertyDescriptor
- 
setPropertyAttribute
- 
getIconRetrieves the BeanInfo icon for the class.
- 
isContainerDetermines if the object is a Swing container like JScrollPane- Parameters:
- obj- Object to test.
- Returns:
- true if the object is a Swing container.
 
- 
getContainerDelegateReturns the container delegate for the object. The container delegate is the actual container for which objects are added to for Swing containers. For example, The JViewport is the container delegate for the JScrollPane.- Returns:
- container delegate or null if there is no container delegate.
 
- 
getProxyComponentReturns the visual proxy for the object A visual proxy is a visual component which represents a non visual component.- Returns:
- an instance of the visual proxy component or null if a proxy doesn't exist.
 
 
-