public interface

AttributeCreator

implements MetadataCreator
com.google.gdata.model.AttributeCreator

Class Overview

An attribute creator allows setting attribute information, which includes the following pieces:

  • name: The qualified name to use for input and output. Defaults to using the value in the AttributeKey associated with the metadata. Setting the name here will override the default.
  • required: Validates that the attribute exists in both input and output. Defaults to false.
  • visible: Hides or shows an attribute in the output. Defaults to true.

Summary

Public Methods
abstract AttributeCreator setName(QName name)
Sets the name of the attribute.
abstract AttributeCreator setRequired(boolean required)
Sets the requiredness of this attribute.
abstract AttributeCreator setVirtualValue(Metadata.VirtualValue virtualValue)
Sets the virtual value for the attribute.
abstract AttributeCreator setVisible(boolean visible)
Sets whether this attribute is visible.
[Expand]
Inherited Methods
From interface com.google.gdata.model.MetadataCreator

Public Methods

public abstract AttributeCreator setName (QName name)

Sets the name of the attribute. This is used on parsing to decide which field to place an attriubte in, and during generation to choose the display name of the attribute. This should only be set to override the default name, which is the ID specified in the AttributeKey.

Parameters
name The new name to use for the attribute.
Returns
  • this attribute creator for chaining.

public abstract AttributeCreator setRequired (boolean required)

Sets the requiredness of this attribute. If set to true, this attribute must appear in both the input and output or a validation error will occur. If set to false, this attribute is optional.

Parameters
required True to set the attribute to required, false to set it to optional (the default).
Returns
  • this attribute creator for chaining.

public abstract AttributeCreator setVirtualValue (Metadata.VirtualValue virtualValue)

Sets the virtual value for the attribute. This is used as the value of the attribute during parsing and generation.

Parameters
virtualValue

public abstract AttributeCreator setVisible (boolean visible)

Sets whether this attribute is visible. If the attribute is not visible then it will not be included in the output. This can be used to hide an attribute in particular contexts (such as RSS or JSON output). It can also be used to explicitly set an attribute to visible that may be hidden by other metadata rules.

Parameters
visible True to make the attribute visible (the default), false to hide it from the output.
Returns
  • this attribute creator for chaining.