Class LanguageCode


  • public class LanguageCode
    extends CodeValidation
    Class that can be used to check if a language code is well-formed. IMPORTANT: this doesn't check if the code is valid in the sense that it doesn't check the code against a list of languages.
    • Constructor Summary

      Constructors 
      Constructor Description
      LanguageCode()  
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      boolean isValid​(java.lang.String code)
      The code list provided with the ZUGFeRD standard only lists four codes: de, fr, en, and es.
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Constructor Detail

      • LanguageCode

        public LanguageCode()
    • Method Detail

      • isValid

        public boolean isValid​(java.lang.String code)
        The code list provided with the ZUGFeRD standard only lists four codes: de, fr, en, and es. Obviously, there are more codes available (in ISO 639-1). We won't check the presence of a code in ISO 639-1, but we'll check if the code consists of two letters and if it's lowercase.
        Specified by:
        isValid in class CodeValidation
        Parameters:
        code - the code to be tested
        Returns:
        true if the code has the correct format