Top Inners Fields Constructors Methods
com.thoughtworks.xstream.mapper

public Class ImplicitCollectionMapper

extends MapperWrapper
Class Inheritance
Imports
com.thoughtworks.xstream.InitializationException, com.thoughtworks.xstream.converters.reflection.ReflectionProvider, com.thoughtworks.xstream.core.util.Primitives, java.lang.reflect.Field, .Modifier, java.util.Collection, .HashMap, .Iterator, .Map

Nested and Inner Type Summary

Modifier and TypeClass and Description
private class
private static class
private static class

Field Summary

Modifier and TypeField and Description
private final Map<K, V>
private ReflectionProvider

Constructor Summary

AccessConstructor and Description
public
ImplicitCollectionMapper(Mapper wrapped, ReflectionProvider reflectionProvider)

Method Summary

Modifier and TypeMethod and Description
public void
add(Class<T> definedIn, String fieldName, Class<T> itemType)

public void
add(Class<T> definedIn, String fieldName, String itemFieldName, Class<T> itemType)

public void
add(Class<T> definedIn, String fieldName, String itemFieldName, Class<T> itemType, String keyFieldName)

public String
getFieldNameForItemTypeAndName(Class<T>
owning type
definedIn
,
Class<T>
item type
itemType
,
String
optional item element name
itemFieldName
)

Overrides com.thoughtworks.xstream.mapper.MapperWrapper.getFieldNameForItemTypeAndName.

Implements com.thoughtworks.xstream.mapper.Mapper.getFieldNameForItemTypeAndName.

Get the name of the field that acts as the default collection for an object, or return null if there is none.
public Mapper.ImplicitCollectionMapping
public Class<T>
private ImplicitCollectionMapper.ImplicitCollectionMapperForClass
getMapper(final Class<T> declaredFor, final String fieldName)

private ImplicitCollectionMapper.ImplicitCollectionMapperForClass
getOrCreateMapper(Class<T> definedIn)

Inherited from com.thoughtworks.xstream.mapper.MapperWrapper:
aliasForAttributealiasForAttributealiasForSystemAttributeattributeForAliasattributeForAliasdefaultImplementationOfgetConverterFromAttributegetConverterFromAttributegetConverterFromAttributegetConverterFromItemTypegetConverterFromItemTypegetConverterFromItemTypegetLocalConverterisIgnoredElementisImmutableValueTypeisReferenceablelookupMapperOfTyperealClassrealMemberserializedClassserializedMembershouldSerializeMember

Field Detail

classNameToMapperback to summary
private final Map<K, V> classNameToMapper
reflectionProviderback to summary
private ReflectionProvider reflectionProvider

Constructor Detail

ImplicitCollectionMapperback to summary
public ImplicitCollectionMapper(Mapper wrapped, ReflectionProvider reflectionProvider)

Method Detail

addback to summary
public void add(Class<T> definedIn, String fieldName, Class<T> itemType)
addback to summary
public void add(Class<T> definedIn, String fieldName, String itemFieldName, Class<T> itemType)
addback to summary
public void add(Class<T> definedIn, String fieldName, String itemFieldName, Class<T> itemType, String keyFieldName)
getFieldNameForItemTypeAndNameback to summary
public String getFieldNameForItemTypeAndName(Class<T> definedIn, Class<T> itemType, String itemFieldName)

Overrides com.thoughtworks.xstream.mapper.MapperWrapper.getFieldNameForItemTypeAndName.

Implements com.thoughtworks.xstream.mapper.Mapper.getFieldNameForItemTypeAndName.

Doc from com.thoughtworks.xstream.mapper.Mapper.getFieldNameForItemTypeAndName.

Get the name of the field that acts as the default collection for an object, or return null if there is none.

Parameters
definedIn:Class<T>

owning type

itemType:Class<T>

item type

itemFieldName:String

optional item element name

getImplicitCollectionDefForFieldNameback to summary
public Mapper.ImplicitCollectionMapping getImplicitCollectionDefForFieldName(Class<T> itemType, String fieldName)

Overrides com.thoughtworks.xstream.mapper.MapperWrapper.getImplicitCollectionDefForFieldName.

