Package org.apache.felix.inventory
Class Format
- java.lang.Object
-
- org.apache.felix.inventory.Format
-
public final class Format extends java.lang.Object
Java 1.4 compatible enumeration of formats used for inventory printing.InventoryPrinter
services indicate supported formats listing any of these values in theirInventoryPrinter.FORMAT
service properties.Requestors of inventory printing indicate the desired output format by specifying the respective constant when calling the
InventoryPrinter.print(java.io.PrintWriter, Format, boolean)
method.Round-tripping is guaranteed between the
toString()
andvalueOf(String)
methods.
-
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description java.lang.String
toString()
Returns the string value of this format.static Format
valueOf(java.lang.String format)
Converts the givenformat
string into an instance of this class.
-
-
-
Field Detail
-
TEXT
public static Format TEXT
Inventory is printed in plain text format.
-
HTML
public static Format HTML
Inventory is printed in HTML format.Technically the output is expected to be an HTML fragment which is intended to be inserted into any block element, such as
<div>
, within a HTML<body>
.
-
JSON
public static Format JSON
Inventory is printed in JSON format.The output is expected to be a valid JSON object. That is, the output must start with an opening curly brace (
{
) and end with a closing curly brace (}
).
-
-
Method Detail
-
valueOf
public static Format valueOf(java.lang.String format)
Converts the givenformat
string into an instance of this class.- Parameters:
format
- The string value to be converted into aFormat
.- Returns:
- One of the defined
Format
constants ornull
.
-
toString
public java.lang.String toString()
Returns the string value of this format.- Overrides:
toString
in classjava.lang.Object
-
-