|
||||||||||
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. since 1.3 |
|
AttributeMapper(Mapper wrapped,
ConverterLookup converterLookup)
|
Method Summary | |
---|---|
void |
addAttributeFor(java.lang.Class type)
|
void |
addAttributeFor(java.lang.Class definedIn,
java.lang.String fieldName)
Tells this mapper to use an attribute for this field. |
void |
addAttributeFor(java.lang.reflect.Field field)
Tells this mapper to use an attribute for this field. |
void |
addAttributeFor(java.lang.String fieldName,
java.lang.Class type)
|
SingleValueConverter |
getConverterFromAttribute(java.lang.Class definedIn,
java.lang.String attribute)
Returns which converter to use for an specific attribute in a type. |
SingleValueConverter |
getConverterFromAttribute(java.lang.String attributeName)
Deprecated. since 1.3, use getConverterFromAttribute(Class, String) |
SingleValueConverter |
getConverterFromItemType(java.lang.Class type)
Deprecated. since 1.3, use getConverterFromItemType(String, Class, Class) |
SingleValueConverter |
getConverterFromItemType(java.lang.String fieldName,
java.lang.Class type)
Deprecated. since 1.3, use getConverterFromItemType(String, Class, Class) |
SingleValueConverter |
getConverterFromItemType(java.lang.String fieldName,
java.lang.Class type,
java.lang.Class definedIn)
Returns a single value converter to be used in a specific field. |
protected SingleValueConverter |
getLocalConverterFromItemType(java.lang.Class type)
|
void |
setConverterLookup(ConverterLookup converterLookup)
Deprecated. since 1.3 |
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)
Method Detail |
---|
public void setConverterLookup(ConverterLookup converterLookup)
public void addAttributeFor(java.lang.String fieldName, java.lang.Class type)
public void addAttributeFor(java.lang.Class type)
protected SingleValueConverter getLocalConverterFromItemType(java.lang.Class type)
public SingleValueConverter getConverterFromItemType(java.lang.String fieldName, java.lang.Class type)
getConverterFromItemType(String, Class, Class)
getConverterFromItemType
in interface Mapper
getConverterFromItemType
in class MapperWrapper
public SingleValueConverter getConverterFromItemType(java.lang.String fieldName, java.lang.Class type, java.lang.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 SingleValueConverter getConverterFromItemType(java.lang.Class type)
getConverterFromItemType(String, Class, Class)
getConverterFromItemType
in interface Mapper
getConverterFromItemType
in class MapperWrapper
public SingleValueConverter getConverterFromAttribute(java.lang.String attributeName)
getConverterFromAttribute(Class, String)
getConverterFromAttribute
in interface Mapper
getConverterFromAttribute
in class MapperWrapper
public SingleValueConverter getConverterFromAttribute(java.lang.Class definedIn, java.lang.String attribute)
Mapper
getConverterFromAttribute
in interface Mapper
getConverterFromAttribute
in class MapperWrapper
definedIn
- the field's parentattribute
- the attribute namepublic void addAttributeFor(java.lang.reflect.Field field)
field
- the field itselfpublic void addAttributeFor(java.lang.Class definedIn, java.lang.String fieldName)
definedIn
- the declaring class of the fieldfieldName
- the name of the field
java.lang.IllegalArgumentException
- if the field does not exist
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |