|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Objectcom.google.gdata.model.ForwardingElementMetadata<D,E>
public abstract class ForwardingElementMetadata<D,E extends Element>
The ForwardingElementMetadata abstract class provides a simple delegating ElementMetadata implementation. It can be subclassed to create transient element metadata instances that override or modify selected behaviors without requiring the creation of a new registered metadata type.
| Nested Class Summary |
|---|
| Nested classes/interfaces inherited from interface com.google.gdata.model.ElementMetadata |
|---|
ElementMetadata.Cardinality, ElementMetadata.MultipleVirtualElement, ElementMetadata.SingleVirtualElement |
| Nested classes/interfaces inherited from interface com.google.gdata.model.Metadata |
|---|
Metadata.VirtualValue |
| Constructor Summary | |
|---|---|
ForwardingElementMetadata()
|
|
| 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. |
|
protected abstract ElementMetadata<D,E> |
delegate()
Returns the delegate element metadata instance that is the delegation target for this forwarding instance. |
|
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.lang.Object |
generateValue(Element element,
ElementMetadata<?,?> metadata)
Generate the value of this property on the given element. |
|
java.util.Collection<AttributeKey<?>> |
getAttributes()
Returns an immutable collection of attribute keys in declaration order. |
|
ElementMetadata.Cardinality |
getCardinality()
Returns the cardinality of this element. |
|
MetadataContext |
getContext()
Returns the metadata context that this metadata was created for, or null if this metadata is not part of a context. |
|
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. |
|
QName |
getName()
Returns the qualified name of the property, used during parsing and generation. |
|
ElementKey<?,?> |
getParent()
Returns the parent of this metadata instance, or null if this
metadata does not take the parent key into account. |
|
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. |
|
Schema |
getSchema()
Returns the Schema that this metadata is a part of. |
|
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 |
isRequired()
Returns true if this property is required. |
|
boolean |
isSelected(Element e)
Returns true if the element instance is selected for use in the current operation. |
|
boolean |
isVisible()
Returns true if this property is visible. |
|
void |
parseValue(Element element,
ElementMetadata<?,?> metadata,
java.lang.Object value)
Parses the value of this property into the given element. |
|
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 class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
|---|
public ForwardingElementMetadata()
| Method Detail |
|---|
protected abstract ElementMetadata<D,E> delegate()
public ElementKey<?,?> adapt(java.lang.String kind)
ElementMetadatanull if no adaptation
was found.
adapt in interface ElementMetadata<D,E extends Element>public ElementMetadata<D,E> bind(MetadataContext context)
ElementMetadata
bind in interface ElementMetadata<D,E extends Element>public <K> AttributeMetadata<K> bindAttribute(AttributeKey<K> key)
ElementMetadatanull if no such attribute is declared.
bindAttribute in interface ElementMetadata<D,E extends Element>public <K,L extends Element> ElementMetadata<K,L> bindElement(ElementKey<K,L> key)
ElementMetadatanull if no such element is declared.
bindElement in interface ElementMetadata<D,E extends Element>
public E createElement()
throws ContentCreationException
ElementMetadata
createElement in interface ElementMetadata<D,E extends Element>ContentCreationException - if the element could not be created.public AttributeKey<?> findAttribute(QName id)
ElementMetadata
findAttribute in interface ElementMetadata<D,E extends Element>public ElementKey<?,?> findElement(QName id)
ElementMetadata
findElement in interface ElementMetadata<D,E extends Element>public java.util.Collection<AttributeKey<?>> getAttributes()
ElementMetadata
getAttributes in interface ElementMetadata<D,E extends Element>public ElementMetadata.Cardinality getCardinality()
ElementMetadata
getCardinality in interface ElementMetadata<D,E extends Element>public java.util.Collection<ElementKey<?,?>> getElements()
ElementMetadata
getElements in interface ElementMetadata<D,E extends Element>public ElementKey<D,E> getKey()
ElementMetadata
getKey in interface ElementMetadata<D,E extends Element>getKey in interface Metadata<D>public java.lang.Object getProperties()
ElementMetadata
getProperties in interface ElementMetadata<D,E extends Element>public ElementValidator getValidator()
ElementMetadata
getValidator in interface ElementMetadata<D,E extends Element>public boolean isContentRequired()
ElementMetadata
isContentRequired in interface ElementMetadata<D,E extends Element>public boolean isDeclared(AttributeKey<?> key)
ElementMetadata
isDeclared in interface ElementMetadata<D,E extends Element>public boolean isDeclared(ElementKey<?,?> element)
ElementMetadata
isDeclared in interface ElementMetadata<D,E extends Element>public boolean isReferenced()
ElementMetadata
isReferenced in interface ElementMetadata<D,E extends Element>public boolean isSelected(Element e)
ElementMetadata
isSelected in interface ElementMetadata<D,E extends Element>public boolean isFlattened()
ElementMetadatatrue if the element has been flattened, which means its
value should be output directly in its parent.
isFlattened in interface ElementMetadata<D,E extends Element>
public void validate(ValidationContext vc,
Element e)
ElementMetadata
validate in interface ElementMetadata<D,E extends Element>vc - validation context.e - element to be validate.
public java.lang.Object generateValue(Element element,
ElementMetadata<?,?> metadata)
Metadata
generateValue in interface Metadata<D>public MetadataContext getContext()
Metadatanull if this metadata is not part of a context.
getContext in interface Metadata<D>public QName getName()
Metadata
getName in interface Metadata<D>public ElementKey<?,?> getParent()
Metadatanull if this
metadata does not take the parent key into account.
getParent in interface Metadata<D>public Schema getSchema()
MetadataSchema that this metadata is a part of.
getSchema in interface Metadata<D>public boolean isRequired()
Metadata
isRequired in interface Metadata<D>public boolean isVisible()
Metadata
isVisible in interface Metadata<D>
public void parseValue(Element element,
ElementMetadata<?,?> metadata,
java.lang.Object value)
throws ParseException
Metadata
parseValue in interface Metadata<D>ParseException - if parsing fails.public ElementMetadata.MultipleVirtualElement getMultipleVirtualElement()
ElementMetadata
getMultipleVirtualElement in interface ElementMetadata<D,E extends Element>public ElementMetadata.SingleVirtualElement getSingleVirtualElement()
ElementMetadata
getSingleVirtualElement in interface ElementMetadata<D,E extends Element>public XmlNamespace getDefaultNamespace()
ElementMetadata
getDefaultNamespace in interface ElementMetadata<D,E extends Element>public java.util.Collection<XmlNamespace> getReferencedNamespaces()
ElementMetadata
getReferencedNamespaces in interface ElementMetadata<D,E extends Element>
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||