|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
D
- the datatype of the text node of the element. If the element has
no text node this will be Void
. See getKey()
.E
- the element type to use for this metadata. This is the type
of the key and is used during parsing. See getKey()
.public interface ElementMetadata<D,E extends Element>
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
MetadataRegistry.build(ElementKey)
.
Nested Class Summary | |
---|---|
static class |
ElementMetadata.Cardinality
Cardinality of an element. |
static interface |
ElementMetadata.MultipleVirtualElement
Defines a virtual element with multiple cardinality. |
static interface |
ElementMetadata.SingleVirtualElement
Defines a virtual element with single cardinality. |
Nested classes/interfaces inherited from interface com.google.gdata.model.Metadata |
---|
Metadata.VirtualValue |
Method Summary | ||
---|---|---|
ElementKey<?,?> |
adapt(java.lang.String kind)
Adapts this metadata to another type, based on the given kind. |
|
ElementMetadata<D,E> |
bind(MetadataContext context)
Binds this element metadata to the given context. |
|
|
bindAttribute(AttributeKey<K> key)
Binds the attribute metadata associated with a particular key. |
|
|
bindElement(ElementKey<K,L> key)
Binds the child element metadata associated with a particular key. |
|
E |
createElement()
Create an element with this metadata as the metadata for the element. |
|
AttributeKey<?> |
findAttribute(QName id)
Finds an attribute of the given id on this element or any adaptations. |
|
ElementKey<?,?> |
findElement(QName id)
Finds an element of the given id on this element or any adaptations. |
|
java.util.Collection<AttributeKey<?>> |
getAttributes()
Returns an immutable collection of attribute keys in declaration order. |
|
ElementMetadata.Cardinality |
getCardinality()
Returns the cardinality of this element. |
|
XmlNamespace |
getDefaultNamespace()
Returns the best namespace to use as the default in documents if this element is the root type. |
|
java.util.Collection<ElementKey<?,?>> |
getElements()
Returns an immutable set of child keys in declaration order. |
|
ElementKey<D,E> |
getKey()
Returns the element key that this element is bound to. |
|
ElementMetadata.MultipleVirtualElement |
getMultipleVirtualElement()
Returns the virtual element associated with this metadata with repeated cardinality. |
|
java.lang.Object |
getProperties()
Returns the object properties associated with this metadata. |
|
java.util.Collection<XmlNamespace> |
getReferencedNamespaces()
Returns an immutable collection of the namespaces that are referenced by this element, its attributes, and recursively within any declared children. |
|
ElementMetadata.SingleVirtualElement |
getSingleVirtualElement()
Returns the virtual element associated with this metadata with single cardinality. |
|
ElementValidator |
getValidator()
Returns an element validator that can be used to validate this content. |
|
boolean |
isContentRequired()
Returns true if the text content of this element is required. |
|
boolean |
isDeclared(AttributeKey<?> key)
Returns true if this metadata declares the given attribute. |
|
boolean |
isDeclared(ElementKey<?,?> element)
Returns true if this metadata declares the given child element. |
|
boolean |
isFlattened()
Returns true if the element has been flattened, which means its
value should be output directly in its parent. |
|
boolean |
isReferenced()
Returns true if the element type is referenced to generate the the output representation of the element type. |
|
boolean |
isSelected(Element e)
Returns true if the element instance is selected for use in the current operation. |
|
void |
validate(ValidationContext vc,
Element e)
Validates an element using the specified validation context and the element validator associated with this element metadata. |
Methods inherited from interface com.google.gdata.model.Metadata |
---|
generateValue, getContext, getName, getParent, getSchema, isRequired, isVisible, parseValue |
Method Detail |
---|
ElementKey<?,?> adapt(java.lang.String kind)
null
if no adaptation
was found.
ElementMetadata<D,E> bind(MetadataContext context)
ElementKey<D,E> getKey()
getKey
in interface Metadata<D>
ElementMetadata.Cardinality getCardinality()
boolean isReferenced()
boolean isSelected(Element e)
boolean isContentRequired()
boolean isFlattened()
true
if the element has been flattened, which means its
value should be output directly in its parent.
ElementValidator getValidator()
void validate(ValidationContext vc, Element e)
vc
- validation context.e
- element to be validate.java.lang.Object getProperties()
java.util.Collection<AttributeKey<?>> getAttributes()
<K> AttributeMetadata<K> bindAttribute(AttributeKey<K> key)
null
if no such attribute is declared.
boolean isDeclared(AttributeKey<?> key)
AttributeKey<?> findAttribute(QName id)
java.util.Collection<ElementKey<?,?>> getElements()
<K,L extends Element> ElementMetadata<K,L> bindElement(ElementKey<K,L> key)
null
if no such element is declared.
boolean isDeclared(ElementKey<?,?> element)
ElementKey<?,?> findElement(QName id)
ElementMetadata.SingleVirtualElement getSingleVirtualElement()
ElementMetadata.MultipleVirtualElement getMultipleVirtualElement()
E createElement() throws ContentCreationException
ContentCreationException
- if the element could not be created.XmlNamespace getDefaultNamespace()
java.util.Collection<XmlNamespace> getReferencedNamespaces()
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |