public abstract class ForwardingElementMetadata<D,E extends Element> extends java.lang.Object implements ElementMetadata<D,E>
ElementMetadata.Cardinality, ElementMetadata.MultipleVirtualElement, ElementMetadata.SingleVirtualElementMetadata.VirtualValue| Constructor and Description |
|---|
ForwardingElementMetadata() |
| Modifier and Type | Method and Description |
|---|---|
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.
|
<K> AttributeMetadata<K> |
bindAttribute(AttributeKey<K> key)
Binds the attribute metadata associated with a particular key.
|
<K,L extends Element> |
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.
|
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)
ElementMetadatabind 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
ElementMetadatacreateElement in interface ElementMetadata<D,E extends Element>ContentCreationException - if the element could not be created.public AttributeKey<?> findAttribute(QName id)
ElementMetadatafindAttribute in interface ElementMetadata<D,E extends Element>public ElementKey<?,?> findElement(QName id)
ElementMetadatafindElement in interface ElementMetadata<D,E extends Element>public java.util.Collection<AttributeKey<?>> getAttributes()
ElementMetadatagetAttributes in interface ElementMetadata<D,E extends Element>public ElementMetadata.Cardinality getCardinality()
ElementMetadatagetCardinality in interface ElementMetadata<D,E extends Element>public java.util.Collection<ElementKey<?,?>> getElements()
ElementMetadatagetElements in interface ElementMetadata<D,E extends Element>public ElementKey<D,E> getKey()
ElementMetadatapublic java.lang.Object getProperties()
ElementMetadatagetProperties in interface ElementMetadata<D,E extends Element>public ElementValidator getValidator()
ElementMetadatagetValidator in interface ElementMetadata<D,E extends Element>public boolean isContentRequired()
ElementMetadataisContentRequired in interface ElementMetadata<D,E extends Element>public boolean isDeclared(AttributeKey<?> key)
ElementMetadataisDeclared in interface ElementMetadata<D,E extends Element>public boolean isDeclared(ElementKey<?,?> element)
ElementMetadataisDeclared in interface ElementMetadata<D,E extends Element>public boolean isReferenced()
ElementMetadataisReferenced in interface ElementMetadata<D,E extends Element>public boolean isSelected(Element e)
ElementMetadataisSelected 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)
ElementMetadatavalidate in interface ElementMetadata<D,E extends Element>vc - validation context.e - element to be validate.public java.lang.Object generateValue(Element element, ElementMetadata<?,?> metadata)
MetadatagenerateValue 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()
Metadatapublic ElementKey<?,?> getParent()
Metadatanull if this
metadata does not take the parent key into account.public Schema getSchema()
MetadataSchema that this metadata is a part of.public boolean isRequired()
MetadataisRequired in interface Metadata<D>public boolean isVisible()
Metadatapublic void parseValue(Element element, ElementMetadata<?,?> metadata, java.lang.Object value) throws ParseException
MetadataparseValue in interface Metadata<D>ParseException - if parsing fails.public ElementMetadata.MultipleVirtualElement getMultipleVirtualElement()
ElementMetadatagetMultipleVirtualElement in interface ElementMetadata<D,E extends Element>public ElementMetadata.SingleVirtualElement getSingleVirtualElement()
ElementMetadatagetSingleVirtualElement in interface ElementMetadata<D,E extends Element>public XmlNamespace getDefaultNamespace()
ElementMetadatagetDefaultNamespace in interface ElementMetadata<D,E extends Element>public java.util.Collection<XmlNamespace> getReferencedNamespaces()
ElementMetadatagetReferencedNamespaces in interface ElementMetadata<D,E extends Element>