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 void
clear()
Clear the object and reset to defaultsprotected javax.json.JsonObjectBuilder
createJson()
Convert this object into JSONvoid
fromJSONObject(javax.json.JsonObject jsonObj)
Extract the metadata from the JSON object.List<String>
getInternalPropertyNames()
Get the list of internal property names.Mode
getMode()
Get the validation mode.Map<String,PropertyDescription>
getPropertyDescriptions()
Get the propertiesRegion
getRegion()
Which region does this entity apply to?boolean
isAllowAdditionalProperties()
Are additional properties allowed?void
setAllowAdditionalProperties(boolean flag)
Set whether additional properties are allowedprotected void
setDefaults()
Apply the non-null default values.void
setMode(Mode value)
Set the validation modevoid
setRegion(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:AttributeableEntity
Apply the non-null default values.- Overrides:
setDefaults
in classAttributeableEntity
-
clear
public void clear()
Clear the object and reset to defaults- Overrides:
clear
in classDescribableEntity
-
fromJSONObject
public void fromJSONObject(javax.json.JsonObject jsonObj) throws IOException
Extract the metadata from the JSON object. This method first callsclear()
- Overrides:
fromJSONObject
in 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:
true
if additional properties are allowed- Since:
- 1.4
-
setAllowAdditionalProperties
public void setAllowAdditionalProperties(boolean flag)
Set whether additional properties are allowed- Parameters:
flag
- Set totrue
to 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 javax.json.JsonObjectBuilder createJson() throws IOException
Convert this object into JSON- Overrides:
createJson
in classDescribableEntity
- Returns:
- The json object builder
- Throws:
IOException
- If generating the JSON fails
-
-