src/share/jaxws_classes/com/sun/xml/internal/bind/v2/model/impl/RuntimeBuiltinLeafInfoImpl.java

Print this page

        

*** 89,98 **** --- 89,101 ---- import com.sun.xml.internal.bind.v2.runtime.output.Pcdata; import com.sun.xml.internal.bind.v2.runtime.unmarshaller.Base64Data; import com.sun.xml.internal.bind.v2.runtime.unmarshaller.UnmarshallingContext; import com.sun.xml.internal.bind.v2.util.ByteArrayOutputStreamEx; import com.sun.xml.internal.bind.v2.util.DataSourceSource; + import java.util.logging.Logger; + import com.sun.xml.internal.bind.Util; + import java.util.logging.Level; import org.xml.sax.SAXException; /** * {@link BuiltinLeafInfoImpl} with a support for runtime.
*** 103,112 **** --- 106,117 ---- * @author Kohsuke Kawaguchi */ public abstract class RuntimeBuiltinLeafInfoImpl<T> extends BuiltinLeafInfoImpl<Type,Class> implements RuntimeBuiltinLeafInfo, Transducer<T> { + private static final Logger logger = Util.getClassLogger(); + private RuntimeBuiltinLeafInfoImpl(Class type, QName... typeNames) { super(type, typeNames); LEAVES.put(type,this); }
*** 194,203 **** --- 199,209 ---- * handled differently than ordinary classes. See table 8-2 "Mapping of Standard Java classes". */ public static final List<RuntimeBuiltinLeafInfoImpl<?>> builtinBeanInfos; public static final String MAP_ANYURI_TO_URI = "mapAnyUriToUri"; + public static final String USE_OLD_GMONTH_MAPPING = "jaxb.ri.useOldGmonthMapping"; static { QName[] qnames = (System.getProperty(MAP_ANYURI_TO_URI) == null) ? new QName[] { createXS("string"),
*** 958,968 **** --- 964,981 ---- Map<QName,String> m = xmlGregorianCalendarFormatString; // See 4971612: be careful for SCCS substitution m.put(DatatypeConstants.DATETIME, "%Y-%M-%DT%h:%m:%s"+ "%z"); m.put(DatatypeConstants.DATE, "%Y-%M-%D" +"%z"); m.put(DatatypeConstants.TIME, "%h:%m:%s"+ "%z"); + if (System.getProperty(USE_OLD_GMONTH_MAPPING) == null) { + m.put(DatatypeConstants.GMONTH, "--%M%z"); // E2-12 Error. http://www.w3.org/2001/05/xmlschema-errata#e2-12 + } else { // backw. compatibility + if (logger.isLoggable(Level.FINE)) { + logger.log(Level.FINE, "Old GMonth mapping used."); + } m.put(DatatypeConstants.GMONTH, "--%M--%z"); + } m.put(DatatypeConstants.GDAY, "---%D" + "%z"); m.put(DatatypeConstants.GYEAR, "%Y" + "%z"); m.put(DatatypeConstants.GYEARMONTH, "%Y-%M" + "%z"); m.put(DatatypeConstants.GMONTHDAY, "--%M-%D" +"%z"); }