flink-instrumentation/workspace/flink-1.4.1-instrumented/flink-1.4.1/flink-core/src/main/java/org/apache/flink/configuration/ConfigOptionsDocGenerator.java
/**
	 * This method generates html tables from set of classes containing {@link ConfigOption ConfigOptions}.
	 *
	 * <p>For each class 1 or more html tables will be generated and placed into a separate file, depending on whether
	 * the class is annotated with {@link ConfigGroups}. The tables contain the key, default value and description for
	 * every {@link ConfigOption}.
	 *
	 * @param args first argument is output path for the generated files, second argument is full package name containing
	 *             classes with {@link ConfigOption}
	 */
This method generates html tables from set of classes containing  ConfigOption ConfigOptions.
For each class 1 or more html tables will be generated and placed into a separate file, depending on whether
the class is annotated with  ConfigGroups. The tables contain the key, default value and description for
every  ConfigOption.

@param args first argument is output path for the generated files, second argument is full package name containing
classes with  ConfigOption
This method generates html tables from set of classes containing ConfigOption ConfigOptions . For each class 1 or more html tables will be generated and placed into a separate file depending on whether the class is annotated with ConfigGroups . The tables contain the key default value and description for every ConfigOption . @param args first argument is output path for the generated files second argument is full package name containing classes with ConfigOption
public static void main(String[] args) throws IOException, ClassNotFoundException {
		String outputPath = args[0];
		String packageName = args[1];
		Path configDir = Paths.get("../src/main/java", packageName.replaceAll("\\.", "/"));
		Pattern p = Pattern.compile("(([a-zA-Z]*)(Options))\\.java");
		try (DirectoryStream<Path> stream = Files.newDirectoryStream(configDir, "*Options.java")) {
			for (Path entry : stream) {
				String fileName = entry.getFileName().toString();
				Matcher matcher = p.matcher(fileName);
				if (!fileName.equals("ConfigOptions.java") && matcher.matches()) {
					Class<?> optionsClass = Class.forName(packageName + "." + matcher.group(1));
					List<Tuple2<ConfigGroup, String>> tables = generateTablesForClass(optionsClass);
					if (tables.size() > 0) {
						for (Tuple2<ConfigGroup, String> group : tables) {
							String name = group.f0 == null
								? matcher.group(2).replaceAll("(.)(\\p{Upper})", "$1_$2").toLowerCase()
								: group.f0.name().replaceAll("(.)(\\p{Upper})", "$1_$2").toLowerCase();
							String outputFile = name + "_configuration.html";
							Files.write(Paths.get(outputPath, outputFile), group.f1.getBytes(StandardCharsets.UTF_8));
						}
					}
				}
			}
		}
	}
public static void main ( String [ ] args ) throws IOException , ClassNotFoundException { String outputPath = args [ 0 ] ; String packageName = args [ 1 ] ; Path configDir = Paths . get ( "../src/main/java" , packageName . replaceAll ( "\\." , "/" ) ) ; Pattern p = Pattern . compile ( "(([a-zA-Z]*)(Options))\\.java" ) ; try ( DirectoryStream < Path > stream = Files . newDirectoryStream ( configDir , "*Options.java" ) ) { for ( Path entry : stream ) { String fileName = entry . getFileName ( ) . toString ( ) ; Matcher matcher = p . matcher ( fileName ) ; if ( ! fileName . equals ( "ConfigOptions.java" ) && matcher . matches ( ) ) { Class < ? > optionsClass = Class . forName ( packageName + "." + matcher . group ( 1 ) ) ; List < Tuple2 < ConfigGroup , String > > tables = generateTablesForClass ( optionsClass ) ; if ( tables . size ( ) > 0 ) { for ( Tuple2 < ConfigGroup , String > group : tables ) { String name = group . f0 == null ? matcher . group ( 2 ) . replaceAll ( "(.)(\\p{Upper})" , "$1_$2" ) . toLowerCase ( ) : group . f0 . name ( ) . replaceAll ( "(.)(\\p{Upper})" , "$1_$2" ) . toLowerCase ( ) ; String outputFile = name + "_configuration.html" ; Files . write ( Paths . get ( outputPath , outputFile ) , group . f1 . getBytes ( StandardCharsets . UTF_8 ) ) ; } } } } } }
This method generates html tables from set of classes containing {@link ConfigOption ConfigOptions}.
This method generates html tables from set of classes containing { @link ConfigOption ConfigOptions } .