com.google.gdata.model
Interface MetadataCreator

All Known Subinterfaces:
AttributeCreator, ElementCreator

public interface MetadataCreator

Shared interface for metadata creators. Extended by AttributeCreator and ElementCreator, this is used to create both elements and attributes, which we refer to as properties.


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

Method Detail

setName

MetadataCreator setName(QName name)
Sets the name of the property. This is used on parsing to decide which field to place a property in, and during generation to choose the display name of the property. This should only be set to override the default name, which is the ID specified in the MetadataKey.

Parameters:
name - the new name to use for the property.
Returns:
this metadata creator for chaining.

setRequired

MetadataCreator setRequired(boolean required)
Sets the requiredness of this property. If set to true, this property must appear in both the input and output or a validation error will occur. If set to false, this property is optional.

Parameters:
required - true to set the property to required, false to set it to optional (the default).
Returns:
this metadata creator for chaining.

setVisible

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

Parameters:
visible - true to make the property visible (the default), false to hide it from the output.
Returns:
this metadata creator for chaining.

setVirtualValue

MetadataCreator setVirtualValue(Metadata.VirtualValue virtualValue)
Sets the virtual value for the property. This is used as the value of the property during parsing and generation.