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

## com.fujitsu.iflow.common
Class UdaNameSanitizer

    java.lang.Object
      com.fujitsu.iflow.common.UdaNameSanitizer

public class UdaNameSanitizer
extends java.lang.Object

This is an utility class that is used to get the sanitized User Defined Attribute (UDA) names, which means it returns only valid alphanumeric characters in the UDA names and underscore is returned unchanged.

This class can also be used to get the original UDA name given the Sanitized name through a reverse lookup mechanism.

Constructor Summary
`UdaNameSanitizer()`

Method Summary
`static java.util.Hashtable` | `getForwardLookup(java.lang.String[] names)` Returns a list of combinations of User Defined Attribute (UDA) names (key) and their generated identifiers (value).
`static java.lang.String[]` | `getRepeatIdentifiers(java.lang.String[] names)` Returns all the names whose identifier match with another name.
`static java.util.Hashtable` | `getReverseLookup_old(java.lang.String[] names)`
`static java.util.Hashtable` | `getReverseLookup(java.lang.String[] names)` Returns a list of combinations of User Defined Attributes (UDA) names (value) and their generated identifiers (key).
`static java.lang.String` | `getSanitizedString_old(java.lang.String s)`
`static java.lang.String` | `getSanitizedString(java.lang.String s)` Returns only valid alphanumeric characters of the input String.

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

Constructor Detail

### UdaNameSanitizer

    public UdaNameSanitizer()

Method Detail

### getSanitizedString

    public static java.lang.String getSanitizedString(java.lang.String s)

  Returns only valid alphanumeric characters of the input String. Any characters outside the ASCII character set (greater than 127) used to be returned unchanged (version 7.2 and earlier) but now characters > 127 are excluded. This is because JavaScript variable rules (sanitized names are used for JS variables as well as form variable names) require only alphanumeric and underscore.

  Parameters:
    `s` - The input String to be translated to pure alphanumeric String.
  Returns:
    The String after removing all non-alphanumeric characters.

### getReverseLookup

    public static java.util.Hashtable getReverseLookup(java.lang.String[] names)

  Returns a list of combinations of User Defined Attributes (UDA) names (value) and their generated identifiers (key). If the list of supplied names is empty or contains only `null` values, the returned hashtable is empty.

  The map is generated by using the passed names as the values and the generated identifiers as keys.

  Parameters:
    `names` - The names to be used for generating the identifier map.
  Returns:
    The hashtable with the generated identifiers as keys and the names as values or an empty list if no valid names were passed. Returns `null` if the supplied list of uda names is `null`.

### getReverseLookup_old

    public static java.util.Hashtable getReverseLookup_old(java.lang.String[] names)

### getSanitizedString_old

    public static java.lang.String getSanitizedString_old(java.lang.String s)

### getForwardLookup

    public static java.util.Hashtable getForwardLookup(java.lang.String[] names)

  Returns a list of combinations of User Defined Attribute (UDA) names (key) and their generated identifiers (value). If the list of supplied names is empty or contains only null values, the returned hashtable is empty.

  The map is generated by using the passed names as key and the generated identifier as the values.

  Parameters:
    `names` - The names to be used for generating the identifier map.
  Returns:
    The hashtable with the names as keys and identifiers as values or an empty list if no valid names were passed. Returns `null` if the supplied list of uda names is `null`.

### getRepeatIdentifiers

    public static java.lang.String[] getRepeatIdentifiers(java.lang.String[] names)

  Returns all the names whose identifier match with another name. If there are none, the returned list is empty.

  The identifier is generated by keeping only non-ASCII and ASCII-alphabets and ASCII-numerals.

  Parameters:
    `names` - The names to be scanned for matching identifiers.
  Returns:
    The names whose identifiers match another name's identifier or an empty list if there are none. Returns `null` if the supplied list is `null`.

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