Class Option
java.lang.Object
org.apache.sling.feature.extension.apiregions.api.config.AttributeableEntity
org.apache.sling.feature.extension.apiregions.api.config.DescribableEntity
org.apache.sling.feature.extension.apiregions.api.config.Option
Option for a property value
This class is not thread safe.
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidclear()Clear the object and reset to defaultsprotected jakarta.json.JsonObjectBuilderConvert this object into JSONvoidfromJSONObject(jakarta.json.JsonObject jsonObj) Extract the metadata from the JSON object.getValue()Get the value for the optionvoidSet the value for the optionMethods inherited from class org.apache.sling.feature.extension.apiregions.api.config.DescribableEntity
getDeprecated, getDescription, getEnforceOn, getSince, getTitle, setDeprecated, setDescription, setEnforceOn, setSince, setTitleMethods inherited from class org.apache.sling.feature.extension.apiregions.api.config.AttributeableEntity
getAttributes, getBoolean, getInteger, getNumber, getString, getString, getStringArray, setDefaults, setString, setStringArray, toJSONObject
-
Constructor Details
-
Option
public Option()
-
-
Method Details
-
clear
public void clear()Clear the object and reset to defaults- Overrides:
clearin classDescribableEntity
-
fromJSONObject
Extract the metadata from the JSON object. This method first callsclear()- Overrides:
fromJSONObjectin classDescribableEntity- Parameters:
jsonObj- The JSON Object- Throws:
IOException- If JSON parsing fails
-
getValue
Get the value for the option- Returns:
- the value or
null
-
setValue
Set the value for the option- Parameters:
value- the value to set
-
createJson
Convert this object into JSON- Overrides:
createJsonin classDescribableEntity- Returns:
- The json object builder
- Throws:
IOException- If generating the JSON fails
-