Implements com.thoughtworks.xstream.mapper.Mapper.getImplicitCollectionDefForFieldName.

getItemTypeForItemFieldNameback to summary
public Class<T> getItemTypeForItemFieldName(Class<T> definedIn, String itemFieldName)

Overrides com.thoughtworks.xstream.mapper.MapperWrapper.getItemTypeForItemFieldName.

Implements com.thoughtworks.xstream.mapper.Mapper.getItemTypeForItemFieldName.

getMapperback to summary
private ImplicitCollectionMapper.ImplicitCollectionMapperForClass getMapper(final Class<T> declaredFor, final String fieldName)
getOrCreateMapperback to summary
private ImplicitCollectionMapper.ImplicitCollectionMapperForClass getOrCreateMapper(Class<T> definedIn)
com.thoughtworks.xstream.mapper back to summary

private Class ImplicitCollectionMapper.ImplicitCollectionMapperForClass

extends Object
Class Inheritance
  • java.lang.Object
  • com.thoughtworks.xstream.mapper.ImplicitCollectionMapper.ImplicitCollectionMapperForClass

Field Summary

Modifier and TypeField and Description
private Class<T>
private Map<K, V>
private Map<K, V>
private Map<K, V>

Constructor Summary

AccessConstructor and Description
pack-priv

Method Summary

Modifier and TypeMethod and Description
public void
public String
getFieldNameForItemTypeAndName(Class<T> itemType, String itemFieldName)

private ImplicitCollectionMapper.ImplicitCollectionMappingImpl
public Mapper.ImplicitCollectionMapping
public Class<T>
Inherited from java.lang.Object:
cloneequalsfinalizegetClasshashCodenotifynotifyAlltoStringwaitwaitwait

Field Detail

definedInback to summary
private Class<T> definedIn
fieldNameToDefback to summary
private Map<K, V> fieldNameToDef
itemFieldNameToDefback to summary
private Map<K, V> itemFieldNameToDef
namedItemTypeToDefback to summary
private Map<K, V> namedItemTypeToDef

Constructor Detail

ImplicitCollectionMapperForClassback to summary
pack-priv ImplicitCollectionMapperForClass(Class<T> definedIn)

Method Detail

addback to summary
public void add(ImplicitCollectionMapper.ImplicitCollectionMappingImpl def)
getFieldNameForItemTypeAndNameback to summary
public String getFieldNameForItemTypeAndName(Class<T> itemType, String itemFieldName)
getImplicitCollectionDefByItemFieldNameback to summary
private ImplicitCollectionMapper.ImplicitCollectionMappingImpl getImplicitCollectionDefByItemFieldName(String itemFieldName)
getImplicitCollectionDefForFieldNameback to summary
public Mapper.ImplicitCollectionMapping getImplicitCollectionDefForFieldName(String fieldName)
getItemTypeForItemFieldNameback to summary
public Class<T> getItemTypeForItemFieldName(String itemFieldName)
com.thoughtworks.xstream.mapper back to summary

private Class ImplicitCollectionMapper.ImplicitCollectionMappingImpl

extends Object
implements ImplicitCollectionMapping
Class Inheritance
  • java.lang.Object
  • com.thoughtworks.xstream.mapper.ImplicitCollectionMapper.ImplicitCollectionMappingImpl
All Implemented Interfaces
com.thoughtworks.xstream.mapper.Mapper.ImplicitCollectionMapping

Field Summary

Modifier and TypeField and Description
private final String
private final String
private final Class<T>
private final String

Constructor Summary

AccessConstructor and Description
pack-priv
ImplicitCollectionMappingImpl(String fieldName, Class<T> itemType, String itemFieldName, String keyFieldName)

Method Summary

Modifier and TypeMethod and Description
public ImplicitCollectionMapper.NamedItemType
public String
public String
public Class<T>
public String
Inherited from java.lang.Object:
cloneequalsfinalizegetClasshashCodenotifynotifyAlltoStringwaitwaitwait

Field Detail

fieldNameback to summary
private final String fieldName
itemFieldNameback to summary
private final String itemFieldName
itemTypeback to summary
private final Class<T> itemType
keyFieldNameback to summary
private final String keyFieldName

Constructor Detail

