MCPcopy Create free account
hub / github.com/antlr/codebuff / from

Method from

output/java_guava/1.4.16/HostSpecifier.java:112–123  ·  view source on GitHub ↗

Attempts to return a HostSpecifier for the given string, throwing an exception if parsing fails. Always use this method in preference to #fromValid(String) for a specifier that is not already known to be valid. @throws ParseException if the specifier is not valid.

(String specifier)

Source from the content-addressed store, hash-verified

110
111
112 public static HostSpecifier from(String specifier) throws ParseException {
113 try {
114 return fromValid(specifier);
115 } catch (IllegalArgumentException e) {
116 // Since the IAE can originate at several different points inside
117 // fromValid(), we implement this method in terms of that one rather
118 // than the reverse.
119 ParseException parseException = new ParseException("Invalid host specifier: " + specifier, 0);
120 parseException.initCause(e);
121 throw parseException;
122 }
123 }
124
125 /**
126 * Determines whether {@code specifier} represents a valid {@link HostSpecifier} as described in

Callers

nothing calls this directly

Calls 1

fromValidMethod · 0.95

Tested by

no test coverage detected