use of org.apache.deltaspike.core.api.config.view.metadata.InlineViewMetaData in project deltaspike by apache.
the class ViewConfigExtension method addIndirectlyInheritedMetaData.
protected void addIndirectlyInheritedMetaData(Class configClass, Set<Annotation> annotations) {
for (Annotation annotation : annotations) {
InlineViewMetaData inlineViewMetaData = annotation.annotationType().getAnnotation(InlineViewMetaData.class);
if (inlineViewMetaData != null) {
Class<? extends TargetViewConfigProvider> targetViewConfigProviderClass = inlineViewMetaData.targetViewConfigProvider();
TargetViewConfigProvider targetViewConfigProvider = ClassUtils.tryToInstantiateClass(targetViewConfigProviderClass);
for (Class<? extends ViewConfig> viewConfigRef : targetViewConfigProvider.getTarget(annotation)) {
ViewConfigNode viewConfigNode = findNode(viewConfigRef);
if (viewConfigNode == null) {
addPageDefinition(viewConfigRef);
viewConfigNode = findNode(viewConfigRef);
if (viewConfigNode == null) {
throw new IllegalStateException("No node created for: " + viewConfigRef);
}
}
Class<? extends InlineMetaDataTransformer> inlineNodeTransformerClass = inlineViewMetaData.inlineMetaDataTransformer();
if (!InlineMetaDataTransformer.class.equals(inlineNodeTransformerClass)) {
InlineMetaDataTransformer inlineMetaDataTransformer = ClassUtils.tryToInstantiateClass(inlineNodeTransformerClass);
viewConfigNode.getInheritedMetaData().add(inlineMetaDataTransformer.convertToViewMetaData(annotation, configClass));
} else // no custom transformer registered -> add the annotation itself
{
viewConfigNode.getInheritedMetaData().add(annotation);
}
}
break;
}
}
}
Aggregations