Package org.joda.beans

Examples of org.joda.beans.MetaBean


   * @param <R> the bean type
   * @param cls  the class to get the builder for, not null
   * @return the bean builder, not null
   */
  public static <R extends Bean> DirectBeanFudgeBuilder<R> of(final Class<R> cls) {
    MetaBean meta;
    try {
      meta = (MetaBean) cls.getMethod("meta").invoke(null);
    } catch (RuntimeException ex) {
      throw ex;
    } catch (Exception ex) {
View Full Code Here


      try {
        cls = DealAttributeEncoder.class.getClassLoader().loadClass(dealClass);
      } catch (ClassNotFoundException ex) {
        throw new OpenGammaRuntimeException("Unable to load deal class", ex);
      }
      MetaBean metaBean = JodaBeanUtils.metaBean(cls);
      deal = (Deal) metaBean.builder().build();
      for (Map.Entry<String, String> entry : tradeAttributes.entrySet()) {
        String key = entry.getKey();
        if (key.startsWith(DEAL_PREFIX) && !key.equals(DEAL_CLASSNAME) && !key.equals(DEAL_TYPE)) {
          String propertyName = StringUtils.substringAfter(key, DEAL_PREFIX);
          if (metaBean.metaPropertyExists(propertyName)) {
            MetaProperty<?> mp = metaBean.metaProperty(propertyName);
            String value = entry.getValue();
            if (s_logger.isDebugEnabled()) {
              s_logger.debug("Setting property {}({}) with value {}", new Object[]{mp, mp.propertyType(), value});
            }
            mp.setString(deal, value);
View Full Code Here

TOP

Related Classes of org.joda.beans.MetaBean

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.