Constructor
new SubstanceMetadataParseResult(updates, errors)
Create a new SubstanceMetadataParseResult.
Parameters:
| Name | Type | Description |
|---|---|---|
updates |
Array.<SubstanceMetadataUpdate> | Array of successfully parsed updates |
errors |
Array.<SubstanceMetadataError> | Array of parsing errors |
- Source:
Methods
addError(error)
Add a parsing error.
Parameters:
| Name | Type | Description |
|---|---|---|
error |
SubstanceMetadataError | Error to add |
- Source:
addUpdate(update)
Add a successfully parsed metadata update.
Parameters:
| Name | Type | Description |
|---|---|---|
update |
SubstanceMetadataUpdate | Update to add |
- Source:
getErrorSummary() → {string}
Get a summary of all errors as a formatted string.
- Source:
Returns:
Multi-line error summary
- Type
- string
getErrors() → {Array.<SubstanceMetadataError>}
Get all parsing errors.
- Source:
Returns:
Array of errors
- Type
- Array.<SubstanceMetadataError>
getSystemErrors() → {Array.<SubstanceMetadataError>}
Get only system programming errors.
- Source:
Returns:
Array of system errors
- Type
- Array.<SubstanceMetadataError>
getUpdates() → {Array.<SubstanceMetadataUpdate>}
Get the successfully parsed metadata updates.
- Source:
Returns:
Array of parsed updates
- Type
- Array.<SubstanceMetadataUpdate>
getUserErrors() → {Array.<SubstanceMetadataError>}
Get only user data errors.
- Source:
Returns:
Array of user errors
- Type
- Array.<SubstanceMetadataError>
hasErrors() → {boolean}
Check if any errors occurred during parsing.
- Source:
Returns:
True if errors exist
- Type
- boolean
hasSystemErrors() → {boolean}
Check if any system errors occurred.
- Source:
Returns:
True if system errors exist
- Type
- boolean
hasUserErrors() → {boolean}
Check if any user data errors occurred.
- Source:
Returns:
True if user errors exist
- Type
- boolean
isSuccess() → {boolean}
Check if parsing was completely successful.
- Source:
Returns:
True if no errors occurred
- Type
- boolean