|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectcom.thoughtworks.xstream.mapper.MapperWrapper
com.thoughtworks.xstream.mapper.AttributeMapper
public class AttributeMapper
Mapper that allows the usage of attributes for fields and corresponding
types or specified arbitrary types. It is responsible for the lookup of the
SingleValueConverter
for item types and attribute names.
Nested Class Summary |
---|
Nested classes/interfaces inherited from interface com.thoughtworks.xstream.mapper.Mapper |
---|
Mapper.ImplicitCollectionMapping, Mapper.Null |
Constructor Summary | |
---|---|
AttributeMapper(Mapper wrapped)
Deprecated. As of 1.3 |
|
AttributeMapper(Mapper wrapped,
ConverterLookup converterLookup,
ReflectionProvider refProvider)
|
Methods inherited from class com.thoughtworks.xstream.mapper.MapperWrapper |
---|
aliasForAttribute, aliasForAttribute, aliasForSystemAttribute, attributeForAlias, attributeForAlias, defaultImplementationOf, getFieldNameForItemTypeAndName, getImplicitCollectionDefForFieldName, getItemTypeForItemFieldName, getLocalConverter, isImmutableValueType, lookupMapperOfType, realClass, realMember, serializedClass, serializedMember, shouldSerializeMember |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public AttributeMapper(Mapper wrapped)
public AttributeMapper(Mapper wrapped, ConverterLookup converterLookup, ReflectionProvider refProvider)
Method Detail |
---|
public void setConverterLookup(ConverterLookup converterLookup)
public void addAttributeFor(String fieldName, Class type)
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 field
public 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 field
IllegalArgumentException
- if the field does not exist
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |