com.google.gdata.model
Interface AttributeCreator

All Superinterfaces:
MetadataCreator

public interface AttributeCreator
extends MetadataCreator

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


Method Summary
 AttributeCreator setName(QName name)
          Sets the name of the attribute.
 AttributeCreator setRequired(boolean required)
          Sets the requiredness of this attribute.
 AttributeCreator setVirtualValue(Metadata.VirtualValue virtualValue)
          Sets the virtual value for the attribute.
 AttributeCreator setVisible(boolean visible)
          Sets whether this attribute is visible.
 

Method Detail

setName

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.

Specified by:
setName in interface MetadataCreator
Parameters:
name - the new name to use for the attribute.
Returns:
this attribute creator for chaining.

setRequired

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.

Specified by:
setRequired in interface MetadataCreator
Parameters:
required - true to set the attribute to required, false to set it to optional (the default).
Returns:
this attribute creator for chaining.

setVisible

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.

Specified by:
setVisible in interface MetadataCreator
Parameters:
visible - true to make the attribute visible (the default), false to hide it from the output.
Returns:
this attribute creator for chaining.

setVirtualValue

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.

Specified by:
setVirtualValue in interface MetadataCreator