Package com.google.javascript.jscomp
Class CodePrinter.Builder
java.lang.Object
com.google.javascript.jscomp.CodePrinter.Builder
- Enclosing class:
CodePrinter
-
Nested Class Summary
Nested Classes -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionbuild()
Generates the source code and returns it.Set a custom code generator factory to enable custom code generation.setCompilerOptions
(CompilerOptions options) Sets the output options from compiler options.setLicenseTracker
(CodePrinter.LicenseTracker licenseTracker) Sets the license tracker to use when printing.setLineBreak
(boolean lineBreak) Sets whether line breaking should be done automatically.setOutputTypes
(boolean outputTypes) Sets whether to output closure-style type annotations.setPrettyPrint
(boolean prettyPrint) Sets whether pretty printing should be used.setTagAsStrict
(boolean tagAsStrict) Set whether the output should be tags as ECMASCRIPT 5 Strict.setTagAsTypeSummary
(boolean tagAsTypeSummary) Set whether the output should be tagged as an .i.js file.setTypeRegistry
(JSTypeRegistry registry)
-
Constructor Details
-
Builder
Sets the root node from which to generate the source code.- Parameters:
node
- The root node.
-
-
Method Details
-
setCompilerOptions
Sets the output options from compiler options. -
setTypeRegistry
-
setPrettyPrint
Sets whether pretty printing should be used.- Parameters:
prettyPrint
- If true, pretty printing will be used.
-
setLineBreak
Sets whether line breaking should be done automatically.- Parameters:
lineBreak
- If true, line breaking is done automatically.
-
setOutputTypes
Sets whether to output closure-style type annotations.- Parameters:
outputTypes
- If true, outputs closure-style type annotations.
-
setLicenseTracker
@CanIgnoreReturnValue public CodePrinter.Builder setLicenseTracker(CodePrinter.LicenseTracker licenseTracker) Sets the license tracker to use when printing.- Parameters:
licenseTracker
- The tracker to use. Can be null to disable license tracking.
-
setTagAsTypeSummary
Set whether the output should be tagged as an .i.js file. -
setTagAsStrict
Set whether the output should be tags as ECMASCRIPT 5 Strict. -
setCodeGeneratorFactory
@CanIgnoreReturnValue public CodePrinter.Builder setCodeGeneratorFactory(CodePrinter.Builder.CodeGeneratorFactory factory) Set a custom code generator factory to enable custom code generation. -
build
Generates the source code and returns it. -
buildWithSourceMappings
-