Skip to content

Commit

Permalink
expose custom type naming (#56)
Browse files Browse the repository at this point in the history
  • Loading branch information
bkrieger authored and ryanmcnamara committed May 22, 2018
1 parent 4b98917 commit 8f4eed9
Showing 1 changed file with 12 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@
import java.net.URI;
import java.util.ArrayList;
import java.util.HashSet;
import java.util.LinkedHashMap;
import java.util.List;
import java.util.Map;
import java.util.Set;
Expand Down Expand Up @@ -65,6 +66,13 @@ public Result processType(Type javaType, Context context) {
};
}

@Value.Default
public Map<String, String> customTypeNaming() {
return new LinkedHashMap<>();
}

public abstract Optional<String> customTypeNamingFunction();

/**
* Provides a strategy for resolving duplicate method names
* @return
Expand Down Expand Up @@ -210,6 +218,10 @@ public Settings getSettings() {
typeProcessors.add(getOverridingTypeParser());
typeProcessors.add(genericTypeProcessor);
settings.customTypeProcessor = new TypeProcessor.Chain(typeProcessors);
settings.customTypeNaming = customTypeNaming();
if (customTypeNamingFunction().isPresent()) {
settings.customTypeNamingFunction = customTypeNamingFunction().get();
}
settings.addTypeNamePrefix = generatedInterfacePrefix();
settings.sortDeclarations = true;
settings.noFileComment = true;
Expand Down

0 comments on commit 8f4eed9

Please sign in to comment.