@Override public CSSInputStream getInput(Object source, String encoding) throws IOException { return CSSInputStream.stringStream((String) source); }
@Override public CSSInputStream getInput(Object source, String encoding) throws IOException { return CSSInputStream.stringStream((String) source); }
/** * Creates input for CSSLexer * * @param source * Source, either raw data (String) or URL * @return Created stream * @throws IOException * When file is not found or other IO exception occurs */ protected static CSSInputStream getInput(Object source, NetworkProcessor network, String encoding, SourceType type) throws IOException { switch (type) { case INLINE: case EMBEDDED: return CSSInputStream.stringStream((String) source); case URL: return CSSInputStream.urlStream((URL) source, network, encoding); default: throw new RuntimeException("Coding error"); } }
CSSInputStream input = CSSInputStream.stringStream(query); input.setBase(new URL("file://media/query/url")); //this URL should not be used, just for safety