MCPcopy
hub / github.com/SeleniumHQ/selenium / apply

Method apply

java/src/org/openqa/selenium/json/UrlCoercer.java:32–56  ·  view source on GitHub ↗
(Type type)

Source from the content-addressed store, hash-verified

30 }
31
32 @Override
33 public BiFunction<JsonInput, PropertySetting, URL> apply(Type type) {
34 return (jsonInput, propertySetting) -> {
35 String toCoerce;
36
37 switch (jsonInput.peek()) {
38 case NAME:
39 toCoerce = jsonInput.nextName();
40 break;
41
42 case STRING:
43 toCoerce = jsonInput.nextString();
44 break;
45
46 default:
47 throw new JsonException("Unable to coerce type to URL: " + jsonInput.peek());
48 }
49
50 try {
51 return new URL(toCoerce);
52 } catch (MalformedURLException e) {
53 throw new JsonException(e);
54 }
55 };
56 }
57}

Callers 15

createNativeTouchListFunction · 0.45
inject.jsFile · 0.45
window.jsFile · 0.45
cuFunction · 0.45
jquery.min.jsFile · 0.45
gFunction · 0.45
nFunction · 0.45
eFunction · 0.45
mFunction · 0.45
sFunction · 0.45
relative.jsFile · 0.45
findInPathFunction · 0.45

Calls 3

nextNameMethod · 0.80
nextStringMethod · 0.80
peekMethod · 0.45

Tested by

no test coverage detected