public interface ParamInfo<T>
Modifier and Type | Interface and Description |
---|---|
static interface |
ParamInfo.Traversal
Traversal interface used when coercing values
|
Modifier and Type | Method and Description |
---|---|
boolean |
execConfiguration() |
T |
get(Object dto) |
Hint |
getHint() |
Object |
getImplicitPreCoercionValue() |
String |
getName() |
String |
getPythonName() |
Class<?> |
getResultClass() |
TypeCoercer<?,T> |
getTypeCoercer() |
boolean |
hasElementTypes(Class<?>... types) |
boolean |
isConfigurable() |
boolean |
isDep() |
boolean |
isInput() |
boolean |
isOptional() |
boolean |
isTargetGraphOnlyDep() |
void |
set(CellNameResolver cellNameResolver,
ProjectFilesystem filesystem,
ForwardRelativePath pathRelativeToProjectRoot,
TargetConfiguration targetConfiguration,
TargetConfiguration hostConfiguration,
Object dto,
Object value)
Sets a single property of the
dto , coercing types as necessary. |
void |
setCoercedValue(Object dto,
Object value)
Set the param on dto to value, assuming value has already been coerced.
|
boolean |
splitConfiguration() |
void |
traverse(CellNameResolver cellPathResolver,
ParamInfo.Traversal traversal,
Object dto)
Traverse the value of the field on
dto that is represented by this instance. |
String getName()
TypeCoercer<?,T> getTypeCoercer()
TypeCoercer
that converts raw values to the correct type for this paramboolean isOptional()
String getPythonName()
boolean isDep()
boolean isTargetGraphOnlyDep()
Hint.isTargetGraphOnlyDep()
boolean isInput()
Hint.isConfigurable()
boolean isConfigurable()
boolean splitConfiguration()
Hint.splitConfiguration()
boolean execConfiguration()
Hint.execConfiguration()
Class<?> getResultClass()
void traverse(CellNameResolver cellPathResolver, ParamInfo.Traversal traversal, Object dto)
dto
that is represented by this instance.
If this field has a top level Optional type, traversal begins at the Optional value, or not at all if the field is empty.
cellPathResolver
- traversal
- traversal to apply on the values.dto
- the object whose field will be traversed.TypeCoercer.traverse(com.facebook.buck.core.cell.nameresolver.CellNameResolver, Object,
TypeCoercer.Traversal)
@Nullable Object getImplicitPreCoercionValue()
null
This is used for parameters that have a default value and need to be accessed by users'
rule implementations, but should not be set directly by users. e.g. underscore prefixed
attributes in user defined rules. These values are pre-coercion and may be user provided.
If this parameter is not an implicit parameter, this method should return null
void set(CellNameResolver cellNameResolver, ProjectFilesystem filesystem, ForwardRelativePath pathRelativeToProjectRoot, TargetConfiguration targetConfiguration, TargetConfiguration hostConfiguration, Object dto, @Nullable Object value) throws ParamInfoException
dto
, coercing types as necessary.cellNameResolver
- filesystem
- ProjectFilesystem
used to ensure Path
s exist.pathRelativeToProjectRoot
- The path relative to the project root that this DTO is for.hostConfiguration
- dto
- The constructor DTO on which the value should be set.value
- The value, which may be coerced depending on the type on dto
.ParamInfoException
boolean hasElementTypes(Class<?>... types)