public interface

Metadata

com.google.gdata.model.Metadata<D>
Known Indirect Subclasses

Class Overview

The Metadata interface defines operations that are common to all content model properties (elements or attributes). This interface describes the id, name and datatype of a property, as well as including flags for whether the property is required, undeclared, or visible. Creating new instances of Metadata should be done using Schema.

Summary

Nested Classes
interface Metadata.VirtualValue Defines a virtual value. 
Public Methods
abstract Object generateValue(Element element, ElementMetadata<?, ?> metadata)
Generate the value of this property on the given element.
abstract MetadataContext getContext()
Returns the metadata context that this metadata was created for, or null if this metadata is not part of a context.
abstract MetadataKey<D> getKey()
Returns the attribute key for this metadata.
abstract QName getName()
Returns the qualified name of the property, used during parsing and generation.
abstract ElementKey<?, ?> getParent()
Returns the parent of this metadata instance, or null if this metadata does not take the parent key into account.
abstract Schema getSchema()
Returns the Schema that this metadata is a part of.
abstract boolean isRequired()
Returns true if this property is required.
abstract boolean isVisible()
Returns true if this property is visible.
abstract void parseValue(Element element, ElementMetadata<?, ?> metadata, Object value)
Parses the value of this property into the given element.

Public Methods

public abstract Object generateValue (Element element, ElementMetadata<?, ?> metadata)

Generate the value of this property on the given element. If the property is virtual, it will be used to generate the value, otherwise the regular property value will be used.

Parameters
element
metadata

public abstract MetadataContext getContext ()

Returns the metadata context that this metadata was created for, or null if this metadata is not part of a context.

public abstract MetadataKey<D> getKey ()

Returns the attribute key for this metadata.

public abstract QName getName ()

Returns the qualified name of the property, used during parsing and generation. For atom this will usually be the same as the id, but for json or other alt types it may be different.

Returns
  • the qualified name of the property.

public abstract ElementKey<?, ?> getParent ()

Returns the parent of this metadata instance, or null if this metadata does not take the parent key into account.

public abstract Schema getSchema ()

Returns the Schema that this metadata is a part of.

public abstract boolean isRequired ()

Returns true if this property is required. If a property is required it must appear in its parent element for that parent element to be valid.

Returns
  • true if the property is required in its parent element.

public abstract boolean isVisible ()

Returns true if this property is visible. If a property is visible it will be included in the output generation for its parent element, if it is hidden (not visible) it will not be included.

Returns
  • true if the property is visible in its parent element.

public abstract void parseValue (Element element, ElementMetadata<?, ?> metadata, Object value)

Parses the value of this property into the given element. If the property is virtual, it will be used to parse the value, otherwise the value will be stored directly in the property.

Parameters
element
metadata
value
Throws
ParseException if parsing fails.