public class BeanObjectWriterHandler extends AbstractObjectWriterHandler
Modifier and Type | Field and Description |
---|---|
protected IBeanIntrospector |
introspector
The bean introspector (also scans for public fields).
|
protected java.util.Set<java.lang.Class<?>> |
no_typeinfos
No type infos.
|
protected java.util.Map<IFilter<java.lang.Object>,IPreProcessor> |
preprocessors
The filter based post processors.
|
flattening, gentypetags, prefertags, titmanager
Constructor and Description |
---|
BeanObjectWriterHandler(java.util.Set<TypeInfo> typeinfos)
Create a new writer (gentypetags=false, prefertags=true, flattening=true).
|
BeanObjectWriterHandler(java.util.Set<TypeInfo> typeinfos,
boolean gentypetags)
Create a new writer (prefertags=true, flattening=true).
|
BeanObjectWriterHandler(java.util.Set<TypeInfo> typeinfos,
boolean gentypetags,
boolean prefertags)
Create a new writer (flattening=true).
|
BeanObjectWriterHandler(java.util.Set<TypeInfo> typeinfos,
boolean gentypetags,
boolean prefertags,
boolean flattening)
Create a new writer.
|
Modifier and Type | Method and Description |
---|---|
void |
addPreProcessor(IFilter<java.lang.Object> filter,
IPreProcessor processor)
Add a pre processor.
|
protected java.lang.reflect.Method |
findGetMethod(java.lang.Object object,
java.lang.String name,
java.lang.String[] prefixes)
Find a get method with some prefix.
|
java.lang.Object |
getObjectType(java.lang.Object object,
IContext context)
Get the object type
|
IPreProcessor[] |
getPreProcessors(java.lang.Object object,
java.lang.Object typeinfo)
Get the pre-processor.
|
protected java.util.Collection<BeanProperty> |
getProperties(java.lang.Object object,
IContext context,
boolean includemethods,
boolean includefields)
Get the properties of an object.
|
protected java.lang.Object |
getProperty(java.lang.Object info)
Get the property.
|
protected java.lang.String |
getPropertyName(java.lang.Object property)
Get the name of a property.
|
QName |
getTagName(java.lang.Object object,
IContext context)
Get the tag name for an object.
|
QName |
getTagWithPrefix(QName tag,
IContext context)
Get the tag with namespace.
|
TypeInfo |
getTypeInfo(java.lang.Object object,
QName[] fullpath,
IContext context)
Get the most specific mapping info.
|
protected java.lang.Object |
getValue(java.lang.Object object,
java.lang.Object attr,
IContext context,
java.lang.Object info)
Get a value from an object.
|
protected boolean |
isBasicType(java.lang.Object property,
java.lang.Object value)
Test if a value is a basic type.
|
protected boolean |
isDecodableToSameType(java.lang.Object property,
java.lang.Object value,
IContext context)
Test if a value is decodable to the same type.
|
protected boolean |
isTypeCompatible(java.lang.Object object,
ObjectInfo info,
IContext context)
Test if a value is compatible with the defined typeinfo.
|
void |
removePreProcessor(IFilter<java.lang.Object> filter)
Remove a pre processor.
|
createPath, getDefaultValue, getObjectWriteInfo, getTypeInfoManager
protected IBeanIntrospector introspector
protected java.util.Set<java.lang.Class<?>> no_typeinfos
protected java.util.Map<IFilter<java.lang.Object>,IPreProcessor> preprocessors
public BeanObjectWriterHandler(java.util.Set<TypeInfo> typeinfos)
public BeanObjectWriterHandler(java.util.Set<TypeInfo> typeinfos, boolean gentypetags)
public BeanObjectWriterHandler(java.util.Set<TypeInfo> typeinfos, boolean gentypetags, boolean prefertags)
public BeanObjectWriterHandler(java.util.Set<TypeInfo> typeinfos, boolean gentypetags, boolean prefertags, boolean flattening)
public TypeInfo getTypeInfo(java.lang.Object object, QName[] fullpath, IContext context)
getTypeInfo
in interface IObjectWriterHandler
getTypeInfo
in class AbstractObjectWriterHandler
tag
- The tag.fullpath
- The full path.public java.lang.Object getObjectType(java.lang.Object object, IContext context)
getObjectType
in class AbstractObjectWriterHandler
object
- The object.public QName getTagName(java.lang.Object object, IContext context)
public QName getTagWithPrefix(QName tag, IContext context)
protected java.lang.Object getValue(java.lang.Object object, java.lang.Object attr, IContext context, java.lang.Object info) throws java.lang.Exception
getValue
in class AbstractObjectWriterHandler
java.lang.Exception
protected java.lang.Object getProperty(java.lang.Object info)
getProperty
in class AbstractObjectWriterHandler
protected java.lang.String getPropertyName(java.lang.Object property)
getPropertyName
in class AbstractObjectWriterHandler
protected boolean isBasicType(java.lang.Object property, java.lang.Object value)
isBasicType
in class AbstractObjectWriterHandler
protected java.util.Collection<BeanProperty> getProperties(java.lang.Object object, IContext context, boolean includemethods, boolean includefields)
getProperties
in class AbstractObjectWriterHandler
protected java.lang.reflect.Method findGetMethod(java.lang.Object object, java.lang.String name, java.lang.String[] prefixes)
object
- The object.name
- The name.prefixes
- The prefixes to test.protected boolean isTypeCompatible(java.lang.Object object, ObjectInfo info, IContext context)
isTypeCompatible
in class AbstractObjectWriterHandler
protected boolean isDecodableToSameType(java.lang.Object property, java.lang.Object value, IContext context)
isDecodableToSameType
in class AbstractObjectWriterHandler
public IPreProcessor[] getPreProcessors(java.lang.Object object, java.lang.Object typeinfo)
getPreProcessors
in interface IObjectWriterHandler
getPreProcessors
in class AbstractObjectWriterHandler
public void addPreProcessor(IFilter<java.lang.Object> filter, IPreProcessor processor)
filter
- The filter.processor
- The pre processor.public void removePreProcessor(IFilter<java.lang.Object> filter)
filter
- The filter.processor
- The pre processor.