public interface

ElementMetadata

implements Metadata<D>
com.google.gdata.model.ElementMetadata<D, E extends com.google.gdata.model.Element>
Known Indirect Subclasses

Class Overview

Element metadata. This describes the metadata for an individual element, which extends the Metadata interface with an element type, element cardinality, validator, content requiredness, and attributes and child elements. To create new instances of ElementMetadata you should use build(ElementKey).

Summary

Nested Classes
enum ElementMetadata.Cardinality Cardinality of an element. 
interface ElementMetadata.MultipleVirtualElement Defines a virtual element with multiple cardinality. 
interface ElementMetadata.SingleVirtualElement Defines a virtual element with single cardinality. 
Public Methods
abstract ElementKey<?, ?> adapt(String kind)
Adapts this metadata to another type, based on the given kind.
abstract ElementMetadata<D, E> bind(MetadataContext context)
Binds this element metadata to the given context.
abstract <K> AttributeMetadata<K> bindAttribute(AttributeKey<K> key)
Binds the attribute metadata associated with a particular key.
abstract <K, L extends Element> ElementMetadata<K, L> bindElement(ElementKey<K, L> key)
Binds the child element metadata associated with a particular key.
abstract E createElement()
Create an element with this metadata as the metadata for the element.
abstract AttributeKey<?> findAttribute(QName id)
Finds an attribute of the given id on this element or any adaptations.
abstract ElementKey<?, ?> findElement(QName id)
Finds an element of the given id on this element or any adaptations.
abstract Collection<AttributeKey<?>> getAttributes()
Returns an immutable collection of attribute keys in declaration order.
abstract ElementMetadata.Cardinality getCardinality()
Returns the cardinality of this element.
abstract XmlNamespace getDefaultNamespace()
Returns the best namespace to use as the default in documents if this element is the root type.
abstract Collection<ElementKey<?, ?>> getElements()
Returns an immutable set of child keys in declaration order.
abstract ElementKey<D, E> getKey()
Returns the element key that this element is bound to.
abstract ElementMetadata.MultipleVirtualElement getMultipleVirtualElement()
Returns the virtual element associated with this metadata with repeated cardinality.
abstract Object getProperties()
Returns the object properties associated with this metadata.
abstract Collection<XmlNamespace> getReferencedNamespaces()
Returns an immutable collection of the namespaces that are referenced by this element, its attributes, and recursively within any declared children.
abstract ElementMetadata.SingleVirtualElement getSingleVirtualElement()
Returns the virtual element associated with this metadata with single cardinality.
abstract ElementValidator getValidator()
Returns an element validator that can be used to validate this content.
abstract boolean isContentRequired()
Returns true if the text content of this element is required.
abstract boolean isDeclared(AttributeKey<?> key)
Returns true if this metadata declares the given attribute.
abstract boolean isDeclared(ElementKey<?, ?> element)
Returns true if this metadata declares the given child element.
abstract boolean isFlattened()
Returns true if the element has been flattened, which means its value should be output directly in its parent.
abstract boolean isReferenced()
Returns true if the element type is referenced to generate the the output representation of the element type.
abstract boolean isSelected(Element e)
Returns true if the element instance is selected for use in the current operation.
abstract void validate(ValidationContext vc, Element e)
Validates an element using the specified validation context and the element validator associated with this element metadata.
[Expand]
Inherited Methods
From interface com.google.gdata.model.Metadata

Public Methods

public abstract ElementKey<?, ?> adapt (String kind)

Adapts this metadata to another type, based on the given kind. Will return the element key that the kind represents, or null if no adaptation was found.

Parameters
kind

public abstract ElementMetadata<D, E> bind (MetadataContext context)

Binds this element metadata to the given context.

Parameters
context

public abstract AttributeMetadata<K> bindAttribute (AttributeKey<K> key)

Binds the attribute metadata associated with a particular key. Will return null if no such attribute is declared.

Parameters
key

public abstract ElementMetadata<K, L> bindElement (ElementKey<K, L> key)

Binds the child element metadata associated with a particular key. Will return null if no such element is declared.

Parameters
key

public abstract E createElement ()

Create an element with this metadata as the metadata for the element.

Throws
ContentCreationException if the element could not be created.

public abstract AttributeKey<?> findAttribute (QName id)

Finds an attribute of the given id on this element or any adaptations. This can be used to find appropriate attribute metadata to parse into while parsing an element. This will include attributes that are not declared as part of this metadata, but are declared on adaptations.

Parameters
id

public abstract ElementKey<?, ?> findElement (QName id)

Finds an element of the given id on this element or any adaptations. This can be used to find appropriate element metadata to parse into while parsing an element.

Parameters
id

public abstract Collection<AttributeKey<?>> getAttributes ()

Returns an immutable collection of attribute keys in declaration order.

public abstract ElementMetadata.Cardinality getCardinality ()

Returns the cardinality of this element.

public abstract XmlNamespace getDefaultNamespace ()

Returns the best namespace to use as the default in documents if this element is the root type.

public abstract Collection<ElementKey<?, ?>> getElements ()

Returns an immutable set of child keys in declaration order.

public abstract ElementKey<D, E> getKey ()

Returns the element key that this element is bound to.

public abstract ElementMetadata.MultipleVirtualElement getMultipleVirtualElement ()

Returns the virtual element associated with this metadata with repeated cardinality. A virtual element represents a completely virtual DOM element that can have its own attributes and child elements, all of which are pulled from elsewhere in the DOM.

public abstract Object getProperties ()

Returns the object properties associated with this metadata.

public abstract Collection<XmlNamespace> getReferencedNamespaces ()

Returns an immutable collection of the namespaces that are referenced by this element, its attributes, and recursively within any declared children.

public abstract ElementMetadata.SingleVirtualElement getSingleVirtualElement ()

Returns the virtual element associated with this metadata with single cardinality. A virtual element represents a completely virtual DOM element that can have its own attributes and child elements, all of which are pulled from elsewhere in the DOM.

public abstract ElementValidator getValidator ()

Returns an element validator that can be used to validate this content.

public abstract boolean isContentRequired ()

Returns true if the text content of this element is required.

public abstract boolean isDeclared (AttributeKey<?> key)

Returns true if this metadata declares the given attribute.

Parameters
key

public abstract boolean isDeclared (ElementKey<?, ?> element)

Returns true if this metadata declares the given child element.

Parameters
element

public abstract boolean isFlattened ()

Returns true if the element has been flattened, which means its value should be output directly in its parent.

public abstract boolean isReferenced ()

Returns true if the element type is referenced to generate the the output representation of the element type. This generally means that the element may be visible or is required to evaluate a selection condition.

public abstract boolean isSelected (Element e)

Returns true if the element instance is selected for use in the current operation.

Parameters
e

public abstract void validate (ValidationContext vc, Element e)

Validates an element using the specified validation context and the element validator associated with this element metadata.

Parameters
vc Validation context.
e Element to be validate.