Examples of PropertyInfo


Examples of org.modelmapper.spi.PropertyInfo

  @Override
  protected Class<?> getElementType(MappingContext<Object, Collection<Object>> context) {
    Mapping mapping = context.getMapping();
    if (mapping instanceof PropertyMapping) {
      PropertyInfo destInfo = ((PropertyMapping) mapping).getLastDestinationProperty();
      Class<?> elementType = TypeResolver.resolveArgument(destInfo.getGenericType(),
          destInfo.getInitialType());
      return elementType == Unknown.class ? Object.class : elementType;
    } else if (context.getGenericDestinationType() instanceof ParameterizedType)
      return Types.rawTypeFor(((ParameterizedType) context.getGenericDestinationType()).getActualTypeArguments()[0]);

    return Object.class;
View Full Code Here

Examples of org.projectforge.core.PropertyInfo

  }

  private I18nExportColumn createColumn(final ExcelExporter exporter, final ExportSheet sheet, final Class< ? > clazz, final String property)
  {
    final Field field = PropUtils.getField(clazz, property);
    final PropertyInfo propInfo = PropUtils.get(field);
    final I18nExportColumn exportColumn = new I18nExportColumn(property, propInfo.i18nKey(), 100);
    exporter.putFieldFormat(sheet, field, propInfo, exportColumn);
    return exportColumn;
  }
View Full Code Here

Examples of org.qi4j.runtime.property.PropertyInfo

    {
        ValueModel valueModel = compositeModelModule.model();
        this.properties = new LinkedHashMap<>();
        for( PropertyDescriptor propertyDescriptor : valueModel.state().properties() )
        {
            PropertyInfo builderInfo = ( (PropertyModel) propertyDescriptor ).getBuilderInfo();
            Object value = stateResolver.getPropertyState( propertyDescriptor );
            PropertyInstance<Object> propertyInstance = new PropertyInstance<>( builderInfo, value );
            properties.put( propertyDescriptor.accessor(), propertyInstance );
        }
View Full Code Here

Examples of org.sgx.yuigwt.editors.props.PropertyInfo

      return null;
  }

  public Editor<?> newPropertyEditor(PropertyHaver ph, String propName) throws EditorNotFound {
    Editor<?> ed = null;
    PropertyInfo prop = ph.getProperties().get(propName);

    // Window.alert("ajjaja: "+prop.getEditorId());
    if (prop != null && Util.notNull(prop.getEditorId())) {
      ed = newEditorNamed(prop.getEditorId());
    }

    if (prop != null && prop.getType() != null && ed == null)
      ed = newEditor(prop.getType());

    return ed;
  }
View Full Code Here

