Package org.apache.sis.internal.jaxb

Examples of org.apache.sis.internal.jaxb.Context


         * Substitute <gco:CharacterString> by <gmx:Anchor> if a linkage is found.
         */
        if (!(value instanceof Anchor)) {
            final String key = CharSequences.trimWhitespaces(value.toString());
            if (key != null && !key.isEmpty()) {
                final Context context = Context.current();
                final XLink linkage = Context.resolver(context).anchor(context, value, key);
                if (linkage != null) {
                    if (linkage instanceof Anchor) {
                        value = (Anchor) linkage;
                    } else {
View Full Code Here


        string = CharSequences.trimWhitespaces(string);
        if (string == null || string.isEmpty()) {
            return null;
        }
        CharSequence value = string;
        final Context context = Context.current();
        final XLink linkage = Context.resolver(context).anchor(context, object, string);
        if (linkage != null) {
            if (linkage instanceof Anchor) {
                value = (Anchor) linkage;
            } else {
View Full Code Here

     * @param timezone The timezone, or {@code null} for the default.
     *
     * @see #clearContext()
     */
    protected final void createContext(final boolean marshal, final Locale locale, final String timezone) {
        context = new Context(marshal ? Context.MARSHALLING : 0, locale,
                (timezone != null) ? TimeZone.getTimeZone(timezone) : null, null, null, null, null, null);
    }
View Full Code Here

     *
     * @param  marshalling {@code true} for marshalling, or {@code false} for unmarshalling.
     * @return The (un)marshalling context.
     */
    public static Context begin(final boolean marshalling) {
        return new Context(marshalling ? Context.MARSHALLING : 0, null, null, null, null,
                new ReferenceResolverMock(), null, null);
    }
View Full Code Here

    @XmlAttribute(name = "locale", required = true)
    public String getLocale() {
        if (locale == null) {
            return null;
        }
        final Context context = Context.current();
        return LOCALE.concat(Context.converter(context).toLanguageCode(context, locale));
    }
View Full Code Here

     *
     * @param localeId The new locale.
     */
    public void setLocale(final String localeId) {
        if (localeId != null) {
            final Context context = Context.current();
            locale = Context.converter(context).toLocale(context, localeId.substring(localeId.indexOf('-') + 1));
        } else {
            locale = null;
        }
    }
View Full Code Here

     * @param  value The adapter for this metadata value.
     * @return A {@linkplain Locale locale} which represents the metadata value.
     */
    @Override
    public Locale unmarshal(final LanguageCode value) {
        final Context context = Context.current();
        final Locale candidate = LanguageCode.getLocale(context, value, false);
        if (candidate != null) {
            return candidate;
        }
        final String text = StringAdapter.toString(value);
View Full Code Here

        /**
         * Creates a new wrapper for the given locale.
         */
        Wrapper(final Locale locale) {
            final Context context = Context.current();
            languageCode = LanguageCode.create(context, locale);
            country      = Country     .create(context, locale);
            // The characterEncoding field will be initialized at marshalling time (see method below).
        }
View Full Code Here

     * This method is invoked automatically by JAXB and should never be invoked explicitely.
     *
     * @throws IllegalArgumentException If the UUID is already assigned to an other object.
     */
    private void setUUID(String id) {
        final Context context = Context.current();
        final ValueConverter converter = Context.converter(context);
        final UUID uuid;
        try {
            uuid = converter.toUUID(context, id);
        } catch (IllegalArgumentException e) {
View Full Code Here

                     * Be tolerant - we can treat such case as an empty range, which is a similar
                     * approach to what JDK does for Rectangle width and height. We will log with
                     * TemporalPrimitive as the source class, since it is the closest we can get
                     * to a public API.
                     */
                    final Context context = Context.current();
                    final LogRecord record = Errors.getResources(context != null ? context.getLocale() : null)
                            .getLogRecord(Level.WARNING, Errors.Keys.IllegalRange_2, begin, end);
                    record.setSourceClassName(TemporalPrimitive.class.getName());
                    record.setSourceMethodName("setTimePeriod");
                    Context.warningOccured(context, this, record);
                } else try {
View Full Code Here

TOP

Related Classes of org.apache.sis.internal.jaxb.Context

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.