public class UnconfiguredBuildTargetParser extends Object
UnconfiguredBuildTarget
.
Fully qualified build target name looks like `cell//path/to:target#flavor1,flavor2`, where `cell` and `path/to` components is allowed to be empty, and flavors may not be specified along with `#` sign. So a minimum valid build target string is `//:target` indicating a target named `target` at the package on the root path of the default cell without flavors
Modifier and Type | Method and Description |
---|---|
static UnconfiguredBuildTarget |
parse(String target)
Parse a string representing fully qualified build target, validating build target format
|
static UnconfiguredBuildTarget |
parse(String target,
boolean intern)
Parse a string representing fully qualified build target, validating build target format
|
public static UnconfiguredBuildTarget parse(String target) throws BuildTargetParseException
Fully qualified build target format is `cell//path/to:target#flavor1,flavor2` where cell may be an empty string, and flavors may be omitted along with `#` sign
The target must be in canonical form. Importantly, the cell name must be the canonical name.
target
- String representing fully-qualified build target, for example "//foo/bar:bar"BuildTargetParseException
- If build target format is invalid; at this moment BuildTargetParseException
is unchecked exception but we still want to declare it with the
hope to make it checked one day; this type of exception would be properly handled as user
errorpublic static UnconfiguredBuildTarget parse(String target, boolean intern) throws BuildTargetParseException
Fully qualified build target format is `cell//path/to:target#flavor1,flavor2` where cell may be an empty string, and flavors may be omitted along with `#` sign
The target must be in canonical form. Importantly, the cell name must be the canonical name.
target
- String representing fully-qualified build target, for example "//foo/bar:bar"intern
- Whether to intern parsed instance; once interned the instance stays in memory
forever but subsequent hash map/set operations are faster because Object.equals(Object)
is cheapBuildTargetParseException
- If build target format is invalid; at this moment BuildTargetParseException
is unchecked exception but we still want to declare it with the
hope to make it checked one day; this type of exception would be properly handled as user
error