Class ObjectFile
- java.lang.Object
-
- software.amazon.jsii.JsiiObject
-
- software.constructs.Construct
-
- io.github.cdklabs.projen.Component
-
- io.github.cdklabs.projen.FileBase
-
- io.github.cdklabs.projen.ObjectFile
-
- All Implemented Interfaces:
software.amazon.jsii.JsiiSerializable,software.constructs.IConstruct,software.constructs.IDependable
@Generated(value="jsii-pacmak/1.96.0 (build 921e240)", date="2024-03-28T21:16:42.778Z") @Stability(Experimental) public abstract class ObjectFile extends FileBase
(experimental) Represents an Object file.
-
-
Constructor Summary
Constructors Modifier Constructor Description protectedObjectFile(software.amazon.jsii.JsiiObject.InitializationMode initializationMode)protectedObjectFile(software.amazon.jsii.JsiiObjectRef objRef)protectedObjectFile(software.constructs.IConstruct scope, String filePath, ObjectFileOptions options)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidaddDeletionOverride(String path)(experimental) Syntactic sugar foraddOverride(path, undefined).voidaddOverride(String path, Object value)(experimental) Adds an override to the synthesized object file.voidaddToArray(String path, @NotNull Object... values)(experimental) Adds to an array in the synthesized object file.BooleangetOmitEmpty()(experimental) Indicates if empty objects and arrays are omitted from the output object.voidpatch(@NotNull JsonPatch... patches)(experimental) Applies an RFC 6902 JSON-patch to the synthesized object file.protected StringsynthesizeContent(IResolver resolver)(experimental) Implemented by derived classes and returns the contents of the file to emit.-
Methods inherited from class io.github.cdklabs.projen.FileBase
getAbsolutePath, getChanged, getExecutable, getMarker, getPath, getReadonly, setExecutable, setReadonly, synthesize
-
Methods inherited from class io.github.cdklabs.projen.Component
getProject, isComponent, postSynthesize, preSynthesize
-
Methods inherited from class software.amazon.jsii.JsiiObject
jsiiAsyncCall, jsiiAsyncCall, jsiiCall, jsiiCall, jsiiGet, jsiiGet, jsiiSet, jsiiStaticCall, jsiiStaticCall, jsiiStaticGet, jsiiStaticGet, jsiiStaticSet, jsiiStaticSet
-
-
-
-
Constructor Detail
-
ObjectFile
protected ObjectFile(software.amazon.jsii.JsiiObjectRef objRef)
-
ObjectFile
protected ObjectFile(software.amazon.jsii.JsiiObject.InitializationMode initializationMode)
-
ObjectFile
@Stability(Experimental) protected ObjectFile(@NotNull software.constructs.IConstruct scope, @NotNull String filePath, @NotNull ObjectFileOptions options)- Parameters:
scope- This parameter is required.filePath- This parameter is required.options- This parameter is required.
-
-
Method Detail
-
addDeletionOverride
@Stability(Experimental) public void addDeletionOverride(@NotNull String path)(experimental) Syntactic sugar foraddOverride(path, undefined).- Parameters:
path- The path of the value to delete. This parameter is required.
-
addOverride
@Stability(Experimental) public void addOverride(@NotNull String path, @NotNull Object value)(experimental) Adds an override to the synthesized object file.If the override is nested, separate each nested level using a dot (.) in the path parameter. If there is an array as part of the nesting, specify the index in the path.
To include a literal
.in the property name, prefix with a\. In most programming languages you will need to write this as"\\."because the\itself will need to be escaped.For example,
project.tsconfig.file.addOverride('compilerOptions.alwaysStrict', true); project.tsconfig.file.addOverride('compilerOptions.lib', ['dom', 'dom.iterable', 'esnext']);would add the overrides
"compilerOptions": { "alwaysStrict": true, "lib": [ "dom", "dom.iterable", "esnext" ] ... } ...- Parameters:
path-- The path of the property, you can use dot notation to override values in complex types.
value-- The value.
-
addToArray
@Stability(Experimental) public void addToArray(@NotNull String path, @NotNull @NotNull Object... values)(experimental) Adds to an array in the synthesized object file.If the array is nested, separate each nested level using a dot (.) in the path parameter. If there is an array as part of the nesting, specify the index in the path.
To include a literal
.in the property name, prefix with a\. In most programming languages you will need to write this as"\\."because the\itself will need to be escaped.For example, with the following object file
"compilerOptions": { "exclude": ["node_modules"], "lib": ["es2019"] ... } ...project.tsconfig.file.addToArray('compilerOptions.exclude', 'coverage'); project.tsconfig.file.addToArray('compilerOptions.lib', 'dom', 'dom.iterable', 'esnext');would result in the following object file
"compilerOptions": { "exclude": ["node_modules", "coverage"], "lib": ["es2019", "dom", "dom.iterable", "esnext"] ... } ...- Parameters:
path-- The path of the property, you can use dot notation to att to arrays in complex types.
values-- The values to add.
-
patch
@Stability(Experimental) public void patch(@NotNull @NotNull JsonPatch... patches)(experimental) Applies an RFC 6902 JSON-patch to the synthesized object file. See https://datatracker.ietf.org/doc/html/rfc6902 for more information.For example, with the following object file
"compilerOptions": { "exclude": ["node_modules"], "lib": ["es2019"] ... } ...project.tsconfig.file.patch(JsonPatch.add("/compilerOptions/exclude/-", "coverage")); project.tsconfig.file.patch(JsonPatch.replace("/compilerOptions/lib", ["dom", "dom.iterable", "esnext"]));would result in the following object file
"compilerOptions": { "exclude": ["node_modules", "coverage"], "lib": ["dom", "dom.iterable", "esnext"] ... } ...- Parameters:
patches-- The patch operations to apply.
-
synthesizeContent
@Stability(Experimental) @Nullable protected String synthesizeContent(@NotNull IResolver resolver)
(experimental) Implemented by derived classes and returns the contents of the file to emit.- Specified by:
synthesizeContentin classFileBase- Parameters:
resolver- This parameter is required.- Returns:
- the content to synthesize or undefined to skip the file
-
getOmitEmpty
@Stability(Experimental) @NotNull public Boolean getOmitEmpty()
(experimental) Indicates if empty objects and arrays are omitted from the output object.
-
-