com.landawn.abacus.parser.JSONParser Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of abacus-common Show documentation
Show all versions of abacus-common Show documentation
A general programming library in Java/Android. It's easy to learn and simple to use with concise and powerful APIs.
/*
* Copyright (C) 2015 HaiYang Li
*
* Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except
* in compliance with the License. You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software distributed under the License
* is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express
* or implied. See the License for the specific language governing permissions and limitations under
* the License.
*/
package com.landawn.abacus.parser;
import java.io.File;
import java.io.IOException;
import java.io.InputStream;
import java.io.Reader;
import java.util.Collection;
import java.util.Map;
import com.landawn.abacus.util.ExceptionalStream;
/**
*
* @author Haiyang Li
* @since 0.8
*/
public interface JSONParser extends Parser {
/**
*
* @param
* @param targetClass
* @param str
* @return
*/
T readString(Class targetClass, String str);
/**
*
* @param
* @param targetClass
* @param str
* @param config
* @return
*/
T readString(Class targetClass, String str, JSONDeserializationConfig config);
/**
*
* @param outResult
* @param str
*/
void readString(Object[] outResult, String str);
/**
*
* @param outResult
* @param str
* @param config
*/
void readString(Object[] outResult, String str, JSONDeserializationConfig config);
/**
*
* @param outResult
* @param str
*/
void readString(Collection> outResult, String str);
/**
*
* @param outResult
* @param str
* @param config
*/
void readString(Collection> outResult, String str, JSONDeserializationConfig config);
/**
*
* @param outResult
* @param str
*/
void readString(Map, ?> outResult, String str);
/**
*
* @param outResult
* @param str
* @param config
*/
void readString(Map, ?> outResult, String str, JSONDeserializationConfig config);
/**
*
* @param
* @param targetClass
* @param str
* @param fromIndex
* @param toIndex
* @return
*/
T deserialize(Class targetClass, String str, int fromIndex, int toIndex);
/**
*
* @param
* @param targetClass
* @param str
* @param fromIndex
* @param toIndex
* @param config
* @return
*/
T deserialize(Class targetClass, String str, int fromIndex, int toIndex, JSONDeserializationConfig config);
/**
*
* @param
* @param elementClass Only Entity/Map/Collection/Array/DataSet element types are supported at present.
* @param source
* @return
*/
ExceptionalStream stream(Class elementClass, String source);
/**
*
* @param
* @param elementClass Only Entity/Map/Collection/Array/DataSet element types are supported at present.
* @param source
* @param config
* @return
*/
ExceptionalStream stream(Class elementClass, String source, JSONDeserializationConfig config);
/**
*
* @param
* @param elementClass Only Entity/Map/Collection/Array/DataSet element types are supported at present.
* @param source
* @return
*/
ExceptionalStream stream(Class elementClass, File source);
/**
*
* @param
* @param elementClass Only Entity/Map/Collection/Array/DataSet element types are supported at present.
* @param source
* @param config
* @return
*/
ExceptionalStream stream(Class elementClass, File source, JSONDeserializationConfig config);
/**
*
* @param
* @param elementClass Only Entity/Map/Collection/Array/DataSet element types are supported at present.
* @param source
* @param closeInputStreamWhenStreamIsClosed
* @return
*/
ExceptionalStream stream(Class elementClass, InputStream source, boolean closeInputStreamWhenStreamIsClosed);
/**
*
* @param
* @param elementClass Only Entity/Map/Collection/Array/DataSet element types are supported at present.
* @param source
* @param closeInputStreamWhenStreamIsClosed
* @param config
* @return
*/
ExceptionalStream stream(Class elementClass, InputStream source, boolean closeInputStreamWhenStreamIsClosed,
JSONDeserializationConfig config);
/**
*
* @param
* @param elementClass Only Entity/Map/Collection/Array/DataSet element types are supported at present.
* @param source
* @param closeReaderWhenStreamIsClosed
* @return
*/
ExceptionalStream stream(Class elementClass, Reader source, boolean closeReaderWhenStreamIsClosed);
/**
*
* @param
* @param elementClass Only Entity/Map/Collection/Array/DataSet element types are supported at present.
* @param source
* @param closeReaderWhenStreamIsClosed
* @param config
* @return
*/
ExceptionalStream stream(Class elementClass, Reader source, boolean closeReaderWhenStreamIsClosed, JSONDeserializationConfig config);
}