public class ConfigurationApi extends AttributeableEntity
Modifier and Type | Field and Description |
---|---|
static String |
EXTENSION_NAME
The name of the api regions extension.
|
Constructor and Description |
---|
ConfigurationApi() |
Modifier and Type | Method and Description |
---|---|
void |
clear()
Clear the object and reset to defaults
|
protected javax.json.JsonObjectBuilder |
createJson()
Convert this object into JSON
|
Region |
detectRegion()
Detect the region, either return the stored region or the default (GLOBAL)
|
void |
fromJSONObject(javax.json.JsonObject jsonObj)
Extract the metadata from the JSON object.
|
static ConfigurationApi |
getConfigurationApi(org.apache.sling.feature.Extension ext)
Get the configuration api from the extension.
|
static ConfigurationApi |
getConfigurationApi(org.apache.sling.feature.Feature feature)
Get the configuration api from the feature - if it exists.
|
Map<String,ConfigurationDescription> |
getConfigurationDescriptions()
Get the configuration descriptions
|
Map<String,FactoryConfigurationDescription> |
getFactoryConfigurationDescriptions()
Get the factory configuration descriptions
|
Map<org.apache.sling.feature.ArtifactId,Region> |
getFeatureToRegionCache()
Get the feature to region cache to keep track of regions for origin features
|
Map<String,FrameworkPropertyDescription> |
getFrameworkPropertyDescriptions()
Get the framework properties
|
Set<String> |
getInternalConfigurations()
Deprecated.
Please use empty configuration descriptions via
getConfigurationDescriptions() |
Set<String> |
getInternalFactoryConfigurations()
Deprecated.
Please use empty factory configuration descriptions via
getFactoryConfigurationDescriptions() |
Set<String> |
getInternalFrameworkProperties()
Get the internal framework property names
|
Mode |
getMode()
Get the validation mode.
|
Region |
getRegion()
Get the api configuration region
|
static void |
setConfigurationApi(org.apache.sling.feature.Feature feature,
ConfigurationApi api)
Set the configuration api as an extension to the feature
|
protected void |
setDefaults()
Apply the non-null default values.
|
void |
setMode(Mode value)
Set the validation mode
|
void |
setRegion(Region value)
Set the api configuration region
|
getAttributes, getBoolean, getInteger, getNumber, getString, getString, getStringArray, setString, setStringArray, toJSONObject
public static final String EXTENSION_NAME
public static ConfigurationApi getConfigurationApi(org.apache.sling.feature.Feature feature)
setConfigurationApi(Feature, ConfigurationApi)
can be used to update
the feature.feature
- The featurenull
.IllegalArgumentException
- If the extension is wrongly formattedpublic static ConfigurationApi getConfigurationApi(org.apache.sling.feature.Extension ext)
ext
- The extensionnull
if the extension is null
.IllegalArgumentException
- If the extension is wrongly formattedpublic static void setConfigurationApi(org.apache.sling.feature.Feature feature, ConfigurationApi api)
feature
- The featureapi
- The configuration apiIllegalStateException
- If the feature has already an extension of a wrong typeIllegalArgumentException
- If the api configuration can't be serialized to JSONprotected void setDefaults()
AttributeableEntity
setDefaults
in class AttributeableEntity
public void clear()
clear
in class AttributeableEntity
public void fromJSONObject(javax.json.JsonObject jsonObj) throws IOException
clear()
.fromJSONObject
in class AttributeableEntity
jsonObj
- The JSON ObjectIOException
- If JSON parsing failspublic Map<String,ConfigurationDescription> getConfigurationDescriptions()
public Map<String,FactoryConfigurationDescription> getFactoryConfigurationDescriptions()
public Map<String,FrameworkPropertyDescription> getFrameworkPropertyDescriptions()
@Deprecated public Set<String> getInternalConfigurations()
getConfigurationDescriptions()
@Deprecated public Set<String> getInternalFactoryConfigurations()
getFactoryConfigurationDescriptions()
public Set<String> getInternalFrameworkProperties()
public Region getRegion()
null
public void setRegion(Region value)
value
- The region to setpublic Region detectRegion()
public Map<org.apache.sling.feature.ArtifactId,Region> getFeatureToRegionCache()
public Mode getMode()
Mode.STRICT
public void setMode(Mode value)
value
- The validation modeprotected javax.json.JsonObjectBuilder createJson() throws IOException
createJson
in class AttributeableEntity
IOException
- If generating the JSON failsCopyright © 2007–2021 The Apache Software Foundation. All rights reserved.