01: package de.java2html;
02:
03: import de.java2html.converter.IJavaSourceConverter;
04: import de.java2html.converter.JavaSourceConverterProvider;
05: import de.java2html.options.JavaSourceConversionOptions;
06: import de.java2html.util.Ensure;
07:
08: /**
09: * @author Markus Gebhard
10: */
11: public class JavaSourceConversionSettings {
12:
13: private final String converterName;
14: private final JavaSourceConversionOptions options;
15:
16: public JavaSourceConversionSettings(
17: JavaSourceConversionOptions options, String converterName) {
18: Ensure.ensureArgumentNotNull(options);
19: Ensure.ensureArgumentNotNull(converterName);
20: this .converterName = converterName;
21: this .options = options;
22: }
23:
24: public JavaSourceConversionSettings(
25: JavaSourceConversionOptions options) {
26: this (options, JavaSourceConverterProvider
27: .getAllConverterNames()[0]);
28: }
29:
30: public IJavaSourceConverter createConverter() {
31: return JavaSourceConverterProvider
32: .getJavaSourceConverterByName(converterName);
33: }
34:
35: public JavaSourceConversionOptions getConversionOptions() {
36: return options;
37: }
38:
39: public static JavaSourceConversionSettings getDefault() {
40: return new JavaSourceConversionSettings(
41: JavaSourceConversionOptions.getDefault(),
42: JavaSourceConverterProvider.getAllConverterNames()[0]);
43: }
44:
45: }
|