Examples of acquireMarshaller()


Examples of org.apache.sis.xml.MarshallerPool.acquireMarshaller()

         * Format metadata to the standard output stream.
         */
        if (metadata != null) {
            if (toXML) {
                final MarshallerPool pool = new MarshallerPool(null);
                final Marshaller marshaller = pool.acquireMarshaller();
                marshaller.setProperty(XML.LOCALE,   locale);
                marshaller.setProperty(XML.TIMEZONE, timezone);
                marshaller.marshal(metadata, out);
            } else {
                final TreeTable tree = MetadataStandard.ISO_19115.asTreeTable(metadata, ValueExistencePolicy.NON_EMPTY);
View Full Code Here

Examples of org.apache.sis.xml.MarshallerPool.acquireMarshaller()

        /*
         * Test marshaling. We can not yet compare with the original XML file
         * because of all the information lost. This may be fixed in a future
         * SIS version (SIS-160).
         */
        final Marshaller marshaller = pool.acquireMarshaller();
        marshaller.setProperty(XML.GML_VERSION, version);
        final String xml = marshal(marshaller, datum);
        pool.recycle(marshaller);
        assertXmlEquals(
                "<gml:VerticalDatum xmlns:gml=\"" + LegacyNamespaces.GML + "\">\n" +
View Full Code Here

Examples of org.apache.sis.xml.MarshallerPool.acquireMarshaller()

    @Test
    @DependsOnMethod("testMarshall")
    public void testMarshallGML31() throws JAXBException {
        final DefaultPrimeMeridian pm = new DefaultPrimeMeridian(GREENWICH);
        final MarshallerPool pool = getMarshallerPool();
        final Marshaller marshaller = pool.acquireMarshaller();
        marshaller.setProperty(XML.GML_VERSION, LegacyNamespaces.VERSION_3_0);
        final String xml = marshal(marshaller, pm);
        pool.recycle(marshaller);
        assertXmlEquals(getGreenwichXml(LegacyNamespaces.GML), xml, "xmlns:*", "xsi:schemaLocation");
    }
View Full Code Here

Examples of org.apache.sis.xml.MarshallerPool.acquireMarshaller()

        final String expected = getResponsiblePartyXML(Schemas.ISO_19139_ROOT);
        final ResponsibleParty rp = (ResponsibleParty) XML.unmarshal(expected);
        assertEquals(Role.PRINCIPAL_INVESTIGATOR, rp.getRole());

        final MarshallerPool pool = getMarshallerPool();
        final Marshaller marshaller = pool.acquireMarshaller();
        marshaller.setProperty(XML.SCHEMAS, Collections.singletonMap("gmd",
                "http://standards.iso.org/ittf/PubliclyAvailableStandards/ISO_19139_Schemas")); // Intentionally omit trailing '/'.
        final String actual = marshal(marshaller, rp);
        pool.recycle(marshaller);
        assertXmlEquals(expected, actual, "xmlns:*");
 
View Full Code Here

Examples of org.apache.sis.xml.MarshallerPool.acquireMarshaller()

     * @throws JAXBException If an error occurred while marshaling the XML.
     */
    @Test
    public void testLocalization() throws JAXBException {
        final MarshallerPool pool = getMarshallerPool();
        final Marshaller marshaller = pool.acquireMarshaller();
        /*
         * First, test using the French locale.
         */
        marshaller.setProperty(XML.LOCALE, Locale.FRENCH);
        String expected = getCitationXML(Schemas.METADATA_ROOT, "fra", "Création");
View Full Code Here

Examples of org.apache.sis.xml.MarshallerPool.acquireMarshaller()

        /*
         * Format metadata to the standard output stream.
         */
        if (toXML) {
            final MarshallerPool pool = new MarshallerPool(null);
            final Marshaller marshaller = pool.acquireMarshaller();
            marshaller.setProperty(XML.LOCALE,   locale);
            marshaller.setProperty(XML.TIMEZONE, timezone);
            if (isConsole()) {
                marshaller.marshal(crs != null ? crs : metadata, out);
            } else {
View Full Code Here

Examples of org.apache.sis.xml.MarshallerPool.acquireMarshaller()

     *
     * @see #unmarshal(Class, String)
     */
    protected final String marshal(final Object object) throws JAXBException {
        final MarshallerPool pool = getMarshallerPool();
        final Marshaller marshaller = pool.acquireMarshaller();
        final String xml = marshal(marshaller, object);
        pool.recycle(marshaller);
        return xml;
    }

View Full Code Here
TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.