blob: a4c32274caa607f03822afe8ba907c4cee9c533e (
plain) (
blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
|
// Copyright 2017 Yahoo Holdings. Licensed under the terms of the Apache 2.0 license. See LICENSE in the project root.
package com.yahoo.search.pagetemplates;
import com.yahoo.search.pagetemplates.model.PageTemplateVisitor;
import com.yahoo.search.pagetemplates.model.Source;
import java.util.HashSet;
import java.util.Set;
/**
* Visits a page template object structure and records the sources mentioned.
*
* @author bratseth
*/
class SourceVisitor extends PageTemplateVisitor {
private Set<Source> sources=new HashSet<>();
@Override
public void visit(Source source) {
sources.add(source);
}
/** Returns the live list of sources collected by this during visiting */
public Set<Source> getSources() { return sources; }
}
|