Package org.opengis.util

Examples of org.opengis.util.InternationalString


            obj.put("type", obj, Context.javaToJS(binding, getParentScope()));
        }
       
        obj.put("name", obj, param.getName());
       
        InternationalString i18nTitle = param.getTitle();
        if (i18nTitle != null) {
            obj.put("title", obj, i18nTitle.toString());
        }

        InternationalString i18nDescription = param.getDescription();
        if (i18nDescription != null) {
            obj.put("description", obj, i18nDescription.toString());
        }
       
        int minOccurs = param.getMinOccurs();
        if (minOccurs > -1) {
            obj.put("minOccurs", obj, minOccurs);
View Full Code Here


        boolean showHeaders  = false;
        boolean showNaNCount = false;
        for (int i=0; i<stats.length; i++) {
            final Statistics s = stats[i];
            showNaNCount |= (s.countNaN() != 0);
            final InternationalString header = s.name();
            if (header != null) {
                headers[i] = header.toString(headerLocale);
                showHeaders |= (headers[i] != null);
            }
        }
        char horizontalLine = 0;
        String separator = columnSeparator;
View Full Code Here

    /**
     * Test the header of some constants.
     */
    @Test
    public void testConstantHeader() {
        InternationalString i18n = NAME.getHeader();
        assertEquals("Name", i18n.toString(Locale.ROOT));
        assertEquals("Name", i18n.toString(Locale.ENGLISH));
        assertEquals("Nom",  i18n.toString(Locale.FRENCH));
        assertSame("Test caching", i18n, NAME.getHeader());

        i18n = TYPE.getHeader();
        assertEquals("Type", i18n.toString(Locale.ROOT));
        assertEquals("Type", i18n.toString(Locale.ENGLISH));
        assertEquals("Type", i18n.toString(Locale.FRENCH));
        assertSame("Test caching", i18n, TYPE.getHeader());
    }
View Full Code Here

     */
    public static void assertTitleEquals(final String message, final String expected, final Citation actual) {
        if (isNull(message, expected, actual)) {
            return;
        }
        InternationalString title = actual.getTitle();
        if (title != null && expected.equals(title.toString())) {
            return;
        }
        for (final InternationalString t : actual.getAlternateTitles()) {
            if (expected.equals(t.toString())) {
                return;
View Full Code Here

    public static DefaultLocalName castOrCopy(final LocalName object) {
        if (object == null || object instanceof DefaultLocalName) {
            return (DefaultLocalName) object;
        }
        final NameSpace scope = object.scope();
        final InternationalString name = object.toInternationalString();
        final LocalName result;
        if (object instanceof MemberName) {
            result = DefaultFactories.SIS_NAMES.createMemberName(scope, name, ((MemberName) object).getAttributeType());
        } else if (object instanceof TypeName) {
            result = DefaultFactories.SIS_NAMES.createTypeName(scope, name);
View Full Code Here

             * syntax (which should be integer values), but maybe this is what the user wants.
             */
            final DatatypeFactory factory = XmlUtilities.getDatatypeFactory();
            final org.apache.sis.internal.geoapi.temporal.PeriodDuration metadata =
                    (org.apache.sis.internal.geoapi.temporal.PeriodDuration) this.metadata;
            InternationalString value;
            BigInteger years = null;
            if ((value = metadata.getYears()) != null) {
                years = new BigInteger(value.toString());
            }
            BigInteger months = null;
            if ((value = metadata.getMonths()) != null) {
                months = new BigInteger(value.toString());
            }
            BigInteger days = null;
            if ((value = metadata.getDays()) != null) {
                days = new BigInteger(value.toString());
            }
            BigInteger hours = null;
            if ((value = metadata.getHours()) != null) {
                hours = new BigInteger(value.toString());
            }
            BigInteger minutes = null;
            if ((value = metadata.getMinutes()) != null) {
                minutes = new BigInteger(value.toString());
            }
            BigDecimal seconds = null;
            if ((value = metadata.getSeconds()) != null) {
                seconds = new BigDecimal(value.toString());
            }
            return factory.newDuration(true, years, months, days, hours, minutes, seconds);
        } catch (DatatypeConfigurationException e) {
            warningOccured("getElement", e);
        }
View Full Code Here

     */
    public void setElement(final Duration duration) {
        metadata = null; // Cleaned first in case of failure.
        if (duration != null) try {
            final TemporalFactory factory = TemporalUtilities.getTemporalFactory();
            InternationalString years = null;
            int value;
            if ((value = duration.getYears()) != 0) {
                years = new SimpleInternationalString(Integer.toString(value));
            }
            InternationalString months = null;
            if ((value = duration.getMonths()) != 0) {
                months = new SimpleInternationalString(Integer.toString(value));
            }
            InternationalString weeks = null; // no weeks in javax.xml.datatype.Duration
            InternationalString days = null;
            if ((value = duration.getDays()) != 0) {
                days = new SimpleInternationalString(Integer.toString(value));
            }
            InternationalString hours = null;
            if ((value = duration.getHours()) != 0) {
                hours = new SimpleInternationalString(Integer.toString(value));
            }
            InternationalString minutes = null;
            if ((value = duration.getMinutes()) != 0) {
                minutes = new SimpleInternationalString(Integer.toString(value));
            }
            InternationalString seconds = null;
            if ((value = duration.getSeconds()) != 0) {
                seconds = new SimpleInternationalString(Integer.toString(value));
            }
            metadata = factory.createPeriodDuration(years, months, weeks, days, hours, minutes, seconds);
        } catch (UnsupportedOperationException e) {
View Full Code Here

     * Tests the formatting of an international string.
     */
    @Test
    @DependsOnMethod("testGetResources")
    public void testFormatInternational() {
        InternationalString i18n = Errors.formatInternational(Errors.Keys.NullArgument_1);
        assertEquals("Argument ‘{0}’ shall not be null.",      i18n.toString(Locale.ROOT));
        assertEquals("Argument ‘{0}’ shall not be null.",      i18n.toString(Locale.ENGLISH));
        assertEquals("L’argument ‘{0}’ ne doit pas être nul.", i18n.toString(Locale.FRENCH));
        assertNotSame(i18n, assertSerializedEquals(i18n));

        i18n = Errors.formatInternational(Errors.Keys.NullArgument_1, "CRS");
        assertEquals("Argument ‘CRS’ shall not be null.",      i18n.toString(Locale.ROOT));
        assertEquals("Argument ‘CRS’ shall not be null.",      i18n.toString(Locale.ENGLISH));
        assertEquals("L’argument ‘CRS’ ne doit pas être nul.", i18n.toString(Locale.FRENCH));
        assertNotSame(i18n, assertSerializedEquals(i18n));
    }
View Full Code Here

        assertNull(properties.put("authority""Some authority"));
        assertNull(properties.put("version",    "Some version"));
        assertNull(properties.put("remarks",    "Some remarks"));
        assertNull(Types.toInternationalString(properties, "dummy"));

        InternationalString i18n = Types.toInternationalString(properties, "remarks");
        assertInstanceOf("Single locale", SimpleInternationalString.class, i18n);
        assertEquals("Some remarks", i18n.toString());

        assertNull(properties.put("remarks_fr", "Une remarque"));
        i18n = Types.toInternationalString(properties, "remarks");
        assertInstanceOf("Two locales", DefaultInternationalString.class, i18n);
        assertEquals("Some remarks", i18n.toString(Locale.ROOT));
        assertEquals("Une remarque", i18n.toString(Locale.FRENCH));

        assertNotNull(properties.remove("remarks"));
        i18n = Types.toInternationalString(properties, "remarks");
        assertInstanceOf("Single locale", SimpleInternationalString.class, i18n);
        assertEquals("Une remarque", i18n.toString());
    }
View Full Code Here

    /**
     * Tests the {@link Types#getDescription(Class)} method.
     */
    @Test
    public void testGetDescription() {
        final InternationalString description = Types.getDescription(CharacterSet.class);
        assertEquals("Name of the character coding standard used in the resource.",
                description.toString(Locale.ROOT));
        assertEquals("Name of the character coding standard used in the resource.",
                description.toString(Locale.ENGLISH));
        assertEquals("Jeu de caractères.",
                description.toString(Locale.FRENCH));
    }
View Full Code Here

TOP

Related Classes of org.opengis.util.InternationalString

Copyright © 2018 www.massapicom. 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.