Class TemplatingClass
- java.lang.Object
-
- com.microblink.entities.recognizers.templating.TemplatingClass
-
- All Implemented Interfaces:
android.os.Parcelable
public final class TemplatingClass extends java.lang.Object implements android.os.Parcelable
Class that represents a specific class of documents when used within Templating API.
-
-
Field Summary
Fields Modifier and Type Field Description static android.os.Parcelable.Creator<TemplatingClass>
CREATOR
-
Constructor Summary
Constructors Constructor Description TemplatingClass()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
consumeResultFrom(TemplatingClass other)
int
describeContents()
protected void
finalize()
ProcessorGroup[]
getClassificationProcessorGroups()
Returns the currently set array of classification processor groups.ProcessorGroup[]
getNonClassificationProcessorGroups()
Returns the currently set array of non-classification processor groups.<T extends TemplatingRecognizer>
TgetOwningRecognizer()
Returns theTemplatingRecognizer
which contains thisTemplatingClass
ornull
if thisTemplatingClass
is not contained withing anyTemplatingRecognizer
.void
setClassificationProcessorGroups(ProcessorGroup... processorGroups)
Sets processor groups that will be executed before classification, i.e.void
setNonClassificationProcessorGroups(ProcessorGroup... processorGroups)
Sets processor groups that will be executed ifTemplatingClassifier.classify(TemplatingClass)
returnstrue
.void
setTemplatingClassifier(TemplatingClassifier templatingClassifier)
Sets the classifier which will tell whether currently processed document belongs to this class.void
writeToParcel(android.os.Parcel dest, int flags)
-
-
-
Field Detail
-
CREATOR
@NonNull public static final android.os.Parcelable.Creator<TemplatingClass> CREATOR
-
-
Method Detail
-
setTemplatingClassifier
public void setTemplatingClassifier(@Nullable TemplatingClassifier templatingClassifier)
Sets the classifier which will tell whether currently processed document belongs to this class. If set tonull
, existing classifier (if exists) will be cleared and non-classification processor groups will not be executed.- Parameters:
templatingClassifier
- Classifier which will tell whether currently processed document belongs to this class.
-
consumeResultFrom
public void consumeResultFrom(@NonNull TemplatingClass other)
-
setClassificationProcessorGroups
public void setClassificationProcessorGroups(@Nullable ProcessorGroup... processorGroups)
Sets processor groups that will be executed before classification, i.e. beforeTemplatingClassifier.classify(TemplatingClass)
is invoked.- Parameters:
processorGroups
- processor groups that will be executed before classification
-
getClassificationProcessorGroups
@Nullable public ProcessorGroup[] getClassificationProcessorGroups()
Returns the currently set array of classification processor groups.- Returns:
- the currently set array of classification processor groups.
-
setNonClassificationProcessorGroups
public void setNonClassificationProcessorGroups(@Nullable ProcessorGroup... processorGroups)
Sets processor groups that will be executed ifTemplatingClassifier.classify(TemplatingClass)
returnstrue
.- Parameters:
processorGroups
- processor groups that will be executed after classification, if classification is positive
-
getNonClassificationProcessorGroups
@Nullable public ProcessorGroup[] getNonClassificationProcessorGroups()
Returns the currently set array of non-classification processor groups.- Returns:
- the currently set array of non-classification processor groups.
-
getOwningRecognizer
@Nullable public <T extends TemplatingRecognizer> T getOwningRecognizer()
Returns theTemplatingRecognizer
which contains thisTemplatingClass
ornull
if thisTemplatingClass
is not contained withing anyTemplatingRecognizer
.- Returns:
- the
TemplatingRecognizer
which contains thisTemplatingClass
ornull
if thisTemplatingClass
is not contained withing anyTemplatingRecognizer
. - Throws:
java.lang.ClassCastException
- if owning recognizer is not of correct type
-
finalize
protected void finalize() throws java.lang.Throwable
- Overrides:
finalize
in classjava.lang.Object
- Throws:
java.lang.Throwable
-
describeContents
public int describeContents()
- Specified by:
describeContents
in interfaceandroid.os.Parcelable
-
writeToParcel
public void writeToParcel(@NonNull android.os.Parcel dest, int flags)
- Specified by:
writeToParcel
in interfaceandroid.os.Parcelable
-
-