sis-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From desruisse...@apache.org
Subject svn commit: r1479856 - in /sis/branches/JDK7: sis-metadata/src/main/java/org/apache/sis/metadata/ sis-metadata/src/main/java/org/apache/sis/metadata/iso/ sis-metadata/src/main/java/org/apache/sis/metadata/iso/maintenance/ sis-metadata/src/main/java/org...
Date Tue, 07 May 2013 11:07:12 GMT
Author: desruisseaux
Date: Tue May  7 11:07:11 2013
New Revision: 1479856

URL: http://svn.apache.org/r1479856
Log:
Renamed the internal "MarshalContext" class as "Context", for differentiating from the public
"MarshalContext" class and for anticipating usage in slightly wider cases than just (un)marshalling.

Added:
    sis/branches/JDK7/sis-utility/src/main/java/org/apache/sis/internal/jaxb/Context.java
      - copied, changed from r1479579, sis/branches/JDK7/sis-utility/src/main/java/org/apache/sis/internal/jaxb/MarshalContext.java
Removed:
    sis/branches/JDK7/sis-utility/src/main/java/org/apache/sis/internal/jaxb/MarshalContext.java
Modified:
    sis/branches/JDK7/sis-metadata/src/main/java/org/apache/sis/metadata/ModifiableMetadata.java
    sis/branches/JDK7/sis-metadata/src/main/java/org/apache/sis/metadata/iso/DefaultMetadata.java
    sis/branches/JDK7/sis-metadata/src/main/java/org/apache/sis/metadata/iso/maintenance/DefaultScopeDescription.java
    sis/branches/JDK7/sis-metadata/src/main/java/org/apache/sis/metadata/iso/quality/AbstractElement.java
    sis/branches/JDK7/sis-utility/src/main/java/org/apache/sis/internal/jaxb/NonMarshalledAuthority.java
    sis/branches/JDK7/sis-utility/src/main/java/org/apache/sis/internal/jaxb/gco/CharSequenceAdapter.java
    sis/branches/JDK7/sis-utility/src/main/java/org/apache/sis/internal/jaxb/gco/ObjectReference.java
    sis/branches/JDK7/sis-utility/src/main/java/org/apache/sis/internal/jaxb/gco/PropertyType.java
    sis/branches/JDK7/sis-utility/src/main/java/org/apache/sis/internal/jaxb/gco/StringAdapter.java
    sis/branches/JDK7/sis-utility/src/main/java/org/apache/sis/internal/jaxb/gco/URIAdapter.java
    sis/branches/JDK7/sis-utility/src/main/java/org/apache/sis/internal/jaxb/gmd/CodeListAdapter.java
    sis/branches/JDK7/sis-utility/src/main/java/org/apache/sis/internal/jaxb/gmd/CodeListProxy.java
    sis/branches/JDK7/sis-utility/src/main/java/org/apache/sis/internal/jaxb/gmd/Country.java
    sis/branches/JDK7/sis-utility/src/main/java/org/apache/sis/internal/jaxb/gmd/LanguageCode.java
    sis/branches/JDK7/sis-utility/src/main/java/org/apache/sis/internal/jaxb/gmd/LocaleAdapter.java
    sis/branches/JDK7/sis-utility/src/main/java/org/apache/sis/internal/jaxb/gmd/LocalisedCharacterString.java
    sis/branches/JDK7/sis-utility/src/main/java/org/apache/sis/internal/jaxb/gmd/PT_FreeText.java
    sis/branches/JDK7/sis-utility/src/main/java/org/apache/sis/xml/Pooled.java
    sis/branches/JDK7/sis-utility/src/main/java/org/apache/sis/xml/PooledMarshaller.java
    sis/branches/JDK7/sis-utility/src/main/java/org/apache/sis/xml/PooledUnmarshaller.java

Modified: sis/branches/JDK7/sis-metadata/src/main/java/org/apache/sis/metadata/ModifiableMetadata.java
URL: http://svn.apache.org/viewvc/sis/branches/JDK7/sis-metadata/src/main/java/org/apache/sis/metadata/ModifiableMetadata.java?rev=1479856&r1=1479855&r2=1479856&view=diff
==============================================================================
--- sis/branches/JDK7/sis-metadata/src/main/java/org/apache/sis/metadata/ModifiableMetadata.java [UTF-8] (original)
+++ sis/branches/JDK7/sis-metadata/src/main/java/org/apache/sis/metadata/ModifiableMetadata.java [UTF-8] Tue May  7 11:07:11 2013
@@ -29,7 +29,7 @@ import org.apache.sis.internal.util.Chec
 import org.apache.sis.internal.util.CheckedArrayList;
 
 import static org.apache.sis.util.collection.Containers.isNullOrEmpty;
-import static org.apache.sis.internal.jaxb.MarshalContext.isMarshalling;
+import static org.apache.sis.internal.jaxb.Context.isMarshalling;
 
 
 /**

Modified: sis/branches/JDK7/sis-metadata/src/main/java/org/apache/sis/metadata/iso/DefaultMetadata.java
URL: http://svn.apache.org/viewvc/sis/branches/JDK7/sis-metadata/src/main/java/org/apache/sis/metadata/iso/DefaultMetadata.java?rev=1479856&r1=1479855&r2=1479856&view=diff
==============================================================================
--- sis/branches/JDK7/sis-metadata/src/main/java/org/apache/sis/metadata/iso/DefaultMetadata.java [UTF-8] (original)
+++ sis/branches/JDK7/sis-metadata/src/main/java/org/apache/sis/metadata/iso/DefaultMetadata.java [UTF-8] Tue May  7 11:07:11 2013
@@ -41,8 +41,8 @@ import org.opengis.metadata.maintenance.
 import org.opengis.metadata.quality.DataQuality;
 import org.opengis.metadata.spatial.SpatialRepresentation;
 import org.opengis.referencing.ReferenceSystem;
-import org.apache.sis.internal.jaxb.MarshalContext;
 //import org.apache.sis.internal.jaxb.gmd.PT_Locale; // TODO
+import org.apache.sis.internal.jaxb.Context;
 import org.apache.sis.xml.Namespaces;
 
 import static org.apache.sis.internal.metadata.MetadataUtilities.toDate;
@@ -774,7 +774,7 @@ public class DefaultMetadata extends ISO
      * This method sets the locale to be used for XML marshalling to the metadata language.
      */
     private void beforeMarshal(final Marshaller marshaller) {
-        MarshalContext.push(language);
+        Context.push(language);
     }
 
     /**
@@ -782,6 +782,6 @@ public class DefaultMetadata extends ISO
      * XML. This method restores the locale to be used for XML marshalling to its previous value.
      */
     private void afterMarshal(final Marshaller marshaller) {
-        MarshalContext.pull();
+        Context.pull();
     }
 }

Modified: sis/branches/JDK7/sis-metadata/src/main/java/org/apache/sis/metadata/iso/maintenance/DefaultScopeDescription.java
URL: http://svn.apache.org/viewvc/sis/branches/JDK7/sis-metadata/src/main/java/org/apache/sis/metadata/iso/maintenance/DefaultScopeDescription.java?rev=1479856&r1=1479855&r2=1479856&view=diff
==============================================================================
--- sis/branches/JDK7/sis-metadata/src/main/java/org/apache/sis/metadata/iso/maintenance/DefaultScopeDescription.java [UTF-8] (original)
+++ sis/branches/JDK7/sis-metadata/src/main/java/org/apache/sis/metadata/iso/maintenance/DefaultScopeDescription.java [UTF-8] Tue May  7 11:07:11 2013
@@ -27,7 +27,7 @@ import org.apache.sis.metadata.iso.ISOMe
 import org.apache.sis.internal.metadata.ExcludedSet;
 import org.apache.sis.util.collection.CheckedContainer;
 
-import static org.apache.sis.internal.jaxb.MarshalContext.isMarshalling;
+import static org.apache.sis.internal.jaxb.Context.isMarshalling;
 import static org.apache.sis.util.collection.Containers.isNullOrEmpty;
 
 

