|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object com.ibm.icu.text.SpoofChecker.Builder
public static class SpoofChecker.Builder
SpoofChecker Builder. To create a SpoofChecker, first instantiate a SpoofChecker.Builder, set the desired checking options on the builder, then call the build() function to create a SpoofChecker instance.
Constructor Summary | |
---|---|
SpoofChecker.Builder()
Constructor: Create a default Unicode Spoof Checker Builder, configured to perform all checks except for LOCALE_LIMIT and CHAR_LIMIT. |
|
SpoofChecker.Builder(SpoofChecker src)
Constructor: Create a Spoof Checker Builder, and set the configuration from an existing SpoofChecker. |
Method Summary | |
---|---|
SpoofChecker |
build()
Create a SpoofChecker with current configuration. |
SpoofChecker.Builder |
setAllowedChars(UnicodeSet chars)
Limit the acceptable characters to those specified by a Unicode Set. |
SpoofChecker.Builder |
setAllowedLocales(Set<ULocale> locales)
Limit characters that are acceptable in identifiers being checked to those normally used with the languages associated with the specified locales. |
SpoofChecker.Builder |
setChecks(int checks)
Specify the set of checks that will be performed by the check functions of this Spoof Checker. |
SpoofChecker.Builder |
setData(Reader confusables,
Reader confusablesWholeScript)
Specify the source form of the spoof data Spoof Checker. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public SpoofChecker.Builder()
public SpoofChecker.Builder(SpoofChecker src)
src
- The existing checker.Method Detail |
---|
public SpoofChecker build()
public SpoofChecker.Builder setData(Reader confusables, Reader confusablesWholeScript) throws ParseException, IOException
confusables
- the Reader of confusable characters definitions, as found in file confusables.txt from
unicode.org.confusablesWholeScript
- the Reader of whole script confusables definitions, as found in the file
xonfusablesWholeScript.txt from unicode.org.
ParseException
- To report syntax errors in the input.
IOException
public SpoofChecker.Builder setChecks(int checks)
checks
- The set of checks that this spoof checker will perform. The value is an 'or' of the desired
checks..
public SpoofChecker.Builder setAllowedLocales(Set<ULocale> locales)
locales
- A Set of ULocales, from which the language and associated script are extracted. If the locales Set
is null, no restrictions will be placed on the allowed characters.
public SpoofChecker.Builder setAllowedChars(UnicodeSet chars)
chars
- A Unicode Set containing the list of characters that are permitted. The incoming set is cloned by
this function, so there are no restrictions on modifying or deleting the UnicodeSet after calling
this function. Note that this clears the allowedLocales set.
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |