/** * Returns the set of CSS classnames in the underlying css or gss files. * * @throws UnableToCompleteException if the user has called for a css/gss file we * can't find. */ public Set<String> getCssClassNames() throws UnableToCompleteException { List<URL> urls = getExternalCss(); if (cssClassNames == null) { final File bodyFile = getGeneratedFile(); if (bodyFile != null) { try { urls.add(bodyFile.toURI().toURL()); } catch (MalformedURLException e) { throw new RuntimeException(e); } } assert urls.size() > 0; if (gss) { return getCssClassNames(bodyFile.getName(), body, imports, logger.getTreeLogger()); } else { CssStylesheet sheet = GenerateCssAst.exec(logger.getTreeLogger(), urls.toArray(new URL[urls.size()])); cssClassNames = ExtractClassNamesVisitor.exec(sheet, imports.toArray(new JClassType[imports.size()])); } } return cssClassNames; }
/** * Returns the set of CSS classnames in the underlying css or gss files. * * @throws UnableToCompleteException if the user has called for a css/gss file we * can't find. */ public Set<String> getCssClassNames() throws UnableToCompleteException { List<URL> urls = getExternalCss(); if (cssClassNames == null) { final File bodyFile = getGeneratedFile(); if (bodyFile != null) { try { urls.add(bodyFile.toURI().toURL()); } catch (MalformedURLException e) { throw new RuntimeException(e); } } assert urls.size() > 0; if (gss) { return GssWrapper.getCssClassNames(bodyFile.getName(), body, imports, logger.getTreeLogger()); } else { CssStylesheet sheet = GenerateCssAst.exec(logger.getTreeLogger(), urls.toArray(new URL[urls.size()])); cssClassNames = ExtractClassNamesVisitor.exec(sheet, imports.toArray(new JClassType[imports.size()])); } } return cssClassNames; }