Modified: sis/branches/JDK7/sis-metadata/src/main/java/org/apache/sis/metadata/iso/quality/AbstractElement.java
URL: http://svn.apache.org/viewvc/sis/branches/JDK7/sis-metadata/src/main/java/org/apache/sis/metadata/iso/quality/AbstractElement.java?rev=1479856&r1=1479855&r2=1479856&view=diff
==============================================================================
--- sis/branches/JDK7/sis-metadata/src/main/java/org/apache/sis/metadata/iso/quality/AbstractElement.java [UTF-8] (original)
+++ sis/branches/JDK7/sis-metadata/src/main/java/org/apache/sis/metadata/iso/quality/AbstractElement.java [UTF-8] Tue May  7 11:07:11 2013
@@ -42,7 +42,7 @@ import org.apache.sis.util.collection.Ch
 import org.apache.sis.util.resources.Errors;
 
 import static org.apache.sis.util.collection.Containers.isNullOrEmpty;
-import static org.apache.sis.internal.jaxb.MarshalContext.isMarshalling;
+import static org.apache.sis.internal.jaxb.Context.isMarshalling;
 
 
 /**

Copied: sis/branches/JDK7/sis-utility/src/main/java/org/apache/sis/internal/jaxb/Context.java (from r1479579, sis/branches/JDK7/sis-utility/src/main/java/org/apache/sis/internal/jaxb/MarshalContext.java)
URL: http://svn.apache.org/viewvc/sis/branches/JDK7/sis-utility/src/main/java/org/apache/sis/internal/jaxb/Context.java?p2=sis/branches/JDK7/sis-utility/src/main/java/org/apache/sis/internal/jaxb/Context.java&p1=sis/branches/JDK7/sis-utility/src/main/java/org/apache/sis/internal/jaxb/MarshalContext.java&r1=1479579&r2=1479856&rev=1479856&view=diff
==============================================================================
--- sis/branches/JDK7/sis-utility/src/main/java/org/apache/sis/internal/jaxb/MarshalContext.java [UTF-8] (original)
+++ sis/branches/JDK7/sis-utility/src/main/java/org/apache/sis/internal/jaxb/Context.java [UTF-8] Tue May  7 11:07:11 2013
@@ -20,23 +20,28 @@ import java.util.Map;
 import java.util.Locale;
 import java.util.TimeZone;
 import org.apache.sis.util.Version;
+import org.apache.sis.xml.MarshalContext;
 import org.apache.sis.xml.ValueConverter;
 import org.apache.sis.xml.ReferenceResolver;
 
 
 /**
- * Thread-local status of a marshalling or unmarshalling process.
+ * Thread-local status of a marshalling or unmarshalling processes, also occasionally used for other processes.
  * All non-static methods in this class except {@link #finish()} are implementation of public API.
- * All static methods are internal API. Those methods expect a {@code MarshalContext} instance as
- * their first argument. They should be though as if they were normal member methods, except that
- * they accept {@code null} instance if no (un)marshalling is in progress.
+ * All static methods are internal API. Those methods expect a {@code Context} instance as their first argument.
+ * They should be though as if they were normal member methods, except that they accept {@code null} instance
+ * if no (un)marshalling is in progress.
+ *
+ * <p>While this class is primarily used for (un)marshalling processes, it may also be opportunistically used
+ * for other processes like {@link org.apache.sis.metadata.AbstractMetadata#equals(Object)}. The class name is
+ * only "{@code Context}" for that reason.</p>
  *
  * @author  Martin Desruisseaux (Geomatys)
  * @since   0.3 (derived from geotk-3.07)
  * @version 0.3
  * @module
  */
