Class DescribableEntity
java.lang.Object
org.apache.sling.feature.extension.apiregions.api.config.AttributeableEntity
org.apache.sling.feature.extension.apiregions.api.config.DescribableEntity
- Direct Known Subclasses:
ConfigurableEntity,Option,PropertyDescription
Abstract class for all describable entities, having an optional title,
description and deprecation info.
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.Get the deprecation textGet the descriptionGet the optional since informationgetSince()Get the optional since informationgetTitle()Get the titlevoidsetDeprecated(String deprecated) Set the deprecation textvoidsetDescription(String description) Set the descriptionvoidsetEnforceOn(String enforceOn) Set the enforce on information.voidSet the since information.voidSet the titleMethods 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
-
DescribableEntity
public DescribableEntity()
-
-
Method Details
-
clear
public void clear()Clear the object and reset to defaults- Overrides:
clearin classAttributeableEntity
-
fromJSONObject
Extract the metadata from the JSON object. This method first callsclear()- Overrides:
fromJSONObjectin classAttributeableEntity- Parameters:
jsonObj- The JSON Object- Throws:
IOException- If JSON parsing fails
-
getTitle
Get the title- Returns:
- The title or
null
-
setTitle
Set the title- Parameters:
title- the title to set
-
getDescription
Get the description- Returns:
- the description or
null
-
setDescription
Set the description- Parameters:
description- the description to set
-
getDeprecated
Get the deprecation text- Returns:
- the deprecation text or
null
-
setDeprecated
Set the deprecation text- Parameters:
deprecated- the deprecation text to set
-
getSince
Get the optional since information- Returns:
- The since information or
null
-
setSince
Set the since information. This should a date in the format 'YYYY-MM-DD'.- Parameters:
since- The new info
-
getEnforceOn
Get the optional since information- Returns:
- The since information or
null
-
setEnforceOn
Set the enforce on information.- Parameters:
enforceOn- The new info
-
createJson
Convert this object into JSON- Overrides:
createJsonin classAttributeableEntity- Returns:
- The json object builder
- Throws:
IOException- If generating the JSON fails
-