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

## com.tonbeller.wcf.format
Class FormatHandlerSupport

    java.lang.Object
      com.tonbeller.wcf.format.FormatHandlerSupport

All Implemented Interfaces:
  FormatHandler

Direct Known Subclasses:
  BooleanHandler, DateHandler, NumberHandler, RegexHandler, StringHandler

public abstract class FormatHandlerSupport
extends java.lang.Object
implements FormatHandler

base class for FormatHandlers

Field Summary
`protected java.lang.String` | `errorMessage`
`protected java.util.Locale` | `locale`
`protected java.lang.String` | `name`
`protected java.lang.String` | `pattern`
`protected java.util.ArrayList` | `patterns`

Constructor Summary
`FormatHandlerSupport()`

Method Summary
`void` | `addPattern(Pattern p)` adds a pattern for a specific locale
`protected java.lang.String` | `findPattern(java.lang.String userPattern)` returns the pattern for a given locale.
`java.lang.String` | `getErrorMessage()` Returns the errorMessage.
`protected java.lang.String` | `getErrorMessage(java.lang.String userInput)`
`java.util.Locale` | `getLocale()` Returns the locale.
`java.lang.String` | `getName()` Returns the name.
`java.lang.String` | `getPattern()` Returns the default pattern
`void` | `setErrorMessage(java.lang.String errorMessage)` Sets the errorMessage.
`void` | `setLocale(java.util.Locale locale)` Sets the locale.
`void` | `setName(java.lang.String name)` Sets the name.
`void` | `setPattern(java.lang.String pattern)` Sets the default pattern.

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

Methods inherited from interface com.tonbeller.wcf.format.FormatHandler
`canHandle, format, parse, toNativeArray, toObjectArray`

Field Detail

### name

    protected java.lang.String name

### pattern

    protected java.lang.String pattern

### errorMessage

    protected java.lang.String errorMessage

### patterns

    protected java.util.ArrayList patterns

### locale

    protected java.util.Locale locale

Constructor Detail

### FormatHandlerSupport

    public FormatHandlerSupport()

Method Detail

### addPattern

    public void addPattern(Pattern p)

  adds a pattern for a specific locale

### findPattern

    protected java.lang.String findPattern(java.lang.String userPattern)

  returns the pattern for a given locale. First it checks if a Pattern child exists if a child exists with the same language as locale. If not, the pattern property of this is returned.

  Parameters:
    `userPattern` - a pattern that the user may have provided. If not null and not empty, the userPattern will be returned.

### getErrorMessage

    protected java.lang.String getErrorMessage(java.lang.String userInput)

### getName

    public java.lang.String getName()

  Returns the name.

  Specified by:
    `getName` in interface `FormatHandler`
  Returns:
    String

### getPattern

    public java.lang.String getPattern()

  Returns the default pattern

  Returns:
    String

### setName

    public void setName(java.lang.String name)

  Sets the name.

  Parameters:
    `name` - The name to set

### setPattern

    public void setPattern(java.lang.String pattern)

  Sets the default pattern.

  Parameters:
    `pattern` - The pattern to set

### getErrorMessage

    public java.lang.String getErrorMessage()

  Returns the errorMessage.

  Returns:
    String

### setErrorMessage

    public void setErrorMessage(java.lang.String errorMessage)

  Sets the errorMessage.

  Parameters:
    `errorMessage` - The errorMessage to set

### getLocale

    public java.util.Locale getLocale()

  Returns the locale.

  Returns:
    Locale

### setLocale

    public void setLocale(java.util.Locale locale)

  Sets the locale.

  Specified by:
    `setLocale` in interface `FormatHandler`
  Parameters:
    `locale` - The locale to set

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