# ConstraintSetParser

Artifact: [androidx.constraintlayout:constraintlayout-core](https://developer.android.com/jetpack/androidx/releases/constraintlayout) [View Source](https://cs.android.com/search?q=file:androidx/constraintlayout/core/state/ConstraintSetParser.java+class:androidx.constraintlayout.core.state.ConstraintSetParser) Added in [1.1.2](https://developer.android.com/jetpack/androidx/releases/constraintlayout#1.1.2)

*** ** * ** ***


```
class ConstraintSetParser
```

<br />

*** ** * ** ***

## Summary

| ### Nested types |
|---|
| `class https://developer.android.com/reference/kotlin/androidx/constraintlayout/core/state/ConstraintSetParser.DesignElement` |
| `class https://developer.android.com/reference/kotlin/androidx/constraintlayout/core/state/ConstraintSetParser.LayoutVariables` Provide the storage for managing Variables in the system. |
| `enum https://developer.android.com/reference/kotlin/androidx/constraintlayout/core/state/ConstraintSetParser.MotionLayoutDebugFlags` |

| ### Public constructors |
|---|
| `https://developer.android.com/reference/kotlin/androidx/constraintlayout/core/state/ConstraintSetParser#ConstraintSetParser()()` |

| ### Public functions |
|---|---|
| `java-static https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-unit/index.html` | `https://developer.android.com/reference/kotlin/androidx/constraintlayout/core/state/ConstraintSetParser#parseDesignElementsJSON(java.lang.String,java.util.ArrayList<androidx.constraintlayout.core.state.ConstraintSetParser.DesignElement>)( content: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-string/index.html!, list: https://developer.android.com/reference/java/util/ArrayList.html<https://developer.android.com/reference/kotlin/androidx/constraintlayout/core/state/ConstraintSetParser.DesignElement!>! )` parse the Design time elements. |
| `java-static https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-unit/index.html` | `https://developer.android.com/reference/kotlin/androidx/constraintlayout/core/state/ConstraintSetParser#parseJSON(java.lang.String,androidx.constraintlayout.core.state.State,androidx.constraintlayout.core.state.ConstraintSetParser.LayoutVariables)( content: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-string/index.html!, state: https://developer.android.com/reference/kotlin/androidx/constraintlayout/core/state/State!, layoutVariables: https://developer.android.com/reference/kotlin/androidx/constraintlayout/core/state/ConstraintSetParser.LayoutVariables! )` Top leve parsing of the json ConstraintSet supporting "Variables", "Helpers", "Generate", guidelines, and barriers |
| `java-static https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-unit/index.html` | `https://developer.android.com/reference/kotlin/androidx/constraintlayout/core/state/ConstraintSetParser#parseJSON(java.lang.String,androidx.constraintlayout.core.state.Transition,int)(content: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-string/index.html!, transition: https://developer.android.com/reference/kotlin/androidx/constraintlayout/core/state/Transition!, state: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-int/index.html)` Parse and populate a transition |
| `java-static https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-unit/index.html` | `https://developer.android.com/reference/kotlin/androidx/constraintlayout/core/state/ConstraintSetParser#parseMotionSceneJSON(androidx.constraintlayout.core.state.CoreMotionScene,java.lang.String)(scene: https://developer.android.com/reference/kotlin/androidx/constraintlayout/core/state/CoreMotionScene!, content: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-string/index.html!)` Parse and build a motionScene this should be in a MotionScene / MotionSceneParser |

## Public constructors

### ConstraintSetParser

Added in 1.1.2

```
ConstraintSetParser()
```

## Public functions

### parseDesignElementsJSON

Added in [1.1.2](https://developer.android.com/jetpack/androidx/releases/constraintlayout#1.1.2)

```
java-static fun parseDesignElementsJSON(
    content: String!,
    list: ArrayList<ConstraintSetParser.DesignElement!>!
): Unit
```

parse the Design time elements.

| Parameters |
|---|---|
| `content: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-string/index.html!` | the json |
| `list: https://developer.android.com/reference/java/util/ArrayList.html<https://developer.android.com/reference/kotlin/androidx/constraintlayout/core/state/ConstraintSetParser.DesignElement!>!` | output the list of design elements |

| Throws |
|---|---|
| `https://developer.android.com/reference/kotlin/androidx/constraintlayout/core/parser/CLParsingException` |   |

### parseJSON

Added in [1.1.2](https://developer.android.com/jetpack/androidx/releases/constraintlayout#1.1.2)

```
java-static fun parseJSON(
    content: String!,
    state: State!,
    layoutVariables: ConstraintSetParser.LayoutVariables!
): Unit
```

Top leve parsing of the json ConstraintSet supporting "Variables", "Helpers", "Generate", guidelines, and barriers

| Parameters |
|---|---|
| `content: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-string/index.html!` | the JSON string |
| `state: https://developer.android.com/reference/kotlin/androidx/constraintlayout/core/state/State!` | the state to populate |
| `layoutVariables: https://developer.android.com/reference/kotlin/androidx/constraintlayout/core/state/ConstraintSetParser.LayoutVariables!` | the variables to override |

| Throws |
|---|---|
| `https://developer.android.com/reference/kotlin/androidx/constraintlayout/core/parser/CLParsingException` |   |

### parseJSON

Added in [1.1.2](https://developer.android.com/jetpack/androidx/releases/constraintlayout#1.1.2)

```
java-static fun parseJSON(content: String!, transition: Transition!, state: Int): Unit
```

Parse and populate a transition

| Parameters |
|---|---|
| `content: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-string/index.html!` | JSON string to parse |
| `transition: https://developer.android.com/reference/kotlin/androidx/constraintlayout/core/state/Transition!` | The Transition to be populated |
| `state: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-int/index.html` |   |

### parseMotionSceneJSON

Added in [1.1.2](https://developer.android.com/jetpack/androidx/releases/constraintlayout#1.1.2)

```
java-static fun parseMotionSceneJSON(scene: CoreMotionScene!, content: String!): Unit
```

Parse and build a motionScene this should be in a MotionScene / MotionSceneParser