Class DateParser
java.lang.Object
com.microblink.blinkinput.entities.Entity<T>
com.microblink.blinkinput.entities.parsers.Parser<DateParser.Result>
com.microblink.blinkinput.entities.parsers.date.DateParser
- All Implemented Interfaces:
android.os.Parcelable
A parser that can extract date from OCR result.
-
Nested Class Summary
Nested Classes -
Field Summary
FieldsFields inherited from class com.microblink.blinkinput.entities.parsers.Parser
CLASS_NAMEFields inherited from interface android.os.Parcelable
CONTENTS_FILE_DESCRIPTOR, PARCELABLE_WRITE_RETURN_VALUE -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidClears parser result.clone()Create a copy of the entity.voidconsumeResult(DateParser.Result resultToConsume) Consumes given result.voidconsumeResultFrom(Entity other) Consume result from other entity.protected voiddeserializeNativeSettings(byte[] serializedSettings) Returns current date formats.char[]Specifies the date separator characters between date parts (day, month, year) that will be accepted by date parser.protected byte[]voidsetDateFormats(DateFormat[] dateFormats) Specifies the date formats that will be accepted by date parser.voidsetDateSeparatorChars(char[] dateSeparatorChars) Specifies the date separator characters between date parts (day, month, year) that will be accepted by date parser.protected voidterminateNative(long nativeContext) Methods inherited from class com.microblink.blinkinput.entities.parsers.Parser
getPriority, isRequired, setRequiredMethods inherited from class com.microblink.blinkinput.entities.Entity
describeContents, finalize, getNativeContext, getResult, nativeGetNativeResultContext, readFromParcel, writeToParcel
-
Field Details
-
CREATOR
-
-
Constructor Details
-
DateParser
public DateParser()
-
-
Method Details
-
setDateSeparatorChars
public void setDateSeparatorChars(@Nullable char[] dateSeparatorChars) Specifies the date separator characters between date parts (day, month, year) that will be accepted by date parser. By default, this is set to '[., /, -]' -
getDateSeparatorChars
@Nullable public char[] getDateSeparatorChars()Specifies the date separator characters between date parts (day, month, year) that will be accepted by date parser. By default, this is set to '[., /, -]' -
setDateFormats
Specifies the date formats that will be accepted by date parser. By default, all available numeric date formats fromDateFormatenum will be accepted (all formats in which month is numeric).- Parameters:
dateFormats- Array of expected date formats, if it isnullor empty, date formats will be set to default value.
-
getDateFormats
Returns current date formats.- Returns:
- Current date formats.
-
terminateNative
protected void terminateNative(long nativeContext) - Specified by:
terminateNativein classEntity<DateParser.Result>
-
serializeNativeSettings
@Nullable protected byte[] serializeNativeSettings()- Specified by:
serializeNativeSettingsin classEntity<DateParser.Result>
-
deserializeNativeSettings
protected void deserializeNativeSettings(@NonNull byte[] serializedSettings) - Specified by:
deserializeNativeSettingsin classEntity<DateParser.Result>
-
clone
Description copied from class:EntityCreate a copy of the entity. This is required if properties of the entity must be modified while background thread performs processing. In order to avoid race conditions, changing properties is not allowed while entity is used in background processing. However, you are able to make a copy of the entity, change properties of it and then update theRecognizerRunnerVieworRecognizerRunnerwith the updated entity hierarchy.- Specified by:
clonein classEntity<DateParser.Result>- Returns:
- a copy of the entity
-
consumeResultFrom
Description copied from class:EntityConsume result from other entity. The result from other will be put instead current result of this entity. This method is used insideBaseIntentTransferable.loadFromIntent(Intent)and similar methods to replace the result content of the saved entities with results that have arrived overIntent- Specified by:
consumeResultFromin classEntity<DateParser.Result>- Parameters:
other- Entity from which result should be consumed.
-
consumeResult
Description copied from class:ParserConsumes given result. The given result will be put instead current result of this entity.- Specified by:
consumeResultin classParser<DateParser.Result>- Parameters:
resultToConsume- Result that should be consumed.
-
clearResult
public void clearResult()Description copied from class:ParserClears parser result.- Specified by:
clearResultin classParser<DateParser.Result>
-