public enum MatchStrength extends Enum<MatchStrength>
枚举常量和说明 |
---|
FULL_MATCH
Value that indicates that given data contains a signature that is deemed
specific enough to uniquely indicate data format used.
|
INCONCLUSIVE
Value that indicates that detector can not find out whether could
be a match or not.
|
NO_MATCH
Value that indicates that given data can not be in given format.
|
SOLID_MATCH
Value that indicates that given data conforms to (one of) canonical form(s) of
the data format.
|
WEAK_MATCH
Value that indicates that given data could be of specified format (i.e.
|
public static final MatchStrength NO_MATCH
public static final MatchStrength INCONCLUSIVE
public static final MatchStrength WEAK_MATCH
public static final MatchStrength SOLID_MATCH
For example, when testing for XML data format,
seeing a less-than character ("<") alone (with possible leading spaces)
would be a strong indication that data could
be in xml format (but see below for FULL_MATCH
description for more)
public static final MatchStrength FULL_MATCH
For example, when testing for XML data format,
seing "<xml" as the first data bytes ("XML declaration", as per XML specification)
could give full confidence that data is indeed in XML format.
Not all data formats have unique leading identifiers to allow full matches; for example,
JSON only has heuristic matches and can have at most SOLID_MATCH
) match.
public static MatchStrength[] values()
for (MatchStrength c : MatchStrength.values()) System.out.println(c);
public static MatchStrength valueOf(String name)
name
- 要返回的枚举常量的名称。如果该枚举类型没有带有指定名称的常量,
- 则抛出 IllegalArgumentException如果参数为空值,
- 则抛出 NullPointerException