本文整理汇总了Java中com.holonplatform.core.property.PropertyRendererRegistry.NoSuitableRendererAvailableException类的典型用法代码示例。如果您正苦于以下问题:Java NoSuitableRendererAvailableException类的具体用法?Java NoSuitableRendererAvailableException怎么用?Java NoSuitableRendererAvailableException使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
NoSuitableRendererAvailableException类属于com.holonplatform.core.property.PropertyRendererRegistry包,在下文中一共展示了NoSuitableRendererAvailableException类的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: build
import com.holonplatform.core.property.PropertyRendererRegistry.NoSuitableRendererAvailableException; //导入依赖的package包/类
/**
* Build and bind {@link ViewComponent}s to the properties of the property set.
*/
@SuppressWarnings({ "unchecked", "rawtypes" })
public void build() {
propertyViews.clear();
// render and bind ViewComponents
properties.forEach(p -> {
// exclude hidden properties
if (!isPropertyHidden(p)) {
final Optional<ViewComponent> viewComponent = render(p);
if (!viewComponent.isPresent() && !isIgnoreMissingViewComponent()) {
throw new NoSuitableRendererAvailableException(
"No ViewComponent render available to render the property [" + p.toString()
+ "] as a ViewComponent");
}
viewComponent.ifPresent(v -> {
// configure
configureViewComponent(p, v);
// bind
propertyViews.put(p, v);
});
}
});
}
示例2: renderAndBind
import com.holonplatform.core.property.PropertyRendererRegistry.NoSuitableRendererAvailableException; //导入依赖的package包/类
/**
* Render the {@link Input} and set it up in given property configuration.
* @param <T> Property type
* @param configuration Property configuration
*/
private <T> void renderAndBind(PropertyConfiguration<T> configuration) {
final Optional<Input<T>> input = render(configuration.getProperty());
if (!input.isPresent() && !isIgnoreMissingInputs()) {
throw new NoSuitableRendererAvailableException(
"No Input renderer available to render the property [" + configuration.getProperty() + "]");
}
input.ifPresent(i -> {
// configure
configureInput(configuration, i);
// bind
configuration.setInput(i);
});
}
示例3: render
import com.holonplatform.core.property.PropertyRendererRegistry.NoSuitableRendererAvailableException; //导入依赖的package包/类
/**
* Render this property as given <code>renderType</code>.
* <p>
* To successfully render the property, a suitable {@link PropertyRenderer} for given render type must be available
* from the {@link PropertyRendererRegistry} obtained from current {@link Context} or from the default one for
* current ClassLoader.
* </p>
* @param <R> Rendered object type
* @param renderType Render type
* @return Rendered property as given render type
* @throws NoSuitableRendererAvailableException if no PropertyRenderer is available for this property and given
* rendering type
*/
default <R> R render(Class<R> renderType) {
return renderIfAvailable(renderType).orElseThrow(() -> new NoSuitableRendererAvailableException(
"No PropertyRenderer available for rendering type " + renderType + " and property " + this));
}