/// <inheritdoc />
        public override IASSourceMapper GetASSourceMapper(ASSourceMappingDescriptor descriptor)
        {
            foreach (PrimitiveMapper mapper in mappers)
                if (mapper.SupportsSourceMapping(descriptor))
                    return mapper;

            return null;
        }
        /// <inheritdoc />
        public override IASSourceMapper GetASSourceMapper(ASSourceMappingDescriptor descriptor)
        {
            if (descriptor.SourceKind == ASTypeKind.Object)
            {
                ActionScriptClassMapping classMapping = mappingTable.GetClassMappingByAlias(descriptor.SourceClassAlias);
                if (classMapping != null && descriptor.TargetNativeType.IsAssignableFrom(classMapping.NativeType))
                {
                    return new ObjectMapper(classMapping);
                }
            }

            return null;
        }
        /// <summary>
        /// Gets an ActionScript source mapper that satisfies the specified descriptor.
        /// </summary>
        /// <param name="descriptor">The source mapping descriptor</param>
        /// <returns>The ActionScript target mapper, or null if no compatible mapper can be obtained by any registered factory</returns>
        public IASSourceMapper GetASSourceMapper(ASSourceMappingDescriptor descriptor)
        {
            lock (syncRoot)
            {
                IASSourceMapper mapper;
                if (!sourceMapperCache.TryGetValue(descriptor, out mapper))
                {
                    foreach (IASMapperFactory factory in mapperFactories)
                    {
                        mapper = factory.GetASSourceMapper(descriptor);
                        if (mapper != null)
                            break;
                    }

                    sourceMapperCache.Add(descriptor, mapper);
                }

                return mapper;
            }
        }
 /// <summary>
 /// Gets an ActionScript source mapper that satisfies the specified descriptor.
 /// </summary>
 /// <param name="descriptor">The source mapping descriptor</param>
 /// <returns>The ActionScript target mapper, or null if no compatible mapper can be obtained by this factory</returns>
 public virtual IASSourceMapper GetASSourceMapper(ASSourceMappingDescriptor descriptor)
 {
     return null;
 }
 public override bool SupportsSourceMapping(ASSourceMappingDescriptor descriptor)
 {
     ASTypeKind sourceKind = descriptor.SourceKind;
     return descriptor.TargetNativeType.IsEnum
         && (sourceKind == ASTypeKind.Int29 || sourceKind == ASTypeKind.Number || sourceKind == ASTypeKind.String);
 }
            public virtual bool SupportsSourceMapping(ASSourceMappingDescriptor descriptor)
            {
                // Note: Use strict equality here because we don't want to use 
                //       most primitive mappings if the result type is underspecified.
                //       How would we know whether to map to "int" or "long"?  The mapping
                //       would be ambiguous!  Instead we handle this case with default native type
                //       mappings elsewhere.
                if (descriptor.TargetNativeType == type)
                {
                    foreach (ASTypeKind kind in kinds)
                        if (descriptor.SourceKind == kind)
                            return true;
                }

                return false;
            }