Examples of org.soybeanMilk.core.bean.PropertyInfo

 
  @Test
  public void getPropertyInfo()
  {
    {
      PropertyInfo pi=PropertyInfo.getPropertyInfo(String.class);
      Assert.assertNotNull(pi);
      Assert.assertNull( pi.getSubPropertyInfos() );
    }
   
    {
      PropertyInfo pi=PropertyInfo.getPropertyInfo(java.util.Date.class);
      Assert.assertNotNull(pi.getSubPropertyInfo("date").getReadMethod());
      Assert.assertNotNull(pi.getSubPropertyInfo("hours").getReadMethod());
      Assert.assertNotNull(pi.getSubPropertyInfo("minutes").getReadMethod());
      Assert.assertNotNull(pi.getSubPropertyInfo("month").getReadMethod());
      Assert.assertNotNull(pi.getSubPropertyInfo("seconds").getReadMethod());
      Assert.assertNotNull(pi.getSubPropertyInfo("time").getReadMethod());
      Assert.assertNotNull(pi.getSubPropertyInfo("year").getReadMethod());
    }
   
    {
      PropertyInfo pi=PropertyInfo.getPropertyInfo(int.class);
      Assert.assertNotNull(pi);
      Assert.assertNull( pi.getSubPropertyInfos() );
    }
   
    {
      PropertyInfo pi=PropertyInfo.getPropertyInfo(MyBean.class);
      Assert.assertNotNull(pi);
      Assert.assertNotNull(pi.getSubPropertyInfo("integer").getWriteMethod());
     
      PropertyInfo p0=pi.getSubPropertyInfo("myBean");
      Assert.assertNotNull(p0.getReadMethod());
      Assert.assertNotNull(p0.getSubPropertyInfo("myBean").getReadMethod());
    }
   
    {
      PropertyInfo pi=PropertyInfo.getPropertyInfo(MyBean2.class);
      Assert.assertNotNull(pi);
      Assert.assertNotNull(pi.getSubPropertyInfo("list").getReadMethod());
     
      PropertyInfo p0=pi.getSubPropertyInfo("myBean");
      Assert.assertNotNull(p0.getReadMethod());
      Assert.assertNotNull(p0.getSubPropertyInfo("myBean").getReadMethod());
    }
   
    {
      PropertyInfo pi=PropertyInfo.getPropertyInfo(int[].class);
      Assert.assertNotNull(pi);
      Assert.assertNull( pi.getSubPropertyInfos() );
    }
   
    {
      PropertyInfo pi=PropertyInfo.getPropertyInfo(MyBean[].class);
      Assert.assertNotNull(pi);
      Assert.assertNull( pi.getSubPropertyInfos() );
    }
   
    {
      PropertyInfo pi=PropertyInfo.getPropertyInfo(MyBean2[].class);
      Assert.assertNotNull(pi);
      Assert.assertNull( pi.getSubPropertyInfos() );
    }
  }
View Full Code Here

Examples of org.yaac.shared.property.PropertyInfo

                SafeHtmlBuilder sb = new SafeHtmlBuilder();
               
                if (c == null) {  // not necessary always have this column
                  sb.appendHtmlConstant("<br/>");
                } else {
                  PropertyInfo property = PropertyInfo.Builder.fromResultCell(c);
                 
                  // populate warnings in tooltip
                  List<String> warnings = property.getWarnings();
                 
                  if (warnings != null && !warnings.isEmpty()) {
                    List<String> warningMsgs = transform(warnings, new Function<String, String>(){
                      @Override
                      public String apply(String errorCode) {
                        return errMsgs.getString(errorCode);
                      }
                    });
                   
                    sb.appendHtmlConstant(
                        "<div title='" + Joiner.on("<br/>").join(warningMsgs) + "' style='background-color: yellow;'>" +
                        property.asHtml() + "</div>");
                  } else {
                    sb.appendHtmlConstant(property.asHtml())
                  }
                }
                return sb.toSafeHtml();
              }
          };
         
          resultTable.addColumn(column, cell.getTitle());
          colMap.put(cell.getTitle(), column);
         
          sortHandler.setComparator(column, new Comparator<List<ResultCell>>() {
            @Override
            public int compare(List<ResultCell> cell1s, List<ResultCell> cell2s) {
              // dynamic columns, both c1 and c2 can be null
              ResultCell c1 = lookupCell(cell.getTitle(), cell1s);
              ResultCell c2 = lookupCell(cell.getTitle(), cell2s);
             
              if (c1 == null) {
                if (c2 == null) {
                  return 0;
                } else {
                  return -1;
                }
              } else {
                if (c2 == null) {
                  return 1;
                } else {
                  PropertyInfo prop1 = PropertyInfo.Builder.fromResultCell(c1);
                  PropertyInfo prop2 = PropertyInfo.Builder.fromResultCell(c2);
                  return prop1.compareTo(prop2);
                }
              }
            }
          });
View Full Code Here

Examples of pl.net.bluesoft.rnd.processtool.dict.mapping.metadata.item.PropertyInfo

    }
    return null;
  }

  private PropertyInfo getPropertyInfo(Object item, String property) {
    PropertyInfo propInfo = getItemInfo(item.getClass()).getPropertyInfo(property);

    if (propInfo == null) {
      throw new RuntimeException(String.format("No dictionary info for property %s of class %s", property, item.getClass().getSimpleName()));
    }
    return propInfo;
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.