/** * Get the id of this element. */ public QName getElementId() { return key.getId(); }
/** * Get the id of this element. */ public QName getElementId() { return key.getId(); }
/** * Returns {@code true} if the given element key is declared, by ID. */ public boolean isDeclared(ElementKey<?, ?> element) { return elements.containsKey(element.getId()); }
/** * Returns {@code true} if the given element key is declared, by ID. */ public boolean isDeclared(ElementKey<?, ?> element) { return elements.containsKey(element.getId()); }
/** * This method just returns the bare object stored in the map, or null if * either the map didn't contain the object or the map is null. */ private Object getElementObject(ElementKey<?, ?> childKey) { return getElementObject(childKey.getId()); }
/** * This method just returns the bare object stored in the map, or null if * either the map didn't contain the object or the map is null. */ private Object getElementObject(ElementKey<?, ?> childKey) { return getElementObject(childKey.getId()); }
/** * This method just returns the bare object stored in the map, or null if * either the map didn't contain the object or the map is null. */ private Object getElementObject(ElementKey<?, ?> childKey) { return getElementObject(childKey.getId()); }
/** * Remove child element(s) of a given name. All elements with the same ID as * the given key will be removed. * * @param childKey key of the element(s) to remove. * @return this element for chaining. */ public Element removeElement(ElementKey<?, ?> childKey) { return removeElement(childKey.getId()); }
/** * Gets the set of qnames of child elements defined in the given transform. */ private static Set<QName> getElementNames(ElementTransform transform) { Set<QName> result = Sets.newHashSet(); for (ElementInfo info : transform.getElements().values()) { result.add(info.key.getId()); } return result; }
/** * Returns true if the element has child element(s) with the given key. */ public boolean hasElement(ElementKey<?, ?> childKey) { return hasElement(childKey.getId()); }
/** * Remove child element(s) of a given name. All elements with the same ID as * the given key will be removed. * * @param childKey key of the element(s) to remove. * @return this element for chaining. */ public Element removeElement(ElementKey<?, ?> childKey) { return removeElement(childKey.getId()); }
/** * Gets the set of qnames of child elements defined in the given transform. */ private static Set<QName> getElementNames(ElementTransform transform) { Set<QName> result = Sets.newHashSet(); for (ElementInfo info : transform.getElements().values()) { result.add(info.key.getId()); } return result; }
/** * Remove child element(s) of a given name. All elements with the same ID as * the given key will be removed. * * @param childKey key of the element(s) to remove. * @return this element for chaining. */ public Element removeElement(ElementKey<?, ?> childKey) { return removeElement(childKey.getId()); }
@Override public <K, L extends Element> ElementMetadata<K, L> bindElement( ElementKey<K, L> key) { // Use the provided partial metadata for any child with a matching id if (childMetadata.getKey().getId().equals(key.getId())) { @SuppressWarnings("unchecked") ElementMetadata<K, L> metadata = (ElementMetadata<K, L>) childMetadata; return metadata; } return super.bindElement(key); }
private static void addAtompubTransform(MetadataRegistry registry, ElementKey<?, ?> key) { registry.build(key, V1_CONTEXT).setName( new QName(Namespaces.atomPubDraftNs, key.getId().getLocalName())); } }
@SuppressWarnings("deprecation") private static void addOssTransform(MetadataRegistry registry, ElementKey<?, ?> key) { registry.build(key, V1_CONTEXT).setName( new QName(Namespaces.openSearchNs, key.getId().getLocalName())); } }
private static void addAtompubTransform(MetadataRegistry registry, ElementKey<?, ?> key) { registry.build(key, V1_CONTEXT).setName( new QName(Namespaces.atomPubDraftNs, key.getId().getLocalName())); } }
@SuppressWarnings("deprecation") private static void addOssTransform(MetadataRegistry registry, ElementKey<?, ?> key) { registry.build(key, V1_CONTEXT).setName( new QName(Namespaces.openSearchNs, key.getId().getLocalName())); } }
@SuppressWarnings("deprecation") private static void addOssTransform(MetadataRegistry registry, ElementKey<?, ?> key) { registry.build(key, V1_CONTEXT).setName( new QName(Namespaces.openSearchNs, key.getId().getLocalName())); } }