Package org.apache.sis.internal.jaxb

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


     */
    static XMLGregorianCalendar toXML(final Instant instant) {
        if (instant != null) {
            final Position position = instant.getPosition();
            if (position != null) {
                final Context context = Context.current();
                try {
                    final XMLGregorianCalendar date = XmlUtilities.toXML(context, position.getDate());
                    if (date != null) {
                        XmlUtilities.trimTime(date, false);
                        return date;
View Full Code Here


    @XmlAnyElement(lax = true)
    public Object getElement() {
        final LogRecord record = new LogRecord(Level.WARNING, "VerticalCRS is not supported in Apache SIS 0.3.");
        record.setSourceClassName(SC_VerticalCRS.class.getName());
        record.setSourceMethodName("getElement");
        final Context context = Context.current();
        Context.warningOccured(context, metadata, record);
        return null;
    }
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

     * @param period The wrapper to set.
     */
    public void setTimePeriod(final TimePeriod period) {
        metadata = null; // Cleaned first in case of failure.
        if (period != null) {
            final Context context = Context.current();
            final Date begin = toDate(context, period.begin);
            final Date end   = toDate(context, period.end);
            if (begin != null || end != null) {
                if (begin != null && end != null && end.before(begin)) {
                    /*
 
View Full Code Here

     * @return The XML date, or {@code null.
     */
    @Override
    public XMLGregorianCalendar marshal(final Date value) {
        if (value != null) {
            final Context context = Context.current();
            try {
                final XMLGregorianCalendar gc = XmlUtilities.toXML(context, value);
                XmlUtilities.trimTime(gc, true); // Type is xsd:date without time.
                return gc;
            } catch (DatatypeConfigurationException e) {
View Full Code Here

     */
    static XMLGregorianCalendar toXML(final Instant instant) {
        if (instant != null) {
            final Position position = instant.getPosition();
            if (position != null) {
                final Context context = Context.current();
                try {
                    final XMLGregorianCalendar date = XmlUtilities.toXML(context, position.getDate());
                    if (date != null) {
                        XmlUtilities.trimTime(date, false);
                        return date;
View Full Code Here

     * @param  value The MIME type, or {@code null}.
     * @return The wrapper for the given MIME type, or {@code null}.
     */
    @Override
    public GO_CharacterString marshal(final String value) {
        final Context context = Context.current();
        final GO_CharacterString wrapper = CharSequenceAdapter.wrap(context, value, value);
        if (wrapper != null) {
            if (!Context.isFlagSet(context, Context.SUBSTITUTE_MIMETYPE)) {
                wrapper.type = GO_CharacterString.MIME_TYPE;
            }
View Full Code Here

            };
        } else {
            key = Errors.Keys.IllegalArgumentClass_3;
            arguments = new Object[] {"element", expectedType, element.getClass()};
        }
        final Context context = Context.current();
        if (context != null) {
            Context.warningOccured(context, collection.getClass(), "add", Errors.class, key, arguments);
            return null;
        } else {
            return Errors.format(key, arguments);
View Full Code Here

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

     * @param localeId The new locale.
     * @see <a href="https://issues.apache.org/jira/browse/SIS-137">SIS-137</a>
     */
    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

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.