diff --git a/inventory/src/main/java/org/apache/felix/inventory/Format.java b/inventory/src/main/java/org/apache/felix/inventory/Format.java
new file mode 100644
index 0000000..3ef7bd9
--- /dev/null
+++ b/inventory/src/main/java/org/apache/felix/inventory/Format.java
@@ -0,0 +1,99 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+package org.apache.felix.inventory;
+
+/**
+ * Java 1.4 compatible enumeration of formats used for inventory printing.
+ * <p>
+ * {@link InventoryPrinter} services indicate supported formats listing any of
+ * these values in their {@link InventoryPrinter#FORMAT} service
+ * properties.
+ * <p>
+ * Requestors of inventory printing indicate the desired output format by
+ * specifying the respective constant when calling the
+ * {@link InventoryPrinter#print(java.io.PrintWriter, Format, boolean)} method.
+ * <p>
+ * Round-tripping is guaranteed between the {@link #toString()} and
+ * {@link #valueOf(String)} methods.
+ */
+public final class Format
+{
+
+    /**
+     * Inventory is printed in plain text format.
+     */
+    public static Format TEXT = new Format("TEXT");
+
+    /**
+     * Inventory is printed in HTML format.
+     * <p>
+     * Technically the output is expected to be an HTML fragment which is
+     * intended to be inserted into any block element, such as {@code <div>},
+     * within a HTML {@code <body>}.
+     */
+    public static Format HTML = new Format("HTML");
+
+    /**
+     * Inventory is printed in JSON format.
+     * <p>
+     * The output is expected to be a valid JSON object. That is, the output
+     * must start with an opening curly brace (<code>{</code>) and end with a
+     * closing curly brace (<code>}</code>).
+     */
+    public static Format JSON = new Format("JSON");
+
+    private final String format;
+
+    private Format(final String format)
+    {
+        this.format = format;
+    }
+
+    /**
+     * Converts the given {@code format} string into an instance of
+     * this class.
+     *
+     * @param format The string value to be converted into a {@code Format}.
+     * @return One of the defined {@code Format} constants or {@code null}.
+     */
+    public static Format valueOf(final String format)
+    {
+        if (TEXT.format.equalsIgnoreCase(format))
+        {
+            return TEXT;
+        }
+        else if (HTML.format.equalsIgnoreCase(format))
+        {
+            return HTML;
+        }
+        else if (JSON.format.equalsIgnoreCase(format))
+        {
+            return JSON;
+        }
+        return null;
+    }
+
+    /**
+     * Returns the string value of this format.
+     */
+    public String toString()
+    {
+        return format;
+    }
+}
diff --git a/inventory/src/main/java/org/apache/felix/inventory/InventoryPrinter.java b/inventory/src/main/java/org/apache/felix/inventory/InventoryPrinter.java
index d1807cf..6ba5dd2 100644
--- a/inventory/src/main/java/org/apache/felix/inventory/InventoryPrinter.java
+++ b/inventory/src/main/java/org/apache/felix/inventory/InventoryPrinter.java
@@ -6,9 +6,9 @@
  * to you under the Apache License, Version 2.0 (the
  * "License"); you may not use this file except in compliance
  * with the License. You may obtain a copy of the License at
- * 
+ *
  * http://www.apache.org/licenses/LICENSE-2.0
- * 
+ *
  * Unless required by applicable law or agreed to in writing,
  * software distributed under the License is distributed on an
  * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
@@ -24,15 +24,15 @@
  * The <code>InventoryPrinter</code> is a service interface to be
  * implemented by providers which want to hook into the display of the
  * current configuration and state of the OSGi framework and application.
- * 
- * A inventory printer must configure at least these three configuration
- * properties
+ * <p>
+ * The following service registration properties further declare the
+ * {@code InventoryPrinter} service:
  * <ul>
