de.vc.jfo.rtf.listeners

## Class AbstractDataSource

- java.lang.Object
- - de.vc.jfo.rtf.listeners.AbstractDataSource

- All Implemented Interfaces:
    FieldListener
  Direct Known Subclasses:
    AbstractDataMergeFieldListener, ReflectionDataSource, SimpleDataSource

      public abstract class AbstractDataSource
      extends java.lang.Object
      implements FieldListener

- - ### Field Summary

    - ### Fields inherited from interface de.vc.jfo.rtf.FieldListener

      `FIELD_FILLIN, FIELD_MERGEFIELD`

  - ### Constructor Summary

    Constructors
    Constructor and Description
    `AbstractDataSource()`
    `AbstractDataSource(boolean caseSensitiveKeywords)`

  - ### Method Summary

    Methods
    Modifier and Type | Method and Description
    --- | ---
    `void` | `fieldEncountered(FieldContext context)` Implementation of FieldListener-Interface.
    `protected void` | `handleUnpopulatedField(java.lang.String keyword, FieldContext ctx)`
    `abstract boolean` | `hasValue(java.lang.String keyword)` Checks whether value (can also be an empty or null value) is assigned to a keyword.
    `protected abstract boolean` | `insertResult(FieldContext ctx, java.lang.String normalizedKeyword)`
    `boolean` | `isCaseSensitiveKeywords()` Checks if keywords are handled case sensitive.
    `abstract boolean` | `isEmptyValue(java.lang.String keyword)` Checks whether an empty value is assigned to a keyword.
    `boolean` | `isEnableDateFormatting()`
    `boolean` | `isEnableNumberFormatting()`
    `boolean` | `isHighlightUnpopulatedFields()` Checks whether unpopulated fields are highlighted (displayed in red color and underlined).
    `protected java.lang.String` | `normalizeKey(java.lang.String key)` Normalizes the key of a value.
    `void` | `setCaseSensitiveKeywords(boolean caseSensitiveKeywords)` Sets if keywords of fields are handled case sensitve.
    `void` | `setEnableDateFormatting(boolean enableDateFormatting)`
    `void` | `setEnableNumberFormatting(boolean enableNumberFormatting)`
    `void` | `setHighlightUnpopulatedFields(boolean highlightUnpopulatedFields)` Sets whether unpopulated fields are highlighted (displayed in red color and underlined).

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

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

- - ### Constructor Detail

    - #### AbstractDataSource

          public AbstractDataSource()

    - #### AbstractDataSource

          public AbstractDataSource(boolean caseSensitiveKeywords)

  - ### Method Detail

    - #### fieldEncountered

          public void fieldEncountered(FieldContext context)

      Implementation of FieldListener-Interface.
      Specified by:
        `fieldEncountered` in interface `FieldListener`
      Parameters:
        `context` - FieldContext.

    - #### setCaseSensitiveKeywords

          public void setCaseSensitiveKeywords(boolean caseSensitiveKeywords)

      Sets if keywords of fields are handled case sensitve.
      Parameters:
        `caseSensitiveKeywords` - `true` for case sensitive handling.

    - #### setHighlightUnpopulatedFields

          public void setHighlightUnpopulatedFields(boolean highlightUnpopulatedFields)

      Sets whether unpopulated fields are highlighted (displayed in red color and underlined). A field is unpopulated if no value (also null-values are values) was assigned to the keyword.
      Note: Highlighting is only available for FILLIN and MERGEFIELD fields.
      Parameters:
        `highlightUnpopulatedFields` - true to enable highlighting.

    - #### setEnableNumberFormatting

          public void setEnableNumberFormatting(boolean enableNumberFormatting)

    - #### setEnableDateFormatting

          public void setEnableDateFormatting(boolean enableDateFormatting)

    - #### isCaseSensitiveKeywords

          public boolean isCaseSensitiveKeywords()

      Checks if keywords are handled case sensitive.
      Returns:
        `true` if case sensitive handling.

    - #### isHighlightUnpopulatedFields

          public boolean isHighlightUnpopulatedFields()

      Checks whether unpopulated fields are highlighted (displayed in red color and underlined). A field is unpopulated if no value (also null-values are values) was assigned to the keyword.
      Note: Highlighting is only available for FILLIN and MERGEFIELD fields.
      Returns:
        true if highlighting is enabled (defaults to false).

    - #### isEnableNumberFormatting

          public boolean isEnableNumberFormatting()

    - #### isEnableDateFormatting

          public boolean isEnableDateFormatting()

    - #### hasValue

          public abstract boolean hasValue(java.lang.String keyword)

      Checks whether value (can also be an empty or null value) is assigned to a keyword.
      Parameters:
        `keyword` - Normalized keyword.
      Returns:
        `true` if there is a registered value for keyword.

    - #### isEmptyValue

          public abstract boolean isEmptyValue(java.lang.String keyword)

      Checks whether an empty value is assigned to a keyword.
      Parameters:
        `keyword` - Keyword
      Returns:
        `true` if value of `keyword` is empty.

    - #### normalizeKey

          protected final java.lang.String normalizeKey(java.lang.String key)

      Normalizes the key of a value. If caseSensitiveKeywords are disabled this method returns all letters in lower case.
      Parameters:
        `key` - Key of value.
      Returns:
        Normalized key.

    - #### insertResult

          protected abstract boolean insertResult(FieldContext ctx,
                             java.lang.String normalizedKeyword)

    - #### handleUnpopulatedField

          protected void handleUnpopulatedField(java.lang.String keyword,
                                    FieldContext ctx)

© 2003-2011 by Sascha Schmidt (vision-cloud.de). All Rights Reserved.