net.sourceforge.pmd.lang.java.rule.basic

## Class AvoidUsingHardCodedIPRule

- java.lang.Object
- - net.sourceforge.pmd.AbstractPropertySource
  - - net.sourceforge.pmd.lang.rule.AbstractRule
    - - net.sourceforge.pmd.lang.java.rule.AbstractJavaRule
      - - net.sourceforge.pmd.lang.java.rule.basic.AvoidUsingHardCodedIPRule

All Implemented Interfaces:
  JavaParserVisitor, ImmutableLanguage, PropertySource, Rule

    public class AvoidUsingHardCodedIPRule
    extends AbstractJavaRule

### Field Summary

Fields
`static EnumeratedMultiProperty<String>` `CHECK_ADDRESS_TYPES_DESCRIPTOR`
`protected boolean` `checkIPv4`
`protected boolean` `checkIPv4MappedIPv6`
`protected boolean` `checkIPv6`
`static String` `IPV4`
`static String` `IPV4_MAPPED_IPV6`
`protected static Pattern` `IPV4_PATTERN`
`protected static String` `IPV4_REGEXP`
`static String` `IPV6`
`protected static Pattern` `IPV6_PATTERN`
`protected static String` `IPV6_REGEXP`

### Fields inherited from class net.sourceforge.pmd.AbstractPropertySource

`propertyDescriptors, propertyValuesByDescriptor`

### Fields inherited from interface net.sourceforge.pmd.Rule

`VIOLATION_SUPPRESS_REGEX_DESCRIPTOR, VIOLATION_SUPPRESS_XPATH_DESCRIPTOR`

### Constructor Summary

Constructors
Constructor and Description
`AvoidUsingHardCodedIPRule()`

### Method Summary

Methods
`String` `dysfunctionReason()` Returns a description of why the receiver may be dysfunctional.
`boolean` `hasChosenAddressTypes()`
`protected boolean` `isHexCharacter(char c)`
`protected boolean` `isIPv4(char firstChar, String s)`
`protected boolean` `isIPv6(char firstChar, String s, boolean checkIPv6, boolean checkIPv4MappedIPv6)`
`protected boolean` `isLatinDigit(char c)`
`Object` `visit(ASTCompilationUnit node, Object data)`
`Object` `visit(ASTLiteral node, Object data)`

### Methods inherited from class net.sourceforge.pmd.lang.java.rule.AbstractJavaRule

`apply, getDeclaringType, importsPackage, isQualifiedName, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visitAll`

### Methods inherited from class net.sourceforge.pmd.lang.rule.AbstractRule

`addExample, addRuleChainVisit, addRuleChainVisit, addViolation, addViolation, addViolation, addViolationWithMessage, addViolationWithMessage, addViolationWithMessage, deepCopyValuesTo, end, equals, getDescription, getExamples, getExternalInfoUrl, getLanguage, getMaximumLanguageVersion, getMessage, getMinimumLanguageVersion, getName, getParserOptions, getPriority, getRuleChainVisits, getRuleClass, getRuleSetName, getSince, hashCode, isDeprecated, setDeprecated, setDescription, setExternalInfoUrl, setLanguage, setMaximumLanguageVersion, setMessage, setMinimumLanguageVersion, setName, setPriority, setRuleClass, setRuleSetName, setSince, setUsesDFA, setUsesTypeResolution, start, usesDFA, usesRuleChain, usesTypeResolution`

### Methods inherited from class net.sourceforge.pmd.AbstractPropertySource

`copyPropertyDescriptors, copyPropertyValues, definePropertyDescriptor, getPropertiesByPropertyDescriptor, getProperty, getPropertyDescriptor, getPropertyDescriptors, hasDescriptor, ignoredProperties, setProperty, useDefaultValueFor, usesDefaultValues`

### Methods inherited from class java.lang.Object

`clone, finalize, getClass, notify, notifyAll, toString, wait, wait, wait`

### Methods inherited from interface net.sourceforge.pmd.PropertySource

`definePropertyDescriptor, getPropertiesByPropertyDescriptor, getProperty, getPropertyDescriptor, getPropertyDescriptors, hasDescriptor, ignoredProperties, setProperty, useDefaultValueFor, usesDefaultValues`

### Field Detail

#### IPV4

    public static final String IPV4

See Also:
  Constant Field Values

#### IPV6

    public static final String IPV6

See Also:
  Constant Field Values

#### IPV4_MAPPED_IPV6

    public static final String IPV4_MAPPED_IPV6

See Also:
  Constant Field Values

#### CHECK_ADDRESS_TYPES_DESCRIPTOR

    public static final EnumeratedMultiProperty<String> CHECK_ADDRESS_TYPES_DESCRIPTOR

#### IPV4_REGEXP

    protected static final String IPV4_REGEXP

See Also:
  Constant Field Values

#### IPV6_REGEXP

    protected static final String IPV6_REGEXP

#### IPV4_PATTERN

    protected static final Pattern IPV4_PATTERN

#### IPV6_PATTERN

    protected static final Pattern IPV6_PATTERN

#### checkIPv4

    protected boolean checkIPv4

#### checkIPv6

    protected boolean checkIPv6

#### checkIPv4MappedIPv6

    protected boolean checkIPv4MappedIPv6

### Constructor Detail

#### AvoidUsingHardCodedIPRule

    public AvoidUsingHardCodedIPRule()

### Method Detail

#### visit

    public Object visit(ASTCompilationUnit node,
               Object data)

Specified by:
  `visit` in interface `JavaParserVisitor`
Overrides:
  `visit` in class `AbstractJavaRule`

#### visit

    public Object visit(ASTLiteral node,
               Object data)

Specified by:
  `visit` in interface `JavaParserVisitor`
Overrides:
  `visit` in class `AbstractJavaRule`

#### isLatinDigit

    protected boolean isLatinDigit(char c)

#### isHexCharacter

    protected boolean isHexCharacter(char c)

#### isIPv4

    protected boolean isIPv4(char firstChar,
                 String s)

#### isIPv6

    protected boolean isIPv6(char firstChar,
                 String s,
                 boolean checkIPv6,
                 boolean checkIPv4MappedIPv6)

#### hasChosenAddressTypes

    public boolean hasChosenAddressTypes()

#### dysfunctionReason

    public String dysfunctionReason()

Description copied from interface: `PropertySource`
Returns a description of why the receiver may be dysfunctional. Usually due to missing property values or some kind of conflict between values. Returns null if the receiver is ok.

Specified by:
  `dysfunctionReason` in interface `PropertySource`
Overrides:
  `dysfunctionReason` in class `AbstractPropertySource`
Returns:
  String
See Also:
  `PropertySource#dysfunctionReason()`