Enum Class Term

java.lang.Object
java.lang.Enum<Term>
com.sodius.oslc.server.core.nls.Term
All Implemented Interfaces:
Serializable, Comparable<Term>, java.lang.constant.Constable

public enum Term extends Enum<Term>
Defines terms that can be customized by applications integrating the framework. A typical example is PROJECT that can be rendered as "project", "product", "space" or anything else in a given application. This enables to adapt messages displayed to end-user and use vocabulary that they are familiar with.

Terms are usually combined with articles in sentences:

 String projectTerm = Article.DEFINITE.capitalizedSingular(Term.PROJECT);
 
which renders "The project" in English and "Le projet" in French, but can be adapted to "The space" and "L'espace" in a given application.
Since:
4.0.0
  • Enum Constant Details

    • ARTIFACT

      public static final Term ARTIFACT
      The term to refer to an artifact of the application that can have OSLC links.
    • DELIVERABLE

      public static final Term DELIVERABLE
      The term to refer to a Change Management Deliverable.
    • PROJECT

      public static final Term PROJECT
      The term to refer to a ProjectArea, in which associations are defined.
  • Method Details

    • values

      public static Term[] values()
      Returns an array containing the constants of this enum class, in the order they are declared.
      Returns:
      an array containing the constants of this enum class, in the order they are declared
    • valueOf

      public static Term valueOf(String name)
      Returns the enum constant of this class with the specified name. The string must match exactly an identifier used to declare an enum constant in this class. (Extraneous whitespace characters are not permitted.)
      Parameters:
      name - the name of the enum constant to be returned.
      Returns:
      the enum constant with the specified name
      Throws:
      IllegalArgumentException - if this enum class has no constant with the specified name
      NullPointerException - if the argument is null
    • reset

      public static void reset()
      Resets the term definitions, to discard any custom definition that may have been registered.
    • singular

      public String singular()
      Returns the singular term for preferred locales.
      Returns:
      the singular term for preferred locales, e.g. "project"
    • capitalizedSingular

      public String capitalizedSingular()
      Returns the capitalized singular term for preferred locales.
      Returns:
      the capitalized singular term for preferred locales, e.g. "Project"
    • plural

      public String plural()
      Returns the plural term for preferred locales.
      Returns:
      the plural term for preferred locales, e.g. "projects"
    • capitalizedPlural

      public String capitalizedPlural()
      Returns the capitalized plural term for preferred locales.
      Returns:
      the capitalized plural term for preferred locales, e.g. "Projects"
    • overrideWith

      public void overrideWith(TermDefinition definition)
      Overrides the default words for this term with the given definition.
      Parameters:
      definition - the definition with words for a given locale to use for this term