Class DefaultGomLangInfo

java.lang.Object
de.espirit.firstspirit.access.store.templatestore.gom.AbstractGomElement
de.espirit.firstspirit.access.store.templatestore.gom.DefaultGomLangInfo
All Implemented Interfaces:
GomCheckable, GomElement, GomLangInfo, Serializable

public class DefaultGomLangInfo extends AbstractGomElement implements GomLangInfo, GomCheckable
Default implementation of a GOM information object.
Since:
4.0.17
See Also:
  • Field Details

  • Constructor Details

    • DefaultGomLangInfo

      public DefaultGomLangInfo()
      Constructor for parsing.
      Since:
      4.0.17
    • DefaultGomLangInfo

      public DefaultGomLangInfo(de.espirit.firstspirit.common.text.LanguageAbbreviation lang)
      Convenience constructor. Assumes to be used under standard tag name LANGINFO!
      Since:
      4.0.17
    • DefaultGomLangInfo

      public DefaultGomLangInfo(String lang, String label, String description)
      Convenience constructor for direct usage. Assumes to be used under standard tag name LANGINFO!
      Since:
      4.0.17
  • Method Details

    • getDefaultTag

      protected String getDefaultTag()
      Provides the default tag.
      Specified by:
      getDefaultTag in class AbstractGomElement
      Returns:
      The elements default tag.
      Since:
      4.0.17
    • getLang

      public de.espirit.firstspirit.common.text.LanguageAbbreviation getLang()
      Provides the language of this information.
      Specified by:
      getLang in interface GomLangInfo
      Returns:
      The language abbreviation object.
      Since:
      4.0.17
    • getDescription

      public String getDescription()
      Provides the stored description.
      Specified by:
      getDescription in interface GomLangInfo
      Returns:
      The description.
      Since:
      4.0.17
    • getLabel

      public String getLabel()
      Provides the stored label.
      Specified by:
      getLabel in interface GomLangInfo
      Returns:
      The label.
      Since:
      4.0.17
    • setLang

      public void setLang(de.espirit.firstspirit.common.text.LanguageAbbreviation lang)
      Sets the language for this information.
      Specified by:
      setLang in interface GomLangInfo
      Parameters:
      lang - The language abbreviation object.
      Since:
      4.0.17
    • setDescription

      public void setDescription(String description)
      Sets the description.
      Specified by:
      setDescription in interface GomLangInfo
      Parameters:
      description - The description.
      Since:
      4.0.17
    • setLabel

      public void setLabel(String label)
      Sets the label.
      Specified by:
      setLabel in interface GomLangInfo
      Parameters:
      label - The label.
      Since:
      4.0.17
    • cloneAndComplete

      public GomLangInfo cloneAndComplete(GomLangInfo source)
      Clones this language information container and completes missing information by the given source.
      Specified by:
      cloneAndComplete in interface GomLangInfo
      Parameters:
      source - A source language information container.
      Returns:
      The cloned container.
      Since:
      4.0.17
    • equals

      public boolean equals(Object obj)
      Equality check implementation that ignores the language.
      Overrides:
      equals in class Object
      Parameters:
      obj - The object to compare to.
      Returns:
      true, if considered equal.
      Since:
      4.0.17
    • equals

      public boolean equals(Object obj, boolean ignoreLanguage)
      Equality check implementation.
      Specified by:
      equals in interface GomLangInfo
      Parameters:
      obj - The object to compare to.
      ignoreLanguage - true, to ignore the language.
      Returns:
      true, if considered equal.
      Since:
      4.0.17
    • equals

      protected boolean equals(DefaultGomLangInfo other, boolean ignoreLanguage)
      Equality check implementation on a concrete language information implementation.
      Parameters:
      other - The object to compare to.
      ignoreLanguage - true, to ignore the language.
      Since:
      4.0.17
    • getHashCode

      protected final de.espirit.common.util.HashCode getHashCode()
      Provide this information object's hashcode.
      Returns:
      A hash code.
      Since:
      4.0.93
    • createHashCode

      protected DefaultGomLangInfo.GomLangHashCode createHashCode()
      Create this object's hash code.
      Returns:
      The hash code.
      Since:
      4.0.93
    • hashCode

      public int hashCode()
      Hash code implementation.
      Overrides:
      hashCode in class Object
      Returns:
      The hash code.
      Since:
      4.0.17
    • isEmpty

      public boolean isEmpty()
      Indicates, whether no language information have been defined.
      Specified by:
      isEmpty in interface GomLangInfo
      Returns:
      true, if no language information have been defined.
      Since:
      4.0.17
    • verify

      public void verify() throws IllegalStateException
      Verify the element to be fulfill its syntactic constraints.
      Specified by:
      verify in interface GomCheckable
      Throws:
      IllegalStateException - If the element is not correctly set up.
      Since:
      5.2.21
    • validate

      public void validate(GomCheckable.Context context) throws GomValidationError
      Validate the element against the given context.
      Specified by:
      validate in interface GomCheckable
      Parameters:
      context - The context to validate for.
      Throws:
      GomValidationError - If the element is not plausible wrt. its context.
      Since:
      5.2.21