hudson.util.xstream
Class MapperDelegate

java.lang.Object
  extended by com.thoughtworks.xstream.mapper.MapperWrapper
      extended by hudson.util.xstream.MapperDelegate
All Implemented Interfaces:
com.thoughtworks.xstream.mapper.Mapper

public class MapperDelegate
extends com.thoughtworks.xstream.mapper.MapperWrapper

Works like MapperWrapper except it lets the subtype change the delegation target.

Since XStream caches the result of mapper pipeline, the kind of mutation and when you can do it is limited.

Author:
Kohsuke Kawaguchi

Nested Class Summary
 
Nested classes/interfaces inherited from interface com.thoughtworks.xstream.mapper.Mapper
com.thoughtworks.xstream.mapper.Mapper.ImplicitCollectionMapping, com.thoughtworks.xstream.mapper.Mapper.Null
 
Field Summary
protected  com.thoughtworks.xstream.mapper.Mapper delegate
           
 
Constructor Summary
MapperDelegate(com.thoughtworks.xstream.mapper.Mapper delegate)
           
 
Method Summary
 String aliasForAttribute(Class definedIn, String fieldName)
          Deprecated. since 1.3, use combination of serializedMember(Class, String) and getConverterFromItemType(String, Class, Class)
 String aliasForAttribute(String attribute)
           
 String aliasForSystemAttribute(String attribute)
           
 String attributeForAlias(Class definedIn, String alias)
          Deprecated. since 1.3, use combination of realMember(Class, String) and getConverterFromItemType(String, Class, Class)
 String attributeForAlias(String alias)
           
 Class defaultImplementationOf(Class type)
           
 com.thoughtworks.xstream.converters.SingleValueConverter getConverterFromAttribute(Class type, String attribute)
          Deprecated. since 1.3.1, use getConverterFromAttribute(Class, String, Class)
 com.thoughtworks.xstream.converters.SingleValueConverter getConverterFromAttribute(Class definedIn, String attribute, Class type)
           
 com.thoughtworks.xstream.converters.SingleValueConverter getConverterFromAttribute(String name)
          Deprecated. since 1.3, use getConverterFromAttribute(Class, String, Class)
 com.thoughtworks.xstream.converters.SingleValueConverter getConverterFromItemType(Class type)
          Deprecated. since 1.3, use getConverterFromItemType(String, Class, Class)
 com.thoughtworks.xstream.converters.SingleValueConverter getConverterFromItemType(String fieldName, Class type)
          Deprecated. since 1.3, use getConverterFromItemType(String, Class, Class)
 com.thoughtworks.xstream.converters.SingleValueConverter getConverterFromItemType(String fieldName, Class type, Class definedIn)
           
 String getFieldNameForItemTypeAndName(Class definedIn, Class itemType, String itemFieldName)
           
 com.thoughtworks.xstream.mapper.Mapper.ImplicitCollectionMapping getImplicitCollectionDefForFieldName(Class itemType, String fieldName)
           
 Class getItemTypeForItemFieldName(Class definedIn, String itemFieldName)
           
 com.thoughtworks.xstream.converters.Converter getLocalConverter(Class definedIn, String fieldName)
           
 boolean isImmutableValueType(Class type)
           
 com.thoughtworks.xstream.mapper.Mapper lookupMapperOfType(Class type)
           
 Class realClass(String elementName)
           
 String realMember(Class type, String serialized)
           
 String serializedClass(Class type)
           
 String serializedMember(Class type, String memberName)
           
 boolean shouldSerializeMember(Class definedIn, String fieldName)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

delegate

protected com.thoughtworks.xstream.mapper.Mapper delegate
Constructor Detail

MapperDelegate

public MapperDelegate(com.thoughtworks.xstream.mapper.Mapper delegate)
Method Detail

serializedClass

