/** * Creates the lineage object if it does not already exists, then returns it. * * @return the lineage (never {@code null}). * @see #newLineage() */ private DefaultLineage lineage() { if (lineage == null) { lineage = new DefaultLineage(); } return lineage; }
/** * Creates the lineage object if it does not already exists, then returns it. * * @return the lineage (never {@code null}). * @see #newLineage() */ private DefaultLineage lineage() { if (lineage == null) { lineage = new DefaultLineage(); } return lineage; }
/** * Returns a SIS metadata implementation with the values of the given arbitrary implementation. * This method performs the first applicable action in the following choices: * * <ul> * <li>If the given object is {@code null}, then this method returns {@code null}.</li> * <li>Otherwise if the given object is already an instance of * {@code DefaultLineage}, then it is returned unchanged.</li> * <li>Otherwise a new {@code DefaultLineage} instance is created using the * {@linkplain #DefaultLineage(Lineage) copy constructor} * and returned. Note that this is a <cite>shallow</cite> copy operation, since the other * metadata contained in the given object are not recursively copied.</li> * </ul> * * @param object the object to get as a SIS implementation, or {@code null} if none. * @return a SIS implementation containing the values of the given object (may be the * given object itself), or {@code null} if the argument was null. */ public static DefaultLineage castOrCopy(final Lineage object) { if (object == null || object instanceof DefaultLineage) { return (DefaultLineage) object; } return new DefaultLineage(object); }
/** * Returns a SIS metadata implementation with the values of the given arbitrary implementation. * This method performs the first applicable action in the following choices: * * <ul> * <li>If the given object is {@code null}, then this method returns {@code null}.</li> * <li>Otherwise if the given object is already an instance of * {@code DefaultLineage}, then it is returned unchanged.</li> * <li>Otherwise a new {@code DefaultLineage} instance is created using the * {@linkplain #DefaultLineage(Lineage) copy constructor} * and returned. Note that this is a <cite>shallow</cite> copy operation, since the other * metadata contained in the given object are not recursively copied.</li> * </ul> * * @param object the object to get as a SIS implementation, or {@code null} if none. * @return a SIS implementation containing the values of the given object (may be the * given object itself), or {@code null} if the argument was null. */ public static DefaultLineage castOrCopy(final Lineage object) { if (object == null || object instanceof DefaultLineage) { return (DefaultLineage) object; } return new DefaultLineage(object); }
/** * Create a lineage to marshal. If {@code extension} is {@code false}, then this method uses * only properties defined in ISO 19115-1. If {@code extension} is {@code true}, then this * method adds an ISO 19115-2 property. */ private static DefaultLineage create(final boolean extension) { final DefaultLineage lineage = new DefaultLineage(); final DefaultSource source = new DefaultSource(); source.setDescription(new SimpleInternationalString("Description of source data level.")); lineage.getSources().add(source); if (extension) { source.setProcessedLevel(new DefaultIdentifier("DummyLevel")); } return lineage; }
String value = stringValue(HISTORY); if (value != null) { lineage = new DefaultLineage(); lineage.setStatement(new SimpleInternationalString(value)); if (lineage == null) lineage = new DefaultLineage(); addIfAbsent(lineage.getSources(), new DefaultSource(value));