2
* xslthl - XSLT Syntax Highlighting
3
* https://sourceforge.net/projects/xslthl/
4
* Copyright (C) 2005-2008 Michal Molhanec, Jirka Kosek, Michiel Hendriks
6
* This software is provided 'as-is', without any express or implied
7
* warranty. In no event will the authors be held liable for any damages
8
* arising from the use of this software.
10
* Permission is granted to anyone to use this software for any purpose,
11
* including commercial applications, and to alter it and redistribute it
12
* freely, subject to the following restrictions:
14
* 1. The origin of this software must not be misrepresented; you must not
15
* claim that you wrote the original software. If you use this software
16
* in a product, an acknowledgment in the product documentation would be
17
* appreciated but is not required.
18
* 2. Altered source versions must be plainly marked as such, and must not be
19
* misrepresented as being the original software.
20
* 3. This notice may not be removed or altered from any source distribution.
22
* Michal Molhanec <mol1111 at users.sourceforge.net>
23
* Jirka Kosek <kosek at users.sourceforge.net>
24
* Michiel Hendriks <elmuerte at users.sourceforge.net>
26
package net.sf.xslthl;
28
import java.util.Collection;
29
import java.util.HashSet;
34
public abstract class WholeHighlighter extends Highlighter {
35
private Collection<String> styles = new HashSet<String>();
36
private boolean emptyStyle = true;
37
private boolean allStyles = false;
39
void loadStyles(Params params) {
40
if (!params.isSet("empty")) {
43
if (params.isSet("all")) {
47
params.getMutliParams("style", styles);
50
boolean appliesOnEmptyStyle() {
54
boolean appliesOnAllStyles() {
58
boolean appliesOnStyle(String style) {
59
return styles.contains(style);
65
* @see net.sf.xslthl.Highlighter#init(net.sf.xslthl.Params)
68
public void init(Params params) throws HighlighterConfigurationException {
70
if (params != null && params.isSet("applyOnStyles")) {
71
loadStyles(params.getParams("applyOnStyles"));