> ## Documentation Index
> Fetch the complete documentation index at: https://cdktn.io/docs/llms.txt
> Use this file to discover all available pages before exploring further.

# Java: App

> CDKTN Core API Reference for App in Java.

Represents a cdktn application.

## Initializers <a name="Initializers" id="cdktn.App.Initializer" />

```java theme={null}
import io.cdktn.cdktn.App;

App.Builder.create()
//  .context(java.util.Map<java.lang.String, java.lang.Object>)
//  .hclOutput(java.lang.Boolean)
//  .outdir(java.lang.String)
//  .skipBackendValidation(java.lang.Boolean)
//  .skipValidation(java.lang.Boolean)
//  .stackTraces(java.lang.Boolean)
    .build();
```

| **Name**                                                                                                | **Type**                                                          | **Description**                                                 |
| ------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------- | --------------------------------------------------------------- |
| <code><a href="#cdktn.App.Initializer.parameter.context">context</a></code>                             | <code>java.util.Map\< java.lang.String, java.lang.Object ></code> | Additional context values for the application.                  |
| <code><a href="#cdktn.App.Initializer.parameter.hclOutput">hclOutput</a></code>                         | <code>java.lang.Boolean</code>                                    | *No description.*                                               |
| <code><a href="#cdktn.App.Initializer.parameter.outdir">outdir</a></code>                               | <code>java.lang.String</code>                                     | The directory to output Terraform resources.                    |
| <code><a href="#cdktn.App.Initializer.parameter.skipBackendValidation">skipBackendValidation</a></code> | <code>java.lang.Boolean</code>                                    | Whether to skip backend validation during synthesis of the app. |
| <code><a href="#cdktn.App.Initializer.parameter.skipValidation">skipValidation</a></code>               | <code>java.lang.Boolean</code>                                    | Whether to skip all validations during synthesis of the app.    |
| <code><a href="#cdktn.App.Initializer.parameter.stackTraces">stackTraces</a></code>                     | <code>java.lang.Boolean</code>                                    | *No description.*                                               |

***

### `context`<sup>Optional</sup> <a name="context" id="cdktn.App.Initializer.parameter.context" />

* *Type:* java.util.Map\< java.lang.String, java.lang.Object >
* *Default:* no additional context

Additional context values for the application.

Context set by the CLI or the `context` key in `cdktf.json` has precedence.

Context can be read from any construct using `node.getContext(key)`.

***

### `hclOutput`<sup>Optional</sup> <a name="hclOutput" id="cdktn.App.Initializer.parameter.hclOutput" />

* *Type:* java.lang.Boolean

***

### `outdir`<sup>Optional</sup> <a name="outdir" id="cdktn.App.Initializer.parameter.outdir" />

* *Type:* java.lang.String
* *Default:* CDKTF\_OUTDIR if defined, otherwise "cdktf.out"

The directory to output Terraform resources.

If you are using the CDKTN CLI, this value is automatically set from one of the following three sources:

* The `-o` / `--output` CLI option
* The `CDKTF_OUTDIR` environment variable
* The `outdir` key in `cdktf.json`

If you are using the CDKTN CLI and want to set a different value here, you will also need to set the same value via one of the three ways specified above.

The most common case to set this value is when you are using the CDKTN library directly (e.g. when writing unit tests).

***

### `skipBackendValidation`<sup>Optional</sup> <a name="skipBackendValidation" id="cdktn.App.Initializer.parameter.skipBackendValidation" />

* *Type:* java.lang.Boolean
* *Default:* false

Whether to skip backend validation during synthesis of the app.

***

### `skipValidation`<sup>Optional</sup> <a name="skipValidation" id="cdktn.App.Initializer.parameter.skipValidation" />

* *Type:* java.lang.Boolean
* *Default:* false

Whether to skip all validations during synthesis of the app.

***

### `stackTraces`<sup>Optional</sup> <a name="stackTraces" id="cdktn.App.Initializer.parameter.stackTraces" />

