Class TypeNameLocalization


  • public class TypeNameLocalization
    extends java.lang.Object

    Localization of names for argument types. Localized names for commonly used types in the JDK (e.g. Integer and Boolean) are provided, but for custom types, the developer of the type must provide the localization. This class tries to load the display name by using the following sources. The first display name that is found is used:

    1. Key displayName of resource bundle <fully-qualified custom type name>-argparse4j (with the dots replaced by slashes).
    2. Key type.<simple class name of the type> of resource bundle net/sourceforge/argparse4j/internal/ArgumentParserImpl.
    3. The simple class name of the type.

    The application code should not use this class directly.

    Since:
    0.8.0
    • Constructor Detail

      • TypeNameLocalization

        private TypeNameLocalization()
    • Method Detail

      • localizeTypeNameIfPossible

        public static java.lang.String localizeTypeNameIfPossible​(ArgumentParser parser,
                                                                  java.lang.Class<?> type)
      • localizeTypeName

        private static java.lang.String localizeTypeName​(ArgumentParser parser,
                                                         java.lang.Class<?> type)