Class 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
    • 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

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

        @Deprecated
        public com.thoughtworks.xstream.converters.SingleValueConverter getConverterFromItemType​(Class type)
        Specified by:
        getConverterFromItemType in interface com.thoughtworks.xstream.mapper.Mapper
        Overrides:
        getConverterFromItemType in class com.thoughtworks.xstream.mapper.MapperWrapper
      • getConverterFromAttribute

        @Deprecated
        public com.thoughtworks.xstream.converters.SingleValueConverter getConverterFromAttribute​(String name)
        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
      • getConverterFromAttribute

        @Deprecated
        public com.thoughtworks.xstream.converters.SingleValueConverter getConverterFromAttribute​(Class type,
                                                                                                  String attribute)
        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
      • isIgnoredElement

        public boolean isIgnoredElement​(String name)
        Specified by:
        isIgnoredElement in interface com.thoughtworks.xstream.mapper.Mapper
        Overrides:
        isIgnoredElement in class com.thoughtworks.xstream.mapper.MapperWrapper
      • isReferenceable

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