Package org.robolectric.android
Class AttributeSetBuilderImpl
java.lang.Object
org.robolectric.android.AttributeSetBuilderImpl
- All Implemented Interfaces:
AttributeSetBuilder
,Robolectric.AttributeSetBuilder
public class AttributeSetBuilderImpl extends Object implements AttributeSetBuilder
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static class
AttributeSetBuilderImpl.ArscResourceResolver
static class
AttributeSetBuilderImpl.LegacyResourceResolver
static interface
AttributeSetBuilderImpl.ResourceResolver
-
Constructor Summary
Constructors Modifier Constructor Description protected
AttributeSetBuilderImpl(AttributeSetBuilderImpl.ResourceResolver resourceResolver)
-
Method Summary
Modifier and Type Method Description AttributeSetBuilder
addAttribute(int resId, String value)
Set an attribute to the given value.AttributeSet
build()
Build anAttributeSet
with the antecedent attributes.AttributeSetBuilder
setClassAttribute(String value)
Set the class attribute to the given value.AttributeSetBuilder
setIdAttribute(String value)
Set the id attribute to the given value.AttributeSetBuilder
setStyleAttribute(String value)
Set the style attribute to the given value.
-
Constructor Details
-
Method Details
-
addAttribute
Description copied from interface:AttributeSetBuilder
Set an attribute to the given value. The value will be interpreted according to the attribute's format.- Specified by:
addAttribute
in interfaceAttributeSetBuilder
- Specified by:
addAttribute
in interfaceRobolectric.AttributeSetBuilder
- Parameters:
resId
- The attribute resource id to set.value
- The value to set.- Returns:
- This
AttributeSetBuilder
.
-
setStyleAttribute
Description copied from interface:AttributeSetBuilder
Set the style attribute to the given value. The value will be interpreted as a resource reference.- Specified by:
setStyleAttribute
in interfaceAttributeSetBuilder
- Specified by:
setStyleAttribute
in interfaceRobolectric.AttributeSetBuilder
- Parameters:
value
- The value for the specified attribute in thisAttributeSet
.- Returns:
- This
AttributeSetBuilder
.
-
setClassAttribute
Description copied from interface:AttributeSetBuilder
Set the class attribute to the given value. The value will be interpreted as a class name.- Specified by:
setClassAttribute
in interfaceAttributeSetBuilder
- Parameters:
value
- The value for thisAttributeSet
'sclass
attribute.- Returns:
- This
AttributeSetBuilder
.
-
setIdAttribute
Description copied from interface:AttributeSetBuilder
Set the id attribute to the given value. The value will be interpreted as an element id name.- Specified by:
setIdAttribute
in interfaceAttributeSetBuilder
- Parameters:
value
- The value for thisAttributeSet
'sid
attribute.- Returns:
- This
AttributeSetBuilder
.
-
build
Description copied from interface:AttributeSetBuilder
Build anAttributeSet
with the antecedent attributes.- Specified by:
build
in interfaceAttributeSetBuilder
- Specified by:
build
in interfaceRobolectric.AttributeSetBuilder
- Returns:
- A new
AttributeSet
.
-