class ArrayExtractor implements Extractor {

    public Object extractObject(ObjectToJsonConverter pConverter, Object pValue, Stack<String> pPathParts,boolean jsonify) throws AttributeNotFoundException {
        int length = pConverter.getCollectionLength(Array.getLength(pValue));
        String pathPart = pPathParts.isEmpty() ? null : pPathParts.pop();
        if (pathPart != null) {
            return extractWithPath(pConverter, pValue, pPathParts, jsonify, pathPart);
        } else {
            return jsonify ? extractArray(pConverter, pValue, pPathParts, jsonify, length) : pValue;
        }
    }

}