PublishedSchemaXmlFileLocater Class
This locater is responsible for locating standard schema files that are released by the core-backend package. The locater needs an argument to the known backend assets directory where the core-backend package is installed. This can be accessed by the KnownLocations.nativeAssetsDir getter provided by core-backend.
@note This locater is read-only and does not allow adding new schema search paths.
@note This locater should be used as a fallback/last chance locater in the schema context as any user defined schema should have higher precedence over the standard schema. This is a workaround due to the current lack of a full xml parser.
Extends
Implements
Methods
Name | Description | |
---|---|---|
constructor(knownBackendAssetsDir: string): PublishedSchemaXmlFileLocater | Constructs a new PublishedSchemaXmlFileLocater | |
addSchemaSearchPath(_schemaPath: string): void | Overrides the addSchemaSearchPath method to prevent adding new schema search paths. | |
addSchemaSearchPaths(_schemaPaths: string[]): void | Overrides the addSchemaSearchPaths method to prevent adding new schema search paths. |
Inherited methods
Name | Inherited from | Description |
---|---|---|
compareSchemaKeyByVersion(lhs: FileSchemaKey, rhs: FileSchemaKey): number Inherited | SchemaXmlFileLocater | Compares two Schema versions. |
fileExists(filePath: string): Promise<undefined | boolean> Inherited | SchemaXmlFileLocater | |
fileExistsSync(filePath: string): undefined | boolean Inherited | SchemaXmlFileLocater | |
findEligibleSchemaKeys(desiredKey: Readonly<SchemaKey>, matchType: SchemaMatchType, format: string): FileSchemaKey[] Protected Inherited | SchemaXmlFileLocater | Attempts to find all Schema files in the configurable search paths that match |
getSchema<T extends Schema>(key: SchemaKey, matchType: SchemaMatchType, context: SchemaContext): Promise<undefined | T> Inherited | SchemaXmlFileLocater | Attempts to retrieve a Schema with the given SchemaKey by using the configured search paths |
getSchemaInfo(schemaKey: SchemaKey, matchType: SchemaMatchType, context: SchemaContext): Promise<undefined | SchemaInfo> Inherited | SchemaXmlFileLocater | Gets the schema info which matches the provided SchemaKey. |
getSchemaKey(data: string): SchemaKey Inherited | SchemaXmlFileLocater | Constructs a SchemaKey based on the information in the Schema XML. |
getSchemaSync<T extends Schema>(key: SchemaKey, matchType: SchemaMatchType, context: SchemaContext): undefined | T Inherited | SchemaXmlFileLocater | Attempts to retrieve a Schema with the given SchemaKey by using the configured search paths |
readUtf8FileToString(filePath: string): Promise<undefined | string> Inherited | SchemaXmlFileLocater | |
readUtf8FileToStringSync(filePath: string): undefined | string Inherited | SchemaXmlFileLocater |
Inherited properties
Name | Type | Inherited from | Description |
---|---|---|---|
searchPaths Inherited | string[] | SchemaXmlFileLocater |
Defined in
Last Updated: 18 January, 2025
Found something wrong, missing, or unclear on this page?Raise an issue in our repo.