* *Type:* java.lang.Boolean

***

## Methods <a name="Methods" id="Methods" />

| **Name**                                                                      | **Description**                                                                                          |
| ----------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------- |
| <code><a href="#cdktn.App.toString">toString</a></code>                       | Returns a string representation of this construct.                                                       |
| <code><a href="#cdktn.App.with">with</a></code>                               | Applies one or more mixins to this construct.                                                            |
| <code><a href="#cdktn.App.crossStackReference">crossStackReference</a></code> | Creates a reference from one stack to another, invoked on prepareStack since it creates extra resources. |
| <code><a href="#cdktn.App.synth">synth</a></code>                             | Synthesizes all resources to the output directory.                                                       |

***

### `toString` <a name="toString" id="cdktn.App.toString" />

```java theme={null}
public java.lang.String toString()
```

Returns a string representation of this construct.

### `with` <a name="with" id="cdktn.App.with" />

```java theme={null}
public IConstruct with(IMixin... mixins)
```

Applies one or more mixins to this construct.

Mixins are applied in order. The list of constructs is captured at the
start of the call, so constructs added by a mixin will not be visited.
Use multiple `with()` calls if subsequent mixins should apply to added
constructs.

#### `mixins`<sup>Required</sup> <a name="mixins" id="cdktn.App.with.parameter.mixins" />

* *Type:* software.constructs.IMixin...

The mixins to apply.

***

### `crossStackReference` <a name="crossStackReference" id="cdktn.App.crossStackReference" />

```java theme={null}
public java.lang.String crossStackReference(TerraformStack fromStack, TerraformStack toStack, java.lang.String identifier)
```

Creates a reference from one stack to another, invoked on prepareStack since it creates extra resources.

#### `fromStack`<sup>Required</sup> <a name="fromStack" id="cdktn.App.crossStackReference.parameter.fromStack" />

* *Type:* <a href="#cdktn.TerraformStack">TerraformStack</a>

***

#### `toStack`<sup>Required</sup> <a name="toStack" id="cdktn.App.crossStackReference.parameter.toStack" />

* *Type:* <a href="#cdktn.TerraformStack">TerraformStack</a>

***

#### `identifier`<sup>Required</sup> <a name="identifier" id="cdktn.App.crossStackReference.parameter.identifier" />

* *Type:* java.lang.String

***

### `synth` <a name="synth" id="cdktn.App.synth" />

```java theme={null}
public void synth()
```

Synthesizes all resources to the output directory.

## Static Functions <a name="Static Functions" id="Static Functions" />

| **Name**                                                      | **Description**               |
| ------------------------------------------------------------- | ----------------------------- |
| <code><a href="#cdktn.App.isConstruct">isConstruct</a></code> | Checks if `x` is a construct. |
| <code><a href="#cdktn.App.isApp">isApp</a></code>             | *No description.*             |
| <code><a href="#cdktn.App.of">of</a></code>                   | *No description.*             |

***

### `isConstruct` <a name="isConstruct" id="cdktn.App.isConstruct" />

```java theme={null}
import io.cdktn.cdktn.App;

App.isConstruct(java.lang.Object x)
```

Checks if `x` is a construct.

Use this method instead of `instanceof` to properly detect `Construct`
instances, even when the construct library is symlinked.

Explanation: in JavaScript, multiple copies of the `constructs` library on
disk are seen as independent, completely different libraries. As a
consequence, the class `Construct` in each copy of the `constructs` library
is seen as a different class, and an instance of one class will not test as
`instanceof` the other class. `npm install` will not create installations
like this, but users may manually symlink construct libraries together or
use a monorepo tool: in those cases, multiple copies of the `constructs`
library can be accidentally installed, and `instanceof` will behave
unpredictably. It is safest to avoid using `instanceof`, and using
this type-testing method instead.

#### `x`<sup>Required</sup> <a name="x" id="cdktn.App.isConstruct.parameter.x" />

