public class AttributeMapper extends MapperWrapper
SingleValueConverter
for item types and attribute names.Mapper.ImplicitCollectionMapping, Mapper.Null
Constructor and Description |
---|
AttributeMapper(Mapper wrapped)
Deprecated.
As of 1.3
|
AttributeMapper(Mapper wrapped,
ConverterLookup converterLookup,
ReflectionProvider refProvider) |
aliasForAttribute, aliasForAttribute, aliasForSystemAttribute, attributeForAlias, attributeForAlias, defaultImplementationOf, getFieldNameForItemTypeAndName, getImplicitCollectionDefForFieldName, getItemTypeForItemFieldName, getLocalConverter, isImmutableValueType, isReferenceable, lookupMapperOfType, realClass, realMember, serializedClass, serializedMember, shouldSerializeMember
public AttributeMapper(Mapper wrapped)
public AttributeMapper(Mapper wrapped, ConverterLookup converterLookup, ReflectionProvider refProvider)
public void setConverterLookup(ConverterLookup converterLookup)
public void addAttributeFor(Class type)
public SingleValueConverter getConverterFromItemType(String fieldName, Class type)
getConverterFromItemType(String, Class, Class)
getConverterFromItemType
in interface Mapper
getConverterFromItemType
in class MapperWrapper
public SingleValueConverter getConverterFromItemType(String fieldName, Class type, Class definedIn)
Mapper
getConverterFromItemType
in interface Mapper
getConverterFromItemType
in class MapperWrapper
fieldName
- the field nametype
- the field typedefinedIn
- the type which defines this fieldpublic boolean shouldLookForSingleValueConverter(String fieldName, Class type, Class definedIn)
public SingleValueConverter getConverterFromItemType(Class type)
getConverterFromItemType(String, Class, Class)
getConverterFromItemType
in interface Mapper
getConverterFromItemType
in class MapperWrapper
public SingleValueConverter getConverterFromAttribute(String attributeName)
getConverterFromAttribute(Class, String, Class)
getConverterFromAttribute
in interface Mapper
getConverterFromAttribute
in class MapperWrapper
public SingleValueConverter getConverterFromAttribute(Class definedIn, String attribute)
getConverterFromAttribute(Class, String, Class)
Mapper
getConverterFromAttribute
in interface Mapper
getConverterFromAttribute
in class MapperWrapper
definedIn
- the field's parentattribute
- the attribute namepublic SingleValueConverter getConverterFromAttribute(Class definedIn, String attribute, Class type)
Mapper
getConverterFromAttribute
in interface Mapper
getConverterFromAttribute
in class MapperWrapper
definedIn
- the field's parentattribute
- the attribute nametype
- the type the converter should createpublic void addAttributeFor(Field field)
field
- the field itselfpublic void addAttributeFor(Class definedIn, String fieldName)
definedIn
- the declaring class of the fieldfieldName
- the name of the fieldIllegalArgumentException
- if the field does not existCopyright © 2004–2016 XStream. All rights reserved.