public static RuntimeFieldFactory<?> getFieldFactory(Class<?> clazz,
            IdStrategy strategy)
    {
        if (strategy.isDelegateRegistered(clazz))
            return DELEGATE;

        final RuntimeFieldFactory<?> inline = __inlineValues.get(clazz
                .getName());
        if (inline != null)
            return inline;

        if (Message.class.isAssignableFrom(clazz))
            return POJO;

        if (clazz.isEnum())
            return ENUM;

        // Of all the scalar (inline) fields, java.lang.Number is the only
        // abstract
        // super type, hence we can filter it here
        // Note that it has 10 built-in subtypes
        if (clazz.isArray() || Object.class == clazz || Number.class == clazz
                || Class.class == clazz || Enum.class == clazz
                || Throwable.class.isAssignableFrom(clazz))
        {
            return OBJECT;
        }
        
        if (strategy.isRegistered(clazz))
            return clazz.isInterface() ? POJO : POLYMORPHIC_POJO;
        
        if (Map.class.isAssignableFrom(clazz))
            return RuntimeMapFieldFactory.MAP;

        if (Collection.class.isAssignableFrom(clazz))
        {
            // repeated fields.
            return COLLECTION;
        }

        // Enums or boxed types of primitives do implement interfaces.
        // Although serializing polymorphic pojos declared as interfaces will be
        // a
        // little bit slower than before, this is more correct.
        //
        // In versions prior to 1.0.5, it would serialize a field declared as
        // java.lang.Serializable like a polymorphic pojo even though it
        // gets assigned enum/string/number types.
        //
        // If you have declared fields as serializable, it wont be compatible
        if (clazz.isInterface())
            return OBJECT;

        // checks delegated to POLYMORPHIC_POJO
        return POLYMORPHIC_POJO;
    }
public static RuntimeFieldFactory < ? > getFieldFactory ( Class < ? > clazz , IdStrategy strategy ) { if ( strategy . isDelegateRegistered ( clazz ) ) return DELEGATE ; final RuntimeFieldFactory < ? > inline = __inlineValues . get ( clazz . getName ( ) ) ; if ( inline != null ) return inline ; if ( Message . class . isAssignableFrom ( clazz ) ) return POJO ; if ( clazz . isEnum ( ) ) return ENUM ; if ( clazz . isArray ( ) || Object . class == clazz || Number . class == clazz || Class . class == clazz || Enum . class == clazz || Throwable . class . isAssignableFrom ( clazz ) ) { return OBJECT ; } if ( strategy . isRegistered ( clazz ) ) return clazz . isInterface ( ) ? POJO : POLYMORPHIC_POJO ; if ( Map . class . isAssignableFrom ( clazz ) ) return RuntimeMapFieldFactory . MAP ; if ( Collection . class . isAssignableFrom ( clazz ) ) { return COLLECTION ; } if ( clazz . isInterface ( ) ) return OBJECT ; return POLYMORPHIC_POJO ; }
Gets the runtime field factory of the given {@code clazz}.