- java.lang.Object
-
- org.mal_lang.langspec.builders.LangBuilder
-
-
Constructor Summary
Constructors Constructor Description LangBuilder()
Constructs a newLangBuilder
object.
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description LangBuilder
addAsset(AssetBuilder asset)
Adds an asset to thisLangBuilder
object.LangBuilder
addAssociation(AssociationBuilder association)
Adds an association to thisLangBuilder
object.LangBuilder
addCategory(CategoryBuilder category)
Adds a category to thisLangBuilder
object.LangBuilder
addDefine(String key, String value)
Adds a define to thisLangBuilder
object.static LangBuilder
fromJson(JsonObject jsonLang)
Creates a newLangBuilder
from aJsonObject
.static LangBuilder
fromJson(JsonObject jsonLang, String license, String notice)
Creates a newLangBuilder
from aJsonObject
.static LangBuilder
fromJson(JsonObject jsonLang, Map<String,byte[]> svgIcons, Map<String,byte[]> pngIcons)
Creates a newLangBuilder
from aJsonObject
.static LangBuilder
fromJson(JsonObject jsonLang, Map<String,byte[]> svgIcons, Map<String,byte[]> pngIcons, String license, String notice)
Creates a newLangBuilder
from aJsonObject
.List<AssetBuilder>
getAssets()
Returns a list of all assets in thisLangBuilder
object.List<AssociationBuilder>
getAssociations()
Returns a list of all associations in thisLangBuilder
object.List<CategoryBuilder>
getCategories()
Returns a list of all categories in thisLangBuilder
object.Map<String,String>
getDefines()
Returns all defines in thisLangBuilder
object.String
getLicense()
Returns the license of thisLangBuilder
object, ornull
if no license has been set.String
getNotice()
Returns the notice of thisLangBuilder
object, ornull
if no notice has been set.LangBuilder
setLicense(String license)
Sets the license of thisLangBuilder
object.LangBuilder
setNotice(String notice)
Sets the notice of thisLangBuilder
object.
-
-
-
Method Detail
-
getDefines
public Map<String,String> getDefines()
Returns all defines in thisLangBuilder
object.- Returns:
- all defines in this
LangBuilder
object - Since:
- 1.0.0
-
addDefine
public LangBuilder addDefine(String key, String value)
Adds a define to thisLangBuilder
object.- Parameters:
key
- the key of the definevalue
- the value of the define- Returns:
- this
LangBuilder
object - Throws:
NullPointerException
- ifkey
orvalue
isnull
IllegalArgumentException
- ifkey
is not a valid identifier- Since:
- 1.0.0
-
getCategories
public List<CategoryBuilder> getCategories()
Returns a list of all categories in thisLangBuilder
object.- Returns:
- a list of all categories in this
LangBuilder
object - Since:
- 1.0.0
-
addCategory
public LangBuilder addCategory(CategoryBuilder category)
Adds a category to thisLangBuilder
object.- Parameters:
category
- the category to add- Returns:
- this
LangBuilder
object - Throws:
NullPointerException
- ifcategory
isnull
- Since:
- 1.0.0
-
getAssets
public List<AssetBuilder> getAssets()
Returns a list of all assets in thisLangBuilder
object.- Returns:
- a list of all assets in this
LangBuilder
object - Since:
- 1.0.0
-
addAsset
public LangBuilder addAsset(AssetBuilder asset)
Adds an asset to thisLangBuilder
object.- Parameters:
asset
- the asset to add- Returns:
- this
LangBuilder
object - Throws:
NullPointerException
- ifasset
isnull
- Since:
- 1.0.0
-
getAssociations
public List<AssociationBuilder> getAssociations()
Returns a list of all associations in thisLangBuilder
object.- Returns:
- a list of all associations in this
LangBuilder
object - Since:
- 1.0.0
-
addAssociation
public LangBuilder addAssociation(AssociationBuilder association)
Adds an association to thisLangBuilder
object.- Parameters:
association
- the association to add- Returns:
- this
LangBuilder
object - Throws:
NullPointerException
- ifassociation
isnull
- Since:
- 1.0.0
-
getLicense
public String getLicense()
Returns the license of thisLangBuilder
object, ornull
if no license has been set.- Returns:
- the license of this
LangBuilder
object, ornull
if no license has been set - Since:
- 1.0.0
-
setLicense
public LangBuilder setLicense(String license)
Sets the license of thisLangBuilder
object.- Parameters:
license
- the license to set- Returns:
- this
LangBuilder
object - Throws:
NullPointerException
- iflicense
isnull
- Since:
- 1.0.0
-
getNotice
public String getNotice()
Returns the notice of thisLangBuilder
object, ornull
if no notice has been set.- Returns:
- the notice of this
LangBuilder
object, ornull
if no notice has been set - Since:
- 1.0.0
-
setNotice
public LangBuilder setNotice(String notice)
Sets the notice of thisLangBuilder
object.- Parameters:
notice
- the notice to set- Returns:
- this
LangBuilder
object - Throws:
NullPointerException
- ifnotice
isnull
- Since:
- 1.0.0
-
fromJson
public static LangBuilder fromJson(JsonObject jsonLang)
Creates a newLangBuilder
from aJsonObject
.- Parameters:
jsonLang
- theJsonObject
- Returns:
- a new
LangBuilder
- Throws:
NullPointerException
- ifjsonLang
isnull
- Since:
- 1.0.0
-
fromJson
public static LangBuilder fromJson(JsonObject jsonLang, Map<String,byte[]> svgIcons, Map<String,byte[]> pngIcons)
Creates a newLangBuilder
from aJsonObject
.- Parameters:
jsonLang
- theJsonObject
svgIcons
- the SVG icons of the languagepngIcons
- the PNG icons of the language- Returns:
- a new
LangBuilder
- Throws:
NullPointerException
- ifjsonLang
,svgIcons
, orpngIcons
isnull
- Since:
- 1.0.0
-
fromJson
public static LangBuilder fromJson(JsonObject jsonLang, String license, String notice)
Creates a newLangBuilder
from aJsonObject
.- Parameters:
jsonLang
- theJsonObject
license
- the license of the language, ornull
notice
- the notice of the language, ornull
- Returns:
- a new
LangBuilder
- Throws:
NullPointerException
- ifjsonLang
isnull
- Since:
- 1.0.0
-
fromJson
public static LangBuilder fromJson(JsonObject jsonLang, Map<String,byte[]> svgIcons, Map<String,byte[]> pngIcons, String license, String notice)
Creates a newLangBuilder
from aJsonObject
.- Parameters:
jsonLang
- theJsonObject
svgIcons
- the SVG icons of the languagepngIcons
- the PNG icons of the languagelicense
- the license of the language, ornull
notice
- the notice of the language, ornull
- Returns:
- a new
LangBuilder
- Throws:
NullPointerException
- ifjsonLang
,svgIcons
, orpngIcons
isnull
- Since:
- 1.0.0
-
-