Modifier and Type | Field and Description |
---|---|
static java.lang.String |
ERROR_MESSAGE |
Modifier | Constructor and Description |
---|---|
protected |
StyleBase(java.lang.Class<T> styleableObjectType)
Creates a new instance of
StyleBase class. |
Modifier and Type | Method and Description |
---|---|
protected abstract void |
applyStyleInternal(T styleableObject)
Applies this style to specified styleable object.
|
protected abstract void |
discardStyleInternal(T objectToStyle)
Discards this style on specified styleable object.
|
protected <TProperty> |
getPropertyValue(T objectToStyle,
java.lang.String propertyName,
java.lang.Class<TProperty> propertyType)
Reads the specified property from internal property storage.
|
java.lang.Class<? extends T> |
getStyleableObjectType()
Gets the target styleable object type.
|
protected <TProperty> |
putPropertyValue(T objectToStyle,
java.lang.String propertyName,
TProperty propertyValue)
Saves the specified property into internal property storage.
|
void |
tryApplyStyle(java.lang.Object styleableObject)
Applies this style to specified styleable object.
|
void |
tryDiscardStyle(java.lang.Object styleableObject)
Discards this style on specified styleable object.
|
public static final java.lang.String ERROR_MESSAGE
public final java.lang.Class<? extends T> getStyleableObjectType()
getStyleableObjectType
in interface IStyle
public final void tryApplyStyle(java.lang.Object styleableObject)
tryApplyStyle
in interface IStyle
styleableObject
- The target styleable object.protected abstract void applyStyleInternal(T styleableObject)
styleableObject
- The styleable object instance.public final void tryDiscardStyle(java.lang.Object styleableObject)
tryDiscardStyle
in interface IStyle
styleableObject
- The target styleable object.protected abstract void discardStyleInternal(T objectToStyle)
objectToStyle
- The styleable object instance.protected final <TProperty> void putPropertyValue(T objectToStyle, java.lang.String propertyName, TProperty propertyValue)
TProperty
- The type of value.objectToStyle
- The target styleable object.propertyName
- The property name to save.propertyValue
- The property value to save.protected final <TProperty> TProperty getPropertyValue(T objectToStyle, java.lang.String propertyName, java.lang.Class<TProperty> propertyType)
TProperty
- The type of value.objectToStyle
- The target styleable object.propertyName
- The property name to save.propertyType
- The type of value.