Overview | Package | Class | Use | Tree | Deprecated | Index | Help
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD

## org.apache.commons.validator.routines
Class InetAddressValidator

    java.lang.Object
      org.apache.commons.validator.routines.InetAddressValidator

All Implemented Interfaces:
  Serializable

    public class InetAddressValidator

extends Object
implements Serializable

InetAddress validation and conversion routines (`java.net.InetAddress`).

This class provides methods to validate a candidate IP address.

This class is a Singleton; you can retrieve the instance via the `getInstance()` method.

Since:
  Validator 1.4
Version:
  $Revision: 1227719 $
See Also:
  Serialized Form

Constructor Summary
`InetAddressValidator()`

Method Summary
`static InetAddressValidator` | `getInstance()` Returns the singleton instance of this validator.
`boolean` | `isValid(String inetAddress)` Checks if the specified string is a valid IP address.
`boolean` | `isValidInet4Address(String inet4Address)` Validates an IPv4 address.

Methods inherited from class java.lang.Object
`clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

Constructor Detail

### InetAddressValidator

    public InetAddressValidator()

Method Detail

### getInstance

    public static InetAddressValidator getInstance()

  Returns the singleton instance of this validator.

  Returns:
    the singleton instance of this validator

### isValid

    public boolean isValid(String inetAddress)

  Checks if the specified string is a valid IP address.

  Parameters:
    `inetAddress` - the string to validate
  Returns:
    true if the string validates as an IP address

### isValidInet4Address

    public boolean isValidInet4Address(String inet4Address)

  Validates an IPv4 address. Returns true if valid.

  Parameters:
    `inet4Address` - the IPv4 address to validate
  Returns:
    true if the argument contains a valid IPv4 address

Overview | Package | Class | Use | Tree | Deprecated | Index | Help
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD

Copyright © 2002-2012 The Apache Software Foundation. All Rights Reserved.