| java.lang.Object | ||
| ↳ | com.google.gdata.data.AbstractExtension | |
| ↳ | com.google.gdata.data.ValueConstruct | |
Known Direct Subclasses
|
The ValueConstruct class is an abstract Extension class that can
be used to subclassed to create a GData extension element with a
single value, like:
or
Using constructor parameters, a customized subclass has full
control over the value construct element namespace and tag name,
as well whether the value is contained within an XML attribute
or the element text value.
A subclass can override the setValue(String)
method to do customized validation of any value set directly
by a client or as a result of XML parsing.
Two ValueConstruct instances are considered equal if they have the same concrete subclass and the value of the two instances are equal. The namespace, tagname, and attribute names are not taken into account by the equality comparison; they are assumed to be equivalent for all instances of a particular concrete subclass.
| Fields | |||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|
| attrName | The XML attribute name for the value construct. | ||||||||||
| required | Indicates that the value is required (true by default). |
||||||||||
| value | The value of the value construct. | ||||||||||
|
[Expand]
Inherited Fields | |||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|
From class
com.google.gdata.data.AbstractExtension
| |||||||||||
| Protected Constructors | |||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|
Constructs a value construct bound to a specific XML representation.
| |||||||||||
Constructs an ValueConstruct bound to a specific XML representation
A concrete subclass should always use constants value for all three
parameters.
| |||||||||||
Constructs a new ValueConstruct instance bound to a specific XML
representation.
| |||||||||||
| Public Methods | |||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|
Generates an XML representation for the extension.
| |||||||||||
The default implementation uses the
AbstractExtension.AttributesHandler to handle
parsing the extension. | |||||||||||
Returns the value of the value construct.
| |||||||||||
Returns whether it has the value.
| |||||||||||
Puts attributes into the attribute generator.
| |||||||||||
Sets the value.
| |||||||||||
| Protected Methods | |||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|
Consumes attributes from the attribute helper.
| |||||||||||
|
[Expand]
Inherited Methods | |||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|
From class
com.google.gdata.data.AbstractExtension
| |||||||||||
From class
java.lang.Object
| |||||||||||
From interface
com.google.gdata.data.Extension
| |||||||||||
The XML attribute name for the value construct. When null,
indicates that the value is contained within the XML element text
content.
Indicates that the value is required (true by default).
The value of the value construct.
Constructs a value construct bound to a specific XML representation. The
concrete subclass must have an ExtensionDescription.Default
attribute defined, and should always use constant values for the attrName parameter.
| attrName | The name of attribute that contains the value, or null if the value is contained within the element
content.
|
|---|
Constructs an ValueConstruct bound to a specific XML representation A concrete subclass should always use constants value for all three parameters.
| namespace | The namespace of the value element. |
|---|---|
| localName | The local name of the value element. |
| attrName | The name of attribute that contains the value, or
null if the value is contained within the element content.
|
Constructs a new ValueConstruct instance bound to a specific XML
representation. A concrete subclass should always use constant values
for the namespace, localName, and attrName
parameters. If an initial value is provided and it is not null,
an immutable instance will be created that is initialized to this
value and may not be modified by setValue(String).
| namespace | The namespace of the value element. |
|---|---|
| localName | The local name of the value element. |
| attrName | The name of attribute that contains the value, or
null if the value is contained within the element content. |
| value | The value that should be used to initialize the value construct instance. After construction, the value will be immutable. |
| o |
|---|
Generates an XML representation for the extension.
| w | XML writer |
|---|---|
| p | Extension profile |
| IOException |
|---|
The default implementation uses the AbstractExtension.AttributesHandler to handle
parsing the extension.
| p | Extension profile |
|---|---|
| namespace | Extension namespace |
| localName | Tag name, without the namespace prefix |
| attrs | Tag attributes |
| ParseException |
|---|
Returns the value of the value construct.
Returns whether it has the value.
Puts attributes into the attribute generator. Called from
generate(XmlWriter, ExtensionProfile). Default implementation
does nothing, though generally this is discouraged unless there really are
no attributes.
| generator | Attribute generator |
|---|
Sets the value. Subclasses can override this method to do additional validation of the value.
| v | New value for the value construct or null to reset. |
|---|
| IllegalArgumentException | if the value is invalid for the construct. |
|---|---|
| IllegalStateException | if the value construct is read only |
Consumes attributes from the attribute helper. May also use
consumeContent(boolean) to consume the element's text
content. Called from getHandler(ExtensionProfile, String, String, Attributes). Default implementation does
nothing, though generally this is discouraged unless there really are no
attributes.
| helper | Attribute helper |
|---|
| ParseException |
|---|
| isRequired |
|---|