| 限定符和类型 | 类 | 说明 |
|---|---|---|
static class |
TypedAttribute.AttrData |
Defines attribute data, including the name, value, and type of the attribute represented by
TypedAttribute. |
| 限定符和类型 | 字段 | 说明 |
|---|---|---|
static int |
BOOLEAN_ATTR |
Indicates that the type of the XML
attribute value is BOOLEAN_ATTR. |
static int |
COLOR_ATTR |
Indicates that the type of the XML
attribute value is COLOR_ATTR. |
static int |
FLOAT_ATTR |
Indicates that the type of the XML
attribute value is FLOAT_ATTR. |
static int |
GRAPHIC_ATTR |
Indicates that the type of the XML
attribute value is GRAPHIC_ATTR. |
static int |
INTEGER_ATTR |
Indicates that the type of the XML
attribute value is INTEGER_ATTR. |
static int |
LAYOUT_ATTR |
Indicates that the type of the XML
attribute value is LAYOUT_ATTR. |
static int |
MEDIA_ATTR |
Indicates that the type of the XML
attribute value is MEDIA_ATTR. |
static int |
PATTERN_ATTR |
Indicates that the type of the XML
attribute value is PATTERN_ATTR. |
static int |
STRING_ATTR |
Indicates that the type of the XML
attribute value is STRING_ATTR. |
static int |
UNDEFINED_ATTR |
Indicates that the type of the XML
attribute value is undefined. |
| 构造器 | 说明 |
|---|---|
TypedAttribute() |
| 限定符和类型 | 方法 | 说明 |
|---|---|---|
static float |
computeFloatValue(String original,
Configuration config,
DeviceCapability devCap) |
Calculates the float value represented by the float attribute based on the device configuration and capability.
|
static int |
computePixelValue(String original,
Configuration config,
DeviceCapability devCap,
boolean truncate) |
Calculates the pixel value represented by the float attribute based on the device configuration and capability.
|
static float |
computeTranslateRatio(DeviceCapability devCap) |
Calculates the conversion rate of the float attribute based on the device capability.
|
abstract boolean |
getBooleanValue() |
Obtains the boolean reference value of the XML
attribute. |
abstract int |
getColorValue() |
Obtains the color data represented by an integer reference value of the XML
attribute. |
abstract float |
getFloatValue() |
Obtains the float reference value of the XML
attribute. |
abstract int |
getIntegerValue() |
Obtains the integer reference value of the XML
attribute. |
abstract SolidXml |
getLayoutValue() |
Obtains the layout data represented by a
SolidXml reference value of the XML attribute. |
abstract Resource |
getMediaResource() |
Obtains the
Media attribute represented by the Resource referenced by the XML attribute. |
abstract String |
getMediaValue() |
Obtains the relative path of the media file represented by a string reference value of the XML
attribute. |
abstract String |
getName() |
Obtains the tag name of an attribute.
|
abstract String |
getOriginalValue() |
Obtains the original value represented by a string reference value of the XML
attribute. |
abstract String |
getParsedValue() |
Obtains a string representing the attribute value referenced by the XML
attribute. |
abstract Pattern |
getPatternValue() |
Obtains the pattern attributes represented by a
Pattern reference value of the XML attribute. |
abstract int |
getPixelValue(boolean truncate) |
Obtains the pixel value represented by the float value referenced by the XML
attribute. |
abstract int |
getResId() |
Obtains the resource ID represented by an integer reference value of the XML
attribute. |
abstract ResourceManager |
getResourceManager() |
Obtains the resource manager associated with this
TypedAttribute. |
abstract SolidXml |
getStateColorsValue() |
Obtains the color data represented by a
SolidXml reference value of the XML attribute |
abstract String |
getStringValue() |
Obtains the string reference value of the XML
attribute. |
abstract int |
getType() |
Obtains the type of an XML
attribute value. |
public static final int BOOLEAN_ATTR
attribute value is BOOLEAN_ATTR.public static final int COLOR_ATTR
attribute value is COLOR_ATTR.public static final int FLOAT_ATTR
attribute value is FLOAT_ATTR.public static final int GRAPHIC_ATTR
attribute value is GRAPHIC_ATTR.public static final int INTEGER_ATTR
attribute value is INTEGER_ATTR.public static final int LAYOUT_ATTR
attribute value is LAYOUT_ATTR.public static final int MEDIA_ATTR
attribute value is MEDIA_ATTR.public static final int PATTERN_ATTR
attribute value is PATTERN_ATTR.public static final int STRING_ATTR
attribute value is STRING_ATTR.public static final int UNDEFINED_ATTR
attribute value is undefined.public abstract int getType()
attribute value. The type can be UNDEFINED_ATTR,
BOOLEAN_ATTR, COLOR_ATTR, FLOAT_ATTR, INTEGER_ATTR, STRING_ATTR,
LAYOUT_ATTR, MEDIA_ATTR, PATTERN_ATTR, or GRAPHIC_ATTR.attribute value.public abstract boolean getBooleanValue()
throws IOException,
NotExistException,
WrongTypeException
attribute.attribute.NotExistException - Throws this exception if the obtained value is null or another invalid value.IOException - Throws this exception if an I/O error occurs.WrongTypeException - Throws this exception if the type of the attribute reference value is
not BOOLEAN_ATTR.public abstract int getColorValue()
throws IOException,
NotExistException,
WrongTypeException
attribute.
The original value of attribute must be in one of the following formats:
#RRGGBB
#AARRGGBB
NotExistException - Throws this exception if the obtained value is null or another invalid value.IOException - Throws this exception if an I/O error occurs.WrongTypeException - Throws this exception if the type of the attribute reference value is
not COLOR_ATTR.public abstract SolidXml getStateColorsValue() throws IOException, NotExistException, WrongTypeException
SolidXml reference value of the XML attributeSolidXml reference value.NotExistException - Throws this exception if the obtained value is null or another invalid value.IOException - Throws this exception if an I/O error occurs.WrongTypeException - Throws this exception if the type of the attribute reference value is
not COLOR_ATTR.public abstract float getFloatValue()
throws IOException,
NotExistException,
WrongTypeException
attribute.attribute.NotExistException - Throws this exception if the obtained value is null or another invalid value.IOException - Throws this exception if an I/O error occurs.WrongTypeException - Throws this exception if the type of the attribute reference value
is not FLOAT_ATTR.public abstract int getIntegerValue()
throws IOException,
NotExistException,
WrongTypeException
attribute.attribute.NotExistException - Throws this exception if the obtained value is null or another invalid value.IOException - Throws this exception if an I/O error occurs.WrongTypeException - Throws this exception if the type of the attribute reference value is
not INTEGER_ATTR.public abstract String getStringValue() throws IOException, NotExistException, WrongTypeException
attribute.attribute.NotExistException - Throws this exception if the obtained value is null or another invalid value.IOException - Throws this exception if an I/O error occurs.WrongTypeException - Throws this exception if the type of the attribute reference value is
not STRING_ATTR.public abstract SolidXml getLayoutValue() throws IOException, NotExistException, WrongTypeException
SolidXml reference value of the XML attribute.SolidXml reference value.NotExistException - Throws this exception if the obtained value is null or another invalid value.IOException - Throws this exception if an I/O error occurs.WrongTypeException - Throws this exception if the type of the attribute reference value is
not LAYOUT_ATTR.public abstract String getMediaValue() throws IOException, NotExistException, WrongTypeException
attribute.NotExistException - Throws this exception if the obtained value is null or another invalid value.IOException - Throws this exception if an I/O error occurs.WrongTypeException - Throws this exception if the type of the attribute reference value is
not MEDIA_ATTR.public abstract String getOriginalValue()
attribute.public abstract Pattern getPatternValue() throws IOException, NotExistException, WrongTypeException
Pattern reference value of the XML attribute.Pattern reference value representing the pattern attributes.NotExistException - Throws this exception if the obtained value is null or another invalid value.IOException - Throws this exception if an I/O error occurs.WrongTypeException - Throws this exception if the type of the attribute reference value is
not PATTERN_ATTR.public abstract String getName()
public abstract int getResId()
throws IOException,
NotExistException,
WrongTypeException
attribute.attribute.NotExistException - Throws this exception if the obtained value is null or another invalid value.IOException - Throws this exception if an I/O error occurs.WrongTypeException - Throws this exception if the attribute is not a referenced value.public abstract String getParsedValue() throws IOException, NotExistException, WrongTypeException
attribute.NotExistException - Throws this exception if the obtained value is null or another invalid value.IOException - Throws this exception if an I/O error occurs.WrongTypeException - Throws this exception if the attribute is not a supported referenced value.public abstract ResourceManager getResourceManager()
TypedAttribute.public abstract Resource getMediaResource() throws IOException, NotExistException, WrongTypeException
Media attribute represented by the Resource referenced by the XML attribute.Resource.NotExistException - Throws this exception if the obtained Resource is null.IOException - Throws this exception if an I/O error occurs.WrongTypeException - Throws this exception if the type of the attribute is not MEDIA_ATTR.public abstract int getPixelValue(boolean truncate)
throws IOException,
NotExistException,
WrongTypeException
attribute.truncate - Specifies whether the returned result is truncated. The value true indicates that
the decimal part of the float value is truncated, and false indicates that the float value is
rounded off.NotExistException - Throws this exception if the obtained value is null or another invalid value.IOException - Throws this exception if an I/O error occurs.WrongTypeException - Throws this exception if the type of the attribute is not FLOAT_ATTR.public static float computeTranslateRatio(DeviceCapability devCap)
devCap - Indicates the device capability.public static int computePixelValue(String original, Configuration config, DeviceCapability devCap, boolean truncate) throws WrongTypeException
original - Indicates the string representation of the float attribute.config - Indicates the device configuration.devCap - Indicates the device capability.truncate - Specifies whether the returned result is truncated. The value true indicates that
the decimal part of the float value is truncated, and false indicates that the float value is
rounded off.WrongTypeException - Throws this exception if the input original does not match the
float attribute.public static float computeFloatValue(String original, Configuration config, DeviceCapability devCap) throws WrongTypeException
original - Indicates the string representation of the float attribute.config - Indicates the device configuration.devCap - Indicates the device capability.WrongTypeException - Throws this exception if the input original does not match the
float attribute.