use of org.whole.lang.resources.CompoundResourceRegistry in project whole by wholeplatform.
the class ReusablesInterpreterVisitor method visit.
@Override
public void visit(Registry entity) {
entity.getRegistryUri().accept(this);
String registryId = getResult().wStringValue();
if (!ResourceRegistry.hasRegistry(registryId))
throw new WholeIllegalArgumentException("Undefined registry " + registryId).withSourceEntity(entity).withBindings(getBindings());
IResourceRegistry<IResource> registry = ResourceRegistry.getRegistry(registryId);
entity.getUri().accept(this);
String uri = getResult().wStringValue();
if (ResourceUtils.hasFragmentPart(uri) && registry instanceof CompoundResourceRegistry) {
CompoundResourceRegistry<IResource> compoundRegistry = (CompoundResourceRegistry<IResource>) registry;
setResult(compoundRegistry.getFunctionModel(uri, true, getBindings()));
} else
setResult(registry.getResourceModel(uri, true, getBindings()));
}
Aggregations