public String serializedClass(Class type)
Specified by:
serializedClass in interface com.thoughtworks.xstream.mapper.Mapper
Overrides:
serializedClass in class com.thoughtworks.xstream.mapper.MapperWrapper

realClass

public Class realClass(String elementName)
Specified by:
realClass in interface com.thoughtworks.xstream.mapper.Mapper
Overrides:
realClass in class com.thoughtworks.xstream.mapper.MapperWrapper

serializedMember

public String serializedMember(Class type,
                               String memberName)
Specified by:
serializedMember in interface com.thoughtworks.xstream.mapper.Mapper
Overrides:
serializedMember in class com.thoughtworks.xstream.mapper.MapperWrapper

realMember

public String realMember(Class type,
                         String serialized)
Specified by:
realMember in interface com.thoughtworks.xstream.mapper.Mapper
Overrides:
realMember in class com.thoughtworks.xstream.mapper.MapperWrapper

isImmutableValueType

public boolean isImmutableValueType(Class type)
Specified by:
isImmutableValueType in interface com.thoughtworks.xstream.mapper.Mapper
Overrides:
isImmutableValueType in class com.thoughtworks.xstream.mapper.MapperWrapper

defaultImplementationOf

public Class defaultImplementationOf(Class type)
Specified by:
defaultImplementationOf in interface com.thoughtworks.xstream.mapper.Mapper
Overrides:
defaultImplementationOf in class com.thoughtworks.xstream.mapper.MapperWrapper

aliasForAttribute

public String aliasForAttribute(String attribute)
Specified by:
aliasForAttribute in interface com.thoughtworks.xstream.mapper.Mapper
Overrides:
aliasForAttribute in class com.thoughtworks.xstream.mapper.MapperWrapper

attributeForAlias

public String attributeForAlias(String alias)
Specified by:
attributeForAlias in interface com.thoughtworks.xstream.mapper.Mapper
Overrides:
attributeForAlias in class com.thoughtworks.xstream.mapper.MapperWrapper

aliasForSystemAttribute

public String aliasForSystemAttribute(String attribute)
Specified by:
aliasForSystemAttribute in interface com.thoughtworks.xstream.mapper.Mapper
Overrides:
aliasForSystemAttribute in class com.thoughtworks.xstream.mapper.MapperWrapper

getFieldNameForItemTypeAndName

public String getFieldNameForItemTypeAndName(Class definedIn,
                                             Class itemType,
                                             String itemFieldName)
Specified by:
getFieldNameForItemTypeAndName in interface com.thoughtworks.xstream.mapper.Mapper
Overrides:
getFieldNameForItemTypeAndName in class com.thoughtworks.xstream.mapper.MapperWrapper

getItemTypeForItemFieldName

public Class getItemTypeForItemFieldName(Class definedIn,
                                         String itemFieldName)
Specified by:
getItemTypeForItemFieldName in interface com.thoughtworks.xstream.mapper.Mapper
Overrides:
getItemTypeForItemFieldName in class com.thoughtworks.xstream.mapper.MapperWrapper

getImplicitCollectionDefForFieldName

public com.thoughtworks.xstream.mapper.Mapper.ImplicitCollectionMapping getImplicitCollectionDefForFieldName(Class itemType,
                                                                                                             String fieldName)
Specified by:
getImplicitCollectionDefForFieldName in interface com.thoughtworks.xstream.mapper.Mapper
Overrides:
getImplicitCollectionDefForFieldName in class com.thoughtworks.xstream.mapper.MapperWrapper

shouldSerializeMember

public boolean shouldSerializeMember(Class definedIn,
                                     String fieldName)
Specified by:
shouldSerializeMember in interface com.thoughtworks.xstream.mapper.Mapper
Overrides:
shouldSerializeMember in class com.thoughtworks.xstream.mapper.MapperWrapper

getConverterFromItemType

public com.thoughtworks.xstream.converters.SingleValueConverter getConverterFromItemType(String fieldName,
                                                                                         Class type)