- * <li>{@link #CONFIG_PRINTER_MODES} - the supported modes</li>
- * <li>{@link #CONFIG_TITLE} - the printer title</li>
- * <li>{@link #CONFIG_NAME} - the printer name</li>
+ * <li>{@link #FORMAT} - the supported formats</li>
+ * <li>{@link #TITLE} - the printer title</li>
+ * <li>{@link #NAME} - the printer name</li>
+ * <li>{@link #WEBCONSOLE} - whether to confine the printer to the Web Console</li>
  * </ul>
- * 
  */
 public interface InventoryPrinter
 {
@@ -41,60 +41,67 @@
      * The service name under which services of this class must be registered
      * to be picked for inclusion in the configuration report.
      */
-    String SERVICE = InventoryPrinter.class.getName(); //$NON-NLS-1$
+    String SERVICE = "org.apache.felix.inventory.InventoryPrinter"; //$NON-NLS-1$
 
     /**
-     * The property defining the supported rendering modes.
-     * The value of this property is either a string or a string array
-     * containing
-     * valid names of {@link PrinterMode}.
-     * 
-     * If this property is missing or contains invalid values,
-     * the printer is ignored.
+     * The property defining one or more supported formats. The value of this
+     * property is either a string, a string array or a Collection<String>
+     * containing valid names of the constants defined in the {@link Format}
+     * class.
+     * <p>
+     * Any unknown formats are ignored. If this property is not declared or does
+     * not declare any known formats, the {@link Format#TEXT} format is assumed
+     * as the printer's supported format.
      */
-    String CONFIG_PRINTER_MODES = "felix.inventory.printer.modes"; //$NON-NLS-1$
+    String FORMAT = "felix.inventory.printer.format"; //$NON-NLS-1$
 
     /**
-     * The unique name of the printer.
-     * If this property is missing the printer is ignored.
-     * If there are two or more services with the same name, the
-     * service with the highest ranking is used.
+     * The unique name (or label) of the printer.
+     * <p>
+     * If this property is missing or an empty string, the name is constructed
+     * from the string {@code InventoryPrinter} and the service's
+     * {@code service.id} property.
      */
-    String CONFIG_NAME = "felix.inventory.printer.name"; //$NON-NLS-1$
+    String NAME = "felix.inventory.printer.name"; //$NON-NLS-1$
 
     /**
      * The title displayed by tools when this printer is used. It should be
      * descriptive but short.
-     * If this property is missing the printer is ignored.
+     * <p>
+     * If this property is missing or an empty string, the {@link #NAME} value
+     * is used as the title.
      */
-    String CONFIG_TITLE = "felix.inventory.printer.title"; //$NON-NLS-1$
+    String TITLE = "felix.inventory.printer.title"; //$NON-NLS-1$
 
     /**
-     * Optional property controlling whether the printer will be displayed
-     * in the web console. By default, a printer is displayed in the
-     * web console, unless this property is added with the value 'false'.
-     * The property value can either be a boolean or a string.
+     * The inventory printer feature has first class integration with the
+     * Apache Felix Web Console. This service registration property can be used
+     * to hide an inventory printer service from the Web Console. The service
+     * will still be called to generate the single file or ZIP file output of
+     * inventory printers.
+     * <p>
+     * By default, a printer is displayed in the web console, unless this
+     * property is set to {@code false}. The property value can either be a
+     * boolean or a string.
      */
-    String CONFIG_WEBCONSOLE = "felix.inventory.printer.webconsole"; //$NON-NLS-1$
+    String WEBCONSOLE = "felix.inventory.printer.webconsole"; //$NON-NLS-1$
 
     /**
      * Prints the configuration report to the given <code>printWriter</code>.
      * Implementations are free to print whatever information they deem useful.
-     * 
-     * If a printer is invoked with a mode it doesn't support (
-     * {@link #CONFIG_PRINTER_MODES})
+     * <p>
+     * If a printer is invoked with a format it doesn't support ( {@link #FORMAT})
      * the printer should just do/print nothing and directly return.
-     * 
+     * <p>
      * A printer might be used in one of two different situations: either for
      * directly displaying the information to a user (like in the web console)
      * or the output is included in a ZIP. The printer might want to return
      * different output depending on the usage situation.
-     * 
-     * @param mode The render mode.
-     * @param printWriter where to write the configuration data. It might be
-     *            flushed,
-     *            but must not be closed.
+     *
+     * @param printWriter where to write the data. Implementations may flush the
+     *            writer but must not close it.
+     * @param format The render format.
      * @param isZip whether this is included in a ZIP file or used directly
      */
-    void print(PrinterMode mode, PrintWriter printWriter, boolean isZip);
+    void print(PrintWriter printWriter, Format format, boolean isZip);
 }
diff --git a/inventory/src/main/java/org/apache/felix/inventory/PrinterMode.java b/inventory/src/main/java/org/apache/felix/inventory/PrinterMode.java
deleted file mode 100644
index b213bbe..0000000
--- a/inventory/src/main/java/org/apache/felix/inventory/PrinterMode.java
+++ /dev/null
@@ -1,69 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- * 
- * http://www.apache.org/licenses/LICENSE-2.0
- * 
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-package org.apache.felix.inventory;
-
-/**
- * Enumeration for the different printer modes.
- */
-public final class PrinterMode
-{
-
-    // plain text
-    public static PrinterMode TEXT = new PrinterMode("TEXT");
-
-    // valid HTML fragment (no external references)
-    public static PrinterMode HTML_FRAGMENT = new PrinterMode("HTML_FRAGMENT");
-
-    // JSON output
-    public static PrinterMode JSON = new PrinterMode("JSON");
-
-    private final String mode;
-
-    private PrinterMode(final String mode)
-    {
-        this.mode = mode;
-    }
-
-    public static PrinterMode valueOf(final String m)
-    {
-        if (TEXT.name().equalsIgnoreCase(m))
-        {
-            return TEXT;
-        }
-        else if (HTML_FRAGMENT.name().equalsIgnoreCase(m))
-        {
-            return HTML_FRAGMENT;
-        }
-        else if (JSON.name().equalsIgnoreCase(m))
-        {
-            return JSON;
-        }
-        return null;
-    }
-
-    public String name()
-    {
-        return this.mode;
-    }
-
-    public String toString()
-    {
-        return name();
-    }
-}
diff --git a/inventory/src/main/java/org/apache/felix/inventory/impl/AbstractWebConsolePlugin.java b/inventory/src/main/java/org/apache/felix/inventory/impl/AbstractWebConsolePlugin.java
index d5ae348..51855c3 100644
--- a/inventory/src/main/java/org/apache/felix/inventory/impl/AbstractWebConsolePlugin.java
+++ b/inventory/src/main/java/org/apache/felix/inventory/impl/AbstractWebConsolePlugin.java
@@ -5,9 +5,9 @@
  * The ASF licenses this file to You under the Apache License, Version 2.0
  * (the "License"); you may not use this file except in compliance with
  * the License. You may obtain a copy of the License at
- * 
+ *
  * http://www.apache.org/licenses/LICENSE-2.0
- * 
+ *
  * Unless required by applicable law or agreed to in writing, software
  * distributed under the License is distributed on an "AS IS" BASIS,
  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
@@ -31,7 +31,7 @@
 import javax.servlet.http.HttpServletRequest;
 import javax.servlet.http.HttpServletResponse;
 
-import org.apache.felix.inventory.PrinterMode;
+import org.apache.felix.inventory.Format;
 
 /**
  * The web console plugin for a inventory printer.
@@ -46,7 +46,7 @@
 
     /**
      * Constructor
-     * 
+     *
      * @param inventoryPrinterManager The manager
      */
     AbstractWebConsolePlugin(final InventoryPrinterManagerImpl inventoryPrinterManager)
@@ -56,22 +56,22 @@
 
     protected abstract InventoryPrinterHandler getInventoryPrinterHandler();
 
-    private void printConfigurationInventory(final ConfigurationWriter pw, final PrinterMode mode,
+    private void printConfigurationInventory(final ConfigurationWriter pw, final Format format,
         final InventoryPrinterHandler handler) throws IOException
     {
         if (handler == null)
         {
-            final InventoryPrinterHandler[] adapters = this.inventoryPrinterManager.getHandlers(mode);
+            final InventoryPrinterHandler[] adapters = this.inventoryPrinterManager.getHandlers(format);
             for (int i = 0; i < adapters.length; i++)
             {
-                pw.printInventory(mode, adapters[i]);
+                pw.printInventory(format, adapters[i]);
             }
         }
         else
         {
-            if (handler.supports(mode))
+            if (handler.supports(format))
             {
-                pw.printInventory(mode, handler);
+                pw.printInventory(format, handler);
             }
         }
     }
@@ -83,7 +83,7 @@
      * <p>
      * This method sets the <code>Cache-Control</code>, <code>Expires</code>,
      * and <code>Pragma</code> headers.
-     * 
+     *
      * @param response The response for which to set the cache prevention
      */
     private final void setNoCache(final HttpServletResponse response)
@@ -120,7 +120,7 @@
         if (request.getPathInfo().endsWith(".txt")) { //$NON-NLS-2$
             response.setContentType("text/plain; charset=utf-8"); //$NON-NLS-2$
             final ConfigurationWriter pw = new PlainTextConfigurationWriter(response.getWriter());
-            printConfigurationInventory(pw, PrinterMode.TEXT, handler);
+            printConfigurationInventory(pw, Format.TEXT, handler);
             pw.flush();
         }
         else if (request.getPathInfo().endsWith(".zip")) { //$NON-NLS-2$
@@ -140,7 +140,7 @@
             final ZipEntry entry = new ZipEntry("timestamp.txt"); //$NON-NLS-2$
             entry.setTime(now.getTime());
             zip.putNextEntry(entry);
-            final StringBuilder sb = new StringBuilder();
+            final StringBuffer sb = new StringBuffer();
             sb.append("Date: ");
             synchronized (InventoryPrinterAdapter.DISPLAY_DATE_FORMAT)
             {
@@ -154,8 +154,8 @@
             zip.closeEntry();
 
             final ZipConfigurationWriter pw = new ZipConfigurationWriter(zip);
-            printConfigurationInventory(pw, PrinterMode.TEXT, handler);
-            printConfigurationInventory(pw, PrinterMode.JSON, handler);
+            printConfigurationInventory(pw, Format.TEXT, handler);
+            printConfigurationInventory(pw, Format.JSON, handler);
 
             zip.finish();
         }
@@ -174,20 +174,20 @@
             pw.println("<html xmlns=\"http://www.w3.org/1999/xhtml\">");
             pw.println("<head><title>dummy</title></head><body><div>");
 
-            if (handler.supports(PrinterMode.HTML_FRAGMENT))
+            if (handler.supports(Format.HTML))
             {
-                handler.print(PrinterMode.HTML_FRAGMENT, pw, false);
+                handler.print(pw, Format.HTML, false);
             }
-            else if (handler.supports(PrinterMode.TEXT))
+            else if (handler.supports(Format.TEXT))
             {
                 pw.enableFilter(true);
-                handler.print(PrinterMode.TEXT, pw, false);
+                handler.print(pw, Format.TEXT, false);
                 pw.enableFilter(false);
             }
             else
             {
                 pw.enableFilter(true);
-                handler.print(PrinterMode.JSON, pw, false);
+                handler.print(pw, Format.JSON, false);
                 pw.enableFilter(false);
             }
             pw.println("</div></body></html>");
@@ -204,17 +204,17 @@
             response.setCharacterEncoding("UTF-8"); //$NON-NLS-1$
 
             final JSONConfigurationWriter jcw = new JSONConfigurationWriter(response.getWriter());
-            final PrinterMode mode;
-            if (handler.supports(PrinterMode.JSON))
+            final Format format;
+            if (handler.supports(Format.JSON))
             {
-                mode = PrinterMode.JSON;
+                format = Format.JSON;
             }
             else
             {
-                mode = PrinterMode.TEXT;
+                format = Format.TEXT;
                 jcw.startJSONWrapper();
             }
-            printConfigurationInventory(jcw, mode, handler);
+            printConfigurationInventory(jcw, format, handler);
             jcw.endJSONWrapper();
             jcw.flush();
         }
@@ -260,26 +260,26 @@
             pw.print("<button type=\"button\" class=\"downloadFullZip\" style=\"float: right; margin-right: 30px; margin-top: 5px;\">Download Full Zip</button>");
             pw.print("<button type=\"button\" class=\"downloadFullTxt\" style=\"float: right; margin-right: 30px; margin-top: 5px;\">Download Full Text</button>");
 
-            if (handler.supports(PrinterMode.JSON))
+            if (handler.supports(Format.JSON))
             {
                 pw.print("<button type=\"button\" class=\"downloadJson\" style=\"float: right; margin-right: 30px; margin-top: 5px;\">Download As JSON</button>");
             }
             pw.print("<button type=\"button\" class=\"downloadZip\" style=\"float: right; margin-right: 30px; margin-top: 5px;\">Download As Zip</button>");
-            if (handler.supports(PrinterMode.TEXT))
+            if (handler.supports(Format.TEXT))
             {
                 pw.print("<button type=\"button\" class=\"downloadTxt\" style=\"float: right; margin-right: 30px; margin-top: 5px;\">Download As Text</button>");
             }
 
             pw.println("<br/>&nbsp;</p>"); // status line
             pw.print("<div>");
-            if (handler.supports(PrinterMode.HTML_FRAGMENT))
+            if (handler.supports(Format.HTML))
             {
-                handler.print(PrinterMode.HTML_FRAGMENT, pw, false);
+                handler.print(pw, Format.HTML, false);
             }
             else
             {
                 pw.enableFilter(true);
-                handler.print(PrinterMode.TEXT, pw, false);
+                handler.print(pw, Format.TEXT, false);
                 pw.enableFilter(false);
             }
             pw.print("</div>");
@@ -307,10 +307,10 @@
             // dummy implementation
         }
 
-        public void printInventory(final PrinterMode mode, final InventoryPrinterHandler handler) throws IOException
+        public void printInventory(final Format format, final InventoryPrinterHandler handler) throws IOException
         {
             this.title(handler.getTitle());
-            handler.print(mode, this, false);
+            handler.print(this, format, false);
             this.end();
         }
     }
@@ -555,14 +555,14 @@
 
         /**
          * Escapes HTML special chars like: <>&\r\n and space
-         * 
-         * 
+         *
+         *
          * @param text the text to escape
          * @return the escaped text
          */
         private String escapeHtml(final String text)
         {
-            final StringBuilder sb = new StringBuilder(text.length() * 4 / 3);
+            final StringBuffer sb = new StringBuffer(text.length() * 4 / 3);
             char ch, oldch = '_';
             for (int i = 0; i < text.length(); i++)
             {
@@ -637,29 +637,29 @@
             this.zip = zip;
         }
 
-        public void printInventory(final PrinterMode mode, final InventoryPrinterHandler handler) throws IOException
+        public void printInventory(final Format format, final InventoryPrinterHandler handler) throws IOException
         {
-            if (mode == PrinterMode.TEXT)
+            if (format == Format.TEXT)
             {
                 final ZipEntry entry = new ZipEntry(handler.getName().concat(".txt"));
                 zip.putNextEntry(entry);
-                handler.print(mode, this, false);
+                handler.print(this, format, false);
                 flush();
                 zip.closeEntry();
 
                 handler.addAttachments(handler.getName().concat("/"), this.zip);
             }
-            else if (mode == PrinterMode.JSON)
+            else if (format == Format.JSON)
             {
                 final String name = "json/".concat(handler.getName()).concat(".json");
 
                 final ZipEntry entry = new ZipEntry(name);
                 zip.putNextEntry(entry);
-                handler.print(PrinterMode.JSON, this, true);
+                handler.print(this, Format.JSON, true);
                 flush();
 
                 zip.closeEntry();
-                if (!handler.supports(PrinterMode.TEXT))
+                if (!handler.supports(Format.TEXT))
                 {
                     handler.addAttachments(handler.getName().concat("/"), this.zip);
                 }
diff --git a/inventory/src/main/java/org/apache/felix/inventory/impl/DefaultWebConsolePlugin.java b/inventory/src/main/java/org/apache/felix/inventory/impl/DefaultWebConsolePlugin.java
index 2e013aa..be50540 100644
--- a/inventory/src/main/java/org/apache/felix/inventory/impl/DefaultWebConsolePlugin.java
+++ b/inventory/src/main/java/org/apache/felix/inventory/impl/DefaultWebConsolePlugin.java
@@ -20,7 +20,7 @@
 import java.io.PrintWriter;
 import java.util.zip.ZipOutputStream;
 
-import org.apache.felix.inventory.PrinterMode;
+import org.apache.felix.inventory.Format;
 import org.apache.felix.inventory.impl.webconsole.ConsoleConstants;
 
 /**
@@ -63,27 +63,27 @@
     }
 
     /**
-     * @see org.apache.felix.inventory..implInventoryPrinterHandler#getModes()
+     * @see org.apache.felix.inventory..implInventoryPrinterHandler#getformats()
      */
-    public PrinterMode[] getModes()
+    public Format[] getFormats()
     {
-        return new PrinterMode[]
-            { PrinterMode.TEXT };
+        return new Format[]
+            { Format.TEXT };
     }
 
     /**
-     * @see org.apache.felix.inventory.impl.InventoryPrinterHandler#supports(org.apache.felix.inventory.PrinterMode)
+     * @see org.apache.felix.inventory.impl.InventoryPrinterHandler#supports(org.apache.felix.inventory.Format)
      */
-    public boolean supports(final PrinterMode mode)
+    public boolean supports(final Format format)
     {
-        return mode == PrinterMode.TEXT;
+        return format == Format.TEXT;
     }
 
     /**
-     * @see org.apache.felix.inventory.InventoryPrinter#print(org.apache.felix.inventory.PrinterMode,
-     *      java.io.PrintWriter, boolean)
+     * @see org.apache.felix.inventory.InventoryPrinter#print(java.io.PrintWriter,
+     *      org.apache.felix.inventory.Format, boolean)
      */
-    public void print(final PrinterMode mode, final PrintWriter printWriter, final boolean isZip)
+    public void print(final PrintWriter printWriter, final Format format, final boolean isZip)
     {
         final InventoryPrinterHandler[] handlers = this.inventoryPrinterManager.getAllHandlers();
         printWriter.print("Currently registered ");
diff --git a/inventory/src/main/java/org/apache/felix/inventory/impl/InventoryPrinterAdapter.java b/inventory/src/main/java/org/apache/felix/inventory/impl/InventoryPrinterAdapter.java
index 7e2e8df..b57c55f 100644
--- a/inventory/src/main/java/org/apache/felix/inventory/impl/InventoryPrinterAdapter.java
+++ b/inventory/src/main/java/org/apache/felix/inventory/impl/InventoryPrinterAdapter.java
@@ -5,9 +5,9 @@
  * The ASF licenses this file to You under the Apache License, Version 2.0
  * (the "License"); you may not use this file except in compliance with
  * the License. You may obtain a copy of the License at
- * 
+ *
  * http://www.apache.org/licenses/LICENSE-2.0
- * 
+ *
  * Unless required by applicable law or agreed to in writing, software
  * distributed under the License is distributed on an "AS IS" BASIS,
  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
@@ -24,14 +24,14 @@
 import java.util.zip.ZipOutputStream;
 
 import org.apache.felix.inventory.InventoryPrinter;
-import org.apache.felix.inventory.PrinterMode;
+import org.apache.felix.inventory.Format;
 import org.apache.felix.inventory.ZipAttachmentProvider;
 import org.osgi.framework.BundleContext;
 import org.osgi.framework.ServiceRegistration;
 
 /**
  * Helper class for a inventory printer.
- * 
+ *
  * The adapter simplifies accessing and working with the inventory printer.
  */
 public class InventoryPrinterAdapter implements InventoryPrinterHandler, Comparable
@@ -77,7 +77,7 @@
     {
         if (this.registration == null)
         {
-            final Object value = this.description.getServiceReference().getProperty(InventoryPrinter.CONFIG_WEBCONSOLE);
+            final Object value = this.description.getServiceReference().getProperty(InventoryPrinter.WEBCONSOLE);
             if (value == null || !"false".equalsIgnoreCase(value.toString()))
             {
                 this.registration = WebConsolePlugin.register(context, manager, this.description);
@@ -111,11 +111,11 @@
     }
 
     /**
-     * All supported modes.
+     * All supported formats.
      */
-    public PrinterMode[] getModes()
+    public Format[] getFormats()
     {
-        return this.description.getModes();
+        return this.description.getFormats();
     }
 
     /**
@@ -131,13 +131,13 @@
     }
 
     /**
-     * Whether the printer supports this mode.
+     * Whether the printer supports this format.
      */
-    public boolean supports(final PrinterMode mode)
+    public boolean supports(final Format format)
     {
-        for (int i = 0; i < this.description.getModes().length; i++)
+        for (int i = 0; i < this.description.getFormats().length; i++)
         {
-            if (this.description.getModes()[i] == mode)
+            if (this.description.getFormats()[i] == format)
             {
                 return true;
             }
@@ -146,14 +146,14 @@
     }
 
     /**
-     * @see org.apache.felix.inventory.InventoryPrinter#print(org.apache.felix.inventory.PrinterMode,
+     * @see org.apache.felix.inventory.InventoryPrinter#print(org.apache.felix.inventory.Format,
      *      java.io.PrintWriter)
      */
-    public void print(final PrinterMode mode, final PrintWriter printWriter, final boolean isZip)
+    public void print(final PrintWriter printWriter, final Format format, final boolean isZip)
     {
-        if (this.supports(mode))
+        if (this.supports(format))
         {
-            this.printer.print(mode, printWriter, isZip);
+            this.printer.print(printWriter, format, isZip);
         }
     }
 
diff --git a/inventory/src/main/java/org/apache/felix/inventory/impl/InventoryPrinterDescription.java b/inventory/src/main/java/org/apache/felix/inventory/impl/InventoryPrinterDescription.java
index a563ddf..3952c43 100644
--- a/inventory/src/main/java/org/apache/felix/inventory/impl/InventoryPrinterDescription.java
+++ b/inventory/src/main/java/org/apache/felix/inventory/impl/InventoryPrinterDescription.java
@@ -5,9 +5,9 @@
  * The ASF licenses this file to You under the Apache License, Version 2.0
  * (the "License"); you may not use this file except in compliance with
  * the License. You may obtain a copy of the License at
- * 
+ *
  * http://www.apache.org/licenses/LICENSE-2.0
- * 
+ *
  * Unless required by applicable law or agreed to in writing, software
  * distributed under the License is distributed on an "AS IS" BASIS,
  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
@@ -16,10 +16,11 @@
  */
 package org.apache.felix.inventory.impl;
 
+import java.util.ArrayList;
 import java.util.Arrays;
-
 import org.apache.felix.inventory.InventoryPrinter;
-import org.apache.felix.inventory.PrinterMode;
+import org.apache.felix.inventory.Format;
+import org.osgi.framework.Constants;
 import org.osgi.framework.ServiceReference;
 
 /**
@@ -30,7 +31,7 @@
 
     private final ServiceReference reference;
 
-    private final PrinterMode[] modes;
+    private final Format[] formats;
 
     private final String name;
 
@@ -42,76 +43,79 @@
     {
         this.reference = ref;
 
-        // check modes
-        final Object modesCfg = ref.getProperty(InventoryPrinter.CONFIG_PRINTER_MODES);
-        if (modesCfg instanceof String)
+        // check formats
+        Format[] formats = null;
+        final Object formatsCfg = ref.getProperty(InventoryPrinter.FORMAT);
+        if (formatsCfg instanceof String)
         {
-            final PrinterMode mode = PrinterMode.valueOf((String) modesCfg);
-            if (mode != null)
+            final Format format = Format.valueOf((String) formatsCfg);
+            if (format != null)
             {
-                this.modes = new PrinterMode[]
-                    { mode };
-            }
-            else
-            {
-                this.modes = null;
+                formats = new Format[]
+                    { format };
             }
         }
-        else if (modesCfg instanceof String[])
+        else if (formatsCfg instanceof String[])
         {
-            final String[] modesCfgArray = (String[]) modesCfg;
-            final PrinterMode[] pModes = new PrinterMode[modesCfgArray.length];
-            boolean invalid = false;
-            for (int i = 0; i < modesCfgArray.length; i++)
+            final String[] formatsCfgArray = (String[]) formatsCfg;
+            final ArrayList formatList = new ArrayList();
+            for (int i = 0; i < formatsCfgArray.length; i++)
             {
-                pModes[i] = PrinterMode.valueOf(modesCfgArray[i]);
-                if (pModes[i] == null)
+                final Format format = Format.valueOf(formatsCfgArray[i]);
+                if (format != null)
                 {
-                    invalid = true;
+                    formatList.add(format);
                 }
             }
-            if (invalid)
+            if (!formatList.isEmpty())
             {
-                this.modes = null;
+                formats = (Format[]) formatList.toArray(new Format[formatList.size()]);
             }
-            else
-            {
-                this.modes = pModes;
-            }
-        }
-        else
-        {
-            this.modes = null;
         }
 
         // check name
-        if (ref.getProperty(InventoryPrinter.CONFIG_NAME) != null)
+        final String name;
+        if (ref.getProperty(InventoryPrinter.NAME) != null)
         {
-            this.name = ref.getProperty(InventoryPrinter.CONFIG_NAME).toString();
+            name = ref.getProperty(InventoryPrinter.NAME).toString();
         }
         else
         {
-            this.name = null;
+            name = "InventoryPrinter." + ref.getProperty(Constants.SERVICE_ID);
         }
 
         // check title
-        if (ref.getProperty(InventoryPrinter.CONFIG_TITLE) != null)
+        final String title;
+        String sortKey = null;
+        if (ref.getProperty(InventoryPrinter.TITLE) != null)
         {
-            this.title = ref.getProperty(InventoryPrinter.CONFIG_TITLE).toString();
-            if (this.title.startsWith("%"))
+            title = ref.getProperty(InventoryPrinter.TITLE).toString();
+            if (title.startsWith("%"))
             {
-                this.sortKey = this.title.substring(1);
-            }
-            else
-            {
-                this.sortKey = this.title;
+                sortKey = title.substring(1);
             }
         }
         else
         {
-            this.title = null;
-            this.sortKey = null;
+            title = name;
         }
+
+        // cleanup
+        if (formats == null)
+        {
+            formats = new Format[]
+                { Format.TEXT };
+        }
+        if (sortKey == null)
+        {
+            sortKey = title;
+        }
+
+        // set fields
+        this.formats = formats;
+        this.name = name;
+        this.title = title;
+        this.sortKey = sortKey;
     }
 
     public String getTitle()
@@ -129,9 +133,9 @@
         return this.name;
     }
 
-    public PrinterMode[] getModes()
+    public Format[] getFormats()
     {
-        return this.modes;
+        return this.formats;
     }
 
     public ServiceReference getServiceReference()
@@ -159,7 +163,7 @@
 
     public String toString()
     {
-        return "InventoryPrinterDescription [title=" + title + ", name=" + name + ", modes=" + Arrays.toString(modes)
+        return "InventoryPrinterDescription [title=" + title + ", name=" + name + ", formats=" + Arrays.toString(formats)
             + ", sortKey=" + sortKey + "]";
     }
 }
diff --git a/inventory/src/main/java/org/apache/felix/inventory/impl/InventoryPrinterHandler.java b/inventory/src/main/java/org/apache/felix/inventory/impl/InventoryPrinterHandler.java
index b630b6e..6ddb19a 100644
--- a/inventory/src/main/java/org/apache/felix/inventory/impl/InventoryPrinterHandler.java
+++ b/inventory/src/main/java/org/apache/felix/inventory/impl/InventoryPrinterHandler.java
@@ -6,9 +6,9 @@
  * to you under the Apache License, Version 2.0 (the
  * "License"); you may not use this file except in compliance
  * with the License. You may obtain a copy of the License at
- * 
+ *
  * http://www.apache.org/licenses/LICENSE-2.0
- * 
+ *
  * Unless required by applicable law or agreed to in writing,
  * software distributed under the License is distributed on an
  * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
@@ -19,13 +19,13 @@
 package org.apache.felix.inventory.impl;
 
 import org.apache.felix.inventory.InventoryPrinter;
-import org.apache.felix.inventory.PrinterMode;
+import org.apache.felix.inventory.Format;
 import org.apache.felix.inventory.ZipAttachmentProvider;
 
 /**
  * The inventory printer handler can be used by clients to access
  * a inventory printer.
- * 
+ *
  * For clients using inventory printers, a handler simplifies accessing and
  * working with the inventory printer.
  */
@@ -38,9 +38,9 @@
     /** The human readable title for the inventory printer. */
     String getTitle();
 
-    /** All supported modes. */
-    PrinterMode[] getModes();
+    /** All supported formats. */
+    Format[] getFormats();
 
-    /** Whether the printer supports this mode. */
-    boolean supports(final PrinterMode mode);
+    /** Whether the printer supports this format. */
+    boolean supports(final Format format);
 }
\ No newline at end of file
diff --git a/inventory/src/main/java/org/apache/felix/inventory/impl/InventoryPrinterManagerImpl.java b/inventory/src/main/java/org/apache/felix/inventory/impl/InventoryPrinterManagerImpl.java
index 17ab8f7..0d564b4 100644
--- a/inventory/src/main/java/org/apache/felix/inventory/impl/InventoryPrinterManagerImpl.java
+++ b/inventory/src/main/java/org/apache/felix/inventory/impl/InventoryPrinterManagerImpl.java
@@ -5,9 +5,9 @@
  * The ASF licenses this file to You under the Apache License, Version 2.0
  * (the "License"); you may not use this file except in compliance with
  * the License. You may obtain a copy of the License at
- * 
+ *
  * http://www.apache.org/licenses/LICENSE-2.0
- * 
+ *
  * Unless required by applicable law or agreed to in writing, software
  * distributed under the License is distributed on an "AS IS" BASIS,
  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
@@ -30,7 +30,7 @@
 import java.util.concurrent.ConcurrentSkipListSet;
 
 import org.apache.felix.inventory.InventoryPrinter;
-import org.apache.felix.inventory.PrinterMode;
+import org.apache.felix.inventory.Format;
 import org.apache.felix.inventory.impl.webconsole.ConsoleConstants;
 import org.osgi.framework.Bundle;
 import org.osgi.framework.BundleContext;
@@ -38,7 +38,6 @@
 import org.osgi.framework.ServiceFactory;
 import org.osgi.framework.ServiceReference;
 import org.osgi.framework.ServiceRegistration;
-import org.osgi.service.log.LogService;
 import org.osgi.util.tracker.ServiceTracker;
 import org.osgi.util.tracker.ServiceTrackerCustomizer;
 
@@ -70,7 +69,7 @@
 
     /**
      * Create the inventory printer manager
-     * 
+     *
      * @param btx Bundle Context
      * @throws InvalidSyntaxException Should only happen if we have an error in
      *             the code
@@ -153,34 +152,8 @@
     private void addService(final ServiceReference reference, final InventoryPrinter obj)
     {
         final InventoryPrinterDescription desc = new InventoryPrinterDescription(reference);
+        final InventoryPrinterAdapter adapter = new InventoryPrinterAdapter(desc, obj);
 
-        boolean valid = true;
-        if (desc.getModes() == null)
-        {
-            Activator.log(null, LogService.LOG_INFO,
-                "Ignoring inventory printer - printer modes configuration is missing: " + reference, null);
-            valid = false;
-        }
-        if (desc.getName() == null)
-        {
-            Activator.log(null, LogService.LOG_INFO, "Ignoring inventory printer - name configuration is missing: "
-                + reference, null);
-            valid = false;
-        }
-        if (desc.getTitle() == null)
-        {
-            Activator.log(null, LogService.LOG_INFO, "Ignoring inventory printer - title configuration is missing: "
-                + reference, null);
-            valid = false;
-        }
-        if (valid)
-        {
-            this.addAdapter(new InventoryPrinterAdapter(desc, obj));
-        }
-    }
-
-    private void addAdapter(final InventoryPrinterAdapter adapter)
-    {
         InventoryPrinterAdapter removeAdapter = null;
         InventoryPrinterAdapter addAdapter = null;
 
@@ -281,7 +254,7 @@
 
     /**
      * Get all inventory printer handlers.
-     * 
+     *
      * @return A list of handlers - might be empty.
      */
     public InventoryPrinterHandler[] getAllHandlers()
@@ -291,18 +264,18 @@
     }
 
     /**
-     * Get all handlers supporting the mode.
-     * 
+     * Get all handlers supporting the format.
+     *
      * @return A list of handlers - might be empty.
      */
-    public InventoryPrinterHandler[] getHandlers(final PrinterMode mode)
+    public InventoryPrinterHandler[] getHandlers(final Format format)
     {
         final List result = new ArrayList();
         final Iterator i = this.usedAdapters.iterator();
         while (i.hasNext())
         {
             final InventoryPrinterAdapter printer = (InventoryPrinterAdapter) i.next();
-            if (printer.supports(mode))
+            if (printer.supports(format))
             {
                 result.add(printer);
             }
@@ -312,7 +285,7 @@
 
     /**
      * Return a handler for the unique name.
-     * 
+     *
      * @return The corresponding handler or <code>null</code>.
      */
     public InventoryPrinterHandler getHandler(final String name)
diff --git a/inventory/src/main/java/org/apache/felix/inventory/impl/webconsole/ConfigurationPrinterAdapter.java b/inventory/src/main/java/org/apache/felix/inventory/impl/webconsole/ConfigurationPrinterAdapter.java
index 0b76aee..2148f32 100644
--- a/inventory/src/main/java/org/apache/felix/inventory/impl/webconsole/ConfigurationPrinterAdapter.java
+++ b/inventory/src/main/java/org/apache/felix/inventory/impl/webconsole/ConfigurationPrinterAdapter.java
@@ -5,9 +5,9 @@
  * The ASF licenses this file to You under the Apache License, Version 2.0
  * (the "License"); you may not use this file except in compliance with
  * the License. You may obtain a copy of the License at
- * 
+ *
  * http://www.apache.org/licenses/LICENSE-2.0
- * 
+ *
  * Unless required by applicable law or agreed to in writing, software
  * distributed under the License is distributed on an "AS IS" BASIS,
  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
@@ -25,7 +25,7 @@
 import java.util.List;
 import java.util.Set;
 
-import org.apache.felix.inventory.PrinterMode;
+import org.apache.felix.inventory.Format;
 import org.osgi.framework.ServiceReference;
 
 /**
@@ -213,17 +213,17 @@
         final Set list = new HashSet();
         if (this.match(ConsoleConstants.MODE_TXT) || this.match(ConsoleConstants.MODE_ZIP))
         {
-            list.add(PrinterMode.TEXT.name());
+            list.add(Format.TEXT.toString());
         }
         if (this.match(ConsoleConstants.MODE_WEB))
         {
             if (!escapeHtml)
             {
-                list.add(PrinterMode.HTML_FRAGMENT.name());
+                list.add(Format.HTML.toString());
             }
             else
             {
-                list.add(PrinterMode.TEXT.name());
+                list.add(Format.TEXT.toString());
             }
         }
         return (String[]) list.toArray(new String[list.size()]);
diff --git a/inventory/src/main/java/org/apache/felix/inventory/impl/webconsole/WebConsoleAdapter.java b/inventory/src/main/java/org/apache/felix/inventory/impl/webconsole/WebConsoleAdapter.java
index 299c9e7..24a57dc 100644
--- a/inventory/src/main/java/org/apache/felix/inventory/impl/webconsole/WebConsoleAdapter.java
+++ b/inventory/src/main/java/org/apache/felix/inventory/impl/webconsole/WebConsoleAdapter.java
@@ -5,9 +5,9 @@
  * The ASF licenses this file to You under the Apache License, Version 2.0
  * (the "License"); you may not use this file except in compliance with
  * the License. You may obtain a copy of the License at
- * 
+ *
  * http://www.apache.org/licenses/LICENSE-2.0
- * 
+ *
  * Unless required by applicable law or agreed to in writing, software
  * distributed under the License is distributed on an "AS IS" BASIS,
  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
@@ -32,7 +32,7 @@
 import java.util.zip.ZipOutputStream;
 
 import org.apache.felix.inventory.InventoryPrinter;
-import org.apache.felix.inventory.PrinterMode;
+import org.apache.felix.inventory.Format;
 import org.apache.felix.inventory.ZipAttachmentProvider;
 import org.osgi.framework.BundleContext;
 import org.osgi.framework.Constants;
@@ -112,9 +112,9 @@
                 cpa.label = cpa.title;
             }
             final Dictionary props = new Hashtable();
-            props.put(InventoryPrinter.CONFIG_NAME, cpa.label);
-            props.put(InventoryPrinter.CONFIG_TITLE, cpa.title);
-            props.put(InventoryPrinter.CONFIG_PRINTER_MODES, cpa.getPrinterModes());
+            props.put(InventoryPrinter.NAME, cpa.label);
+            props.put(InventoryPrinter.TITLE, cpa.title);
+            props.put(InventoryPrinter.FORMAT, cpa.getPrinterModes());
 
             final ServiceRegistration reg = this.bundleContext.registerService(InventoryPrinter.class.getName(),
                 new WebConsolePrinter(cpa), props);
@@ -182,21 +182,21 @@
         }
 
         /**
-         * @see org.apache.felix.inventory.InventoryPrinter#print(org.apache.felix.inventory.PrinterMode,
+         * @see org.apache.felix.inventory.InventoryPrinter#print(org.apache.felix.inventory.Format,
          *      java.io.PrintWriter)
          */
-        public void print(final PrinterMode mode, final PrintWriter printWriter, final boolean isZip)
+        public void print(final PrintWriter printWriter, final Format format, final boolean isZip)
         {
             final String m;
-            if (!isZip && mode == PrinterMode.HTML_FRAGMENT)
+            if (!isZip && format == Format.HTML)
             {
                 m = ConsoleConstants.MODE_WEB;
             }
-            else if (!isZip && mode == PrinterMode.TEXT)
+            else if (!isZip && format == Format.TEXT)
             {
                 m = ConsoleConstants.MODE_TXT;
             }
-            else if (isZip && (mode == PrinterMode.TEXT || mode == PrinterMode.HTML_FRAGMENT))
+            else if (isZip && (format == Format.TEXT || format == Format.HTML))
             {
                 m = ConsoleConstants.MODE_ZIP;
             }
diff --git a/inventory/src/test/java/org/apache/felix/inventory/FormatTest.java b/inventory/src/test/java/org/apache/felix/inventory/FormatTest.java
new file mode 100644
index 0000000..5d3131c
--- /dev/null
+++ b/inventory/src/test/java/org/apache/felix/inventory/FormatTest.java
@@ -0,0 +1,65 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+package org.apache.felix.inventory;
+
+import junit.framework.TestCase;
+
+public class FormatTest extends TestCase
+{
+
+    public void test_valueOf()
+    {
+        TestCase.assertSame(Format.TEXT, Format.valueOf("TEXT"));
+        TestCase.assertSame(Format.JSON, Format.valueOf("JSON"));
+        TestCase.assertSame(Format.HTML, Format.valueOf("HTML"));
+
+        TestCase.assertSame(Format.TEXT, Format.valueOf("text"));
+        TestCase.assertSame(Format.JSON, Format.valueOf("json"));
+        TestCase.assertSame(Format.HTML, Format.valueOf("html"));
+
+        TestCase.assertSame(Format.TEXT, Format.valueOf("Text"));
+        TestCase.assertSame(Format.JSON, Format.valueOf("Json"));
+        TestCase.assertSame(Format.HTML, Format.valueOf("HtMl"));
+
+        TestCase.assertNull(Format.valueOf("unsupported_name"));
+    }
+
+    public void test_toString()
+    {
+        TestCase.assertEquals("TEXT", Format.TEXT.toString());
+        TestCase.assertEquals("JSON", Format.JSON.toString());
+        TestCase.assertEquals("HTML", Format.HTML.toString());
+    }
+
+    public void test_equals()
+    {
+        TestCase.assertTrue(Format.TEXT.equals(Format.TEXT));
+        TestCase.assertFalse(Format.TEXT.equals(Format.JSON));
+        TestCase.assertFalse(Format.TEXT.equals(Format.HTML));
+
+        TestCase.assertFalse(Format.JSON.equals(Format.TEXT));
+        TestCase.assertTrue(Format.JSON.equals(Format.JSON));
+        TestCase.assertFalse(Format.JSON.equals(Format.HTML));
+
+        TestCase.assertFalse(Format.HTML.equals(Format.TEXT));
+        TestCase.assertFalse(Format.HTML.equals(Format.JSON));
+        TestCase.assertTrue(Format.HTML.equals(Format.HTML));
+    }
+
+}
diff --git a/inventory/src/test/java/org/apache/felix/inventory/PrinterModeTest.java b/inventory/src/test/java/org/apache/felix/inventory/PrinterModeTest.java
deleted file mode 100644
index f2db39d..0000000
--- a/inventory/src/test/java/org/apache/felix/inventory/PrinterModeTest.java
+++ /dev/null
@@ -1,65 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- * 
- * http://www.apache.org/licenses/LICENSE-2.0
- * 
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-package org.apache.felix.inventory;
-
-import junit.framework.TestCase;
-
-public class PrinterModeTest extends TestCase
-{
-
-    public void test_valueOf()
-    {
-        TestCase.assertSame(PrinterMode.TEXT, PrinterMode.valueOf("TEXT"));
-        TestCase.assertSame(PrinterMode.JSON, PrinterMode.valueOf("JSON"));
-        TestCase.assertSame(PrinterMode.HTML_FRAGMENT, PrinterMode.valueOf("HTML_FRAGMENT"));
-
-        TestCase.assertSame(PrinterMode.TEXT, PrinterMode.valueOf("text"));
-        TestCase.assertSame(PrinterMode.JSON, PrinterMode.valueOf("json"));
-        TestCase.assertSame(PrinterMode.HTML_FRAGMENT, PrinterMode.valueOf("html_fragment"));
-
-        TestCase.assertSame(PrinterMode.TEXT, PrinterMode.valueOf("Text"));
-        TestCase.assertSame(PrinterMode.JSON, PrinterMode.valueOf("Json"));
-        TestCase.assertSame(PrinterMode.HTML_FRAGMENT, PrinterMode.valueOf("HTML_Fragment"));
-
-        TestCase.assertNull(PrinterMode.valueOf("unsupported_name"));
-    }
-
-    public void test_name()
-    {
-        TestCase.assertEquals("TEXT", PrinterMode.TEXT.name());
-        TestCase.assertEquals("JSON", PrinterMode.JSON.name());
-        TestCase.assertEquals("HTML_FRAGMENT", PrinterMode.HTML_FRAGMENT.name());
-    }
-
-    public void test_equals()
-    {
-        TestCase.assertTrue(PrinterMode.TEXT.equals(PrinterMode.TEXT));
-        TestCase.assertFalse(PrinterMode.TEXT.equals(PrinterMode.JSON));
-        TestCase.assertFalse(PrinterMode.TEXT.equals(PrinterMode.HTML_FRAGMENT));
-
-        TestCase.assertFalse(PrinterMode.JSON.equals(PrinterMode.TEXT));
-        TestCase.assertTrue(PrinterMode.JSON.equals(PrinterMode.JSON));
-        TestCase.assertFalse(PrinterMode.JSON.equals(PrinterMode.HTML_FRAGMENT));
-
-        TestCase.assertFalse(PrinterMode.HTML_FRAGMENT.equals(PrinterMode.TEXT));
-        TestCase.assertFalse(PrinterMode.HTML_FRAGMENT.equals(PrinterMode.JSON));
-        TestCase.assertTrue(PrinterMode.HTML_FRAGMENT.equals(PrinterMode.HTML_FRAGMENT));
-    }
-
-}