-public final class MarshalContext extends org.apache.sis.xml.MarshalContext {
+public final class Context extends MarshalContext {
     /**
      * The bit flag telling if a marshalling process is under progress.
      * This flag is unset for unmarshalling processes.
@@ -62,7 +67,7 @@ public final class MarshalContext extend
      * {@code finally} block by the {@link #finish()} method. This {@code ThreadLocal} shall
      * not contain any value when no (un)marshalling is in progress.
      */
-    private static final ThreadLocal<MarshalContext> CURRENT = new ThreadLocal<>();
+    private static final ThreadLocal<Context> CURRENT = new ThreadLocal<>();
 
     /**
      * The value converter currently in use, or {@code null} for {@link ValueConverter#DEFAULT}.
@@ -107,14 +112,14 @@ public final class MarshalContext extend
      * to push properties (e.g. {@link #pushLocale(Locale)}) and pull back the
      * context to its previous state once finished.
      */
-    private final MarshalContext previous;
+    private final Context previous;
 
     /**
      * Invoked when a marshalling or unmarshalling process is about to begin.
      * Must be followed by a call to {@link #finish()} in a {@code finally} block.
      *
      * {@preformat java
-     *     MarshalContext context = new MarshalContext(…);
+     *     Context context = new Context(…);
      *     try {
      *         ...
      *     } finally {
@@ -131,7 +136,7 @@ public final class MarshalContext extend
      * @param  bitMasks   A combination of {@link #MARSHALLING}, {@link #SUBSTITUTE_LANGUAGE},
      *                    {@link #SUBSTITUTE_COUNTRY} or other bit masks.
      */
-    public MarshalContext(final ValueConverter converter, final ReferenceResolver resolver,
+    public Context(final ValueConverter converter, final ReferenceResolver resolver,
             final Version versionGML, final Map<String,String> schemas,
             final Locale locale, final TimeZone timezone, final int bitMasks)
     {
@@ -153,7 +158,7 @@ public final class MarshalContext extend
      *
      * @see #push(Locale)
      */
-    private MarshalContext(final MarshalContext previous) {
+    private Context(final Context previous) {
         if (previous != null) {
             converter  = previous.converter;
             resolver   = previous.resolver;
@@ -201,7 +206,7 @@ public final class MarshalContext extend
     /*
      * ---- END OF PUBLIC API --------------------------------------------------------------
      *
-     * Following are internal API. They are provided as static methods with a MarshalContext
+     * Following are internal API. They are provided as static methods with a Context
      * argument rather than normal member methods in order to accept null context.
      */
 
@@ -211,7 +216,7 @@ public final class MarshalContext extend
      *
      * @return The current (un)marshalling context, or {@code null} if none.
      */
-    public static MarshalContext current() {
+    public static Context current() {
         return CURRENT.get();
     }
 
@@ -223,8 +228,8 @@ public final class MarshalContext extend
      *     return isFlagSet(current(), MARSHALLING);
      * }
      *
-     * Callers should use the {@link #isFlagSet(MarshalContext, int)} method instead if the
-     * {@code MarshalContext} instance is known, for avoiding a call to {@link #current()}.
+     * Callers should use the {@link #isFlagSet(Context, int)} method instead if the
+     * {@code Context} instance is known, for avoiding a call to {@link #current()}.
      *
      * @return {@code true} if XML marshalling is under progress.
      */
@@ -240,7 +245,7 @@ public final class MarshalContext extend
      *         {@link #SUBSTITUTE_COUNTRY} or other bit masks.
      * @return {@code true} if the given flag is set.
      */
-    public static boolean isFlagSet(final MarshalContext context, final int flag) {
+    public static boolean isFlagSet(final Context context, final int flag) {
         return (context != null) && (context.bitMasks & flag) != 0;
     }
 
@@ -253,7 +258,7 @@ public final class MarshalContext extend
      * @param  context The current context, or {@code null} if none.
      * @return The current value converter (never null).
      */
-    public static ValueConverter converter(final MarshalContext context) {
+    public static ValueConverter converter(final Context context) {
         if (context != null) {
             final ValueConverter converter = context.converter;
             if (converter != null) {
@@ -272,7 +277,7 @@ public final class MarshalContext extend
      * @param  context The current context, or {@code null} if none.
      * @return The current reference resolver (never null).
      */
-    public static ReferenceResolver resolver(final MarshalContext context) {
+    public static ReferenceResolver resolver(final Context context) {
         if (context != null) {
             final ReferenceResolver resolver = context.resolver;
             if (resolver != null) {
@@ -294,7 +299,7 @@ public final class MarshalContext extend
      * @param  defaultSchema The value to return if no schema is found for the given key.
      * @return The base URL of the schema, or {@code null} if none were specified.
      */
-    public static String schema(final MarshalContext context, final String key, final String defaultSchema) {
+    public static String schema(final Context context, final String key, final String defaultSchema) {
         if (context != null) {
             final Map<String,String> schemas = context.schemas;
             if (schemas != null) {
@@ -320,7 +325,7 @@ public final class MarshalContext extend
      *
      * @see #getVersion(String)
      */
-    public static boolean isGMLVersion(final MarshalContext context, final Version version) {
+    public static boolean isGMLVersion(final Context context, final Version version) {
         if (context != null) {
             final Version versionGML = context.versionGML;
             if (versionGML != null) {
@@ -338,18 +343,18 @@ public final class MarshalContext extend
      *
      * {@preformat java
      *     private void beforeMarshal(Marshaller marshaller) {
-     *         MarshalContext.push(language);
+     *         Context.push(language);
      *     }
      *
      *     private void afterMarshal(Marshaller marshaller) {
-     *         MarshalContext.pull();
+     *         Context.pull();
      *     }
      * }
      *
      * @param locale The locale to set, or {@code null}.
      */
     public static void push(final Locale locale) {
-        final MarshalContext context = new MarshalContext(current());
+        final Context context = new Context(current());
         if (locale != null) {
             context.locale = locale;
         }
@@ -358,11 +363,11 @@ public final class MarshalContext extend
     /**
      * Restores the locale (or any other setting) which was used prior the call
      * to {@link #push(Locale)}. It is not necessary to invoke this method in a
-     * {@code finally} block if the parent {@code MarshalContext} is itself
+     * {@code finally} block if the parent {@code Context} is itself
      * disposed in a {@code finally} block.
      */
     public static void pull() {
-        final MarshalContext current = current();
+        final Context current = current();
         if (current != null) {
             current.finish();
         }

Modified: sis/branches/JDK7/sis-utility/src/main/java/org/apache/sis/internal/jaxb/NonMarshalledAuthority.java
URL: http://svn.apache.org/viewvc/sis/branches/JDK7/sis-utility/src/main/java/org/apache/sis/internal/jaxb/NonMarshalledAuthority.java?rev=1479856&r1=1479855&r2=1479856&view=diff
==============================================================================
--- sis/branches/JDK7/sis-utility/src/main/java/org/apache/sis/internal/jaxb/NonMarshalledAuthority.java [UTF-8] (original)
+++ sis/branches/JDK7/sis-utility/src/main/java/org/apache/sis/internal/jaxb/NonMarshalledAuthority.java [UTF-8] Tue May  7 11:07:11 2013
@@ -183,7 +183,7 @@ public final class NonMarshalledAuthorit
      * @return The identifiers to marshal, or {@code null} if none.
      */
     public static Collection<Identifier> excludeOnMarshalling(Collection<Identifier> identifiers) {
-        if (identifiers != null && MarshalContext.isMarshalling()) {
+        if (identifiers != null && Context.isMarshalling()) {
             int count = identifiers.size();
             if (count != 0) {
                 final Identifier[] copy = identifiers.toArray(new Identifier[count]);

Modified: sis/branches/JDK7/sis-utility/src/main/java/org/apache/sis/internal/jaxb/gco/CharSequenceAdapter.java
URL: http://svn.apache.org/viewvc/sis/branches/JDK7/sis-utility/src/main/java/org/apache/sis/internal/jaxb/gco/CharSequenceAdapter.java?rev=1479856&r1=1479855&r2=1479856&view=diff
==============================================================================
--- sis/branches/JDK7/sis-utility/src/main/java/org/apache/sis/internal/jaxb/gco/CharSequenceAdapter.java [UTF-8] (original)
+++ sis/branches/JDK7/sis-utility/src/main/java/org/apache/sis/internal/jaxb/gco/CharSequenceAdapter.java [UTF-8] Tue May  7 11:07:11 2013
@@ -21,7 +21,7 @@ import org.opengis.util.InternationalStr
 import org.apache.sis.util.CharSequences;
 import org.apache.sis.xml.XLink;
 import org.apache.sis.xml.ReferenceResolver;
-import org.apache.sis.internal.jaxb.MarshalContext;
+import org.apache.sis.internal.jaxb.Context;
 import org.apache.sis.internal.jaxb.gmx.Anchor;
 import org.apache.sis.internal.jaxb.gmd.PT_FreeText;
 
@@ -98,7 +98,7 @@ public final class CharSequenceAdapter e
          * </gmd:someElement>
          */
         if (value instanceof InternationalString) {
-            final PT_FreeText ft = PT_FreeText.create(MarshalContext.current(), (InternationalString) value);
+            final PT_FreeText ft = PT_FreeText.create(Context.current(), (InternationalString) value);
             if (ft != null) {
                 return ft;
             }
@@ -118,8 +118,8 @@ public final class CharSequenceAdapter e
         if (!(value instanceof Anchor)) {
             final String key = CharSequences.trimWhitespaces(value.toString());
             if (key != null && !key.isEmpty()) {
-                final MarshalContext context = MarshalContext.current();
-                final XLink linkage = MarshalContext.resolver(context).anchor(context, value, key);
+                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;
@@ -157,8 +157,8 @@ public final class CharSequenceAdapter e
             return null;
         }
         CharSequence value = string;
-        final MarshalContext context = MarshalContext.current();
-        final XLink linkage = MarshalContext.resolver(context).anchor(context, object, 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;

Modified: sis/branches/JDK7/sis-utility/src/main/java/org/apache/sis/internal/jaxb/gco/ObjectReference.java
URL: http://svn.apache.org/viewvc/sis/branches/JDK7/sis-utility/src/main/java/org/apache/sis/internal/jaxb/gco/ObjectReference.java?rev=1479856&r1=1479855&r2=1479856&view=diff
==============================================================================
--- sis/branches/JDK7/sis-utility/src/main/java/org/apache/sis/internal/jaxb/gco/ObjectReference.java [UTF-8] (original)
+++ sis/branches/JDK7/sis-utility/src/main/java/org/apache/sis/internal/jaxb/gco/ObjectReference.java [UTF-8] Tue May  7 11:07:11 2013
@@ -24,7 +24,7 @@ import org.apache.sis.xml.IdentifierSpac
 import org.apache.sis.xml.IdentifiedObject;
 import org.apache.sis.xml.ReferenceResolver;
 import org.apache.sis.util.ArraysExt;
-import org.apache.sis.internal.jaxb.MarshalContext;
+import org.apache.sis.internal.jaxb.Context;
 import org.apache.sis.internal.jaxb.IdentifierMapAdapter;
 import org.apache.sis.internal.jaxb.SpecializedIdentifier;
 
@@ -92,8 +92,8 @@ final class ObjectReference {
      * @return The parsed UUID, or {@code null}.
      * @throws IllegalArgumentException If {@code anyUUID} can not be parsed.
      */
-    static UUID toUUID(final MarshalContext context, final String anyUUID) throws IllegalArgumentException {
-        return (anyUUID != null) ? MarshalContext.converter(context).toUUID(context, anyUUID) : null;
+    static UUID toUUID(final Context context, final String anyUUID) throws IllegalArgumentException {
+        return (anyUUID != null) ? Context.converter(context).toUUID(context, anyUUID) : null;
     }
 
     /**
@@ -110,12 +110,12 @@ final class ObjectReference {
      * @return A metadata object for the identifiers, or {@code null}
      * @throws IllegalArgumentException If the {@link #anyUUID} field can not be parsed.
      */
-    final <T> T resolve(final MarshalContext context, final Class<T> type, T metadata) throws IllegalArgumentException {
+    final <T> T resolve(final Context context, final Class<T> type, T metadata) throws IllegalArgumentException {
         if (uuid == null) {
             uuid = toUUID(context, anyUUID);
         }
         if (metadata == null) {
-            final ReferenceResolver resolver = MarshalContext.resolver(context);
+            final ReferenceResolver resolver = Context.resolver(context);
             if ((uuid  == null || (metadata = resolver.resolve(context, type, uuid )) == null) &&
                 (xlink == null || (metadata = resolver.resolve(context, type, xlink)) == null))
             {

Modified: sis/branches/JDK7/sis-utility/src/main/java/org/apache/sis/internal/jaxb/gco/PropertyType.java
URL: http://svn.apache.org/viewvc/sis/branches/JDK7/sis-utility/src/main/java/org/apache/sis/internal/jaxb/gco/PropertyType.java?rev=1479856&r1=1479855&r2=1479856&view=diff
==============================================================================
--- sis/branches/JDK7/sis-utility/src/main/java/org/apache/sis/internal/jaxb/gco/PropertyType.java [UTF-8] (original)
+++ sis/branches/JDK7/sis-utility/src/main/java/org/apache/sis/internal/jaxb/gco/PropertyType.java [UTF-8] Tue May  7 11:07:11 2013
@@ -28,7 +28,7 @@ import org.apache.sis.xml.Namespaces;
 import org.apache.sis.xml.IdentifierMap;
 import org.apache.sis.xml.IdentifierSpace;
 import org.apache.sis.xml.IdentifiedObject;
-import org.apache.sis.internal.jaxb.MarshalContext;
+import org.apache.sis.internal.jaxb.Context;
 import org.apache.sis.util.iso.SimpleInternationalString;
 
 
@@ -150,11 +150,11 @@ public abstract class PropertyType<Value
             UUID   uuid = map.getSpecialized(IdentifierSpace.UUID);
             String anyUUID = (uuid != null) ? uuid.toString() : map.get(IdentifierSpace.UUID);
             if (anyUUID != null || link != null) {
-                final MarshalContext context = MarshalContext.current();
+                final Context context = Context.current();
                 if (uuid == null) {
                     uuid = ObjectReference.toUUID(context, anyUUID); // May still null.
                 }
-                if (uuid == null || MarshalContext.resolver(context).canSubstituteByReference(context, getBoundType(), metadata, uuid)) {
+                if (uuid == null || Context.resolver(context).canSubstituteByReference(context, getBoundType(), metadata, uuid)) {
                     reference = new ObjectReference(uuid, anyUUID, link);
                     return;
                 }
@@ -285,8 +285,8 @@ public abstract class PropertyType<Value
      * 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 MarshalContext context = MarshalContext.current();
-        return MarshalContext.converter(context).toURI(context, uri);
+        final Context context = Context.current();
+        return Context.converter(context).toURI(context, uri);
     }
 
     /**
@@ -499,7 +499,7 @@ public abstract class PropertyType<Value
      */
     @Override
     public final BoundType unmarshal(final ValueType value) throws URISyntaxException {
-        return (value != null) ? value.resolve(MarshalContext.current()) : null;
+        return (value != null) ? value.resolve(Context.current()) : null;
     }
 
     /**
@@ -509,7 +509,7 @@ public abstract class PropertyType<Value
      * @throws URISyntaxException If a URI can not be parsed.
      * @throws IllegalArgumentException If the UUID can not be parsed.
      */
-    final BoundType resolve(final MarshalContext context) throws URISyntaxException, IllegalArgumentException {
+    final BoundType resolve(final Context context) throws URISyntaxException, IllegalArgumentException {
         final ObjectReference ref = reference(false);
         if (ref != null) {
             metadata = ref.resolve(context, getBoundType(), metadata);
@@ -517,7 +517,7 @@ public abstract class PropertyType<Value
         if (metadata == null) {
             final String value = getNilReason();
             if (value != null) {
-                final NilReason nilReason = MarshalContext.converter(context).toNilReason(context, value);
+                final NilReason nilReason = Context.converter(context).toNilReason(context, value);
                 if (nilReason != null) {
                     metadata = nilReason.createNilObject(getBoundType());
                 }

Modified: sis/branches/JDK7/sis-utility/src/main/java/org/apache/sis/internal/jaxb/gco/StringAdapter.java
URL: http://svn.apache.org/viewvc/sis/branches/JDK7/sis-utility/src/main/java/org/apache/sis/internal/jaxb/gco/StringAdapter.java?rev=1479856&r1=1479855&r2=1479856&view=diff
==============================================================================
--- sis/branches/JDK7/sis-utility/src/main/java/org/apache/sis/internal/jaxb/gco/StringAdapter.java [UTF-8] (original)
+++ sis/branches/JDK7/sis-utility/src/main/java/org/apache/sis/internal/jaxb/gco/StringAdapter.java [UTF-8] Tue May  7 11:07:11 2013
@@ -19,7 +19,7 @@ package org.apache.sis.internal.jaxb.gco
 import java.util.Locale;
 import javax.xml.bind.annotation.adapters.XmlAdapter;
 import org.opengis.util.InternationalString;
-import org.apache.sis.internal.jaxb.MarshalContext;
+import org.apache.sis.internal.jaxb.Context;
 
 
 /**
@@ -56,7 +56,7 @@ public final class StringAdapter extends
             final CharSequence text = value.toCharSequence();
             if (text != null) {
                 if (text instanceof InternationalString) {
-                    final MarshalContext context = MarshalContext.current();
+                    final Context context = Context.current();
                     if (context != null) {
                         final Locale locale = context.getLocale();
                         if (locale != null) {

Modified: sis/branches/JDK7/sis-utility/src/main/java/org/apache/sis/internal/jaxb/gco/URIAdapter.java
URL: http://svn.apache.org/viewvc/sis/branches/JDK7/sis-utility/src/main/java/org/apache/sis/internal/jaxb/gco/URIAdapter.java?rev=1479856&r1=1479855&r2=1479856&view=diff
==============================================================================
--- sis/branches/JDK7/sis-utility/src/main/java/org/apache/sis/internal/jaxb/gco/URIAdapter.java [UTF-8] (original)
+++ sis/branches/JDK7/sis-utility/src/main/java/org/apache/sis/internal/jaxb/gco/URIAdapter.java [UTF-8] Tue May  7 11:07:11 2013
@@ -19,7 +19,7 @@ package org.apache.sis.internal.jaxb.gco
 import java.net.URI;
 import java.net.URISyntaxException;
 import javax.xml.bind.annotation.adapters.XmlAdapter;
-import org.apache.sis.internal.jaxb.MarshalContext;
+import org.apache.sis.internal.jaxb.Context;
 
 
 /**
@@ -51,8 +51,8 @@ public final class URIAdapter extends Xm
     public URI unmarshal(final GO_CharacterString value) throws URISyntaxException {
         final String text = StringAdapter.toString(value);
         if (text != null) {
-            final MarshalContext context = MarshalContext.current();
-            return MarshalContext.converter(context).toURI(context, text);
+            final Context context = Context.current();
+            return Context.converter(context).toURI(context, text);
         }
         return null;
     }

Modified: sis/branches/JDK7/sis-utility/src/main/java/org/apache/sis/internal/jaxb/gmd/CodeListAdapter.java
URL: http://svn.apache.org/viewvc/sis/branches/JDK7/sis-utility/src/main/java/org/apache/sis/internal/jaxb/gmd/CodeListAdapter.java?rev=1479856&r1=1479855&r2=1479856&view=diff
==============================================================================
--- sis/branches/JDK7/sis-utility/src/main/java/org/apache/sis/internal/jaxb/gmd/CodeListAdapter.java [UTF-8] (original)
+++ sis/branches/JDK7/sis-utility/src/main/java/org/apache/sis/internal/jaxb/gmd/CodeListAdapter.java [UTF-8] Tue May  7 11:07:11 2013
@@ -19,7 +19,7 @@ package org.apache.sis.internal.jaxb.gmd
 import javax.xml.bind.annotation.adapters.XmlAdapter;
 import org.opengis.util.CodeList;
 import org.apache.sis.util.iso.Types;
-import org.apache.sis.internal.jaxb.MarshalContext;
+import org.apache.sis.internal.jaxb.Context;
 
 
 /**
@@ -133,7 +133,7 @@ public abstract class CodeListAdapter<Va
             return null;
         }
         return wrap(isEnum() ? new CodeListProxy(Types.getCodeName(value))
-                             : new CodeListProxy(MarshalContext.current(), value));
+                             : new CodeListProxy(Context.current(), value));
     }
 
     /**

Modified: sis/branches/JDK7/sis-utility/src/main/java/org/apache/sis/internal/jaxb/gmd/CodeListProxy.java
URL: http://svn.apache.org/viewvc/sis/branches/JDK7/sis-utility/src/main/java/org/apache/sis/internal/jaxb/gmd/CodeListProxy.java?rev=1479856&r1=1479855&r2=1479856&view=diff
==============================================================================
--- sis/branches/JDK7/sis-utility/src/main/java/org/apache/sis/internal/jaxb/gmd/CodeListProxy.java [UTF-8] (original)
+++ sis/branches/JDK7/sis-utility/src/main/java/org/apache/sis/internal/jaxb/gmd/CodeListProxy.java [UTF-8] Tue May  7 11:07:11 2013
@@ -23,9 +23,9 @@ import javax.xml.bind.annotation.XmlAttr
 import javax.xml.bind.annotation.XmlType;
 import javax.xml.bind.annotation.XmlValue;
 import org.opengis.util.CodeList;
-import org.apache.sis.util.logging.Logging;
 import org.apache.sis.util.iso.Types;
-import org.apache.sis.internal.jaxb.MarshalContext;
+import org.apache.sis.util.logging.Logging;
+import org.apache.sis.internal.jaxb.Context;
 
 
 /**
@@ -53,8 +53,8 @@ public final class CodeListProxy {
      * @param  identifier The UML identifier of the code list.
      * @return The URL to the given code list in the given schema.
      */
-    private static String schema(final MarshalContext context, final String file, final String identifier) {
-        return schema(MarshalContext.schema(context, "gmd", "http://schemas.opengis.net/iso/19139/20070417/"),
+    private static String schema(final Context context, final String file, final String identifier) {
+        return schema(Context.schema(context, "gmd", "http://schemas.opengis.net/iso/19139/20070417/"),
                 "resources/Codelist", file, identifier);
     }
 
@@ -70,7 +70,7 @@ public final class CodeListProxy {
      * </ul>
      *
      * @param  schema     The schema, typically as a result of a call to
-     *                    {@link MarshalContext#schema(MarshalContext, String, String)}.
+     *                    {@link Context#schema(Context, String, String)}.
      * @param  directory  The directory to concatenate, for example {@code "resources/uom"}
      *                    or {@code "resources/Codelist"} (<strong>no trailing {@code '/'}</strong>).
      * @param  file       The XML file, for example {@code "gmxUom.xml"}, {@code "gmxCodelists.xml"}
@@ -149,7 +149,7 @@ public final class CodeListProxy {
      * @param codeSpace     The 3-letters language code of the {@code value} attribute, or {@code null} if none.
      * @param value         The value in the language specified by the {@code codeSpace} attribute, or {@code null} if none.
      */
-    CodeListProxy(final MarshalContext context, final String catalog,
+    CodeListProxy(final Context context, final String catalog,
             final String codeList, final String codeListValue, final String codeSpace, final String value)
     {
         this.codeList      = schema(context, catalog, codeList);
@@ -165,7 +165,7 @@ public final class CodeListProxy {
      * @param context The current (un)marshalling context, or {@code null} if none.
      * @param code    The code list to wrap.
      */
-    CodeListProxy(final MarshalContext context, final CodeList<?> code) {
+    CodeListProxy(final Context context, final CodeList<?> code) {
         final String classID = Types.getListName(code);
         final String fieldID = Types.getCodeName(code);
         codeList = schema(context, "gmxCodelists.xml", classID);
@@ -187,7 +187,7 @@ public final class CodeListProxy {
             }
         }
         if (value != null) {
-            codeSpace = MarshalContext.converter(context).toLanguageCode(context, locale);
+            codeSpace = Context.converter(context).toLanguageCode(context, locale);
         } else {
             // Fallback when no value is defined for the code list. Build a value from the
             // most descriptive name (excluding the field name), which is usually the UML

Modified: sis/branches/JDK7/sis-utility/src/main/java/org/apache/sis/internal/jaxb/gmd/Country.java
URL: http://svn.apache.org/viewvc/sis/branches/JDK7/sis-utility/src/main/java/org/apache/sis/internal/jaxb/gmd/Country.java?rev=1479856&r1=1479855&r2=1479856&view=diff
==============================================================================
--- sis/branches/JDK7/sis-utility/src/main/java/org/apache/sis/internal/jaxb/gmd/Country.java [UTF-8] (original)
+++ sis/branches/JDK7/sis-utility/src/main/java/org/apache/sis/internal/jaxb/gmd/Country.java [UTF-8] Tue May  7 11:07:11 2013
@@ -22,7 +22,7 @@ import javax.xml.bind.annotation.XmlElem
 
 import org.apache.sis.util.Locales;
 import org.apache.sis.util.CharSequences;
-import org.apache.sis.internal.jaxb.MarshalContext;
+import org.apache.sis.internal.jaxb.Context;
 import org.apache.sis.internal.jaxb.gco.GO_CharacterString;
 import org.apache.sis.internal.jaxb.gco.CharSequenceAdapter;
 
@@ -64,7 +64,7 @@ public final class Country extends GO_Ch
 
     /**
      * Builds a {@code <gco:CharacterString>} element.
-     * For private use by {@link #create(MarshalContext, Locale)} only.
+     * For private use by {@link #create(Context, Locale)} only.
      */
     private Country(final GO_CharacterString code) {
         super(code);
@@ -72,14 +72,14 @@ public final class Country extends GO_Ch
 
     /**
      * Builds a {@code <Country>} element.
-     * For private use by {@link #create(MarshalContext, Locale, CharSequenceAdapter)} only.
+     * For private use by {@link #create(Context, Locale, CharSequenceAdapter)} only.
      *
      * @param context       The current (un)marshalling context, or {@code null} if none.
      * @param codeListValue The {@code codeListValue} attribute in the XML element.
      * @param codeSpace     The 3-letters language code of the {@code value} attribute, or {@code null} if none.
      * @param value         The value in the language specified by the {@code codeSpace} attribute, or {@code null} if none.
      */
-    private Country(final MarshalContext context, final String codeListValue, final String codeSpace, final String value) {
+    private Country(final Context context, final String codeListValue, final String codeSpace, final String value) {
         proxy = new CodeListProxy(context, "ML_gmxCodelists.xml", "Country", codeListValue, codeSpace, value);
     }
 
@@ -91,10 +91,10 @@ public final class Country extends GO_Ch
      * @return The country to marshal, or {@code null} if the given locale was null
      *         or if its {@link Locale#getCountry()} attribute is the empty string.
      */
-    static Country create(final MarshalContext context, final Locale locale) {
+    static Country create(final Context context, final Locale locale) {
         if (locale != null) {
-            final String codeListValue = MarshalContext.converter(context).toCountryCode(context, locale);
-            if (!codeListValue.isEmpty() && MarshalContext.isFlagSet(context, MarshalContext.SUBSTITUTE_COUNTRY)) {
+            final String codeListValue = Context.converter(context).toCountryCode(context, locale);
+            if (!codeListValue.isEmpty() && Context.isFlagSet(context, Context.SUBSTITUTE_COUNTRY)) {
                 /*
                  * Marshal the locale as a <gco:CharacterString> instead than <Country>,
                  * using the user-supplied anchors if any.
@@ -109,7 +109,7 @@ public final class Country extends GO_Ch
             if (context != null) {
                 final Locale marshalLocale = context.getLocale();
                 if (marshalLocale != null) {
-                    codeSpace = MarshalContext.converter(context).toLanguageCode(context, locale);
+                    codeSpace = Context.converter(context).toLanguageCode(context, locale);
                     value = locale.getDisplayCountry(marshalLocale);
                     if (value.isEmpty()) {
                         value = null;
@@ -129,7 +129,7 @@ public final class Country extends GO_Ch
      * @param value The wrapper for this metadata value.
      * @return A locale which represents the metadata value.
      *
-     * @see LanguageCode#getLocale(MarshalContext, LanguageCode, boolean)
+     * @see LanguageCode#getLocale(Context, LanguageCode, boolean)
      */
     static Locale getLocale(final Country value) {
         if (value != null) {

Modified: sis/branches/JDK7/sis-utility/src/main/java/org/apache/sis/internal/jaxb/gmd/LanguageCode.java
URL: http://svn.apache.org/viewvc/sis/branches/JDK7/sis-utility/src/main/java/org/apache/sis/internal/jaxb/gmd/LanguageCode.java?rev=1479856&r1=1479855&r2=1479856&view=diff
==============================================================================
--- sis/branches/JDK7/sis-utility/src/main/java/org/apache/sis/internal/jaxb/gmd/LanguageCode.java [UTF-8] (original)
+++ sis/branches/JDK7/sis-utility/src/main/java/org/apache/sis/internal/jaxb/gmd/LanguageCode.java [UTF-8] Tue May  7 11:07:11 2013
@@ -20,7 +20,7 @@ import java.util.Locale;
 import javax.xml.bind.annotation.XmlType;
 import javax.xml.bind.annotation.XmlElement;
 
-import org.apache.sis.internal.jaxb.MarshalContext;
+import org.apache.sis.internal.jaxb.Context;
 import org.apache.sis.internal.jaxb.gco.GO_CharacterString;
 import org.apache.sis.internal.jaxb.gco.CharSequenceAdapter;
 
@@ -62,7 +62,7 @@ public final class LanguageCode extends 
 
     /**
      * Builds a {@code <gco:CharacterString>} element.
-     * For private use by {@link #create(MarshalContext, Locale)} only.
+     * For private use by {@link #create(Context, Locale)} only.
      */
     private LanguageCode(final GO_CharacterString code) {
         super(code);
@@ -70,14 +70,14 @@ public final class LanguageCode extends 
 
     /**
      * Builds a {@code <LanguageCode>} element.
-     * For private use by {@link #create(MarshalContext, Locale)} only.
+     * For private use by {@link #create(Context, Locale)} only.
      *
      * @param context       The current (un)marshalling context, or {@code null} if none.
      * @param codeListValue The {@code codeListValue} attribute in the XML element.
      * @param codeSpace     The 3-letters language code of the {@code value} attribute, or {@code null} if none.
      * @param value         The value in the language specified by the {@code codeSpace} attribute, or {@code null} if none.
      */
-    private LanguageCode(final MarshalContext context, final String codeListValue, final String codeSpace, final String value) {
+    private LanguageCode(final Context context, final String codeListValue, final String codeSpace, final String value) {
         proxy = new CodeListProxy(context, "ML_gmxCodelists.xml", "LanguageCode", codeListValue, codeSpace, value);
     }
 
@@ -89,10 +89,10 @@ public final class LanguageCode extends 
      * @return The language to marshal, or {@code null} if the given locale was null
      *         or if its {@link Locale#getLanguage()} attribute is the empty string.
      */
-    static LanguageCode create(final MarshalContext context, final Locale locale) {
+    static LanguageCode create(final Context context, final Locale locale) {
         if (locale != null) {
-            final String codeListValue = MarshalContext.converter(context).toLanguageCode(context, locale);
-            if (!codeListValue.isEmpty() && MarshalContext.isFlagSet(context, MarshalContext.SUBSTITUTE_LANGUAGE)) {
+            final String codeListValue = Context.converter(context).toLanguageCode(context, locale);
+            if (!codeListValue.isEmpty() && Context.isFlagSet(context, Context.SUBSTITUTE_LANGUAGE)) {
                 /*
                  * Marshal the locale as a <gco:CharacterString> instead than <LanguageCode>,
                  * using the user-supplied anchors if any.
@@ -107,7 +107,7 @@ public final class LanguageCode extends 
             if (context != null) {
                 final Locale marshalLocale = context.getLocale();
                 if (marshalLocale != null) {
-                    codeSpace = MarshalContext.converter(context).toLanguageCode(context, locale);
+                    codeSpace = Context.converter(context).toLanguageCode(context, locale);
                     value = locale.getDisplayLanguage(marshalLocale);
                     if (value.isEmpty()) {
                         value = null;
@@ -132,17 +132,17 @@ public final class LanguageCode extends 
      *
      * @see Country#getLocale(Country)
      */
-    static Locale getLocale(final MarshalContext context, final LanguageCode value, final boolean useCharSequence) {
+    static Locale getLocale(final Context context, final LanguageCode value, final boolean useCharSequence) {
         if (value != null) {
             final CodeListProxy proxy = value.proxy;
             if (proxy != null) {
-                final Locale locale = MarshalContext.converter(context).toLocale(context, proxy.codeListValue);
+                final Locale locale = Context.converter(context).toLocale(context, proxy.codeListValue);
                 if (locale != null) {
                     return locale;
                 }
             }
             if (useCharSequence) {
-                return MarshalContext.converter(context).toLocale(context, value.toString());
+                return Context.converter(context).toLocale(context, value.toString());
             }
         }
         return null;

Modified: sis/branches/JDK7/sis-utility/src/main/java/org/apache/sis/internal/jaxb/gmd/LocaleAdapter.java
URL: http://svn.apache.org/viewvc/sis/branches/JDK7/sis-utility/src/main/java/org/apache/sis/internal/jaxb/gmd/LocaleAdapter.java?rev=1479856&r1=1479855&r2=1479856&view=diff
==============================================================================
--- sis/branches/JDK7/sis-utility/src/main/java/org/apache/sis/internal/jaxb/gmd/LocaleAdapter.java [UTF-8] (original)
+++ sis/branches/JDK7/sis-utility/src/main/java/org/apache/sis/internal/jaxb/gmd/LocaleAdapter.java [UTF-8] Tue May  7 11:07:11 2013
@@ -18,8 +18,8 @@ package org.apache.sis.internal.jaxb.gmd
 
 import java.util.Locale;
 import javax.xml.bind.annotation.adapters.XmlAdapter;
-import org.apache.sis.internal.jaxb.MarshalContext;
 import org.apache.sis.internal.jaxb.gco.StringAdapter;
+import org.apache.sis.internal.jaxb.Context;
 
 
 /**
@@ -57,13 +57,13 @@ public final class LocaleAdapter extends
      */
     @Override
     public Locale unmarshal(final LanguageCode value) {
-        final MarshalContext context = MarshalContext.current();
+        final Context context = Context.current();
         final Locale candidate = LanguageCode.getLocale(context, value, false);
         if (candidate != null) {
             return candidate;
         }
         final String text = StringAdapter.toString(value);
-        return (text != null) ? MarshalContext.converter(context).toLocale(context, text) : null;
+        return (text != null) ? Context.converter(context).toLocale(context, text) : null;
     }
 
     /**
@@ -75,6 +75,6 @@ public final class LocaleAdapter extends
      */
     @Override
     public LanguageCode marshal(final Locale value) {
-        return LanguageCode.create(MarshalContext.current(), value);
+        return LanguageCode.create(Context.current(), value);
     }
 }

Modified: sis/branches/JDK7/sis-utility/src/main/java/org/apache/sis/internal/jaxb/gmd/LocalisedCharacterString.java
URL: http://svn.apache.org/viewvc/sis/branches/JDK7/sis-utility/src/main/java/org/apache/sis/internal/jaxb/gmd/LocalisedCharacterString.java?rev=1479856&r1=1479855&r2=1479856&view=diff
==============================================================================
--- sis/branches/JDK7/sis-utility/src/main/java/org/apache/sis/internal/jaxb/gmd/LocalisedCharacterString.java [UTF-8] (original)
+++ sis/branches/JDK7/sis-utility/src/main/java/org/apache/sis/internal/jaxb/gmd/LocalisedCharacterString.java [UTF-8] Tue May  7 11:07:11 2013
@@ -19,7 +19,7 @@ package org.apache.sis.internal.jaxb.gmd
 import java.util.Locale;
 import javax.xml.bind.annotation.XmlValue;
 import javax.xml.bind.annotation.XmlAttribute;
-import org.apache.sis.internal.jaxb.MarshalContext;
+import org.apache.sis.internal.jaxb.Context;
 
 // Related to JDK7
 import java.util.Objects;
@@ -59,7 +59,7 @@ final class LocalisedCharacterString {
     /**
      * Empty constructor only used by JAXB.
      */
-    public LocalisedCharacterString() {
+    LocalisedCharacterString() {
     }
 
     /**
@@ -84,8 +84,8 @@ final class LocalisedCharacterString {
         if (locale == null) {
             return null;
         }
-        final MarshalContext context = MarshalContext.current();
-        return LOCALE.concat(MarshalContext.converter(context).toLanguageCode(context, locale));
+        final Context context = Context.current();
+        return LOCALE.concat(Context.converter(context).toLanguageCode(context, locale));
     }
 
     /**
@@ -96,8 +96,8 @@ final class LocalisedCharacterString {
      */
     public void setLocale(final String localeId) {
         if (localeId != null) {
-            final MarshalContext context = MarshalContext.current();
-            locale = MarshalContext.converter(context).toLocale(context, localeId.substring(localeId.indexOf('-') + 1));
+            final Context context = Context.current();
+            locale = Context.converter(context).toLocale(context, localeId.substring(localeId.indexOf('-') + 1));
         } else {
             locale = null;
         }

Modified: sis/branches/JDK7/sis-utility/src/main/java/org/apache/sis/internal/jaxb/gmd/PT_FreeText.java
URL: http://svn.apache.org/viewvc/sis/branches/JDK7/sis-utility/src/main/java/org/apache/sis/internal/jaxb/gmd/PT_FreeText.java?rev=1479856&r1=1479855&r2=1479856&view=diff
==============================================================================
--- sis/branches/JDK7/sis-utility/src/main/java/org/apache/sis/internal/jaxb/gmd/PT_FreeText.java [UTF-8] (original)
+++ sis/branches/JDK7/sis-utility/src/main/java/org/apache/sis/internal/jaxb/gmd/PT_FreeText.java [UTF-8] Tue May  7 11:07:11 2013
@@ -23,7 +23,7 @@ import javax.xml.bind.annotation.XmlElem
 import javax.xml.bind.annotation.XmlElementWrapper;
 
 import org.opengis.util.InternationalString;
-import org.apache.sis.internal.jaxb.MarshalContext;
+import org.apache.sis.internal.jaxb.Context;
 import org.apache.sis.internal.jaxb.gco.GO_CharacterString;
 import org.apache.sis.util.iso.DefaultInternationalString;
 import org.apache.sis.util.iso.SimpleInternationalString;
@@ -113,7 +113,7 @@ public final class PT_FreeText extends G
      *         or {@code null} otherwise.
      */
     @SuppressWarnings("fallthrough")
-    public static PT_FreeText create(final MarshalContext context, final InternationalString text) {
+    public static PT_FreeText create(final Context context, final InternationalString text) {
         if (text instanceof DefaultInternationalString) {
             final DefaultInternationalString df = (DefaultInternationalString) text;
             final Set<Locale> locales = df.getLocales();

Modified: sis/branches/JDK7/sis-utility/src/main/java/org/apache/sis/xml/Pooled.java
URL: http://svn.apache.org/viewvc/sis/branches/JDK7/sis-utility/src/main/java/org/apache/sis/xml/Pooled.java?rev=1479856&r1=1479855&r2=1479856&view=diff
==============================================================================
--- sis/branches/JDK7/sis-utility/src/main/java/org/apache/sis/xml/Pooled.java [UTF-8] (original)
+++ sis/branches/JDK7/sis-utility/src/main/java/org/apache/sis/xml/Pooled.java [UTF-8] Tue May  7 11:07:11 2013
@@ -32,7 +32,7 @@ import org.apache.sis.util.Version;
 import org.apache.sis.util.CharSequences;
 import org.apache.sis.util.resources.Errors;
 import org.apache.sis.internal.util.CollectionsExt;
-import org.apache.sis.internal.jaxb.MarshalContext;
+import org.apache.sis.internal.jaxb.Context;
 
 
 /**
@@ -151,11 +151,11 @@ abstract class Pooled {
     }
 
     /**
-     * Returns the initial value of {@link MarshalContext#bitMasks}. Shall be 0 if this object is
-     * an unmarshaller, or {@link MarshalContext#MARSHALLING} if it is an {@link Unmarshaller}.
+     * Returns the initial value of {@link Context#bitMasks}. Shall be 0 if this object is
+     * an unmarshaller, or {@link Context#MARSHALLING} if it is an {@link Unmarshaller}.
      */
     private int initialBitMasks() {
-        return (this instanceof Marshaller) ? MarshalContext.MARSHALLING : 0;
+        return (this instanceof Marshaller) ? Context.MARSHALLING : 0;
     }
 
     /**
@@ -287,9 +287,9 @@ abstract class Pooled {
                     if (substitutes != null) {
                         for (final CharSequence substitute : substitutes) {
                             if (CharSequences.equalsIgnoreCase(substitute, "language")) {
-                                mask |= MarshalContext.SUBSTITUTE_LANGUAGE;
+                                mask |= Context.SUBSTITUTE_LANGUAGE;
                             } else if (CharSequences.equalsIgnoreCase(substitute, "country")) {
-                                mask |= MarshalContext.SUBSTITUTE_COUNTRY;
+                                mask |= Context.SUBSTITUTE_COUNTRY;
                             }
                         }
                     }
@@ -324,8 +324,8 @@ abstract class Pooled {
             case XML.TIMEZONE:    return timezone;
             case XML.STRING_SUBSTITUTES: {
                 final StringBuilder buffer = new StringBuilder();
-                if ((bitMasks & MarshalContext.SUBSTITUTE_LANGUAGE) != 0) buffer.append("language,");
-                if ((bitMasks & MarshalContext.SUBSTITUTE_COUNTRY)  != 0) buffer.append("country,");
+                if ((bitMasks & Context.SUBSTITUTE_LANGUAGE) != 0) buffer.append("language,");
+                if ((bitMasks & Context.SUBSTITUTE_COUNTRY)  != 0) buffer.append("country,");
                 final int length = buffer.length();
                 if (length != 0) {
                     buffer.setLength(length - 1); // Remove the last coma.
@@ -417,7 +417,7 @@ abstract class Pooled {
      * operation. Must be followed by a call to {@code finish()} in a {@code finally} block.
      *
      * {@preformat java
-     *     MarshalContext context = begin();
+     *     Context context = begin();
      *     try {
      *         ...
      *     } finally {
@@ -425,9 +425,9 @@ abstract class Pooled {
      *     }
      * }
      *
-     * @see MarshalContext#finish();
+     * @see Context#finish();
      */
-    final MarshalContext begin() {
-        return new MarshalContext(converter, resolver, gmlVersion, schemas, locale, timezone, bitMasks);
+    final Context begin() {
+        return new Context(converter, resolver, gmlVersion, schemas, locale, timezone, bitMasks);
     }
 }

Modified: sis/branches/JDK7/sis-utility/src/main/java/org/apache/sis/xml/PooledMarshaller.java
URL: http://svn.apache.org/viewvc/sis/branches/JDK7/sis-utility/src/main/java/org/apache/sis/xml/PooledMarshaller.java?rev=1479856&r1=1479855&r2=1479856&view=diff
==============================================================================
--- sis/branches/JDK7/sis-utility/src/main/java/org/apache/sis/xml/PooledMarshaller.java [UTF-8] (original)
+++ sis/branches/JDK7/sis-utility/src/main/java/org/apache/sis/xml/PooledMarshaller.java [UTF-8] Tue May  7 11:07:11 2013
@@ -32,7 +32,7 @@ import javax.xml.validation.Schema;
 import org.xml.sax.ContentHandler;
 import org.w3c.dom.Node;
 import org.apache.sis.util.Decorator;
-import org.apache.sis.internal.jaxb.MarshalContext;
+import org.apache.sis.internal.jaxb.Context;
 
 
 /**
@@ -42,7 +42,7 @@ import org.apache.sis.internal.jaxb.Mars
  * <ul>
  *   <li>Save properties before modification, in order to restore them to their original values
  *       when the marshaller is recycled.</li>
- *   <li>Constructs a SIS {@link MarshalContext} object on marshalling, in order to give
+ *   <li>Constructs a SIS {@link Context} object on marshalling, in order to give
  *       additional information to the SIS object being marshalled.</li>
  * </ul>
  *
@@ -106,7 +106,7 @@ final class PooledMarshaller extends Poo
      */
     @Override
     public void marshal(final Object object, final Result output) throws JAXBException {
-        final MarshalContext context = begin();
+        final Context context = begin();
         try {
             marshaller.marshal(object, output);
         } finally {
@@ -119,7 +119,7 @@ final class PooledMarshaller extends Poo
      */
     @Override
     public void marshal(final Object object, final OutputStream output) throws JAXBException {
-        final MarshalContext context = begin();
+        final Context context = begin();
         try {
             marshaller.marshal(object, output);
         } finally {
@@ -132,7 +132,7 @@ final class PooledMarshaller extends Poo
      */
     @Override
     public void marshal(final Object object, final File output) throws JAXBException {
-        final MarshalContext context = begin();
+        final Context context = begin();
         try {
             marshaller.marshal(object, output);
         } finally {
@@ -145,7 +145,7 @@ final class PooledMarshaller extends Poo
      */
     @Override
     public void marshal(final Object object, final Writer output) throws JAXBException {
-        final MarshalContext context = begin();
+        final Context context = begin();
         try {
             marshaller.marshal(object, output);
         } finally {
@@ -158,7 +158,7 @@ final class PooledMarshaller extends Poo
      */
     @Override
     public void marshal(final Object object, final ContentHandler output) throws JAXBException {
-        final MarshalContext context = begin();
+        final Context context = begin();
         try {
             marshaller.marshal(object, output);
         } finally {
@@ -171,7 +171,7 @@ final class PooledMarshaller extends Poo
      */
     @Override
     public void marshal(final Object object, final Node output) throws JAXBException {
-        final MarshalContext context = begin();
+        final Context context = begin();
         try {
             marshaller.marshal(object, output);
         } finally {
@@ -184,7 +184,7 @@ final class PooledMarshaller extends Poo
      */
     @Override
     public void marshal(final Object object, final XMLStreamWriter output) throws JAXBException {
-        final MarshalContext context = begin();
+        final Context context = begin();
         try {
             marshaller.marshal(object, output);
         } finally {
@@ -197,7 +197,7 @@ final class PooledMarshaller extends Poo
      */
     @Override
     public void marshal(final Object object, final XMLEventWriter output) throws JAXBException {
-        final MarshalContext context = begin();
+        final Context context = begin();
         try {
             marshaller.marshal(object, output);
         } finally {
@@ -210,7 +210,7 @@ final class PooledMarshaller extends Poo
      */
     @Override
     public Node getNode(final Object object) throws JAXBException {
-        final MarshalContext context = begin();
+        final Context context = begin();
         try {
             return marshaller.getNode(object);
         } finally {

Modified: sis/branches/JDK7/sis-utility/src/main/java/org/apache/sis/xml/PooledUnmarshaller.java
URL: http://svn.apache.org/viewvc/sis/branches/JDK7/sis-utility/src/main/java/org/apache/sis/xml/PooledUnmarshaller.java?rev=1479856&r1=1479855&r2=1479856&view=diff
==============================================================================
--- sis/branches/JDK7/sis-utility/src/main/java/org/apache/sis/xml/PooledUnmarshaller.java [UTF-8] (original)
+++ sis/branches/JDK7/sis-utility/src/main/java/org/apache/sis/xml/PooledUnmarshaller.java [UTF-8] Tue May  7 11:07:11 2013
@@ -35,7 +35,7 @@ import javax.xml.validation.Schema;
 import org.w3c.dom.Node;
 import org.xml.sax.InputSource;
 import org.apache.sis.util.Decorator;
-import org.apache.sis.internal.jaxb.MarshalContext;
+import org.apache.sis.internal.jaxb.Context;
 
 
 /**
@@ -45,7 +45,7 @@ import org.apache.sis.internal.jaxb.Mars
  * <ul>
  *   <li>Save properties before modification, in order to restore them to their original values
  *       when the unmarshaller is recycled.</li>
- *   <li>Constructs a SIS {@link MarshalContext} object on unmarshalling, in order to give
+ *   <li>Constructs a SIS {@link Context} object on unmarshalling, in order to give
  *       additional information to the SIS object being unmarshalled.</li>
  * </ul>
  *
@@ -107,7 +107,7 @@ final class PooledUnmarshaller extends P
      */
     @Override
     public Object unmarshal(final InputStream input) throws JAXBException {
-        final MarshalContext context = begin();
+        final Context context = begin();
         try {
             return unmarshaller.unmarshal(input);
         } finally {
@@ -120,7 +120,7 @@ final class PooledUnmarshaller extends P
      */
     @Override
     public Object unmarshal(final URL input) throws JAXBException {
-        final MarshalContext context = begin();
+        final Context context = begin();
         try {
             return unmarshaller.unmarshal(input);
         } finally {
@@ -133,7 +133,7 @@ final class PooledUnmarshaller extends P
      */
     @Override
     public Object unmarshal(final File input) throws JAXBException {
-        final MarshalContext context = begin();
+        final Context context = begin();
         try {
             return unmarshaller.unmarshal(input);
         } finally {
@@ -146,7 +146,7 @@ final class PooledUnmarshaller extends P
      */
     @Override
     public Object unmarshal(final Reader input) throws JAXBException {
-        final MarshalContext context = begin();
+        final Context context = begin();
         try {
             return unmarshaller.unmarshal(input);
         } finally {
@@ -159,7 +159,7 @@ final class PooledUnmarshaller extends P
      */
     @Override
     public Object unmarshal(final InputSource input) throws JAXBException {
-        final MarshalContext context = begin();
+        final Context context = begin();
         try {
             return unmarshaller.unmarshal(input);
         } finally {
@@ -172,7 +172,7 @@ final class PooledUnmarshaller extends P
      */
     @Override
     public Object unmarshal(final Node input) throws JAXBException {
-        final MarshalContext context = begin();
+        final Context context = begin();
         try {
             return unmarshaller.unmarshal(input);
         } finally {
@@ -185,7 +185,7 @@ final class PooledUnmarshaller extends P
      */
     @Override
     public <T> JAXBElement<T> unmarshal(final Node input, final Class<T> declaredType) throws JAXBException {
-        final MarshalContext context = begin();
+        final Context context = begin();
         try {
             return unmarshaller.unmarshal(input, declaredType);
         } finally {
@@ -198,7 +198,7 @@ final class PooledUnmarshaller extends P
      */
     @Override
     public Object unmarshal(final Source input) throws JAXBException {
-        final MarshalContext context = begin();
+        final Context context = begin();
         try {
             return unmarshaller.unmarshal(input);
         } finally {
@@ -211,7 +211,7 @@ final class PooledUnmarshaller extends P
      */
     @Override
     public <T> JAXBElement<T> unmarshal(final Source input, final Class<T> declaredType) throws JAXBException {
-        final MarshalContext context = begin();
+        final Context context = begin();
         try {
             return unmarshaller.unmarshal(input, declaredType);
         } finally {
@@ -224,7 +224,7 @@ final class PooledUnmarshaller extends P
      */
     @Override
     public Object unmarshal(final XMLStreamReader input) throws JAXBException {
-        final MarshalContext context = begin();
+        final Context context = begin();
         try {
             return unmarshaller.unmarshal(input);
         } finally {
@@ -237,7 +237,7 @@ final class PooledUnmarshaller extends P
      */
     @Override
     public <T> JAXBElement<T> unmarshal(final XMLStreamReader input, final Class<T> declaredType) throws JAXBException {
-        final MarshalContext context = begin();
+        final Context context = begin();
         try {
             return unmarshaller.unmarshal(input, declaredType);
         } finally {
@@ -250,7 +250,7 @@ final class PooledUnmarshaller extends P
      */
     @Override
     public Object unmarshal(final XMLEventReader input) throws JAXBException {
-        final MarshalContext context = begin();
+        final Context context = begin();
         try {
             return unmarshaller.unmarshal(input);
         } finally {
@@ -263,7 +263,7 @@ final class PooledUnmarshaller extends P
      */
     @Override
     public <T> JAXBElement<T> unmarshal(final XMLEventReader input, final Class<T> declaredType) throws JAXBException {
-        final MarshalContext context = begin();
+        final Context context = begin();
         try {
             return unmarshaller.unmarshal(input, declaredType);
         } finally {



Mime
View raw message