use of com.enonic.xp.region.ImageComponent in project xp by enonic.
the class ImageComponentDataSerializer method fromData.
@Override
public ImageComponent fromData(final PropertySet data) {
final ImageComponent.Builder component = ImageComponent.create();
final PropertySet specialBlockSet = data.getSet(ImageComponentType.INSTANCE.toString());
if (specialBlockSet != null) {
if (specialBlockSet.isNotNull(ID)) {
final ContentId contentId = ContentId.from(specialBlockSet.getString(ID));
component.image(contentId);
}
if (specialBlockSet.hasProperty(CAPTION)) {
final PropertyTree config = new PropertyTree();
config.addString(CAPTION, specialBlockSet.getString(CAPTION));
component.config(config);
}
}
return component.build();
}
Aggregations