Deprecated. since 1.3, use getConverterFromItemType(String, Class, Class)

Specified by:
getConverterFromItemType in interface com.thoughtworks.xstream.mapper.Mapper
Overrides:
getConverterFromItemType in class com.thoughtworks.xstream.mapper.MapperWrapper

getConverterFromItemType

public com.thoughtworks.xstream.converters.SingleValueConverter getConverterFromItemType(Class type)
Deprecated. since 1.3, use getConverterFromItemType(String, Class, Class)

Specified by:
getConverterFromItemType in interface com.thoughtworks.xstream.mapper.Mapper
Overrides:
getConverterFromItemType in class com.thoughtworks.xstream.mapper.MapperWrapper

getConverterFromAttribute

public com.thoughtworks.xstream.converters.SingleValueConverter getConverterFromAttribute(String name)
Deprecated. since 1.3, use getConverterFromAttribute(Class, String, Class)

Specified by:
getConverterFromAttribute in interface com.thoughtworks.xstream.mapper.Mapper
Overrides:
getConverterFromAttribute in class com.thoughtworks.xstream.mapper.MapperWrapper

getLocalConverter

public com.thoughtworks.xstream.converters.Converter getLocalConverter(Class definedIn,
                                                                       String fieldName)
Specified by:
getLocalConverter in interface com.thoughtworks.xstream.mapper.Mapper
Overrides:
getLocalConverter in class com.thoughtworks.xstream.mapper.MapperWrapper

lookupMapperOfType

public com.thoughtworks.xstream.mapper.Mapper lookupMapperOfType(Class type)
Specified by:
lookupMapperOfType in interface com.thoughtworks.xstream.mapper.Mapper
Overrides:
lookupMapperOfType in class com.thoughtworks.xstream.mapper.MapperWrapper

getConverterFromItemType

public com.thoughtworks.xstream.converters.SingleValueConverter getConverterFromItemType(String fieldName,
                                                                                         Class type,
                                                                                         Class definedIn)
Specified by:
getConverterFromItemType in interface com.thoughtworks.xstream.mapper.Mapper
Overrides:
getConverterFromItemType in class com.thoughtworks.xstream.mapper.MapperWrapper

aliasForAttribute

public String aliasForAttribute(Class definedIn,
                                String fieldName)
Deprecated. since 1.3, use combination of serializedMember(Class, String) and getConverterFromItemType(String, Class, Class)

Specified by:
aliasForAttribute in interface com.thoughtworks.xstream.mapper.Mapper
Overrides:
aliasForAttribute in class com.thoughtworks.xstream.mapper.MapperWrapper

attributeForAlias

public String attributeForAlias(Class definedIn,
                                String alias)
Deprecated. since 1.3, use combination of realMember(Class, String) and getConverterFromItemType(String, Class, Class)

Specified by:
attributeForAlias in interface com.thoughtworks.xstream.mapper.Mapper
Overrides:
attributeForAlias in class com.thoughtworks.xstream.mapper.MapperWrapper

getConverterFromAttribute

public com.thoughtworks.xstream.converters.SingleValueConverter getConverterFromAttribute(Class type,
                                                                                          String attribute)
Deprecated. since 1.3.1, use getConverterFromAttribute(Class, String, Class)

Specified by:
getConverterFromAttribute in interface com.thoughtworks.xstream.mapper.Mapper
Overrides:
getConverterFromAttribute in class com.thoughtworks.xstream.mapper.MapperWrapper

getConverterFromAttribute

public com.thoughtworks.xstream.converters.SingleValueConverter getConverterFromAttribute(Class definedIn,
                                                                                          String attribute,
                                                                                          Class type)
Specified by:
getConverterFromAttribute in interface com.thoughtworks.xstream.mapper.Mapper
Overrides:
getConverterFromAttribute in class com.thoughtworks.xstream.mapper.MapperWrapper


Copyright © 2004-2013. All Rights Reserved.