public abstract class AbstractObjectExporter extends Object implements Disposable
Modifier and Type | Field and Description |
---|---|
protected Map<String,Map<String,Variant>> |
attributes |
protected ItemFactory |
factory |
protected Map<String,DataItem> |
items |
Constructor and Description |
---|
AbstractObjectExporter(ItemFactory itemFactory,
boolean readOnly,
boolean nullIsError,
String prefix)
Create a new object factory
|
Modifier and Type | Method and Description |
---|---|
protected void |
createDataItems(Class<?> targetClazz)
create data items from the properties
|
void |
dispose() |
protected void |
fillAttributes(PropertyDescriptor pd,
Map<String,Variant> attributes) |
protected <T extends Annotation> |
findAnnotation(PropertyDescriptor pd,
Class<?> clazz,
Class<T> annotationClazz)
Find the annotation
|
protected Map<String,Variant> |
getAdditionalAttributes() |
protected ItemOptions |
getOptions(PropertyDescriptor pd,
Class<?> clazz) |
protected abstract Object |
getTarget()
Get the current target or
null if there is none |
protected void |
initAttribute(PropertyDescriptor pd)
read the initial value of the property
|
protected String |
makeItemName(PropertyDescriptor pd,
Class<?> clazz) |
protected void |
updateAttribute(String propertyName,
Object newValue,
Throwable e,
Map<String,Variant> additionalAttributes) |
protected void |
updateItemsFromTarget() |
protected void |
writeAttribute(PropertyDescriptor pd,
Variant value) |
protected ItemFactory factory
public AbstractObjectExporter(ItemFactory itemFactory, boolean readOnly, boolean nullIsError, String prefix)
itemFactory
- the item factory to usereadOnly
- flag if all properties should be created read-onlynullIsError
- flag whether controls if null
mean error
prefix
- a local item prefixpublic void dispose()
dispose
in interface Disposable
protected void createDataItems(Class<?> targetClazz)
protected void updateItemsFromTarget()
protected void initAttribute(PropertyDescriptor pd)
pd
- protected void fillAttributes(PropertyDescriptor pd, Map<String,Variant> attributes)
protected <T extends Annotation> T findAnnotation(PropertyDescriptor pd, Class<?> clazz, Class<T> annotationClazz)
The following search order processed
pd
- the property descriptor to checkclazz
- class instancenull
if none was foundprotected ItemOptions getOptions(PropertyDescriptor pd, Class<?> clazz)
protected String makeItemName(PropertyDescriptor pd, Class<?> clazz)
protected void updateAttribute(String propertyName, Object newValue, Throwable e, Map<String,Variant> additionalAttributes)
protected abstract Object getTarget()
null
if there is noneprotected void writeAttribute(PropertyDescriptor pd, Variant value) throws Exception
Exception