parse method

AsserestProperty parse(
  1. Map<String, dynamic> propertyMap
)

Parse propertyMap to corresponsed AsserestProperty.

If there is no url contains in propertyMap, it throws InvalidPropertyMapException. When the given url is not URL string, FormatException will be thrown.

If the given URL does not defined yet, it throws UndefinedSchemeParserException.

Implementation

AsserestProperty parse(Map<String, dynamic> propertyMap) {
  late String scheme;

  try {
    scheme = Uri.parse(propertyMap["url"]).scheme;
  } on TypeError {
    throw InvalidPropertyMapException._(propertyMap);
  }

  try {
    return _parseProcessors[scheme]!.parse(propertyMap);
  } on TypeError {
    throw UndefinedSchemeParserException._(scheme);
  }
}