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
public abstract class ConfigurableEntity extends DescribableEntity
A configurable entity has properties This class is not thread safe.
-
-
Constructor Summary
Constructors Constructor Description ConfigurableEntity()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidclear()Clear the object and reset to defaultsprotected jakarta.json.JsonObjectBuildercreateJson()Convert this object into JSONvoidfromJSONObject(jakarta.json.JsonObject jsonObj)Extract the metadata from the JSON object.List<String>getInternalPropertyNames()Get the list of internal property names.ModegetMode()Get the validation mode.Map<String,PropertyDescription>getPropertyDescriptions()Get the propertiesRegiongetRegion()Which region does this entity apply to?booleanisAllowAdditionalProperties()Are additional properties allowed?voidsetAllowAdditionalProperties(boolean flag)Set whether additional properties are allowedprotected voidsetDefaults()Apply the non-null default values.voidsetMode(Mode value)Set the validation modevoidsetRegion(Region region)Set 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, setTitle
-
Methods inherited from class org.apache.sling.feature.extension.apiregions.api.config.AttributeableEntity
getAttributes, getBoolean, getInteger, getNumber, getString, getString, getStringArray, setString, setStringArray, toJSONObject
-
-
-
-
Method Detail
-
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
public void fromJSONObject(jakarta.json.JsonObject jsonObj) throws IOExceptionExtract 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
public Map<String,PropertyDescription> getPropertyDescriptions()
Get the properties- Returns:
- Mutable map of properties by property name
-
getMode
public Mode getMode()
Get the validation mode.- Returns:
- The mode or
null - Since:
- 1.2
-
setMode
public void setMode(Mode value)
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
public Region getRegion()
Which region does this entity apply to?- Returns:
- the region
- Since:
- 1.4
-
setRegion
public void setRegion(Region region)
Set the region of this entity.- Parameters:
region- The region- Since:
- 1.4
-
getInternalPropertyNames
public List<String> getInternalPropertyNames()
Get the list of internal property names.- Returns:
- the mutable list of internal property names
- Since:
- 1.4
-
createJson
protected jakarta.json.JsonObjectBuilder createJson() throws IOExceptionConvert this object into JSON- Overrides:
createJsonin classDescribableEntity- Returns:
- The json object builder
- Throws:
IOException- If generating the JSON fails
-
-