excelExporter.excelParser.dataModel

## Class Identifier

- java.lang.Object
- - excelExporter.excelParser.dataModel.Identifier

-     public class Identifier
      extends java.lang.Object

  Names of the objects in the data model are represented by this class. The names are offered in their original notation and as identifiers.

  The names of objects are mostly taken from the Excel input data, beginning with the name of the workbook, which may be derived from the file name and continuing with the names of worksheets taken from the tabs in the Excel workbook. These names will typically contain natural elements like blanks or special characters, which can be disturbing, when rendering the data model as kind of program code (source code of programming languages or scripting code). Therefore these names are stored as objects of class Identifier, which behave basically like Strings in a StringTemplate V4 template beside that their normal rendering incorporates the transformation of the natural notation in one, which is compliant with the identifier of most programming languages. The natural notation can still be addressed from a template through a dedicated field.

- - ### Field Summary

    Fields
    Modifier and Type | Field and Description
    --- | ---
    `java.lang.String` | `givenName` The natural, given name of the object.
    `java.lang.String` | `ident` The name of the object as an identifier as defined in many programming languages, e.g.
    `boolean` | `identEquals` This flag indicates whether the given name of the object and the name of the object as identifier `ident` are identical.
    `java.lang.String` | `identStrict` The name of the object as a more restricted identifier as for `ident`.
    `boolean` | `identStrictEquals` This flag indicates whether the given name of the object and the name of the object as strict identifier `identStrict` are identical.

  - ### Constructor Summary

    Constructors
    Constructor and Description
    `Identifier(java.lang.String name)` A new instance of Identifier is created from a normal String.

  - ### Method Summary

    All Methods Static Methods Instance Methods Concrete Methods
    Modifier and Type | Method and Description
    --- | ---
    `static int` | `getUniqueId()` Get the next unique ID, useful for a new object of the data model.
    `static java.lang.String` | `identifierfy(java.lang.String name, boolean isStrict)` Modify a character string carefully, such that it becomes an identifier.
    `static void` | `setErrorContext(excelExporter.excelParser.ErrorCounter errCnt, java.lang.String context)` Set the error context.
    `java.lang.String` | `toString()` Return the name of the object that is designated by this Identifier as an identifier.

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

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

- - ### Field Detail

    - #### givenName

          public final java.lang.String givenName

      The natural, given name of the object. This name can be accessed only explicitly through this field. In a StringTemplate V4 template you would access the natural name of a group like `<group.name.givenName>`.

    - #### ident

          public final java.lang.String ident

      The name of the object as an identifier as defined in many programming languages, e.g. C. The first character may be a letter or the underscore, all others may be the same or a decimal digit. In a code generation environment, `ident` can be considered a kind of corrected version of `givenName`.

      All groups of unpermitted characters are replaced by a single character x and an underscore prepends the resut if it should begin with a digit.

      This field can be accessed as any normal, public filed, but its value is the result of `toString()`, too. The usual way to refer to the value of this field from a StringTemplate V4 template will look like `<object.name>` but the more explicit `<object.name.ident>` would yield the same.

    - #### identStrict

          public final java.lang.String identStrict

      The name of the object as a more restricted identifier as for `ident`. The first character may be a letter, all others may be the same or a decimal digit. In a code generation environment, `identStrict` can be considered a kind of corrected version of `givenName`.

      All groups of unpermitted characters are replaced by a single character x and a further x prepends the result if it should begin with a digit.

    - #### identEquals

          public final boolean identEquals

      This flag indicates whether the given name of the object and the name of the object as identifier `ident` are identical.

    - #### identStrictEquals

          public final boolean identStrictEquals

      This flag indicates whether the given name of the object and the name of the object as strict identifier `identStrict` are identical.

  - ### Constructor Detail

    - #### Identifier

          public Identifier(java.lang.String name)

      A new instance of Identifier is created from a normal String.
      Parameters:
        `name` - The natural name of the object designated by the new Identifier object.

  - ### Method Detail

    - #### setErrorContext

          public static void setErrorContext(excelExporter.excelParser.ErrorCounter errCnt,
                                             java.lang.String context)

      Set the error context. In rare situations, this module can fail to do what it is expected to. Use this method to define an error reporting channel.
      Parameters:
        `errCnt` - The error counter to be used from now. Must not be null.
        `context` - A text fragment, which will prepend all logging messages of this module. Can be null if no such common fragment is required.

    - #### getUniqueId

          public static int getUniqueId()

      Get the next unique ID, useful for a new object of the data model.
      Returns:
        The ID.

    - #### identifierfy

          public static java.lang.String identifierfy(java.lang.String name,
                                                      boolean isStrict)

      Modify a character string carefully, such that it becomes an identifier.
      Parameters:
        `name` - The processed character string; usually the name of an object.
        `isStrict` - Boolean switch if the strict identifier or the less restrictive from the C syntax is supported. If `true` then the more strict kind of identifier is supported, which doesn't allow the underscore.
      Returns:
        Get a string, which resembles name and which begins with a letter or maybe underscore and continues with a series of such or decimal digits.

    - #### toString

          public java.lang.String toString()

      Return the name of the object that is designated by this Identifier as an identifier.
      Overrides:
        `toString` in class `java.lang.Object`