Share via


MappingCharFilter Class

public final class MappingCharFilter
extends CharFilter

A character filter that applies mappings defined with the mappings option. Matching is greedy (longest pattern matching at a given point wins). Replacement is allowed to be the empty string. This character filter is implemented using Apache Lucene.

Constructor Summary

Constructor Description
MappingCharFilter(String name, List<String> mappings)

Creates an instance of MappingCharFilter class.

Method Summary

Modifier and Type Method and Description
static MappingCharFilter fromJson(JsonReader jsonReader)

Reads an instance of MappingCharFilter from the JsonReader.

List<String> getMappings()

Get the mappings property: A list of mappings of the following format: "a=>b" (all occurrences of the character "a" will be replaced with character "b").

String getOdataType()

Get the odataType property: A URI fragment specifying the type of char filter.

JsonWriter toJson(JsonWriter jsonWriter)

Methods inherited from CharFilter

Methods inherited from java.lang.Object

Constructor Details

MappingCharFilter

public MappingCharFilter(String name, List<String> mappings)

Creates an instance of MappingCharFilter class.

Parameters:

name - the name value to set.
mappings - the mappings value to set.

Method Details

fromJson

public static MappingCharFilter fromJson(JsonReader jsonReader)

Reads an instance of MappingCharFilter from the JsonReader.

Parameters:

jsonReader - The JsonReader being read.

Returns:

An instance of MappingCharFilter if the JsonReader was pointing to an instance of it, or null if it was pointing to JSON null.

Throws:

IOException

- If the deserialized JSON object was missing any required properties.

getMappings

public List<String> getMappings()

Get the mappings property: A list of mappings of the following format: "a=>b" (all occurrences of the character "a" will be replaced with character "b").

Returns:

the mappings value.

getOdataType

public String getOdataType()

Get the odataType property: A URI fragment specifying the type of char filter.

Overrides:

MappingCharFilter.getOdataType()

Returns:

the odataType value.

toJson

public JsonWriter toJson(JsonWriter jsonWriter)

Overrides:

MappingCharFilter.toJson(JsonWriter jsonWriter)

Parameters:

jsonWriter

Throws:

Applies to