| java.lang.Object | |
| ↳ | com.google.gdata.data.AttributeHelper |
Helps accessing tag attributes.
The helper only checks attributes in the default namespace ("") and
rejects unknown attributes.
The idea is to remove (consume) attributes as they are read
from the list and at the end make sure that all attributes have
been read, to detect whether unknown attributes have been
specified. This is done by the method assertAllConsumed() usually
called from
processEndElement().
| Nested Classes | |||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|
| AttributeHelper.EnumToAttributeValue<T extends Enum<T>> | Defines a custom mapping of an enum value to an attribute value (similar to a closure). | ||||||||||
| AttributeHelper.LowerCaseEnumToAttributeValue<T extends Enum<T>> | Implements the most common custom mapping of an enum value to an attribute value using the lower-case form of the enum name. | ||||||||||
| Fields | |||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|
| attrs | Maps attribute local name to string value. | ||||||||||
| content | element's text content or null for no text content |
||||||||||
| contentConsumed | if the content has been consumed | ||||||||||
| dups | set of attributes that are duplicated | ||||||||||
| Public Constructors | |||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|
Creates a helper tied to a specific set of SAX attributes.
| |||||||||||
| Public Methods | |||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|
Makes sure all attributes have been removed from the list.
| |||||||||||
Gets the value of an attribute and remove it from the list.
| |||||||||||
Gets the value of a big decimal attribute and remove it from the list.
| |||||||||||
Gets the value of a big decimal attribute and remove it from the list.
| |||||||||||
Gets the value of a big integer attribute and remove it from the list.
| |||||||||||
Gets the value of a big integer attribute and remove it from the list.
| |||||||||||
Gets the value of a boolean attribute and remove it from the list.
| |||||||||||
Gets the value of a boolean attribute and remove it from the list.
| |||||||||||
Gets the value of a byte attribute and remove it from the list.
| |||||||||||
Gets the value of a byte attribute and remove it from the list.
| |||||||||||
Gets the element's text content and removes it from the list.
| |||||||||||
Gets the value of a
DateTime attribute and remove it from the list. | |||||||||||
Gets the value of a double attribute and remove it from the list.
| |||||||||||
Gets the value of a double attribute and remove it from the list.
| |||||||||||
Gets the value of an enumerated attribute and remove it from the list.
| |||||||||||
Gets the value of an enumerated attribute and remove it from the list.
| |||||||||||
Gets the value of an enumerated attribute and remove it from the list,
using a custom mapping of enum to attribute value.
| |||||||||||
Gets the value of a float attribute and remove it from the list.
| |||||||||||
Gets the value of a float attribute and remove it from the list.
| |||||||||||
Gets the value of an integer attribute and remove it from the list.
| |||||||||||
Gets the value of an integer attribute and remove it from the list.
| |||||||||||
Gets the value of a long attribute and remove it from the list.
| |||||||||||
Gets the value of a long attribute and remove it from the list.
| |||||||||||
Gets the value of a short attribute and remove it from the list.
| |||||||||||
Gets the value of a short attribute and remove it from the list.
| |||||||||||
|
[Expand]
Inherited Methods | |||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|
From class
java.lang.Object
| |||||||||||
Maps attribute local name to string value.
element's text content or null for no text content
if the content has been consumed
set of attributes that are duplicated
Creates a helper tied to a specific set of SAX attributes.
| attrs | The SAX attributes to be processed |
|---|
Makes sure all attributes have been removed from the list. To all attribute in the default namespace must correspond exactly one call to consume*().
| ParseException | if an attribute in the default namespace hasn't been removed |
|---|
Gets the value of an attribute and remove it from the list.
| name | Attribute name or null for text content |
|---|---|
| required | Indicates attributes is required |
| ParseException | if required is set and the attribute is not defined |
|---|
Gets the value of a big decimal attribute and remove it from the list.
| name | Attribute name or null for text content |
|---|---|
| required | Indicates attribute is required |
| defaultValue | The default value for an optional attribute (used if not present) |
| ParseException | if required is set and the attribute is not defined, or if the attribute value is not a valid big decimal |
|---|
Gets the value of a big decimal attribute and remove it from the list.
| name | Attribute name |
|---|---|
| required | Indicates attribute is required |
| ParseException | if required is set and the attribute is not defined, or if the attribute value is not a valid big decimal |
|---|
Gets the value of a big integer attribute and remove it from the list.
| name | Attribute name or null for text content |
|---|---|
| required | Indicates attribute is required |
| defaultValue | The default value for an optional attribute (used if not present) |
| ParseException | if required is set and the attribute is not defined, or if the attribute value is not a valid big integer |
|---|
Gets the value of a big integer attribute and remove it from the list.
| name | Attribute name |
|---|---|
| required | Indicates attribute is required |
| ParseException | if required is set and the attribute is not defined, or if the attribute value is not a valid big integer |
|---|
Gets the value of a boolean attribute and remove it from the list. The accepted values are based upon xsd:boolean syntax (true, false, 1, 0).
| name | Attribute name or null for text content |
|---|---|
| required | Indicates attribute is required |
| defaultValue | The default value for an optional attribute (used if not present) |
| ParseException | if required is set and the attribute
is not defined, or if the attribute value is neither true
nor false.
|
|---|
Gets the value of a boolean attribute and remove it from the list. The accepted values are based upon xsd:boolean syntax (true, false, 1, 0).
| name | Attribute name |
|---|---|
| required | Indicates attribute is required |
| ParseException | if required is set and the attribute
is not defined, or if the attribute value is neither true
nor false.
|
|---|
Gets the value of a byte attribute and remove it from the list.
| name | Attribute name or null for text content |
|---|---|
| required | Indicates attribute is required |
| defaultValue | The default value for an optional attribute (used if not present) |
| ParseException | if required is set and the attribute is not defined, or if the attribute value is not a valid byte |
|---|
Gets the value of a byte attribute and remove it from the list.
| name | Attribute name |
|---|---|
| required | Indicates attribute is required |
| ParseException | if required is set and the attribute is not defined, or if the attribute value is not a valid byte |
|---|
Gets the element's text content and removes it from the list.
| required | Indicates attributes is required |
|---|
null for no text content| ParseException | if required is set and the text content is not defined |
|---|
Gets the value of a DateTime attribute and remove it from the list.
| name | Attribute name or null for text content |
|---|---|
| required | Indicates attribute is required |
null by default| ParseException | if required is set and the attribute is not defined, or if the date-time attribute cannot be parsed |
|---|
Gets the value of a double attribute and remove it from the list.
| name | Attribute name or null for text content |
|---|---|
| required | Indicates attribute is required |
| defaultValue | The default value for an optional attribute (used if not present) |
| ParseException | if required is set and the attribute is not defined, or if the attribute value is not a valid double |
|---|
Gets the value of a double attribute and remove it from the list.
| name | Attribute name |
|---|---|
| required | Indicates attribute is required |
| ParseException | if required is set and the attribute is not defined, or if the attribute value is not a valid double |
|---|
Gets the value of an enumerated attribute and remove it from the list. Enumerated values are case-insensitive.
| name | Attribute name or null for text content |
|---|---|
| required | Indicates attribute is required |
| enumClass | Enumeration class |
| defaultValue | The default value for an optional attribute (used if not present) |
| ParseException | if required is set and the attribute is not defined, or if the attribute value is not a valid enumerated value |
|---|
Gets the value of an enumerated attribute and remove it from the list. Enumerated values are case-insensitive.
| name | Attribute name |
|---|---|
| required | Indicates attribute is required |
| enumClass | Enumeration class |
| ParseException | if required is set and the attribute is not defined, or if the attribute value is not a valid enumerated value |
|---|
Gets the value of an enumerated attribute and remove it from the list, using a custom mapping of enum to attribute value.
| name | Attribute name or null for text content |
|---|---|
| required | Indicates attribute is required |
| enumClass | Enumeration class |
| defaultValue | The default value for an optional attribute (used if not present) |
| enumToAttributeValue | Custom mapping of enum to attribute value |
| ParseException | if required is set and the attribute is not defined, or if the attribute value is not a valid enumerated value |
|---|
Gets the value of a float attribute and remove it from the list.
| name | Attribute name or null for text content |
|---|---|
| required | Indicates attribute is required |
| defaultValue | The default value for an optional attribute (used if not present) |
| ParseException | if required is set and the attribute is not defined, or if the attribute value is not a valid float |
|---|
Gets the value of a float attribute and remove it from the list.
| name | Attribute name |
|---|---|
| required | Indicates attribute is required |
| ParseException | if required is set and the attribute is not defined, or if the attribute value is not a valid float |
|---|
Gets the value of an integer attribute and remove it from the list.
| name | Attribute name or null for text content |
|---|---|
| required | Indicates attribute is required |
| defaultValue | The default value for an optional attribute (used if not present) |
| ParseException | if required is set and the attribute is not defined, or if the attribute value is not a valid integer |
|---|
Gets the value of an integer attribute and remove it from the list.
| name | Attribute name |
|---|---|
| required | Indicates attribute is required |
| ParseException | if required is set and the attribute is not defined, or if the attribute value is not a valid integer |
|---|
Gets the value of a long attribute and remove it from the list.
| name | Attribute name |
|---|---|
| required | Indicates attribute is required |
| ParseException | if required is set and the attribute is not defined, or if the attribute value is not a valid long |
|---|
Gets the value of a long attribute and remove it from the list.
| name | Attribute name or null for text content |
|---|---|
| required | Indicates attribute is required |
| defaultValue | The default value for an optional attribute (used if not present) |
| ParseException | if required is set and the attribute is not defined, or if the attribute value is not a valid long |
|---|
Gets the value of a short attribute and remove it from the list.
| name | Attribute name or null for text content |
|---|---|
| required | Indicates attribute is required |
| defaultValue | The default value for an optional attribute (used if not present) |
| ParseException | if required is set and the attribute is not defined, or if the attribute value is not a valid short |
|---|
Gets the value of a short attribute and remove it from the list.
| name | Attribute name |
|---|---|
| required | Indicates attribute is required |
| ParseException | if required is set and the attribute is not defined, or if the attribute value is not a valid short |
|---|