Added 'verbose' flag to DescriptorRenderer.

This commit is contained in:
Evgeny Gerashchenko
2012-12-25 02:30:44 +04:00
parent e95bcbcc97
commit f596fb48fe
2 changed files with 15 additions and 6 deletions
@@ -25,6 +25,7 @@ public class DescriptorRendererBuilder {
private boolean startFromName = false;
private boolean debugMode = false;
private boolean classWithPrimaryConstructor = false;
private boolean verbose = false;
@NotNull
private DescriptorRenderer.ValueParametersHandler valueParametersHandler = new DescriptorRenderer.DefaultValueParameterHandler();
@NotNull
@@ -58,6 +59,16 @@ public class DescriptorRendererBuilder {
return this;
}
public DescriptorRendererBuilder setClassWithPrimaryConstructor(boolean classWithPrimaryConstructor) {
this.classWithPrimaryConstructor = classWithPrimaryConstructor;
return this;
}
public DescriptorRendererBuilder setVerbose(boolean verbose) {
this.verbose = verbose;
return this;
}
public DescriptorRendererBuilder setValueParametersHandler(@NotNull DescriptorRenderer.ValueParametersHandler valueParametersHandler) {
this.valueParametersHandler = valueParametersHandler;
return this;
@@ -68,13 +79,8 @@ public class DescriptorRendererBuilder {
return this;
}
public DescriptorRendererBuilder setClassWithPrimaryConstructor(boolean classWithPrimaryConstructor) {
this.classWithPrimaryConstructor = classWithPrimaryConstructor;
return this;
}
public DescriptorRenderer build() {
return new DescriptorRendererImpl(shortNames, withDefinedIn, modifiers, startFromName, debugMode, classWithPrimaryConstructor,
valueParametersHandler, textFormat);
verbose, valueParametersHandler, textFormat);
}
}
@@ -55,6 +55,7 @@ public class DescriptorRendererImpl implements DescriptorRenderer {
private final boolean startFromName;
private final boolean debugMode;
private final boolean classWithPrimaryConstructor;
private final boolean verbose;
@NotNull
private final ValueParametersHandler handler;
@NotNull
@@ -67,6 +68,7 @@ public class DescriptorRendererImpl implements DescriptorRenderer {
boolean startFromName,
boolean debugMode,
boolean classWithPrimaryConstructor,
boolean verbose,
@NotNull ValueParametersHandler handler,
@NotNull TextFormat textFormat
) {
@@ -76,6 +78,7 @@ public class DescriptorRendererImpl implements DescriptorRenderer {
this.startFromName = startFromName;
this.handler = handler;
this.classWithPrimaryConstructor = classWithPrimaryConstructor;
this.verbose = verbose;
this.debugMode = debugMode;
this.textFormat = textFormat;
}