class ArrayCodecFactory implements CodecFactory {

    @SuppressWarnings("unchecked")
    public <T> Codec<T> create(AnnotatedElement metadata, Class<T> type,
                               ResolverContext context) {
        BoundList settings = null;
        if (metadata != null
                && (settings = metadata.getAnnotation(BoundList.class)) != null
                && type.isArray()
                && settings.size() != null
                && settings.size().length() != 0) {
            Expression<Integer, Resolver> expr = getSizeExpression(settings,
                    context);
            Codec<Object> elementCodec = null;
            if (type.getComponentType().isPrimitive()) {
                elementCodec = (Codec<Object>) factory.create(null, type
                        .getComponentType(), context);
            } else {
                BoundObject objectSettings = getObjectSettings(settings);
                elementCodec = (Codec<Object>) factory.create(
                        new AnnotationWrapper(objectSettings), type
                                .getComponentType(), context);
            }
            return (Codec<T>) new ArrayCodec(expr, elementCodec, type);
        } else {
            return null;
        }

    }

    public  ArrayCodecFactory(CodecFactory delegate);

}