com.ihr.xbrl.util

## Class RegexFormatter

- java.lang.Object
- - javax.swing.JFormattedTextField.AbstractFormatter
  - - javax.swing.text.DefaultFormatter
    - - com.ihr.xbrl.util.RegexFormatter

- All Implemented Interfaces:
    java.io.Serializable, java.lang.Cloneable

      public class RegexFormatter
      extends javax.swing.text.DefaultFormatter

  The Class RegexFormatter.
  Author:
    Ignacio
  See Also:
    Serialized Form

- - ### Constructor Summary

    Constructors
    Constructor and Description
    `RegexFormatter()` Instantiates a new regex formatter.
    `RegexFormatter(java.util.regex.Pattern pattern)` Creates a regular expression based AbstractFormatter.
    `RegexFormatter(java.lang.String pattern)` Creates a regular expression based AbstractFormatter.

  - ### Method Summary

    Methods
    Modifier and Type | Method and Description
    --- | ---
    `java.util.regex.Pattern` | `getPattern()` Returns the Pattern used to determine if a value is legal.
    `void` | `setPattern(java.util.regex.Pattern pattern)` Sets the pattern that will be used to determine if a value is legal.
    `java.lang.Object` | `stringToValue(java.lang.String text)` Parses text returning an arbitrary Object.

    - ### Methods inherited from class javax.swing.text.DefaultFormatter

      `clone, getAllowsInvalid, getCommitsOnValidEdit, getOverwriteMode, getValueClass, install, setAllowsInvalid, setCommitsOnValidEdit, setOverwriteMode, setValueClass, valueToString`

    - ### Methods inherited from class javax.swing.JFormattedTextField.AbstractFormatter

      `uninstall`

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

      `equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

- - ### Constructor Detail

    - #### RegexFormatter

          public RegexFormatter()

      Instantiates a new regex formatter.

    - #### RegexFormatter

          public RegexFormatter(java.lang.String pattern)
                         throws java.text.ParseException

      Creates a regular expression based AbstractFormatter. pattern specifies the regular expression that will be used to determine if a value is legal.
      Parameters:
        `pattern` - the pattern
      Throws:
        `java.text.ParseException` - the parse exception

    - #### RegexFormatter

          public RegexFormatter(java.util.regex.Pattern pattern)

      Creates a regular expression based AbstractFormatter. pattern specifies the regular expression that will be used to determine if a value is legal.
      Parameters:
        `pattern` - the pattern

  - ### Method Detail

    - #### setPattern

          public void setPattern(java.util.regex.Pattern pattern)

      Sets the pattern that will be used to determine if a value is legal.
      Parameters:
        `pattern` - the new pattern

    - #### getPattern

          public java.util.regex.Pattern getPattern()

      Returns the Pattern used to determine if a value is legal.
      Returns:
        the pattern

    - #### stringToValue

          public java.lang.Object stringToValue(java.lang.String text)
                                         throws java.text.ParseException

      Parses text returning an arbitrary Object. Some formatters may return null. If a Pattern has been specified and the text completely matches the regular expression this will invoke setMatcher.
      Overrides:
        `stringToValue` in class `javax.swing.text.DefaultFormatter`
      Parameters:
        `text` - String to convert
      Returns:
        Object representation of text
      Throws:
        `java.text.ParseException` - if there is an error in the conversion