@ Override public void validate ( ) throws HostNameException { if ( parsedHost != null ) { return ; } if ( validationException != null ) { throw validationException ; } synchronized ( this ) { if ( parsedHost != null ) { return ; } if ( validationException != null ) { throw validationException ; } try { parsedHost = getValidator ( ) . validateHost ( this ) ; } catch ( HostNameException e ) { validationException = e ; throw e ; } } }
Validates that this string is a valid host name or IP address and if not throws an exception with a descriptive message indicating why it is not .