/** * Create a {@link CascadingStyleSheet} object from a parsed object. * * @param eVersion * The CSS version to use. May not be <code>null</code>. * @param aNode * The parsed CSS object to read. May not be <code>null</code>. * @return Never <code>null</code>. */ @Nonnull @Deprecated public static CascadingStyleSheet readCascadingStyleSheetFromNode (@Nonnull final ECSSVersion eVersion, @Nonnull final CSSNode aNode) { return readCascadingStyleSheetFromNode (eVersion, aNode, CSSReader.getDefaultInterpretErrorHandler ()); }
/** * Create a {@link CSSDeclarationList} object from a parsed object. * * @param eVersion * The CSS version to use. May not be <code>null</code>. * @param aNode * The parsed CSS object to read. May not be <code>null</code>. * @return Never <code>null</code>. */ @Nonnull @Deprecated public static CSSDeclarationList readDeclarationListFromNode (@Nonnull final ECSSVersion eVersion, @Nonnull final CSSNode aNode) { return readDeclarationListFromNode (eVersion, aNode, CSSReader.getDefaultInterpretErrorHandler ()); }
@Override public TreeContext generate(Reader r) throws IOException { LineReader lr = new LineReader(r); CSSCharStream s = new CSSCharStream(new LineReader(lr)); s.setTabSize(1); final ParserCSS30TokenManager th = new ParserCSS30TokenManager(s); final ParserCSS30 p = new ParserCSS30(th); p.setCustomErrorHandler(null); p.setBrowserCompliantMode(false); try { CascadingStyleSheet sheet = CSSHandler.readCascadingStyleSheetFromNode(ECSSVersion.LATEST, p.styleSheet(), CSSReader.getDefaultInterpretErrorHandler()); GtCssVisitor v = new GtCssVisitor(sheet, lr); CSSVisitor.visitCSS(sheet, v); return v.getTreeContext(); } catch (ParseException e) { throw new IOException(e); } } }
aRealInterpretErrorHandler = getDefaultInterpretErrorHandler ();
aRealInterpretErrorHandler = getDefaultInterpretErrorHandler ();