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

# Interface: ParseableFile

**Package:** `com.phoenix_int.aserver.util.scriptwrapper.api`

**All Known Subinterfaces:**

[`InputFile`](https://developer.synopsys.com/docs/modelcenter/modelcenter-scriptwrapper-api/java_scriptwrapper_api/api/InputFile), [`OutputFile`](https://developer.synopsys.com/docs/modelcenter/modelcenter-scriptwrapper-api/java_scriptwrapper_api/api/OutputFile)

**All Known Implementing Classes:**

[`AbstractFile`](https://developer.synopsys.com/docs/modelcenter/modelcenter-scriptwrapper-api/java_scriptwrapper_api/api/AbstractFile), [`CAEOutputFile`](https://developer.synopsys.com/docs/modelcenter/modelcenter-scriptwrapper-api/java_scriptwrapper_api/api/CAEOutputFile), [`PHXRowFieldFile`](https://developer.synopsys.com/docs/modelcenter/modelcenter-scriptwrapper-api/java_scriptwrapper_api/api/PHXRowFieldFile), [`XPathFile`](https://developer.synopsys.com/docs/modelcenter/modelcenter-scriptwrapper-api/java_scriptwrapper_api/api/XPathFile)

***

**Declaration:**

```java theme={null}
public interface ParseableFile
```

Interface for files (not file variables) used in script wrappers

## Nested Class Summary

| Modifier and Type | Interface and Description |
| - | - |
| `static class` | [`ParseableFile.Mode`](https://developer.synopsys.com/docs/modelcenter/modelcenter-scriptwrapper-api/java_scriptwrapper_api/api/ParseableFile.Mode) File mode. Moved to type-safe enum from legacy integer constants |

## Method Summary

| Modifier and Type | Method and Description |
| - | - |
| `void` | `backup()` Backup the file on disk. |
| `void` | `close()` Close the file and free up resources |
| `void` | `delete()` Delete the file from disk. |
| `void` | `readTemplate()` Read the template. |
| `void` | `setFileToGenerateOrParse(java.lang.String fileName)` Set the file to generate or to parse, depending on the mode |
| `void` | `setTempEmbedded(java.lang.String option)` This method applies only to ModelCenter and has no function in ModelCenter Remote Execution |
| `void` | `setTemplateFile(java.lang.String templateFileName)` Set the template file to read. |
| `void` | `setVariable(java.lang.String name, java.lang.String value)` Sets the value of a variable |

## Method Detail

### backup

```java theme={null}
void backup()
```

Backup the file on disk. File is at the same location with ".bac" appended to the end. If a file by that name already exists, it is deleted prior to moving.

### close

```java theme={null}
void close()
```

Close the file and free up resources

### delete

```java theme={null}
void delete()
```

Delete the file from disk.

### readTemplate

```java theme={null}
void readTemplate()
           throws java.io.IOException,
                  com.phoenix_int.aserver.util.PHXInvalidFormatException,
                  PHXNoSuchTokenException,
                  java.lang.IllegalAccessException,
                  java.lang.InstantiationException,
                  PHXNumberFormatException,
                  PHXBookmarkNotFoundException,
                  PHXSectionNotFoundException
```

Read the template. In MCRE 7.1, this method was changed to never throw any exceptions. Reading the templates allows you to fill in default values if you can, but is not mandatory.

**Throws:**

* `java.io.IOException`
* `com.phoenix_int.aserver.util.PHXInvalidFormatException`
* `PHXNoSuchTokenException`
* `java.lang.IllegalAccessException`
* `java.lang.InstantiationException`
* `PHXNumberFormatException`
* [`PHXBookmarkNotFoundException`](https://developer.synopsys.com/docs/modelcenter/modelcenter-scriptwrapper-api/java_scriptwrapper_api/api/PHXBookmarkNotFoundException)
* [`PHXSectionNotFoundException`](https://developer.synopsys.com/docs/modelcenter/modelcenter-scriptwrapper-api/java_scriptwrapper_api/api/PHXSectionNotFoundException)

### setFileToGenerateOrParse

```java theme={null}
void setFileToGenerateOrParse(java.lang.String fileName)
```

Set the file to generate or to parse, depending on the mode

**Parameters:**

* `fileName` -

### setTempEmbedded

```java theme={null}
void setTempEmbedded(java.lang.String option)
```

This method applies only to ModelCenter and has no function in ModelCenter Remote Execution

### setTemplateFile

```java theme={null}
void setTemplateFile(java.lang.String templateFileName)
```

Set the template file to read. If the template file is not specified, it defaults to the file that is parsed or generated, for [`Mode.PARSE`](https://developer.synopsys.com/docs/modelcenter/modelcenter-scriptwrapper-api/java_scriptwrapper_api/api/ParseableFile.Mode) or [`Mode.GENERATE`](https://developer.synopsys.com/docs/modelcenter/modelcenter-scriptwrapper-api/java_scriptwrapper_api/api/ParseableFile.Mode), respectively.

**Parameters:**

* `templateFileName` - file name

### setVariable

```java theme={null}
void setVariable(java.lang.String name,
                 java.lang.String value)
          throws PHXNoSuchObjectException
```

Sets the value of a variable

**Parameters:**

* `name` - variable name
* `value` - variable value as a string

**Throws:**

* `PHXNoSuchObjectException`
