/** * Invoked by JAXB at marshalling time for getting the actual metadata to write * inside the {@code <gmd:RS_ReferenceSystem>} XML element. * This is the value or a copy of the value given in argument to the {@code wrap} method. * * @return the metadata to be marshalled. */ @XmlElementRef public ReferenceSystemMetadata getElement() { final ReferenceSystem metadata = this.metadata; if (metadata == null) { return null; } else if (metadata instanceof ReferenceSystemMetadata) { return (ReferenceSystemMetadata) metadata; } else { return new ReferenceSystemMetadata(metadata); } }
/** * Invoked by JAXB at marshalling time for getting the actual metadata to write * inside the {@code <gmd:RS_ReferenceSystem>} XML element. * This is the value or a copy of the value given in argument to the {@code wrap} method. * * @return the metadata to be marshalled. */ @XmlElementRef public final ReferenceSystemMetadata getElement() { final ReferenceSystem metadata = this.metadata; if (metadata == null) { return null; } else if (metadata instanceof ReferenceSystemMetadata) { return (ReferenceSystemMetadata) metadata; } else { return new ReferenceSystemMetadata(metadata); } }
/** * Tests {@link FrenchProfile#toAFNOR(ReferenceSystem, boolean)}. */ @Test public void testReferenceSystemToAFNOR() { ReferenceSystem std, fra; std = new ReferenceSystemMetadata(new ImmutableIdentifier(null, "EPSG", "4326")); fra = FrenchProfile.toAFNOR(std, false); assertInstanceOf("Expected AFNOR instance.", DirectReferenceSystem.class, fra); assertSame("Already an AFNOR instance.", fra, FrenchProfile.toAFNOR(fra)); fra = FrenchProfile.toAFNOR(std, true); assertInstanceOf("Expected AFNOR instance.", IndirectReferenceSystem.class, fra); assertSame("Already an AFNOR instance.", fra, FrenchProfile.toAFNOR(fra)); } }
citation.setEdition(new Anchor(URI.create("SDN:C371:1:2"), "2")); metadata.setReferenceSystemInfo(singleton( new ReferenceSystemMetadata(new ImmutableIdentifier(citation, "L101", "EPSG:4326"))));