private List<MetadataResolver> buildSingleMetadataResolver(final MetadataFilter metadataFilterChain, final Resource resource,
                                                               final Document document) {
        val metadataRoot = document.getDocumentElement();
        val metadataProvider = new DOMMetadataResolver(metadataRoot);
        metadataProvider.setParserPool(this.configBean.getParserPool());
        metadataProvider.setFailFastInitialization(true);
        metadataProvider.setRequireValidMetadata(this.requireValidMetadata);
        metadataProvider.setId(metadataProvider.getClass().getCanonicalName());
        if (metadataFilterChain != null) {
            metadataProvider.setMetadataFilter(metadataFilterChain);
        }
        LOGGER.debug("Initializing metadata resolver for [{}]", resource);
        FunctionUtils.doUnchecked(__ -> metadataProvider.initialize());
        val resolvers = new ArrayList<MetadataResolver>(1);
        resolvers.add(metadataProvider);
        return resolvers;
    }
Build single metadata resolver.

@param metadataFilterChain the metadata filters chained together
@param resource            the resource
@param document            the xml document to parse
@return list of resolved metadata from resources.
support/cas-server-support-saml-mdui-core/src/main/java/org/apereo/cas/support/saml/mdui/AbstractMetadataResolverAdapter.java