public class JsonTokenizer
extends org.apache.lucene.analysis.Tokenizer
The tokenizer parses JSON data and generates a token for each field name and each value. The tokenizer attaches a node label and a datatype to each token.
Regarding datatype, the convention is the following:
JSONDatatype.JSON_FIELD is assigned;
XSDDatatype.XSD_STRING is assigned;
XSDDatatype.XSD_BOOLEAN is assigned;
XSDDatatype.XSD_LONG is assigned;
XSDDatatype.XSD_DOUBLE is assigned;
| Modifier and Type | Field and Description |
|---|---|
static String |
DATATYPE_LABEL
Datatype JSON schema: field for the datatype label
|
static String |
DATATYPE_VALUES
Datatype JSON schema: field for the datatype value
|
static int |
FALSE |
static int |
LITERAL |
static int |
NULL
Token Definition
|
static int |
NUMBER |
protected static String[] |
TOKEN_TYPES |
static int |
TRUE |
| Constructor and Description |
|---|
JsonTokenizer(Reader input) |
| Modifier and Type | Method and Description |
|---|---|
void |
close() |
static String[] |
getTokenTypes() |
boolean |
incrementToken() |
void |
reset() |
addAttribute, addAttributeImpl, captureState, clearAttributes, cloneAttributes, copyTo, equals, getAttribute, getAttributeClassesIterator, getAttributeFactory, getAttributeImplsIterator, hasAttribute, hasAttributes, hashCode, reflectAsString, reflectWith, restoreStatepublic static final int NULL
public static final int TRUE
public static final int FALSE
public static final int NUMBER
public static final int LITERAL
public static final String DATATYPE_LABEL
public static final String DATATYPE_VALUES
protected static String[] TOKEN_TYPES
public JsonTokenizer(Reader input)
public static String[] getTokenTypes()
public final boolean incrementToken()
throws IOException
incrementToken in class org.apache.lucene.analysis.TokenStreamIOExceptionpublic void reset()
throws IOException
reset in class org.apache.lucene.analysis.TokenStreamIOExceptionpublic void close()
throws IOException
close in interface Closeableclose in interface AutoCloseableclose in class org.apache.lucene.analysis.TokenizerIOExceptionCopyright © 2014. All rights reserved.