org.daisy.pipeline.css.CssAnalyzer Maven / Gradle / Ivy
package org.daisy.pipeline.css;
import java.io.IOException;
import java.util.Collection;
import java.util.Collections;
import javax.xml.transform.Source;
import javax.xml.transform.URIResolver;
import org.daisy.pipeline.css.Medium;
import org.daisy.pipeline.css.sass.impl.SassAnalyzer;
import org.daisy.pipeline.datatypes.DatatypeRegistry;
import org.daisy.pipeline.datatypes.DatatypeService;
/**
* Analyzes a style sheet and extracts information about global variables.
*/
public class CssAnalyzer {
private final org.daisy.pipeline.css.sass.impl.SassAnalyzer analyzer;
public CssAnalyzer(Medium medium, URIResolver uriResolver, DatatypeRegistry datatypes) {
this(Collections.singleton(medium), uriResolver, datatypes);
}
public CssAnalyzer(Collection media, URIResolver uriResolver, DatatypeRegistry datatypes) {
analyzer = new SassAnalyzer(media, uriResolver, datatypes);
}
/**
* Get the variables declared within the given style sheets and source document.
*
* @param userAndUserAgentStylesheets {@code Source} objects must have absolute hierarchical URI as
* system ID
* @param sourceDocument {@code Source} object must have absolute hierarchical URI as system ID,
* or object may be {@code null}.
*/
public Result analyze(Iterable