Package org.jgroups.util
Class PropertiesToAsciidoc
- java.lang.Object
-
- org.jgroups.util.PropertiesToAsciidoc
-
public class PropertiesToAsciidoc extends java.lang.ObjectIterates over all concrete Protocol classes and creates tables with Protocol's properties. These tables are in turn then merged into asciidoc. Iterates over unsupported and experimental classes and creates tables listing those classes. These tables are in turn then merged into asciidoc.- Author:
- Vladimir Blagojevic, Bela Ban
-
-
Constructor Summary
Constructors Constructor Description PropertiesToAsciidoc()
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description protected static voidconvertUnsupportedToAsciidocTable(java.util.Properties props, java.util.List<java.lang.Class<?>> clazzes, java.lang.String title)static intcopy(java.io.Reader input, java.io.Writer output)protected static java.lang.StringcreateAsciidocTable(java.util.List<java.lang.String[]> rows, java.lang.String title, java.lang.String header)Creates an AsciiDoc table of the elements in rows.static voidmain(java.lang.String[] args)protected static java.lang.StringreadUntilBracket(java.io.InputStream in)Reads until the next bracket '}' and returns the string excluding the bracket, or throws an exception if no bracket has been foundprotected static voidreplaceVariables(java.io.InputStream in, java.io.OutputStream out, java.util.Properties p)Reads from the input stream and replaces occurrences of ${PROT} with p.get("PROT") and writes this to the output stream.protected static voidwriteVarToStream(java.lang.String var, java.util.Properties p, java.io.OutputStream out)
-
-
-
Method Detail
-
main
public static void main(java.lang.String[] args)
-
convertUnsupportedToAsciidocTable
protected static void convertUnsupportedToAsciidocTable(java.util.Properties props, java.util.List<java.lang.Class<?>> clazzes, java.lang.String title) throws javax.xml.parsers.ParserConfigurationException, javax.xml.transform.TransformerException- Throws:
javax.xml.parsers.ParserConfigurationExceptionjavax.xml.transform.TransformerException
-
createAsciidocTable
protected static java.lang.String createAsciidocTable(java.util.List<java.lang.String[]> rows, java.lang.String title, java.lang.String header) throws javax.xml.parsers.ParserConfigurationException, javax.xml.transform.TransformerExceptionCreates an AsciiDoc table of the elements in rows. The first tuple needs to be the column names, the rest the contents- Throws:
javax.xml.parsers.ParserConfigurationExceptionjavax.xml.transform.TransformerException
-
replaceVariables
protected static void replaceVariables(java.io.InputStream in, java.io.OutputStream out, java.util.Properties p)Reads from the input stream and replaces occurrences of ${PROT} with p.get("PROT") and writes this to the output stream. If no value is found, then the ${PROT} will simple be omitted from the output. Escaped values of the form \${PROT} are not looked up and the value without the backslash will be written to the output stream.
-
writeVarToStream
protected static void writeVarToStream(java.lang.String var, java.util.Properties p, java.io.OutputStream out) throws java.io.IOException- Throws:
java.io.IOException
-
readUntilBracket
protected static java.lang.String readUntilBracket(java.io.InputStream in) throws java.io.IOExceptionReads until the next bracket '}' and returns the string excluding the bracket, or throws an exception if no bracket has been found- Throws:
java.io.IOException
-
copy
public static int copy(java.io.Reader input, java.io.Writer output) throws java.io.IOException- Throws:
java.io.IOException
-
-