// Path: framework/src/main/java/com/kifile/android/cornerstone/core/AbstractFetcherConverter.java
// public abstract class AbstractFetcherConverter<FROM, TO> implements DataFetcher<TO> {
// 
//     private DataFetcher<FROM> mProxy;
// 
//     /**
//      * Wrap the DataFetcher will be transformed.
//      *
//      * @param proxy
//      */
//     public AbstractFetcherConverter(DataFetcher<FROM> proxy) {
//         mProxy = proxy;
//     }
// 
//     @Override
//     public TO fetch() throws FetchException, ConvertException {
//         FROM data = mProxy.fetch();
//         if (data == null) {
//             throw new FetchException("Proxy return null.");
//         }
//         return convert(data);
//     }
// 
//     protected abstract TO convert(@NonNull FROM from) throws ConvertException;
// 
// }
// 
// Path: framework/src/main/java/com/kifile/android/cornerstone/core/ConvertException.java
// public class ConvertException extends Exception {
// 
//     private Object o;
// 
//     public ConvertException() {
//     }
// 
//     public ConvertException(String detailMessage) {
//         super(detailMessage);
//     }
// 
//     public ConvertException(String detailMessage, Throwable throwable) {
//         super(detailMessage, throwable);
//     }
// 
//     public ConvertException(Throwable throwable) {
//         super(throwable);
//     }
// 
//     public void setError(Object error) {
//         o = error;
//     }
// 
//     public Object getError() {
//         return o;
//     }
// }
// 
// Path: framework/src/main/java/com/kifile/android/cornerstone/core/DataFetcher.java
// public interface DataFetcher<DATA> {
// 
//     /**
//      * Fetch data.
//      *
//      * @return If fetch successful, return the data.
//      * @throws FetchException   Throw FetchException when you cannot fetch a data.
//      * @throws ConvertException Throw ConvertException when you cannot convert the data to another type.
//      */
//     DATA fetch() throws FetchException, ConvertException;
// }


import android.support.annotation.NonNull;
import com.kifile.android.cornerstone.core.AbstractFetcherConverter;
import com.kifile.android.cornerstone.core.ConvertException;
import com.kifile.android.cornerstone.core.DataFetcher;
import org.json.JSONArray;
import org.json.JSONException;
package com.kifile.android.cornerstone.impl.fetchers;




/**
 * Convert String to JSONArray.
 *
 * @author kifile
 */
public class String2JSONArrayConverter extends AbstractFetcherConverter<String, JSONArray> {

    public String2JSONArrayConverter(DataFetcher<String> proxy) {
        super(proxy);
    }

    @Override
// Path: framework/src/main/java/com/kifile/android/cornerstone/core/AbstractFetcherConverter.java
// public abstract class AbstractFetcherConverter<FROM, TO> implements DataFetcher<TO> {
// 
//     private DataFetcher<FROM> mProxy;
// 
//     /**
//      * Wrap the DataFetcher will be transformed.
//      *
//      * @param proxy
//      */
//     public AbstractFetcherConverter(DataFetcher<FROM> proxy) {
//         mProxy = proxy;
//     }
// 
//     @Override
//     public TO fetch() throws FetchException, ConvertException {
//         FROM data = mProxy.fetch();
//         if (data == null) {
//             throw new FetchException("Proxy return null.");
//         }
//         return convert(data);
//     }
// 
//     protected abstract TO convert(@NonNull FROM from) throws ConvertException;
// 
// }
// 
// Path: framework/src/main/java/com/kifile/android/cornerstone/core/ConvertException.java
// public class ConvertException extends Exception {
// 
//     private Object o;
// 
//     public ConvertException() {
//     }
// 
//     public ConvertException(String detailMessage) {
//         super(detailMessage);
//     }
// 
//     public ConvertException(String detailMessage, Throwable throwable) {
//         super(detailMessage, throwable);
//     }
// 
//     public ConvertException(Throwable throwable) {
//         super(throwable);
//     }
// 
//     public void setError(Object error) {
//         o = error;
//     }
// 
//     public Object getError() {
//         return o;
//     }
// }
// 
// Path: framework/src/main/java/com/kifile/android/cornerstone/core/DataFetcher.java
// public interface DataFetcher<DATA> {
// 
//     /**
//      * Fetch data.
//      *
//      * @return If fetch successful, return the data.
//      * @throws FetchException   Throw FetchException when you cannot fetch a data.
//      * @throws ConvertException Throw ConvertException when you cannot convert the data to another type.
//      */
//     DATA fetch() throws FetchException, ConvertException;
// }


// Path: framework/src/main/java/com/kifile/android/cornerstone/impl/fetchers/String2JSONArrayConverter.java
import android.support.annotation.NonNull;
import com.kifile.android.cornerstone.core.AbstractFetcherConverter;
import com.kifile.android.cornerstone.core.ConvertException;
import com.kifile.android.cornerstone.core.DataFetcher;
import org.json.JSONArray;
import org.json.JSONException;

package com.kifile.android.cornerstone.impl.fetchers;




/**
 * Convert String to JSONArray.
 *
 * @author kifile
 */
public class String2JSONArrayConverter extends AbstractFetcherConverter<String, JSONArray> {

    public String2JSONArrayConverter(DataFetcher<String> proxy) {
        super(proxy);
    }

    @Override
    protected JSONArray convert(@NonNull String s) throws ConvertException {