Class ConfigurableEntity
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.ConfigurableEntity
- Direct Known Subclasses:
ConfigurationDescription,FactoryConfigurationDescription
A configurable entity has properties
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 list of internal property names.getMode()Get the validation mode.Get the propertiesWhich region does this entity apply to?booleanAre additional properties allowed?voidsetAllowAdditionalProperties(boolean flag) Set whether additional properties are allowedprotected voidApply the non-null default values.voidSet the validation modevoidSet the region of this entity.Methods 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, setString, setStringArray, toJSONObject
-
Constructor Details
-
ConfigurableEntity
public ConfigurableEntity()
-
-
Method Details
-
setDefaults
protected void setDefaults()Description copied from class:AttributeableEntityApply the non-null default values.- Overrides:
setDefaultsin classAttributeableEntity
-
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
-
getPropertyDescriptions
Get the properties- Returns:
- Mutable map of properties by property name
-
getMode
Get the validation mode.- Returns:
- The mode or
null - Since:
- 1.2
-
setMode
Set the validation mode- Parameters:
value- The validation mode- Since:
- 1.2
-
isAllowAdditionalProperties
public boolean isAllowAdditionalProperties()Are additional properties allowed?- Returns:
trueif additional properties are allowed- Since:
- 1.4
-
setAllowAdditionalProperties
public void setAllowAdditionalProperties(boolean flag) Set whether additional properties are allowed- Parameters:
flag- Set totrueto allow additional properties- Since:
- 1.4
-
getRegion
Which region does this entity apply to?- Returns:
- the region
- Since:
- 1.4
-
setRegion
Set the region of this entity.- Parameters:
region- The region- Since:
- 1.4
-
getInternalPropertyNames
Get the list of internal property names.- Returns:
- the mutable list of internal property names
- Since:
- 1.4
-
createJson
Convert this object into JSON- Overrides:
createJsonin classDescribableEntity- Returns:
- The json object builder
- Throws:
IOException- If generating the JSON fails
-