Java 类org.apache.commons.beanutils.LazyDynaClass 实例源码

项目:comeon    文件:PictureReader.java   
private void copy(final Directory directory, final Map<String, Object> metadata) {
    final TagDescriptor<?> descriptor = MetadataHelper.getDescriptor(directory);

    final LazyDynaClass directoryClass = new LazyDynaClass(directory.getName(), null, directory.getTags()
            .parallelStream()
            .map(t -> new DynaProperty(t.getTagName().replaceAll(NON_WORD_CHARS, ""), String.class))
            .toArray(DynaProperty[]::new));
    directoryClass.setReturnNull(true);

    final DynaBean directoryMetadata = new LazyDynaBean(directoryClass);
    directory.getTags().stream().forEach(t -> directoryMetadata.set(
            t.getTagName().replaceAll(NON_WORD_CHARS, ""),
            descriptor.getDescription(t.getTagType())
    ));
    metadata.put(directory.getName().replaceAll(NON_WORD_CHARS, ""), directoryMetadata);
}
项目:OpenCyclos    文件:MapBean.java   
public DynaClass getDynaClass() {
    final LazyDynaClass dynaClass = new LazyDynaClass();
    for (final Map.Entry<String, Class<?>> entry : propertyTypes.entrySet()) {
        dynaClass.add(entry.getKey(), entry.getValue());
    }
    return dynaClass;
}
项目:open-cyclos    文件:MapBean.java   
public DynaClass getDynaClass() {
    final LazyDynaClass dynaClass = new LazyDynaClass();
    for (final Map.Entry<String, Class<?>> entry : propertyTypes.entrySet()) {
        dynaClass.add(entry.getKey(), entry.getValue());
    }
    return dynaClass;
}
项目:greenpepper    文件:DynaPropertyWriterTest.java   
protected void setUp() throws Exception {
    DynaProperty name = new DynaProperty("name", int.class);
    bean = new LazyDynaBean(new LazyDynaClass("target", new DynaProperty[] { name } ));
}