com.rt.storage.api.client.json.CustomizeJsonParser Maven / Gradle / Ivy
package com.rt.storage.api.client.json;
import com.rt.storage.api.client.util.Beta;
import java.lang.reflect.Field;
import java.util.Collection;
/**
* {@link Beta}
* Customizes the behavior of a JSON parser.
*
* All methods have a default trivial implementation, so subclasses need only implement the
* methods whose behavior needs customization.
*
*
Implementation has no fields and therefore thread-safe, but sub-classes are not necessarily
* thread-safe.
*
* @since 1.0
* @author Yaniv Inbar
*/
@Beta
public class CustomizeJsonParser {
/** Returns whether to stop parsing at the given key of the given context object. */
public boolean stopAt(Object context, String key) {
return false;
}
/** Called when the given unrecognized key is encountered in the given context object. */
public void handleUnrecognizedKey(Object context, String key) {}
/**
* Returns a new instance value for the given field in the given context object for a JSON array
* or {@code null} for the default behavior.
*/
public Collection