List of usage examples for java.lang IllegalAccessException getMessage
public String getMessage()
From source file:sk.opendata.odn.repository.solr.SolrItem.java
/** * Create SOLR item from given record./* ww w . j a v a 2s . c o m*/ * * @param source * record - source of data * @param type * type of the record * @param id * ID of the record * * @return SOLR item created from given data * * @throws OdnSerializationException * when conversion into SOLR beans fails */ public static SolrItem createSolrItem(AbstractRecord source) throws OdnSerializationException { SolrItem solrItem = null; try { solrItem = new SolrItem(); PropertyUtils.copyProperties(solrItem, source); solrItem.type = SolrItemType.getType(source.getClass()).toString(); solrItem.id = source.getId(); } catch (IllegalAccessException e) { logger.error("illegal access exception", e); throw new OdnSerializationException(e.getMessage(), e); } catch (InvocationTargetException e) { logger.error("invocation target exception", e); throw new OdnSerializationException(e.getMessage(), e); } catch (NoSuchMethodException e) { logger.error("no such method exception", e); throw new OdnSerializationException(e.getMessage(), e); } return solrItem; }
From source file:me.andpay.ti.util.BeanUtils.java
/** * <p>Populate the JavaBeans properties of the specified bean, based on * the specified name/value pairs.</p> * * <p>For more details see <code>BeanUtilsBean</code>.</p> * * @param bean JavaBean whose properties are being populated * @param properties Map keyed by property name, with the * corresponding (String or String[]) value(s) to be set * * @exception IllegalAccessException if the caller does not have * access to the property accessor method * @exception InvocationTargetException if the property accessor method * throws an exception/* w w w . j a v a 2 s . c o m*/ * @see BeanUtilsBean#populate */ public static void populate(Object bean, Map<?, ?> properties) { try { org.apache.commons.beanutils.BeanUtils.populate(bean, properties); } catch (IllegalAccessException e) { throw new RuntimeException(e.getMessage(), e); } catch (InvocationTargetException e) { throw new RuntimeException(e.getMessage(), e); } }
From source file:me.andpay.ti.util.BeanUtils.java
/** * <p>Set the specified property value, performing type conversions as * required to conform to the type of the destination property.</p> * * <p>For more details see <code>BeanUtilsBean</code>.</p> * * @param bean Bean on which setting is to be performed * @param name Property name (can be nested/indexed/mapped/combo) * @param value Value to be set/* w w w. j av a 2 s.c o m*/ * * @exception IllegalAccessException if the caller does not have * access to the property accessor method * @exception InvocationTargetException if the property accessor method * throws an exception * @see BeanUtilsBean#setProperty */ public static void setProperty(Object bean, String name, Object value) { try { org.apache.commons.beanutils.BeanUtils.setProperty(bean, name, value); } catch (IllegalAccessException e) { throw new RuntimeException(e.getMessage(), e); } catch (InvocationTargetException e) { throw new RuntimeException(e.getMessage(), e); } }
From source file:sk.opendata.odn.repository.jackrabbit.JackrabbitItem.java
/** * Create SOLR item from given record./*from w ww . j av a 2s .co m*/ * * @param source * record - source of data * @param type * type of the record * @param id * ID of the record * * @return SOLR item created from given data * * @throws OdnSerializationException * when conversion into SOLR beans fails */ public static JackrabbitItem createJackrabbitItem(AbstractRecord source) throws OdnSerializationException { JackrabbitItem solrItem = null; try { solrItem = new JackrabbitItem(); PropertyUtils.copyProperties(solrItem, source); solrItem.type = JackrabbitItemType.getType(source.getClass()).toString(); solrItem.id = source.getId(); } catch (IllegalAccessException e) { logger.error("illegal access exception", e); throw new OdnSerializationException(e.getMessage(), e); } catch (InvocationTargetException e) { logger.error("invocation target exception", e); throw new OdnSerializationException(e.getMessage(), e); } catch (NoSuchMethodException e) { logger.error("no such method exception", e); throw new OdnSerializationException(e.getMessage(), e); } return solrItem; }
From source file:me.andpay.ti.util.BeanUtils.java
/** * <p>Return the entire set of properties for which the specified bean * provides a read method.</p>//from w w w. ja va2 s . c o m * * <p>For more details see <code>BeanUtilsBean</code>.</p> * * @param bean Bean whose properties are to be extracted * @return Map of property descriptors * * @exception IllegalAccessException if the caller does not have * access to the property accessor method * @exception InvocationTargetException if the property accessor method * throws an exception * @exception NoSuchMethodException if an accessor method for this * property cannot be found * @see BeanUtilsBean#describe */ public static Map<?, ?> describe(Object bean) { try { return org.apache.commons.beanutils.BeanUtils.describe(bean); } catch (IllegalAccessException e) { throw new RuntimeException(e.getMessage(), e); } catch (InvocationTargetException e) { throw new RuntimeException(e.getMessage(), e); } catch (NoSuchMethodException e) { throw new RuntimeException(e.getMessage(), e); } }
From source file:me.andpay.ti.util.BeanUtils.java
/** * <p>Return the value of the specified array property of the specified * bean, as a String array.</p>/* w w w . j a v a 2 s .c o m*/ * * <p>For more details see <code>BeanUtilsBean</code>.</p> * * @param bean Bean whose property is to be extracted * @param name Name of the property to be extracted * @return The array property value * * @exception IllegalAccessException if the caller does not have * access to the property accessor method * @exception InvocationTargetException if the property accessor method * throws an exception * @exception NoSuchMethodException if an accessor method for this * property cannot be found * @see BeanUtilsBean#getArrayProperty */ public static String[] getArrayProperty(Object bean, String name) { try { return org.apache.commons.beanutils.BeanUtils.getArrayProperty(bean, name); } catch (IllegalAccessException e) { throw new RuntimeException(e.getMessage(), e); } catch (InvocationTargetException e) { throw new RuntimeException(e.getMessage(), e); } catch (NoSuchMethodException e) { throw new RuntimeException(e.getMessage(), e); } }
From source file:me.andpay.ti.util.BeanUtils.java
/** * <p>Return the value of the specified indexed property of the specified * bean, as a String.</p>//from w ww .j a va 2 s. c o m * * <p>For more details see <code>BeanUtilsBean</code>.</p> * * @param bean Bean whose property is to be extracted * @param name <code>propertyname[index]</code> of the property value * to be extracted * @return The indexed property's value, converted to a String * * @exception IllegalAccessException if the caller does not have * access to the property accessor method * @exception InvocationTargetException if the property accessor method * throws an exception * @exception NoSuchMethodException if an accessor method for this * property cannot be found * @see BeanUtilsBean#getIndexedProperty(Object, String) */ public static String getIndexedProperty(Object bean, String name) { try { return org.apache.commons.beanutils.BeanUtils.getIndexedProperty(bean, name); } catch (IllegalAccessException e) { throw new RuntimeException(e.getMessage(), e); } catch (InvocationTargetException e) { throw new RuntimeException(e.getMessage(), e); } catch (NoSuchMethodException e) { throw new RuntimeException(e.getMessage(), e); } }
From source file:me.andpay.ti.util.BeanUtils.java
/** * </p>Return the value of the specified indexed property of the specified * bean, as a String.</p>/*from w w w . j a va 2s. c om*/ * * <p>For more details see <code>BeanUtilsBean</code>.</p> * * @param bean Bean whose property is to be extracted * @param name <code>propertyname(index)</code> of the property value * to be extracted * @return The mapped property's value, converted to a String * * @exception IllegalAccessException if the caller does not have * access to the property accessor method * @exception InvocationTargetException if the property accessor method * throws an exception * @exception NoSuchMethodException if an accessor method for this * property cannot be found * @see BeanUtilsBean#getMappedProperty(Object, String) */ public static String getMappedProperty(Object bean, String name) { try { return org.apache.commons.beanutils.BeanUtils.getMappedProperty(bean, name); } catch (IllegalAccessException e) { throw new RuntimeException(e.getMessage(), e); } catch (InvocationTargetException e) { throw new RuntimeException(e.getMessage(), e); } catch (NoSuchMethodException e) { throw new RuntimeException(e.getMessage(), e); } }
From source file:me.andpay.ti.util.BeanUtils.java
/** * Return the value of the specified indexed property of the specified * bean, as a String. The index is specified as a method parameter and * must *not* be included in the property name expression * * <p>For more details see <code>BeanUtilsBean</code>.</p> * * @param bean Bean whose property is to be extracted * @param name Simple property name of the property value to be extracted * @param index Index of the property value to be extracted * @return The indexed property's value, converted to a String * * @exception IllegalAccessException if the caller does not have * access to the property accessor method * @exception InvocationTargetException if the property accessor method * throws an exception/*from w w w .ja v a2 s .c om*/ * @exception NoSuchMethodException if an accessor method for this * property cannot be found * @see BeanUtilsBean#getIndexedProperty(Object, String, int) */ public static String getIndexedProperty(Object bean, String name, int index) { try { return org.apache.commons.beanutils.BeanUtils.getIndexedProperty(bean, name, index); } catch (IllegalAccessException e) { throw new RuntimeException(e.getMessage(), e); } catch (InvocationTargetException e) { throw new RuntimeException(e.getMessage(), e); } catch (NoSuchMethodException e) { throw new RuntimeException(e.getMessage(), e); } }
From source file:me.andpay.ti.util.BeanUtils.java
/** * <p>Return the value of the (possibly nested) property of the specified * name, for the specified bean, as a String.</p> * * <p>For more details see <code>BeanUtilsBean</code>.</p> * * @param bean Bean whose property is to be extracted * @param name Possibly nested name of the property to be extracted * @return The nested property's value, converted to a String * * @exception IllegalAccessException if the caller does not have * access to the property accessor method * @exception IllegalArgumentException if a nested reference to a * property returns null/*w ww. j a v a 2s. c om*/ * @exception InvocationTargetException if the property accessor method * throws an exception * @exception NoSuchMethodException if an accessor method for this * property cannot be found * @see BeanUtilsBean#getNestedProperty */ public static String getNestedProperty(Object bean, String name) { try { return org.apache.commons.beanutils.BeanUtils.getNestedProperty(bean, name); } catch (IllegalAccessException e) { throw new RuntimeException(e.getMessage(), e); } catch (InvocationTargetException e) { throw new RuntimeException(e.getMessage(), e); } catch (NoSuchMethodException e) { throw new RuntimeException(e.getMessage(), e); } }