* {@inheritDoc}
*/
@Override
protected IManagedType resolveManagedType(IMapping mapping) {
ITypeDeclaration typeDeclaration = mapping.getTypeDeclaration();
IType type = typeDeclaration.getType();
// Collection type cannot be traversed
if (getTypeHelper().isCollectionType(type)) {
ITypeDeclaration[] typeParameters = typeDeclaration.getTypeParameters();
if (typeParameters.length == 0) {
return null;
}
type = typeParameters[0].getType();
}
// Wrap the Map into a virtual IManagedType so it can be returned and the
// IType for the Map can be used to retrieve the type of the key and value
else if (getTypeHelper().isMapType(type)) {
ITypeDeclaration[] typeParameters = typeDeclaration.getTypeParameters();
if (typeParameters.length != 2) {
return null;
}
type = typeParameters[1].getType();
}