public class FeatureJSONReader extends Object
Feature using a Reader instance.| Modifier and Type | Class and Description |
|---|---|
static class |
FeatureJSONReader.SubstituteVariables |
| Modifier and Type | Field and Description |
|---|---|
protected String |
exceptionPrefix
Exception prefix containing the location (if set)
|
protected String |
location
The optional location.
|
| Modifier and Type | Method and Description |
|---|---|
protected List<org.apache.sling.feature.Configuration> |
addConfigurations(Map<String,Object> map,
org.apache.sling.feature.Artifact artifact,
org.apache.sling.feature.Configurations container) |
protected void |
checkType(String key,
Object val,
Class<?>... types)
Check if the value is one of the provided types
|
protected Map<String,Object> |
getJsonMap(javax.json.JsonObject json)
Get the JSON object as a map, removing all comments that start with a '#' character
|
protected String |
getProperty(Map<String,Object> map,
String key) |
protected Object |
handleLaunchVars(Object val)
Substitutes variables that need to be substituted at launch time.
|
protected Object |
handleResolveVars(Object val)
Substitutes variables that need to be specified before the resolver executes.
|
protected String |
minify(Reader reader) |
static org.apache.sling.feature.Feature |
read(Reader reader,
org.apache.sling.feature.ArtifactId providedId,
String location,
FeatureJSONReader.SubstituteVariables phase)
Read a new feature from the reader
The reader is not closed.
|
static org.apache.sling.feature.Feature |
read(Reader reader,
String location,
FeatureJSONReader.SubstituteVariables phase)
Read a new feature from the reader
The reader is not closed.
|
protected void |
readArtifacts(String section,
String artifactType,
List<org.apache.sling.feature.Artifact> artifacts,
Object listObj,
org.apache.sling.feature.Configurations container) |
protected void |
readBundles(Map<String,Object> map,
org.apache.sling.feature.Bundles container,
org.apache.sling.feature.Configurations configContainer)
Read the bundles / start levels section
|
protected void |
readConfigurations(Map<String,Object> map,
org.apache.sling.feature.Configurations container) |
protected void |
readExtensions(Map<String,Object> map,
List<String> keywords,
org.apache.sling.feature.Extensions container,
org.apache.sling.feature.Configurations configContainer) |
protected void |
readFrameworkProperties(Map<String,Object> map,
org.apache.sling.feature.KeyValueMap container) |
protected final String location
protected final String exceptionPrefix
public static org.apache.sling.feature.Feature read(Reader reader, String location, FeatureJSONReader.SubstituteVariables phase) throws IOException
reader - The reader for the featurelocation - Optional locationphase - If variables need to be substituted, the phase the this should be done for.IOException - If an IO errors occurs or the JSON is invalid.public static org.apache.sling.feature.Feature read(Reader reader, org.apache.sling.feature.ArtifactId providedId, String location, FeatureJSONReader.SubstituteVariables phase) throws IOException
reader - The reader for the featureprovidedId - Optional artifact idlocation - Optional locationphase - If variables need to be substituted, the phase the this should be done for.IOException - If an IO errors occurs or the JSON is invalid.protected Object handleResolveVars(Object val)
val - The value that may contain a variable.protected Object handleLaunchVars(Object val)
val - The value that may contain a variable.protected String minify(Reader reader) throws IOException
IOExceptionprotected Map<String,Object> getJsonMap(javax.json.JsonObject json)
json - The JSON object to processprotected String getProperty(Map<String,Object> map, String key) throws IOException
IOExceptionprotected void readBundles(Map<String,Object> map, org.apache.sling.feature.Bundles container, org.apache.sling.feature.Configurations configContainer) throws IOException
map - The map describing the featurecontainer - The bundles containerconfigContainer - The configurations containerIOException - If the json is invalid.protected void readArtifacts(String section, String artifactType, List<org.apache.sling.feature.Artifact> artifacts, Object listObj, org.apache.sling.feature.Configurations container) throws IOException
IOExceptionprotected List<org.apache.sling.feature.Configuration> addConfigurations(Map<String,Object> map, org.apache.sling.feature.Artifact artifact, org.apache.sling.feature.Configurations container) throws IOException
IOExceptionprotected void readConfigurations(Map<String,Object> map, org.apache.sling.feature.Configurations container) throws IOException
IOExceptionprotected void readFrameworkProperties(Map<String,Object> map, org.apache.sling.feature.KeyValueMap container) throws IOException
IOExceptionprotected void readExtensions(Map<String,Object> map, List<String> keywords, org.apache.sling.feature.Extensions container, org.apache.sling.feature.Configurations configContainer) throws IOException
IOExceptionprotected void checkType(String key, Object val, Class<?>... types) throws IOException
key - A key for the error messageval - The value to checktypes - The allowed typesIOException - If the val is not of the specified typesCopyright © 2007–2018 The Apache Software Foundation. All rights reserved.