public abstract class AbstractBeanProcessor<T>
extends java.lang.Object
implements net.sf.json.processors.JsonBeanProcessor
Constructor and Description |
---|
AbstractBeanProcessor() |
Modifier and Type | Method and Description |
---|---|
protected void |
addJsonElement(net.sf.json.JSONObject json,
net.sf.json.JsonConfig jsonConfig,
java.lang.String fieldName,
java.lang.Object fieldObject) |
java.util.Set<java.lang.String> |
getExcludes() |
abstract java.util.List<java.lang.String> |
getIgnorePropNames()
Implementations of this abstract class may override this method in order
to supply a List of property names to be ignored in
processBean(Object, JsonConfig) . |
protected java.util.Set<java.lang.String> |
getMergedExcludes()
merges and returns {@link #getIgnorePropNames()} with
{@link #excludes}
|
net.sf.json.JSONObject |
processBean(java.lang.Object bean,
net.sf.json.JsonConfig jsonConfig) |
abstract net.sf.json.JSONObject |
processBeanSecondStep(T bean,
net.sf.json.JSONObject json,
net.sf.json.JsonConfig jsonConfig)
This method is called at the end of
processBean(Object, JsonConfig) just before the JSONObject is returned. |
void |
setExcludes(java.util.Set<java.lang.String> excludes)
This method allows supplying a List of property names to be ignored
during the serialization to JSON.
|
public static final Logger logger
public java.util.Set<java.lang.String> getExcludes()
public void setExcludes(java.util.Set<java.lang.String> excludes)
excludes
will be
merged with the property names configured by subclasses which override
{@link #getIgnorePropNames()}.excludes
- public abstract java.util.List<java.lang.String> getIgnorePropNames()
processBean(Object, JsonConfig)
. This feature generally is used
when #processBeanSecondStep(CdmBase, JSONObject, JsonConfig)
is
implemented. such that this method is responsible of serializing this
property.protected java.util.Set<java.lang.String> getMergedExcludes()
protected void addJsonElement(net.sf.json.JSONObject json, net.sf.json.JsonConfig jsonConfig, java.lang.String fieldName, java.lang.Object fieldObject)
json
- jsonConfig
- fieldName
- fieldObject
- public final net.sf.json.JSONObject processBean(java.lang.Object bean, net.sf.json.JsonConfig jsonConfig)
processBean
in interface net.sf.json.processors.JsonBeanProcessor
public abstract net.sf.json.JSONObject processBeanSecondStep(T bean, net.sf.json.JSONObject json, net.sf.json.JsonConfig jsonConfig)
processBean(Object, JsonConfig)
just before the JSONObject is returned.
By overriding this method it is possible to do further processing.
See also getIgnorePropNames()
!
bean
- json
- jsonConfig
- Copyright © 2007-2020 EDIT. All Rights Reserved.