1 package org.daisy.pipeline.css;
2
3 import java.io.IOException;
4 import java.io.Reader;
5 import java.net.URI;
6 import java.net.URL;
7 import java.nio.charset.Charset;
8
9 public interface CssPreProcessor {
10
11 public boolean supportsMediaType(String mediaType, URL url);
12
13 public PreProcessingResult compile(PreProcessingSource source) throws IOException;
14
15 public static class PreProcessingSource {
16
17
18
19
20 public final Reader stream;
21
22
23
24
25 public final URI base;
26
27
28
29
30
31
32
33 public Reader reread(Charset encoding) throws IOException {
34 throw new IOException();
35 }
36
37 public PreProcessingSource(Reader stream, URI base) {
38 this.stream = stream;
39 this.base = base;
40 }
41 }
42
43 public static final class PreProcessingResult {
44
45
46
47
48 public final Reader stream;
49
50
51
52
53 public final String sourceMap;
54
55
56
57
58 public final URI base;
59
60 public PreProcessingResult(Reader stream, String sourceMap, URI base) {
61 this.stream = stream;
62 this.sourceMap = sourceMap;
63 this.base = base;
64 }
65 }
66 }