Response class

A response to a request.

Clients may not extend, implement or mix-in this class.

Constructors

Response(String id, {Map<String, Object?>? result, RequestError? error})
Initialize a newly created instance to represent a response to a request with the given id. If result is provided, it will be used as the result; otherwise an empty result will be used. If an error is provided then the response will represent an error condition.
Response.debugPortCouldNotBeOpened(Request request, dynamic error)
Create and return the DEBUG_PORT_COULD_NOT_BE_OPENED error response.
Response.fileNotAnalyzed(Request request, String file)
Initialize a newly created instance to represent the FILE_NOT_ANALYZED error condition.
Response.formatInvalidFile(Request request)
Initialize a newly created instance to represent the FORMAT_INVALID_FILE error condition.
Response.formatWithErrors(Request request)
Initialize a newly created instance to represent the FORMAT_WITH_ERROR error condition.
Response.getErrorsInvalidFile(Request request)
Initialize a newly created instance to represent the GET_ERRORS_INVALID_FILE error condition.
Response.getImportedElementsInvalidFile(Request request)
Initialize a newly created instance to represent the GET_IMPORTED_ELEMENTS_INVALID_FILE error condition.
Response.getNavigationInvalidFile(Request request)
Initialize a newly created instance to represent the GET_NAVIGATION_INVALID_FILE error condition.
Response.getReachableSourcesInvalidFile(Request request)
Initialize a newly created instance to represent the GET_REACHABLE_SOURCES_INVALID_FILE error condition.
Response.getSignatureInvalidFile(Request request)
Initialize a newly created instance to represent the GET_SIGNATURE_INVALID_FILE error condition.
Response.getSignatureInvalidOffset(Request request)
Initialize a newly created instance to represent the GET_SIGNATURE_INVALID_OFFSET error condition.
Response.getSignatureUnknownFunction(Request request)
Initialize a newly created instance to represent the GET_SIGNATURE_UNKNOWN_FUNCTION error condition.
Response.importElementsInvalidFile(Request request)
Initialize a newly created instance to represent the IMPORT_ELEMENTS_INVALID_FILE error condition.
Response.invalidAnalysisRoot(Request request, String rootPath)
Initialize a newly created instance to represent an error condition caused by an analysis.reanalyze request that specifies an analysis root that is not in the current list of analysis roots.
Response.invalidExecutionContext(Request request, String contextId)
Initialize a newly created instance to represent an error condition caused by a request that specifies an execution context whose context root does not exist.
Response.invalidFilePathFormat(Request request, dynamic path)
Initialize a newly created instance to represent the INVALID_FILE_PATH_FORMAT error condition.
Response.invalidParameter(Request request, String path, String expectation)
Initialize a newly created instance to represent an error condition caused by a request that had invalid parameter. path is the path to the invalid parameter, in Javascript notation (e.g. "foo.bar" means that the parameter "foo" contained a key "bar" whose value was the wrong type). expectation is a description of the type of data that was expected.
Response.invalidRequestFormat()
Initialize a newly created instance to represent an error condition caused by a malformed request.
Response.organizeDirectivesError(Request request, String message)
Initialize a newly created instance to represent the ORGANIZE_DIRECTIVES_ERROR error condition.
Response.refactoringRequestCancelled(Request request)
Initialize a newly created instance to represent the REFACTORING_REQUEST_CANCELLED error condition.
Response.serverError(Request request, dynamic exception, dynamic stackTrace)
Initialize a newly created instance to represent the SERVER_ERROR error condition.
factory
Response.sortMembersInvalidFile(Request request)
Initialize a newly created instance to represent the SORT_MEMBERS_INVALID_FILE error condition.
Response.sortMembersParseErrors(Request request, int numErrors)
Initialize a newly created instance to represent the SORT_MEMBERS_PARSE_ERRORS error condition.
Response.unknownRequest(Request request)
Initialize a newly created instance to represent an error condition caused by a request that cannot be handled by any known handlers.
Response.unsupportedFeature(String requestId, String message)
Initialize a newly created instance to represent an error condition caused by a request for a service that is not supported.

Properties

error RequestError?
The error that was caused by attempting to handle the request, or null if there was no error.
final
hashCode int
The hash code for this object.
no setterinherited
id String
The unique identifier used to identify the request that this response is associated with.
final
result Map<String, Object?>?
A table mapping the names of result fields to their values. Should be null if there is no result to send.
getter/setter pair
runtimeType Type
A representation of the runtime type of the object.
no setterinherited

Methods

noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
toJson() Map<String, Object>
Return a table representing the structure of the Json object that will be sent to the client to represent this response.
toString() String
A string representation of this object.
inherited

Operators

operator ==(Object other) bool
The equality operator.
inherited

Static Properties

DELAYED_RESPONSE Response
The Response instance that is returned when a real Response cannot be provided at the moment.
final

Static Methods

fromJson(Map<String, Object?> json) Response?
Initialize a newly created instance based on the given JSON data.

Constants

ERROR → const String
The name of the JSON attribute containing the error message.
ID → const String
The name of the JSON attribute containing the id of the request for which this is a response.
RESULT → const String
The name of the JSON attribute containing the result values.