public abstract class OutputListAttribute extends Attribute<com.google.common.collect.ImmutableList<String>>
The list of strings value are turned into relative paths which are then declared automatically before executing the user's implementation function
Constructor and Description |
---|
OutputListAttribute() |
Modifier and Type | Method and Description |
---|---|
abstract boolean |
getAllowEmpty()
Whether or not the list can be empty
|
abstract String |
getDoc()
The docstring to use for this attribute
|
abstract boolean |
getMandatory()
Whether this attribute is mandatory or not
|
PostCoercionTransform<RuleAnalysisContext,?> |
getPostCoercionTransform() |
abstract Object |
getPreCoercionDefaultValue()
The default value to use if no value is provided.
|
TypeCoercer<?,com.google.common.collect.ImmutableList<String>> |
getTypeCoercer()
The type coercer to use to convert raw values from the parser into something usable internally.
|
static OutputListAttribute |
of(Object preCoercionDefaultValue,
String doc,
boolean mandatory,
boolean allowEmpty) |
void |
repr(com.google.devtools.build.lib.skylarkinterface.SkylarkPrinter printer) |
void |
validateCoercedValue(com.google.common.collect.ImmutableList<String> paths)
Validates values post-coercion to ensure other properties besides 'type' are valid
|
getAttribute, getGenericType, getValue, validateProvidersPresent, validateValueInList
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
public abstract Object getPreCoercionDefaultValue()
Attribute
This will be validated against Attribute.getTypeCoercer()
, so may return a value whose type
does not match CoercedType
(e.g. a list of strings, rather than a list of SourcePath
)
getPreCoercionDefaultValue
in class Attribute<com.google.common.collect.ImmutableList<String>>
public abstract String getDoc()
Attribute
public abstract boolean getMandatory()
Attribute
getMandatory
in class Attribute<com.google.common.collect.ImmutableList<String>>
public abstract boolean getAllowEmpty()
public void repr(com.google.devtools.build.lib.skylarkinterface.SkylarkPrinter printer)
public TypeCoercer<?,com.google.common.collect.ImmutableList<String>> getTypeCoercer()
Attribute
getTypeCoercer
in class Attribute<com.google.common.collect.ImmutableList<String>>
public void validateCoercedValue(com.google.common.collect.ImmutableList<String> paths) throws CoerceFailedException
Attribute
validateCoercedValue
in class Attribute<com.google.common.collect.ImmutableList<String>>
paths
- The value to checkCoerceFailedException
- if the value is invalid (e.g. not in a list of pre-approved
values)public PostCoercionTransform<RuleAnalysisContext,?> getPostCoercionTransform()
getPostCoercionTransform
in class Attribute<com.google.common.collect.ImmutableList<String>>
public static OutputListAttribute of(Object preCoercionDefaultValue, String doc, boolean mandatory, boolean allowEmpty)