/** * Create an HTML Serializer object. * * @param namespaceService a namespace service * @param template the template location * @param css the css to use (comma-delimited for multiple css documents) * @param js the js to use (comma-delimited for multiple js documents) * @param icon an icon, may be {@code null} */ public HtmlSerializer(final NamespaceService namespaceService, final String template, final List<String> css, final List<String> js, final String icon) { this.namespaceService = requireNonNull(namespaceService, "NamespaceService may not be null!"); final String templatePath = ofNullable(template).orElse("org/trellisldp/rdfa/resource.mustache"); final File tpl = new File(templatePath); this.template = tpl.exists() ? mf.compile(templatePath) : mf.compile(getReader(templatePath), templatePath); this.css = ofNullable(css).orElseGet(Collections::emptyList); this.js = ofNullable(js).orElseGet(Collections::emptyList); this.icon = icon; }
/** * Create an HTML Serializer object. * * @param namespaceService a namespace service * @param template the template location * @param css the css to use (comma-delimited for multiple css documents) * @param js the js to use (comma-delimited for multiple js documents) * @param icon an icon, may be {@code null} */ public HtmlSerializer(final NamespaceService namespaceService, final String template, final List<String> css, final List<String> js, final String icon) { this.namespaceService = requireNonNull(namespaceService, "NamespaceService may not be null!"); final String templatePath = ofNullable(template).orElse("org/trellisldp/rdfa/resource.mustache"); final File tpl = new File(templatePath); this.template = tpl.exists() ? mf.compile(templatePath) : mf.compile(getReader(templatePath), templatePath); this.css = ofNullable(css).orElseGet(Collections::emptyList); this.js = ofNullable(js).orElseGet(Collections::emptyList); this.icon = icon; }