Package org.joda.beans

Examples of org.joda.beans.Bean.metaBean()


   */
  public static <T> ConfigItem<T> of(final T object) {
    final ConfigItem<T> item = new ConfigItem<T>(object);
    if (object instanceof Bean) {
      final Bean bean = (Bean) object;
      if (bean.metaBean().metaPropertyExists("name")) {
        item.setName(ObjectUtils.toString(bean.property("name").get(), null));
      }
    } else if (object != null) {
      try {
        item.setName((String) object.getClass().getMethod("getName").invoke(object));
View Full Code Here


   * @throws Exception allowing throwing of a checked exception
   */
  protected void setFactoryProperties(ComponentFactory factory, LinkedHashMap<String, String> remainingConfig) throws Exception {
    if (factory instanceof Bean) {
      Bean bean = (Bean) factory;
      for (MetaProperty<?> mp : bean.metaBean().metaPropertyIterable()) {
        String value = remainingConfig.remove(mp.name());
        setProperty(bean, mp, value);
      }
    }
  }
View Full Code Here

      return convertedValue;
    }
    if (Bean.class.isAssignableFrom(value.getClass())) {
      Bean bean = (Bean) value;
      BuildingBeanVisitor<JSONObject> visitor = new BuildingBeanVisitor<>(bean, new JsonDataSink(_converters));
      return traverser.traverse(bean.metaBean(), visitor);
    } else {
      throw new IllegalArgumentException("Unable to convert " + value.getClass().getName());
    }
  }
View Full Code Here

TOP
Copyright © 2018 www.massapi.com. 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.