/** * Returns {@code true} if the given metadata is empty. */ static boolean isEmpty(final Object container) { return (container instanceof AbstractMetadata) && ((AbstractMetadata) container).isEmpty(); }
/** * Returns {@code true} if the given metadata is empty. */ static boolean isEmpty(final Object container) { return (container instanceof AbstractMetadata) && ((AbstractMetadata) container).isEmpty(); }
/** * Validates the given newly constructed metadata. The default implementation ensures that * {@link AbstractMetadata#isEmpty()} returns {@code true}. * * @param metadata the metadata to validate. */ protected void validate(final AbstractMetadata metadata) { assertTrue("AbstractMetadata.isEmpty()", metadata.isEmpty()); }
if (empty == null && e != source && e != target && (e instanceof AbstractMetadata) && ((AbstractMetadata) e).isEmpty()) { empty = e;
if (empty == null && e != source && e != target && (e instanceof AbstractMetadata) && ((AbstractMetadata) e).isEmpty()) { empty = e;
/** * Sets the unique identifier for this metadata file. * * @param newValue the new identifier, or {@code null} if none. * * @deprecated As of ISO 19115:2014, replaced by {@link #setMetadataIdentifier(Identifier)} */ @Deprecated public void setFileIdentifier(final String newValue) { DefaultIdentifier identifier = DefaultIdentifier.castOrCopy(metadataIdentifier); // See "Note about deprecated methods implementation" if (identifier == null) { if (newValue == null) return; identifier = new DefaultIdentifier(); } identifier.setCode(newValue); if (newValue == null && (identifier instanceof AbstractMetadata) && ((AbstractMetadata) identifier).isEmpty()) { identifier = null; } setMetadataIdentifier(identifier); }
/** * Sets the unique identifier for this metadata file. * * @param newValue the new identifier, or {@code null} if none. * * @deprecated As of ISO 19115:2014, replaced by {@link #setMetadataIdentifier(Identifier)} */ @Deprecated public void setFileIdentifier(final String newValue) { // See "Note about deprecated methods implementation" DefaultIdentifier identifier = DefaultIdentifier.castOrCopy(super.getIdentifier()); if (identifier == null) { if (newValue == null) return; identifier = new DefaultIdentifier(); } identifier.setCode(newValue); if (newValue == null && (identifier instanceof AbstractMetadata) && ((AbstractMetadata) identifier).isEmpty()) { identifier = null; } setMetadataIdentifier(identifier); }
final AbstractMetadata md = (AbstractMetadata) element; if (prune) md.prune(); isEmptyElement = md.isEmpty(); } else if (!prune && element instanceof Emptiable) { isEmptyElement = ((Emptiable) element).isEmpty();
final AbstractMetadata md = (AbstractMetadata) element; if (prune) md.prune(); isEmptyElement = md.isEmpty(); } else if (!prune && element instanceof Emptiable) { isEmptyElement = ((Emptiable) element).isEmpty();