Package org.apache.sis.internal.jaxb

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


        final FilterVersion version = getFilterVersion();
        if (version != null) {
            // This exception is thrown by javax.xml.bind.helpers.AbstractMarshallerImpl anyway.
            throw new UnsupportedOperationException();
        } else {
            final Context context = begin();
            try {
                return marshaller.getNode(object);
            } finally {
                context.finish();
            }
        }
    }
View Full Code Here


             */
            final IdentifierMap map = ((IdentifiedObject) value).getIdentifierMap();
            XLink  link = map.getSpecialized(IdentifierSpace.XLINK);
            UUID   uuid = map.getSpecialized(IdentifierSpace.UUID);
            if (uuid != null || link != null) {
                final Context           context  = Context.current();
                final ReferenceResolver resolver = Context.resolver(context);
                final Class<BoundType>  type     = getBoundType();
                /*
                 * Check if the user gives us the permission to use reference to those identifiers.
                 * If not, forget them in order to avoid marshalling the identifiers twice (see the
View Full Code Here

     * @param  uuid The new attribute value.
     * @throws IllegalArgumentException If the given UUID can not be parsed.
     * @category gco:ObjectReference
     */
    public final void setUUIDREF(final String uuid) throws IllegalArgumentException {
        final Context context = Context.current();
        reference(true).uuid = Context.converter(context).toUUID(context, uuid);
    }
View Full Code Here

    /**
     * Parses the given URI, or returns {@code null} if the given argument is null or empty.
     */
    private static URI toURI(final String uri) throws URISyntaxException {
        final Context context = Context.current();
        return Context.converter(context).toURI(context, uri);
    }
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();
        return Context.converter(context).toLocale(context, value.getLanguage());
    }
View Full Code Here

     * @return The unit for the given symbol.
     * @throws IllegalArgumentException if the given symbol is unknown.
     */
    @Override
    public final Unit<?> unmarshal(final String value) throws IllegalArgumentException {
        final Context context = Context.current();
        return Context.converter(context).toUnit(context, value);
    }
View Full Code Here

     * Builds a wrapper for the given {@link Date}.
     *
     * @param date The date to marshal. Can not be {@code null}.
     */
    private GO_DateTime(final Date date) {
        final Context context = Context.current();
        try {
            final XMLGregorianCalendar gc = XmlUtilities.toXML(context, date);
            if (XmlUtilities.trimTime(gc, false)) {
                this.date = gc;
            } else {
View Full Code Here

     * }
     *
     * @see Context#finish();
     */
    final Context begin() {
        return new Context(bitMasks, locale, timezone, schemas, gmlVersion, resolver, converter, warningListener);
    }
View Full Code Here

    static String toString(final CharSequence text) {
        if (text == null) {
            return null;
        }
        if (text instanceof InternationalString) {
            final Context context = Context.current();
            if (context != null) {
                final Locale locale = context.getLocale();
                if (locale != null) {
                    // While Apache SIS accepts null locale, foreigner
                    // implementations are not guaranteed to support null.
                    return ((InternationalString) text).toString(locale);
                }
View Full Code Here

     *
     * @param uom The unit of measure as a string.
     * @throws URISyntaxException If the {@code uom} looks like a URI, but can not be parsed.
     */
    public void setUOM(String uom) throws URISyntaxException {
        final Context context = Context.current();
        unit = Context.converter(context).toUnit(context, uom);
    }
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.