File tree Expand file tree Collapse file tree 4 files changed +24
-0
lines changed
typescript-generator-core/src/main/java/cz/habarta/typescript/generator
typescript-generator-gradle-plugin/src/main/java/cz/habarta/typescript/generator/gradle
typescript-generator-maven-plugin/src/main/java/cz/habarta/typescript/generator/maven Expand file tree Collapse file tree 4 files changed +24
-0
lines changed Original file line number Diff line number Diff line change @@ -48,6 +48,10 @@ public class Settings {
4848 public boolean displaySerializerWarning = true ;
4949
5050
51+ public void setStringQuotes (StringQuotes quotes ) {
52+ this .quotes = quotes == StringQuotes .singleQuotes ? "'" : "\" " ;
53+ }
54+
5155 public void loadCustomTypeProcessor (ClassLoader classLoader , String customTypeProcessor ) {
5256 if (customTypeProcessor != null ) {
5357 this .customTypeProcessor = loadInstance (classLoader , customTypeProcessor , TypeProcessor .class );
Original file line number Diff line number Diff line change 1+
2+ package cz .habarta .typescript .generator ;
3+
4+
5+ public enum StringQuotes {
6+
7+ doubleQuotes , singleQuotes ;
8+
9+ }
Original file line number Diff line number Diff line change @@ -45,6 +45,7 @@ public class GenerateTask extends DefaultTask {
4545 public List <File > javadocXmlFiles ;
4646 public List <String > extensionClasses ;
4747 public List <String > optionalAnnotations ;
48+ public StringQuotes stringQuotes ;
4849 public boolean displaySerializerWarning = true ;
4950
5051 @ TaskAction
@@ -101,6 +102,7 @@ public void generate() throws Exception {
101102 settings .loadExtensions (classLoader , extensionClasses );
102103 settings .loadIncludePropertyAnnotations (classLoader , includePropertyAnnotations );
103104 settings .loadOptionalAnnotations (classLoader , optionalAnnotations );
105+ settings .setStringQuotes (stringQuotes );
104106 settings .displaySerializerWarning = displaySerializerWarning ;
105107 settings .validateFileName (new File (outputFile ));
106108
Original file line number Diff line number Diff line change @@ -272,6 +272,14 @@ public class GenerateMojo extends AbstractMojo {
272272 @ Parameter
273273 private List <String > optionalAnnotations ;
274274
275+ /**
276+ * Specifies how strings will be quoted.
277+ * Supported values are 'doubleQuotes', 'singleQuotes'.
278+ * Default value is 'doubleQuotes'.
279+ */
280+ @ Parameter
281+ private StringQuotes stringQuotes ;
282+
275283 /**
276284 * Display warnings when bean serializer is not found.
277285 */
@@ -324,6 +332,7 @@ public void execute() {
324332 settings .loadExtensions (classLoader , extensions );
325333 settings .loadIncludePropertyAnnotations (classLoader , includePropertyAnnotations );
326334 settings .loadOptionalAnnotations (classLoader , optionalAnnotations );
335+ settings .setStringQuotes (stringQuotes );
327336 settings .displaySerializerWarning = displaySerializerWarning ;
328337 settings .validateFileName (outputFile );
329338
You can’t perform that action at this time.
0 commit comments