2 * This file is part of "SnipSnap Radeox Rendering Engine".
4 * Copyright (c) 2002 Stephan J. Schmidt, Matthias L. Jugel
7 * Please visit http://radeox.org/ for updates and contact.
10 * This library is free software; you can redistribute it and/or
11 * modify it under the terms of the GNU Lesser General Public
12 * License as published by the Free Software Foundation; either
13 * version 2.1 of the License, or (at your option) any later version.
15 * This library is distributed in the hope that it will be useful,
16 * but WITHOUT ANY WARRANTY; without even the implied warranty of
17 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
18 * Lesser General Public License for more details.
20 * You should have received a copy of the GNU Lesser General Public
21 * License along with this library; if not, write to the Free Software
22 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
26 package org.plog4u.wiki.macro.code;
28 import org.radeox.macro.code.DefaultRegexCodeFormatter;
29 import org.radeox.macro.code.SourceCodeFormatter;
32 * SqlCodeFilter colourizes SQL source code
36 * @version $Id: SqlCodeFilter.java,v 1.1 2004-12-24 11:11:13 axelcl Exp $
39 public class SqlCodeFilter extends DefaultRegexCodeFormatter implements SourceCodeFormatter {
41 private static final String KEYWORDS =
42 "\\b(SELECT|DELETE|UPDATE|WHERE|FROM|GROUP|BY|HAVING)\\b";
44 private static final String OBJECTS =
48 private static final String QUOTES =
49 "\"(([^\"\\\\]|\\.)*)\"";
52 public SqlCodeFilter() {
53 super(QUOTES, "<b><font color=\"#2A00FF\">\"$1\"</font></b>");
54 addRegex(OBJECTS, "<b><font color=\"#7F9FBF\">$1</font></b>");
55 addRegex(KEYWORDS, "<b><font color=\"#750055\">$1</font></b>");
59 public String getName() {