org.apache.jena.riot
Class LangBuilder

java.lang.Object
  extended by org.apache.jena.riot.LangBuilder

public class LangBuilder
extends Object

Builder for RDF languages (Syntaxes). Example usage:

  LangBuilder.create()
             .langName("MyLang")
             .contentType("application/wizard")
             .addAltContentTypes(...)
             .addFileExtensions("ext1", "ext2")
             .build()
  


Field Summary
 List<String> altNames
           
 List<String> contentTypes
           
 List<String> fileExtensions
           
 String lang
           
 String officialContentType
           
 
Method Summary
 LangBuilder addAltContentTypes(String... x)
          Add alternative content types
 LangBuilder addAltNames(String... x)
          Add alternative names
 LangBuilder addFileExtensions(String... x)
          Add file name extensions
 Lang build()
          Construct the Lang
 LangBuilder contentType(String officialContentType)
          Set the main content type for this language.
static LangBuilder create()
          Create a builder
static LangBuilder create(String langname, String officialContentType)
          Create a builder - convenience operation to take the language name and content type which should be set if at all possible.
 String getContentType()
           
 LangBuilder langName(String langname)
          Set the language label.
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

lang

public String lang

officialContentType

public String officialContentType

altNames

public List<String> altNames

contentTypes

public List<String> contentTypes

fileExtensions

public List<String> fileExtensions
Method Detail

create

public static LangBuilder create()
Create a builder


create

public static LangBuilder create(String langname,
                                 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(String... x)
Add alternative names


addAltContentTypes

public LangBuilder addAltContentTypes(String... x)
Add alternative content types


addFileExtensions

public LangBuilder addFileExtensions(String... x)
Add file name extensions


build

public Lang build()
Construct the Lang


getContentType

public String getContentType()

contentType

public LangBuilder contentType(String officialContentType)
Set the main content type for this language. If tehre is an officially registers, preferred type, this should be that.


langName

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



Licenced under the Apache License, Version 2.0