public class ApiRegions extends Object
Modifier and Type | Field and Description |
---|---|
static String |
EXTENSION_NAME
The name of the api regions extension.
|
Constructor and Description |
---|
ApiRegions() |
Modifier and Type | Method and Description |
---|---|
boolean |
add(ApiRegion region)
Add the region.
|
boolean |
add(int idx,
ApiRegion region)
Add the region.
|
boolean |
equals(Object obj) |
static ApiRegions |
getApiRegions(org.apache.sling.feature.Extension ext)
Get the api regions from the extension.
|
static ApiRegions |
getApiRegions(org.apache.sling.feature.Feature feature)
Get the api regions from the feature - if it exists.
|
ApiRegion |
getRegionByName(String name)
Get a named region
|
List<String> |
getRegionNames()
Get the names of the regions
|
ApiRegion[] |
getRegionsByFeature(org.apache.sling.feature.ArtifactId featureId) |
ApiRegion |
getRoot()
Get the root regions.
|
int |
hashCode() |
boolean |
isEmpty()
Check if any region exists
|
List<ApiRegion> |
listRegions()
Return the list of regions
|
static ApiRegions |
parse(javax.json.JsonArray json)
Parse a JSON array into an api regions object
|
static ApiRegions |
parse(String json)
Parse a JSON array into an api regions object
|
String |
toJSON()
Convert regions into json
|
javax.json.JsonArray |
toJSONArray()
Convert regions into json
|
String |
toString() |
public static final String EXTENSION_NAME
public List<ApiRegion> listRegions()
public ApiRegion getRoot()
null
public boolean isEmpty()
true
if it has any regionpublic boolean add(ApiRegion region)
region
- The region to addtrue
if the region could be added, false
otherwisepublic boolean add(int idx, ApiRegion region)
idx
- The position to addregion
- The region to addtrue
if the region could be added, false
otherwisepublic ApiRegion getRegionByName(String name)
name
- The namenull
public ApiRegion[] getRegionsByFeature(org.apache.sling.feature.ArtifactId featureId)
public List<String> getRegionNames()
public javax.json.JsonArray toJSONArray() throws IOException
IOException
- If generating the JSON failspublic String toJSON() throws IOException
IOException
- If generating the JSON failspublic static ApiRegions parse(String json) throws IOException
json
- The json as a stringIOException
- If the json could not be parsedpublic static ApiRegions parse(javax.json.JsonArray json) throws IOException
json
- The jsonIOException
- If the json could not be parsedpublic static ApiRegions getApiRegions(org.apache.sling.feature.Feature feature)
feature
- The featurenull
.IllegalArgumentException
- If the extension is wrongly formattedpublic static ApiRegions getApiRegions(org.apache.sling.feature.Extension ext)
ext
- The extensionnull
.IllegalArgumentException
- If the extension is wrongly formattedCopyright © 2007–2021 The Apache Software Foundation. All rights reserved.