Class BeanHelper
- java.lang.Object
- 
- com.inductiveautomation.ignition.common.util.BeanHelper
 
- 
 public class BeanHelper extends java.lang.ObjectThis is a thin wrapper around BeanInfo, which has some more helpful conveniences for calling getters and setters without all the syntax noise
- 
- 
Constructor SummaryConstructors Constructor Description BeanHelper(java.lang.Class<?> clazz)Create a BeanHelper for the given class.
 - 
Method SummaryAll Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description java.util.List<java.beans.PropertyDescriptor>findAllProperties()<T extends java.lang.annotation.Annotation>
 TfindAnnotation(java.lang.String property, java.lang.Class<T> annotationClass)Searches both the read method and the write method (in that order) for the annotation of the given classjava.beans.PropertyDescriptorfindProperty(java.lang.String property)Finds the property with a given name.static BeanHelperforClass(java.lang.Class<?> clazz)Using this static getter will make use of a static cache internallyjava.lang.Objectget(java.lang.Object self, java.lang.String property)Reads the value of the given property from the objectjava.lang.ObjectgetQuiet(java.lang.Object self, java.lang.String property, LoggerEx log)Gets the value of a property on a bean.java.lang.Class<?>getType()voidset(java.lang.Object self, java.lang.String property, java.lang.Object value)voidsetQuiet(java.lang.Object self, java.lang.String property, java.lang.Object value, LoggerEx log)Sets a value for the bean.
 
- 
- 
- 
Method Detail- 
forClasspublic static BeanHelper forClass(java.lang.Class<?> clazz) Using this static getter will make use of a static cache internally
 - 
getTypepublic java.lang.Class<?> getType() 
 - 
findAllPropertiespublic java.util.List<java.beans.PropertyDescriptor> findAllProperties() 
 - 
findPropertypublic java.beans.PropertyDescriptor findProperty(java.lang.String property) Finds the property with a given name. If the property doesn't exist, an IllegalArgumentException will be thrown
 - 
findAnnotationpublic <T extends java.lang.annotation.Annotation> T findAnnotation(java.lang.String property, java.lang.Class<T> annotationClass)Searches both the read method and the write method (in that order) for the annotation of the given class
 - 
getpublic java.lang.Object get(java.lang.Object self, java.lang.String property) throws java.lang.IllegalAccessException, java.lang.IllegalArgumentException, java.lang.reflect.InvocationTargetExceptionReads the value of the given property from the object- Throws:
- java.lang.IllegalAccessException
- java.lang.IllegalArgumentException
- java.lang.reflect.InvocationTargetException
 
 - 
getQuietpublic java.lang.Object getQuiet(java.lang.Object self, java.lang.String property, LoggerEx log)Gets the value of a property on a bean. Upon error, messages are logged to the logger and null is returned, except for IllegalAccessExceptions, which are thrown in RuntimeException wrappers.
 - 
setpublic void set(java.lang.Object self, java.lang.String property, java.lang.Object value) throws java.lang.reflect.InvocationTargetException, java.lang.IllegalAccessException, java.lang.IllegalArgumentException- Throws:
- java.lang.reflect.InvocationTargetException
- java.lang.IllegalAccessException
- java.lang.IllegalArgumentException
 
 - 
setQuietpublic void setQuiet(java.lang.Object self, java.lang.String property, java.lang.Object value, LoggerEx log)Sets a value for the bean. Errors are logged to the logger for this BeanHelper, except for IllegalAccessExceptions, which are thrown in RuntimeException wrappers.
 
- 
 
-