public abstract class JSONCleaner extends Object
Isolate the process of cleaning JSON data from the Interceptor class itself.
The allowed and blocked wildcard patterns, combined with defaultBlock, let you filter out values that should not be injected, in the same way that ParameterFilterInterceptor does. Note that you can only remove values from a Map. Removing values from a List is dangerous because it could change the meaning of the data!
Modifier and Type | Class and Description |
---|---|
static class |
JSONCleaner.Filter |
Constructor and Description |
---|
JSONCleaner() |
Modifier and Type | Method and Description |
---|---|
Object |
clean(String ognlPrefix,
Object data) |
protected Object |
cleanList(String ognlPrefix,
Object data) |
protected Object |
cleanMap(String ognlPrefix,
Object data) |
protected abstract Object |
cleanValue(String ognlName,
Object data) |
Collection<String> |
getAllowedCollection() |
Collection<String> |
getBlockedCollection() |
Map<String,JSONCleaner.Filter> |
getIncludesExcludesMap() |
boolean |
isDefaultBlock() |
void |
setAllowed(String allowed) |
void |
setAllowedCollection(Collection<String> allowed) |
void |
setBlocked(String blocked) |
void |
setBlockedCollection(Collection<String> blocked) |
void |
setDefaultBlock(boolean defaultExclude) |
void |
setIncludesExcludesMap(Map<String,JSONCleaner.Filter> map)
Allow external caching of the compiled result.
|
public Object clean(String ognlPrefix, Object data) throws JSONException
JSONException
protected Object cleanList(String ognlPrefix, Object data) throws JSONException
JSONException
protected Object cleanMap(String ognlPrefix, Object data) throws JSONException
JSONException
protected abstract Object cleanValue(String ognlName, Object data) throws JSONException
JSONException
public Map<String,JSONCleaner.Filter> getIncludesExcludesMap()
public void setIncludesExcludesMap(Map<String,JSONCleaner.Filter> map)
map
- the compiled list of includes and excludespublic boolean isDefaultBlock()
public void setDefaultBlock(boolean defaultExclude)
defaultExclude
- The defaultExclude to set.public Collection<String> getBlockedCollection()
public void setBlockedCollection(Collection<String> blocked)
blocked
- The blocked to set.public void setBlocked(String blocked)
blocked
- The blocked parameters as comma separated String.public Collection<String> getAllowedCollection()
public void setAllowedCollection(Collection<String> allowed)
allowed
- The allowed to set.public void setAllowed(String allowed)
allowed
- The allowed paramters as comma separated String.Copyright © 2000–2020 Apache Software Foundation. All rights reserved.