# AdfNode

An ADF content node. Review signatures, members, parameters, type relationships, and available reference details in OfficeIMO.Adf API Reference.

Class 

`OfficeIMO.Adf`

**Namespace**

`OfficeIMO.Adf`

**Assembly**

`OfficeIMO.Adf`

**Source revision**

`ba882f6b0d07` with working tree changes

**Source**

[AdfDocument.cs:99](https://github.com/EvotecIT/OfficeIMO/blob/ba882f6b0d07acddd884b5e7d3086b0cfff0a05a/OfficeIMO.Adf/AdfDocument.cs#L99)

**Modifiers**

sealed

An ADF content node.

## Inheritance

- object
- AdfNode

## Usage

Explore 6 API references to this type

This type appears in these public API surfaces even when no hand-authored example is attached directly to the page.

### Returned or exposed by 5

- Property [AdfConversionOptions.ExtensionResolver](/api/adf/officeimo-adf-adfconversionoptions/#property-extensionresolver)
- Property [AdfDocument.Content](/api/adf/officeimo-adf-adfdocument/#property-content)
- Method [AdfNode.SetAttribute``1](/api/adf/officeimo-adf-adfnode/#method-setattribute-string)
- Method [AdfNode.TextNode](/api/adf/officeimo-adf-adfnode/#method-textnode-string-collections-generic-ienumerable-officeimo-adf-adfmark)
- Property [AdfNode.Content](/api/adf/officeimo-adf-adfnode/#property-content)

### Accepted by parameters 1

- Constructor [AdfDocument.AdfDocument](/api/adf/officeimo-adf-adfdocument/#constructor-ctor-collections-generic-ienumerable-officeimo-adf-adfnode) parameter `content`

Filter members 

Show inherited

## Constructors

`public AdfNode(string type)` [#](#constructor-ctor-string)

[AdfDocument.cs:99](https://github.com/EvotecIT/OfficeIMO/blob/ba882f6b0d07acddd884b5e7d3086b0cfff0a05a/OfficeIMO.Adf/AdfDocument.cs#L99)

Creates an ADF node.

Parameters

**type string required**

## Methods

`public int? GetInt32Attribute(string name)` [#](#method-getint32attribute-string)

[AdfDocument.cs:172](https://github.com/EvotecIT/OfficeIMO/blob/ba882f6b0d07acddd884b5e7d3086b0cfff0a05a/OfficeIMO.Adf/AdfDocument.cs#L172)

Gets an integer attribute when present.

Parameters

**name string required**

Returns

`int?`

`public string? GetStringAttribute(string name)` [#](#method-getstringattribute-string)

[AdfDocument.cs:166](https://github.com/EvotecIT/OfficeIMO/blob/ba882f6b0d07acddd884b5e7d3086b0cfff0a05a/OfficeIMO.Adf/AdfDocument.cs#L166)

Gets a string attribute when present.

Parameters

**name string required**

Returns

`string?`

SetAttribute``1 2 overloads

`public AdfNode SetAttribute<T>(string name, T? value)` [#](#method-setattribute-string)

[AdfDocument.cs:151](https://github.com/EvotecIT/OfficeIMO/blob/ba882f6b0d07acddd884b5e7d3086b0cfff0a05a/OfficeIMO.Adf/AdfDocument.cs#L151)

Sets a JSON-compatible attribute value.

Type Parameters

**T**

Parameters

**name string required**

**value T? required**

Returns

`AdfNode`

`public AdfNode SetAttribute<T>(string name, T? value, JsonTypeInfo<T?> typeInfo)` [#](#method-setattribute-string-text-json-serialization-metadata-jsontypeinfo)

[AdfDocument.cs:158](https://github.com/EvotecIT/OfficeIMO/blob/ba882f6b0d07acddd884b5e7d3086b0cfff0a05a/OfficeIMO.Adf/AdfDocument.cs#L158)

Sets a custom attribute using source-generated JSON metadata.

Type Parameters

**T**

Parameters

**name string required**

**value T? required**

**typeInfo System.Text.Json.Serialization.Metadata.JsonTypeInfo<T?> required**

Returns

`AdfNode`

`public static AdfNode TextNode(string text, IEnumerable<AdfMark>? marks = null)` [#](#method-textnode-string-collections-generic-ienumerable-officeimo-adf-adfmark)

[AdfDocument.cs:144](https://github.com/EvotecIT/OfficeIMO/blob/ba882f6b0d07acddd884b5e7d3086b0cfff0a05a/OfficeIMO.Adf/AdfDocument.cs#L144)

Creates a text node.

Parameters

**text string required**

**marks System.Collections.Generic.IEnumerable<OfficeIMO.Adf.AdfMark>? = null optional**

Returns

`AdfNode`

## Inherited Methods

`public virtual bool Equals(object? obj)` [#](#method-equals-object)

Inherited from object

Parameters

**obj object? required**

Returns

`bool`

`public virtual int GetHashCode()` [#](#method-gethashcode)

Inherited from object

Returns

`int`

`public Type GetType()` [#](#method-gettype)

Inherited from object

Returns

`Type`

`public virtual string? ToString()` [#](#method-tostring)

Inherited from object

Returns

`string?`

## Properties

`public string Type { get; set; }` [#](#property-type)

[AdfDocument.cs:105](https://github.com/EvotecIT/OfficeIMO/blob/ba882f6b0d07acddd884b5e7d3086b0cfff0a05a/OfficeIMO.Adf/AdfDocument.cs#L105)

Node type such as paragraph, heading, or text.

`public string? Text { get; set; }` [#](#property-text)

[AdfDocument.cs:108](https://github.com/EvotecIT/OfficeIMO/blob/ba882f6b0d07acddd884b5e7d3086b0cfff0a05a/OfficeIMO.Adf/AdfDocument.cs#L108)

Text payload for text nodes.

`public bool IncludeEmptyAttributes { get; set; }` [#](#property-includeemptyattributes)

[AdfDocument.cs:111](https://github.com/EvotecIT/OfficeIMO/blob/ba882f6b0d07acddd884b5e7d3086b0cfff0a05a/OfficeIMO.Adf/AdfDocument.cs#L111)

Includes an empty attributes object when no attributes are set. Parsing retains explicit source presence.

`public bool IncludeEmptyContent { get; set; }` [#](#property-includeemptycontent)

[AdfDocument.cs:113](https://github.com/EvotecIT/OfficeIMO/blob/ba882f6b0d07acddd884b5e7d3086b0cfff0a05a/OfficeIMO.Adf/AdfDocument.cs#L113)

Includes an empty content array when there are no children. Parsing retains explicit source presence.

`public bool IncludeEmptyMarks { get; set; }` [#](#property-includeemptymarks)

[AdfDocument.cs:115](https://github.com/EvotecIT/OfficeIMO/blob/ba882f6b0d07acddd884b5e7d3086b0cfff0a05a/OfficeIMO.Adf/AdfDocument.cs#L115)

Includes an empty marks array when there are no marks. Parsing retains explicit source presence.

`public List<AdfNode> Content { get; }` [#](#property-content)

[AdfDocument.cs:118](https://github.com/EvotecIT/OfficeIMO/blob/ba882f6b0d07acddd884b5e7d3086b0cfff0a05a/OfficeIMO.Adf/AdfDocument.cs#L118)

Child nodes.

`public List<AdfMark> Marks { get; }` [#](#property-marks)

[AdfDocument.cs:121](https://github.com/EvotecIT/OfficeIMO/blob/ba882f6b0d07acddd884b5e7d3086b0cfff0a05a/OfficeIMO.Adf/AdfDocument.cs#L121)

Marks applied to a text node.

`public IDictionary<string, JsonElement> Attributes { get; }` [#](#property-attributes)

[AdfDocument.cs:125](https://github.com/EvotecIT/OfficeIMO/blob/ba882f6b0d07acddd884b5e7d3086b0cfff0a05a/OfficeIMO.Adf/AdfDocument.cs#L125)

Node attributes retained as arbitrary JSON values.

`public IDictionary<string, JsonElement> ExtensionData { get; }` [#](#property-extensiondata)

[AdfDocument.cs:129](https://github.com/EvotecIT/OfficeIMO/blob/ba882f6b0d07acddd884b5e7d3086b0cfff0a05a/OfficeIMO.Adf/AdfDocument.cs#L129)

Unknown node properties retained during parse/write round trips.

<!-- PowerForge markdown artifact sha256:D7EC4B3EF92DD0F8E199DA96B6778808A1F4AA5E4C96C9FAB6FB8F73165D4102 -->
