/** * Returns all prefixes for the given namespace. For example given the {@code "http://www.isotc211.org/2005/gmd"} * namespace from legacy ISO 19139:2007, this method returns {@code "mdb"}, {@code "cit"} and all other prefixes * from the new ISO 19115-3:2016 specification which are used in replacement of the legacy {@code "gmd"} prefix. */ @Override public Iterator<String> getPrefixes(final String namespaceURI) { return new Prefixes(context, version.exports(), namespaceURI); }
/** * A method which is common to both {@code Marshaller} and {@code Unmarshaller}. * It saves the initial state if it was not already done, but subclasses will * need to complete the work. */ @SuppressWarnings("rawtypes") public <A extends XmlAdapter> void setAdapter(final Class<A> type, final A adapter) { if (!isPropertySaved(type)) { saveProperty(type, getAdapter(type)); } }
/** * Wraps this {@code FilteredNamespaces} in a new instance performing the inverse of the replacements * specified by the given version. */ NamespaceContext inverse(final FilterVersion version) { if (toView == version.toView && toImpl == version.toImpl) { return this; } return new FilteredNamespaces(this, version, true); }
/** * A method which is common to both {@code Marshaller} and {@code Unmarshaller}. * It saves the initial state if it was not already done, but subclasses will * need to complete the work. */ public void setSchema(final Schema schema) { if (!isPropertySaved(Schema.class)) { saveProperty(Schema.class, getSchema()); } }
/** * Assigns the {@link #id} value (if non-null) to the given object. This method * is typically invoked at unmarshalling time in order to assign the ID of this * temporary wrapper to the "real" GeoAPI implementation instance. * * @param wrapped the GeoAPI implementation for which to assign the ID. */ public final void copyIdTo(final Object wrapped) { if (id != null && wrapped instanceof IdentifiedObject) { final IdentifierMap map = ((IdentifiedObject) wrapped).getIdentifierMap(); if (map != null) { // Should not be null, but let be safe. map.put(IdentifierSpace.ID, id); } } } }
/** * Invoked on deserialization for replacing the deserialized instance by the unique instance. */ private Object readResolve() throws ObjectStreamException { return reason.createNilObject(InternationalString.class); } }
/** * Marks this {@code xlink} as unmodifiable. After this method call, any call to a setter * method will throw an {@link UnsupportedOperationException}. * * <p>After the first call to this method, any subsequent calls have no effect.</p> */ public void freeze() { if (hashCode == 0) { hashCode = hash(); } }
/** * Creates a pooled unmarshaller wrapping the given one. * Callers shall invoke {@link #reset(Pooled)} after construction for completing the initialization. * * @param unmarshaller the unmarshaller to use for the actual work. * @param template the {@link PooledTemplate} from which to get the initial values. * @throws JAXBException if an error occurred while setting a property. */ PooledUnmarshaller(final Unmarshaller unmarshaller, final Pooled template) throws JAXBException { super(template); this.unmarshaller = unmarshaller; initialize(template); }
@Override public void run() { removeExpired(); } });
/** * Creates a pooled marshaller wrapping the given one. * Callers shall invoke {@link #reset(Pooled)} after construction for completing the initialization. * * @param marshaller the marshaller to use for the actual work. * @param template the {@link PooledTemplate} from which to get the initial values. * @throws JAXBException if an error occurred while setting a property. */ PooledMarshaller(final Marshaller marshaller, final Pooled template) throws JAXBException { super(template); this.marshaller = marshaller; initialize(template); }
/** Skips all null or nil values. */ @Override boolean isSkipped(final Object value) { return (value == null) || (value instanceof NilObject) || NilReason.forObject(value) != null; }
/** * Returns the old namespace for elements (types and properties) in the given namespace. * This method is used only for default relocations, i.e. the fallback to apply when no * explicit rule has been found. */ @Override final String relocate(final String namespace) { return version.exportNS(namespace); }
/** * Returns the new namespace for elements (types and properties) in the given namespace. * This method is used only for default relocations, i.e. the fallback to apply when no * explicit rule has been found. */ @Override final String relocate(final String namespace) { return version.importNS(namespace); }
/** * A method which is common to both {@code Marshaller} and {@code Unmarshaller}. * It saves the initial state if it was not already done, but subclasses will * need to complete the work. */ @SuppressWarnings("rawtypes") public <A extends XmlAdapter> void setAdapter(final Class<A> type, final A adapter) { if (!isPropertySaved(type)) { saveProperty(type, getAdapter(type)); } }
/** * A method which is common to both {@code Marshaller} and {@code Unmarshaller}. * It saves the initial state if it was not already done, but subclasses will * need to complete the work. */ public void setSchema(final Schema schema) { if (!isPropertySaved(Schema.class)) { saveProperty(Schema.class, getSchema()); } }
/** * Invoked on deserialization for replacing the deserialized instance by the unique instance. */ private Object readResolve() throws ObjectStreamException { return reason.createNilObject(InternationalString.class); } }
/** * Returns a hash code value for this XLink. */ @Override public int hashCode() { int hash = hashCode; if (hash == 0) { hash = hash(); // Do not save the hash code value, since it may change. } return hash; }
/** * Creates a pooled unmarshaller wrapping the given one. * Callers shall invoke {@link #reset(Pooled)} after construction for completing the initialization. * * @param unmarshaller the unmarshaller to use for the actual work. * @param template the {@link PooledTemplate} from which to get the initial values. * @throws JAXBException if an error occurred while setting a property. */ PooledUnmarshaller(final Unmarshaller unmarshaller, final Pooled template) throws JAXBException { super(template); this.unmarshaller = unmarshaller; initialize(template); }
/** * Marks this {@code xlink} as unmodifiable. After this method call, any call to a setter * method will throw an {@link UnsupportedOperationException}. * * <p>After the first call to this method, any subsequent calls have no effect.</p> */ public void freeze() { if (hashCode == 0) { hashCode = hash(); } }
/** * Returns a hash code value for this XLink. */ @Override public int hashCode() { int hash = hashCode; if (hash == 0) { hash = hash(); // Do not save the hash code value, since it may change. } return hash; }