Package org.apache.sling.feature.extension.apiregions.api.config

# 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

Modifier and Type
Method
Description
`void`
`clear()`
Clear the object and reset to defaults
`protected jakarta.json.JsonObjectBuilder`
`createJson()`
Convert this object into JSON
`void`
`fromJSONObject(jakarta.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 properties
`Region`
`getRegion()`
Which region does this entity apply to?
`boolean`
`isAllowAdditionalProperties()`
Are additional properties allowed?
`void`
`setAllowAdditionalProperties(boolean flag)`
Set whether additional properties are allowed
`protected void`
`setDefaults()`
Apply the non-null default values.
`void`
`setMode(Mode value)`
Set the validation mode
`void`
`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`

### Methods inherited from class java.lang.Object

`clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

## Constructor Details

### ConfigurableEntity

public ConfigurableEntity()

## Method Details

### setDefaults

protected void setDefaults()
Description copied from class: `AttributeableEntity`
Apply the non-null default values.

Overrides:
  `setDefaults` in class `AttributeableEntity`

### clear

public void clear()
Clear the object and reset to defaults

Overrides:
  `clear` in class `DescribableEntity`

### fromJSONObject

public void fromJSONObject(jakarta.json.JsonObject jsonObj) throws IOException
Extract the metadata from the JSON object. This method first calls `clear()`

Overrides:
  `fromJSONObject` in class `DescribableEntity`
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 to `true` 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 jakarta.json.JsonObjectBuilder createJson() throws IOException
Convert this object into JSON

Overrides:
  `createJson` in class `DescribableEntity`
Returns:
  The json object builder
Throws:
  `IOException` - If generating the JSON fails