* *Type:* java.lang.Object

Any object.

***

### `isApp` <a name="isApp" id="cdktn.App.isApp" />

```java theme={null}
import io.cdktn.cdktn.App;

App.isApp(java.lang.Object x)
```

#### `x`<sup>Required</sup> <a name="x" id="cdktn.App.isApp.parameter.x" />

* *Type:* java.lang.Object

***

### `of` <a name="of" id="cdktn.App.of" />

```java theme={null}
import io.cdktn.cdktn.App;

App.of(IConstruct construct)
```

#### `construct`<sup>Required</sup> <a name="construct" id="cdktn.App.of.parameter.construct" />

* *Type:* software.constructs.IConstruct

***

## Properties <a name="Properties" id="Properties" />

| **Name**                                                                                   | **Type**                                            | **Description**                                                 |
| ------------------------------------------------------------------------------------------ | --------------------------------------------------- | --------------------------------------------------------------- |
| <code><a href="#cdktn.App.property.node">node</a></code>                                   | <code>software.constructs.Node</code>               | The tree node.                                                  |
| <code><a href="#cdktn.App.property.hclOutput">hclOutput</a></code>                         | <code>java.lang.Boolean</code>                      | *No description.*                                               |
| <code><a href="#cdktn.App.property.manifest">manifest</a></code>                           | <code><a href="#cdktn.Manifest">Manifest</a></code> | *No description.*                                               |
| <code><a href="#cdktn.App.property.outdir">outdir</a></code>                               | <code>java.lang.String</code>                       | The output directory into which resources will be synthesized.  |
| <code><a href="#cdktn.App.property.skipBackendValidation">skipBackendValidation</a></code> | <code>java.lang.Boolean</code>                      | Whether to skip backend validation during synthesis of the app. |
| <code><a href="#cdktn.App.property.skipValidation">skipValidation</a></code>               | <code>java.lang.Boolean</code>                      | Whether to skip all validations during synthesis of the app.    |
| <code><a href="#cdktn.App.property.targetStackId">targetStackId</a></code>                 | <code>java.lang.String</code>                       | The stack which will be synthesized.                            |

***

### `node`<sup>Required</sup> <a name="node" id="cdktn.App.property.node" />

```java theme={null}
public Node getNode();
```

* *Type:* software.constructs.Node

The tree node.

***

### `hclOutput`<sup>Required</sup> <a name="hclOutput" id="cdktn.App.property.hclOutput" />

```java theme={null}
public java.lang.Boolean getHclOutput();
```

* *Type:* java.lang.Boolean

***

### `manifest`<sup>Required</sup> <a name="manifest" id="cdktn.App.property.manifest" />

```java theme={null}
public Manifest getManifest();
```

* *Type:* <a href="#cdktn.Manifest">Manifest</a>

***

### `outdir`<sup>Required</sup> <a name="outdir" id="cdktn.App.property.outdir" />

```java theme={null}
public java.lang.String getOutdir();
```

* *Type:* java.lang.String

The output directory into which resources will be synthesized.

***

### `skipBackendValidation`<sup>Required</sup> <a name="skipBackendValidation" id="cdktn.App.property.skipBackendValidation" />

```java theme={null}
public java.lang.Boolean getSkipBackendValidation();
```

* *Type:* java.lang.Boolean

Whether to skip backend validation during synthesis of the app.

***

### `skipValidation`<sup>Required</sup> <a name="skipValidation" id="cdktn.App.property.skipValidation" />

```java theme={null}
public java.lang.Boolean getSkipValidation();
```

* *Type:* java.lang.Boolean

Whether to skip all validations during synthesis of the app.

***

### `targetStackId`<sup>Optional</sup> <a name="targetStackId" id="cdktn.App.property.targetStackId" />

```java theme={null}
public java.lang.String getTargetStackId();
```

* *Type:* java.lang.String

The stack which will be synthesized.

If not set, all stacks will be synthesized.

***
