Class LangBuilder


  • public class LangBuilder
    extends java.lang.Object
    Builder for RDF languages (Syntaxes). Example usage:
      LangBuilder.create()
                 .langName("MyLang")
                 .contentType("application/wizard")
                 .addAltContentTypes(...)
                 .addFileExtensions("ext1", "ext2")
                 .build()
      
    • Field Detail

      • lang

        public java.lang.String lang
      • officialContentType

        public java.lang.String officialContentType
      • altNames

        public java.util.List<java.lang.String> altNames
      • contentTypes

        public java.util.List<java.lang.String> contentTypes
      • fileExtensions

        public java.util.List<java.lang.String> fileExtensions
    • Method Detail

      • create

        public static LangBuilder create()
        Create a builder
      • create

        public static LangBuilder create​(java.lang.String langname,
                                         java.lang.String officialContentType)
        Create a builder - convenience operation to take the language name and content type which should be set if at all possible.
        Parameters:
        langname -
        officialContentType -
      • addAltNames

        public LangBuilder addAltNames​(java.lang.String... x)
        Add alternative names
      • addAltContentTypes

        public LangBuilder addAltContentTypes​(java.lang.String... x)
        Add alternative content types
      • addFileExtensions

        public LangBuilder addFileExtensions​(java.lang.String... x)
        Add file name extensions
      • build

        public Lang build()
        Construct the Lang
      • getContentType

        public java.lang.String getContentType()
      • contentType

        public LangBuilder contentType​(java.lang.String officialContentType)
        Set the main content type for this language. If there is an officially registered, preferred type, this should be that.
      • langName

        public LangBuilder langName​(java.lang.String langname)
        Set the language label. A system wide, unique short name