ImplicitCollectionMappingImplback to summary
pack-priv ImplicitCollectionMappingImpl(String fieldName, Class<T> itemType, String itemFieldName, String keyFieldName)

Method Detail

createNamedItemTypeback to summary
public ImplicitCollectionMapper.NamedItemType createNamedItemType()
getFieldNameback to summary
public String getFieldName()

Implements com.thoughtworks.xstream.mapper.Mapper.ImplicitCollectionMapping.getFieldName.

getItemFieldNameback to summary
public String getItemFieldName()

Implements com.thoughtworks.xstream.mapper.Mapper.ImplicitCollectionMapping.getItemFieldName.

getItemTypeback to summary
public Class<T> getItemType()

Implements com.thoughtworks.xstream.mapper.Mapper.ImplicitCollectionMapping.getItemType.

getKeyFieldNameback to summary
public String getKeyFieldName()

Implements com.thoughtworks.xstream.mapper.Mapper.ImplicitCollectionMapping.getKeyFieldName.

com.thoughtworks.xstream.mapper back to summary

private Class ImplicitCollectionMapper.NamedItemType

extends Object
Class Inheritance
  • java.lang.Object
  • com.thoughtworks.xstream.mapper.ImplicitCollectionMapper.NamedItemType

Field Summary

Modifier and TypeField and Description
pack-priv String
pack-priv Class<T>

Constructor Summary

AccessConstructor and Description
pack-priv
NamedItemType(Class<T> itemType, String itemFieldName)

Method Summary

Modifier and TypeMethod and Description
public boolean
equals(Object
the reference object with which to compare.
obj
)

Overrides java.lang.Object.equals.

Indicates whether some other object is "equal to" this one.
public int
hashCode()

Overrides java.lang.Object.hashCode.

Returns a hash code value for the object.
private static boolean
Inherited from java.lang.Object:
clonefinalizegetClassnotifynotifyAlltoStringwaitwaitwait

Field Detail

itemFieldNameback to summary
pack-priv String itemFieldName
itemTypeback to summary
pack-priv Class<T> itemType

Constructor Detail

NamedItemTypeback to summary
pack-priv NamedItemType(Class<T> itemType, String itemFieldName)

Method Detail

equalsback to summary
public boolean equals(Object obj)

Overrides java.lang.Object.equals.

Doc from java.lang.Object.equals.

Indicates whether some other object is "equal to" this one.

The equals method implements an equivalence relation on non-null object references:

  • It is reflexive: for any non-null reference value x, x.equals(x) should return true.
  • It is symmetric: for any non-null reference values x and y, x.equals(y) should return true if and only if y.equals(x) returns true.
  • It is transitive: for any non-null reference values x, y, and z, if x.equals(y) returns true and y.equals(z) returns true, then x.equals(z) should return true.
  • It is consistent: for any non-null reference values x and y, multiple invocations of x.equals(y) consistently return true or consistently return false, provided no information used in equals comparisons on the objects is modified.
  • For any non-null reference value x, x.equals(null) should return false.

An equivalence relation partitions the elements it operates on into equivalence classes; all the members of an equivalence class are equal to each other. Members of an equivalence class are substitutable for each other, at least for some purposes.

Parameters
obj:Object

the reference object with which to compare.

Returns:boolean

true if this object is the same as the obj argument; false otherwise.

hashCodeback to summary
public int hashCode()

Overrides java.lang.Object.hashCode.

Doc from java.lang.Object.hashCode.

Returns a hash code value for the object. This method is supported for the benefit of hash tables such as those provided by java.util.HashMap.

The general contract of hashCode is:

  • Whenever it is invoked on the same object more than once during an execution of a Java application, the hashCode method must consistently return the same integer, provided no information used in equals comparisons on the object is modified. This integer need not remain consistent from one execution of an application to another execution of the same application.
  • If two objects are equal according to the equals method, then calling the hashCode method on each of the two objects must produce the same integer result.
  • It is not required that if two objects are unequal according to the equals method, then calling the hashCode method on each of the two objects must produce distinct integer results. However, the programmer should be aware that producing distinct integer results for unequal objects may improve the performance of hash tables.
Returns:int

a hash code value for this object.

isEqualsback to summary
private static boolean isEquals(Object a, Object b)