juneau-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From jamesbog...@apache.org
Subject [4/9] incubator-juneau git commit: JUNEAU-26 - Add support for date localization.
Date Wed, 28 Dec 2016 21:03:33 GMT
http://git-wip-us.apache.org/repos/asf/incubator-juneau/blob/bb650bde/juneau-core/src/main/java/org/apache/juneau/urlencoding/UonSerializerContext.java
----------------------------------------------------------------------
diff --git a/juneau-core/src/main/java/org/apache/juneau/urlencoding/UonSerializerContext.java b/juneau-core/src/main/java/org/apache/juneau/urlencoding/UonSerializerContext.java
index 88ccd8f..6a1725f 100644
--- a/juneau-core/src/main/java/org/apache/juneau/urlencoding/UonSerializerContext.java
+++ b/juneau-core/src/main/java/org/apache/juneau/urlencoding/UonSerializerContext.java
@@ -36,24 +36,27 @@ import org.apache.juneau.serializer.*;
  *
  * <h6 class='topic' id='ConfigProperties'>Configurable properties on the URL-Encoding and UON serializers</h6>
  * <table class='styled' style='border-collapse: collapse;'>
- * 	<tr><th>Setting name</th><th>Description</th><th>Data type</th><th>Default value</th></tr>
+ * 	<tr><th>Setting name</th><th>Description</th><th>Data type</th><th>Default value</th><th>Session overridable</th></tr>
  * 	<tr>
  * 		<td>{@link #UON_simpleMode}</td>
  * 		<td>Use simplified output.</td>
  * 		<td><code>Boolean</code></td>
  * 		<td><jk>false</jk></td>
+ * 		<td><jk>true</jk></td>
  * 	</tr>
  * 	<tr>
  * 		<td>{@link #UON_useWhitespace}</td>
  * 		<td>Use whitespace.</td>
  * 		<td><code>Boolean</code></td>
  * 		<td><jk>false</jk></td>
+ * 		<td><jk>true</jk></td>
  * 	</tr>
  * 	<tr>
  * 		<td>{@link #UON_encodeChars}</td>
  * 		<td>Encode non-valid URI characters.</td>
  * 		<td><code>Boolean</code></td>
  * 		<td><jk>false</jk> for {@link UonSerializer}<br><jk>true</jk> for {@link UrlEncodingSerializer}</td>
+ * 		<td><jk>true</jk></td>
  * 	</tr>
  * </table>
  *
@@ -74,6 +77,7 @@ public class UonSerializerContext extends SerializerContext {
 	 * 	<li><b>Name:</b> <js>"UonSerializer.simpleMode"</js>
 	 * 	<li><b>Data type:</b> <code>Boolean</code>
 	 * 	<li><b>Default:</b> <jk>false</jk>
+	 * 	<li><b>Session-overridable:</b> <jk>true</jk>
 	 * </ul>
 	 * <p>
 	 * If <jk>true</jk>, type flags will not be prepended to values in most cases.
@@ -133,6 +137,7 @@ public class UonSerializerContext extends SerializerContext {
 	 * 	<li><b>Name:</b> <js>"UonSerializer.useWhitespace"</js>
 	 * 	<li><b>Data type:</b> <code>Boolean</code>
 	 * 	<li><b>Default:</b> <jk>false</jk>
+	 * 	<li><b>Session-overridable:</b> <jk>true</jk>
 	 * </ul>
 	 * <p>
 	 * If <jk>true</jk>, whitespace is added to the output to improve readability.
@@ -146,6 +151,7 @@ public class UonSerializerContext extends SerializerContext {
 	 * 	<li><b>Name:</b> <js>"UonSerializer.encodeChars"</js>
 	 * 	<li><b>Data type:</b> <code>Boolean</code>
 	 * 	<li><b>Default:</b> <jk>false</jk> for {@link UonSerializer}, <jk>true</jk> for {@link UrlEncodingSerializer}
+	 * 	<li><b>Session-overridable:</b> <jk>true</jk>
 	 * </ul>
 	 * <p>
 	 * Encode non-valid URI characters with <js>"%xx"</js> constructs.

http://git-wip-us.apache.org/repos/asf/incubator-juneau/blob/bb650bde/juneau-core/src/main/java/org/apache/juneau/urlencoding/UonSerializerSession.java
----------------------------------------------------------------------
diff --git a/juneau-core/src/main/java/org/apache/juneau/urlencoding/UonSerializerSession.java b/juneau-core/src/main/java/org/apache/juneau/urlencoding/UonSerializerSession.java
index aa4d08a..39ace7a 100644
--- a/juneau-core/src/main/java/org/apache/juneau/urlencoding/UonSerializerSession.java
+++ b/juneau-core/src/main/java/org/apache/juneau/urlencoding/UonSerializerSession.java
@@ -15,6 +15,7 @@ package org.apache.juneau.urlencoding;
 import static org.apache.juneau.urlencoding.UonSerializerContext.*;
 
 import java.lang.reflect.*;
+import java.util.*;
 
 import org.apache.juneau.*;
 import org.apache.juneau.json.*;
@@ -34,14 +35,17 @@ public class UonSerializerSession extends SerializerSession {
 	 *
 	 * @param ctx The context creating this session object.
 	 * 	The context contains all the configuration settings for this object.
-	 * @param beanContext The bean context being used.
 	 * @param output The output object.  See {@link JsonSerializerSession#getWriter()} for valid class types.
 	 * @param op The override properties.
 	 * 	These override any context properties defined in the context.
 	 * @param javaMethod The java method that called this parser, usually the method in a REST servlet.
+	 * @param locale The session locale.
+	 * 	If <jk>null</jk>, then the locale defined on the context is used.
+	 * @param timeZone The session timezone.
+	 * 	If <jk>null</jk>, then the timezone defined on the context is used.
 	 */
-	protected UonSerializerSession(UonSerializerContext ctx, BeanContext beanContext, Object output, ObjectMap op, Method javaMethod) {
-		super(ctx, beanContext, output, op, javaMethod);
+	protected UonSerializerSession(UonSerializerContext ctx, ObjectMap op, Object output, Method javaMethod, Locale locale, TimeZone timeZone) {
+		super(ctx, op, output, javaMethod, locale, timeZone);
 		if (op == null || op.isEmpty()) {
 			simpleMode = ctx.simpleMode;
 			useWhitespace = ctx.useWhitespace;

http://git-wip-us.apache.org/repos/asf/incubator-juneau/blob/bb650bde/juneau-core/src/main/java/org/apache/juneau/urlencoding/UrlEncodingParser.java
----------------------------------------------------------------------
diff --git a/juneau-core/src/main/java/org/apache/juneau/urlencoding/UrlEncodingParser.java b/juneau-core/src/main/java/org/apache/juneau/urlencoding/UrlEncodingParser.java
index 224d0c3..0047ab4 100644
--- a/juneau-core/src/main/java/org/apache/juneau/urlencoding/UrlEncodingParser.java
+++ b/juneau-core/src/main/java/org/apache/juneau/urlencoding/UrlEncodingParser.java
@@ -65,12 +65,11 @@ public class UrlEncodingParser extends UonParser {
 
 	private <T> T parseAnything(UrlEncodingParserSession session, ClassMeta<T> eType, ParserReader r, Object outer) throws Exception {
 
-		BeanContext bc = session.getBeanContext();
 		if (eType == null)
 			eType = (ClassMeta<T>)object();
 		PojoSwap<T,Object> transform = (PojoSwap<T,Object>)eType.getPojoSwap();
 		ClassMeta<?> sType = eType.getSerializedClassMeta();
-		BeanDictionary bd = bc.getBeanDictionary();
+		BeanDictionary bd = session.getBeanDictionary();
 
 		int c = r.peek();
 		if (c == '?')
@@ -79,40 +78,40 @@ public class UrlEncodingParser extends UonParser {
 		Object o;
 
 		if (sType.isObject()) {
-			ObjectMap m = new ObjectMap(bc);
-			parseIntoMap(session, r, m, bc.string(), bc.object());
+			ObjectMap m = new ObjectMap(session);
+			parseIntoMap(session, r, m, session.string(), session.object());
 			if (m.containsKey("_value"))
 				o = m.get("_value");
 			else
 				o = bd.cast(m);
 		} else if (sType.isMap()) {
-			Map m = (sType.canCreateNewInstance() ? (Map)sType.newInstance() : new ObjectMap(bc));
+			Map m = (sType.canCreateNewInstance() ? (Map)sType.newInstance() : new ObjectMap(session));
 			o = parseIntoMap(session, r, m, sType.getKeyType(), sType.getValueType());
 		} else if (sType.canCreateNewInstanceFromObjectMap(outer)) {
-			ObjectMap m = new ObjectMap(bc);
+			ObjectMap m = new ObjectMap(session);
 			parseIntoMap(session, r, m, string(), object());
 			o = sType.newInstanceFromObjectMap(outer, m);
 		} else if (sType.canCreateNewBean(outer)) {
-			BeanMap m = bc.newBeanMap(outer, sType.getInnerClass());
+			BeanMap m = session.newBeanMap(outer, sType.getInnerClass());
 			m = parseIntoBeanMap(session, r, m);
 			o = m == null ? null : m.getBean();
 		} else {
 			// It could be a non-bean with _type attribute.
-			ObjectMap m = new ObjectMap(bc);
+			ObjectMap m = new ObjectMap(session);
 			ClassMeta<Object> valueType = object();
 			parseIntoMap(session, r, m, string(), valueType);
-			if (m.containsKey(bc.getBeanTypePropertyName()))
+			if (m.containsKey(session.getBeanTypePropertyName()))
 				o = bd.cast(m);
 			else if (m.containsKey("_value"))
-				o = session.getBeanContext().convertToType(m.get("_value"), sType);
+				o = session.convertToType(m.get("_value"), sType);
 			else if (sType.isCollection()) {
 				// ?1=foo&2=bar...
-				Collection c2 = sType.canCreateNewInstance() ? (Collection)sType.newInstance() : new ObjectList(bc);
+				Collection c2 = sType.canCreateNewInstance() ? (Collection)sType.newInstance() : new ObjectList(session);
 				Map<Integer,Object> t = new TreeMap<Integer,Object>();
 				for (Map.Entry<String,Object> e : m.entrySet()) {
 					String k = e.getKey();
 					if (StringUtils.isNumeric(k))
-						t.put(Integer.valueOf(k), bc.convertToType(e.getValue(), sType.getElementType()));
+						t.put(Integer.valueOf(k), session.convertToType(e.getValue(), sType.getElementType()));
 				}
 				c2.addAll(t.values());
 				o = c2;
@@ -124,7 +123,7 @@ public class UrlEncodingParser extends UonParser {
 		}
 
 		if (transform != null && o != null)
-			o = transform.unswap(o, eType, bc);
+			o = transform.unswap(session, o, eType);
 
 		if (outer != null)
 			setParent(eType, o, outer);
@@ -157,7 +156,7 @@ public class UrlEncodingParser extends UonParser {
 						return m;
 					r.unread();
 					Object attr = parseAttr(session, r, true);
-					currAttr = session.trim(session.getBeanContext().convertToType(attr, keyType));
+					currAttr = session.trim(session.convertToType(attr, keyType));
 					state = S2;
 					c = 0; // Avoid isInEscape if c was '\'
 				} else if (state == S2) {
@@ -184,7 +183,7 @@ public class UrlEncodingParser extends UonParser {
 						if (m.containsKey(currAttr) && valueType.isObject()) {
 							Object v2 = m.get(currAttr);
 							if (! (v2 instanceof ObjectList)) {
-								v2 = new ObjectList(v2);
+								v2 = new ObjectList(v2).setBeanSession(session);
 								m.put(currAttr, (V)v2);
 							}
 							((ObjectList)v2).add(value);
@@ -218,8 +217,6 @@ public class UrlEncodingParser extends UonParser {
 
 	private <T> BeanMap<T> parseIntoBeanMap(UrlEncodingParserSession session, ParserReader r, BeanMap<T> m) throws Exception {
 
-		BeanContext bc = session.getBeanContext();
-
 		int c = r.peek();
 		if (c == -1)
 			return m;
@@ -258,7 +255,7 @@ public class UrlEncodingParser extends UonParser {
 					}
 				} else if (state == S3) {
 					if (c == -1 || c == '\u0001') {
-						if (! currAttr.equals(bc.getBeanTypePropertyName())) {
+						if (! currAttr.equals(session.getBeanTypePropertyName())) {
 							BeanPropertyMeta pMeta = m.getPropertyMeta(currAttr);
 							if (pMeta == null) {
 								if (m.getMeta().isSubTyped()) {
@@ -280,7 +277,7 @@ public class UrlEncodingParser extends UonParser {
 							return m;
 						state = S1;
 					} else {
-						if (! currAttr.equals(bc.getBeanTypePropertyName())) {
+						if (! currAttr.equals(session.getBeanTypePropertyName())) {
 							BeanPropertyMeta pMeta = m.getPropertyMeta(currAttr);
 							if (pMeta == null) {
 								if (m.getMeta().isSubTyped()) {
@@ -418,8 +415,7 @@ public class UrlEncodingParser extends UonParser {
 
 	private Object[] parseArgs(UrlEncodingParserSession session, ParserReader r, ClassMeta<?>[] argTypes) throws Exception {
 		// TODO - This can be made more efficient.
-		BeanContext bc = session.getBeanContext();
-		ClassMeta<TreeMap<Integer,String>> cm = bc.getMapClassMeta(TreeMap.class, Integer.class, String.class);
+		ClassMeta<TreeMap<Integer,String>> cm = session.getMapClassMeta(TreeMap.class, Integer.class, String.class);
 		TreeMap<Integer,String> m = parseAnything(session, cm, r, session.getOuter());
 		Object[] vals = m.values().toArray(new Object[m.size()]);
 		if (vals.length != argTypes.length)
@@ -443,7 +439,7 @@ public class UrlEncodingParser extends UonParser {
 	public <T> T parseParameter(CharSequence in, ClassMeta<T> type) throws ParseException {
 		if (in == null)
 			return null;
-		UonParserSession session = createParameterContext(in);
+		UonParserSession session = createParameterSession(in);
 		try {
 			UonReader r = session.getReader();
 			return super.parseAnything(session, type, r, null, true, null);
@@ -465,7 +461,19 @@ public class UrlEncodingParser extends UonParser {
 	 * @throws ParseException
 	 */
 	public <T> T parseParameter(CharSequence in, Class<T> type) throws ParseException {
-		return parseParameter(in, getBeanContext().getClassMeta(type));
+		if (in == null)
+			return null;
+		UonParserSession session = createParameterSession(in);
+		try {
+			UonReader r = session.getReader();
+			return super.parseAnything(session, session.getClassMeta(type), r, null, true, null);
+		} catch (ParseException e) {
+			throw e;
+		} catch (Exception e) {
+			throw new ParseException(session, e);
+		} finally {
+			session.close();
+		}
 	}
 
 	//--------------------------------------------------------------------------------
@@ -473,14 +481,14 @@ public class UrlEncodingParser extends UonParser {
 	//--------------------------------------------------------------------------------
 
 	@Override /* Parser */
-	public UrlEncodingParserSession createSession(Object input, ObjectMap properties, Method javaMethod, Object outer) {
-		return new UrlEncodingParserSession(getContext(UrlEncodingParserContext.class), getBeanContext(), input, properties, javaMethod, outer);
+	public UrlEncodingParserSession createSession(Object input, ObjectMap op, Method javaMethod, Object outer, Locale locale, TimeZone timeZone) {
+		return new UrlEncodingParserSession(getContext(UrlEncodingParserContext.class), op, input, javaMethod, outer, locale, timeZone);
 	}
 
 	@Override /* Parser */
 	protected <T> T doParse(ParserSession session, ClassMeta<T> type) throws Exception {
 		UrlEncodingParserSession s = (UrlEncodingParserSession)session;
-		type = s.getBeanContext().normalizeClassMeta(type);
+		type = session.normalizeClassMeta(type);
 		UonReader r = s.getReader();
 		T o = parseAnything(s, type, r, s.getOuter());
 		return o;
@@ -500,7 +508,7 @@ public class UrlEncodingParser extends UonParser {
 		UonReader r = s.getReader();
 		if (r.peek() == '?')
 			r.read();
-		m = parseIntoMap(s, r, m, s.getBeanContext().getClassMeta(keyType), s.getBeanContext().getClassMeta(valueType));
+		m = parseIntoMap(s, r, m, session.getClassMeta(keyType), session.getClassMeta(valueType));
 		return m;
 	}
 

http://git-wip-us.apache.org/repos/asf/incubator-juneau/blob/bb650bde/juneau-core/src/main/java/org/apache/juneau/urlencoding/UrlEncodingParserContext.java
----------------------------------------------------------------------
diff --git a/juneau-core/src/main/java/org/apache/juneau/urlencoding/UrlEncodingParserContext.java b/juneau-core/src/main/java/org/apache/juneau/urlencoding/UrlEncodingParserContext.java
index 9ca1304..81df420 100644
--- a/juneau-core/src/main/java/org/apache/juneau/urlencoding/UrlEncodingParserContext.java
+++ b/juneau-core/src/main/java/org/apache/juneau/urlencoding/UrlEncodingParserContext.java
@@ -32,11 +32,30 @@ import org.apache.juneau.*;
  * </ul>
  * <p>
  * See {@link ContextFactory} for more information about context properties.
+ *
+ * <h6 class='topic' id='ConfigProperties'>Configurable properties on the URL-Encoding parser</h6>
+ * <table class='styled' style='border-collapse: collapse;'>
+ * 	<tr><th>Setting name</th><th>Description</th><th>Data type</th><th>Default value</th><th>Session overridable</th></tr>
+ * 	<tr>
+ * 		<td>{@link #URLENC_expandedParams}</td>
+ * 		<td>Serialize bean property collections/arrays as separate key/value pairs.</td>
+ * 		<td><code>Boolean</code></td>
+ * 		<td><jk>false</jk></td>
+ * 		<td><jk>true</jk></td>
+ * 	</tr>
+ * </table>
  */
 public class UrlEncodingParserContext extends UonParserContext {
 
 	/**
-	 * Serialize bean property collections/arrays as separate key/value pairs ({@link Boolean}, default=<jk>false</jk>).
+	 * <b>Configuration property:</b> Serialize bean property collections/arrays as separate key/value pairs.
+	 * <p>
+	 * <ul>
+	 * 	<li><b>Name:</b> <js>"UrlEncoding.expandedParams"</js>
+	 * 	<li><b>Data type:</b> <code>Boolean</code>
+	 * 	<li><b>Default:</b> <jk>false</jk>
+	 * 	<li><b>Session-overridable:</b> <jk>true</jk>
+	 * </ul>
 	 * <p>
 	 * 	If <jk>false</jk>, serializing the array <code>[1,2,3]</code> results in <code>?key=$a(1,2,3)</code>.
 	 * 	If <jk>true</jk>, serializing the same array results in <code>?key=1&key=2&key=3</code>.

http://git-wip-us.apache.org/repos/asf/incubator-juneau/blob/bb650bde/juneau-core/src/main/java/org/apache/juneau/urlencoding/UrlEncodingParserSession.java
----------------------------------------------------------------------
diff --git a/juneau-core/src/main/java/org/apache/juneau/urlencoding/UrlEncodingParserSession.java b/juneau-core/src/main/java/org/apache/juneau/urlencoding/UrlEncodingParserSession.java
index 00cc1e6..f611d9a 100644
--- a/juneau-core/src/main/java/org/apache/juneau/urlencoding/UrlEncodingParserSession.java
+++ b/juneau-core/src/main/java/org/apache/juneau/urlencoding/UrlEncodingParserSession.java
@@ -16,6 +16,7 @@ import static org.apache.juneau.urlencoding.UrlEncodingParserContext.*;
 
 import java.io.*;
 import java.lang.reflect.*;
+import java.util.*;
 
 import org.apache.juneau.*;
 
@@ -33,7 +34,6 @@ public class UrlEncodingParserSession extends UonParserSession {
 	 *
 	 * @param ctx The context creating this session object.
 	 * 	The context contains all the configuration settings for this object.
-	 * @param beanContext The bean context being used.
 	 * @param input The input.  Can be any of the following types:
 	 * 	<ul>
 	 * 		<li><jk>null</jk>
@@ -46,9 +46,13 @@ public class UrlEncodingParserSession extends UonParserSession {
 	 * 	These override any context properties defined in the context.
 	 * @param javaMethod The java method that called this parser, usually the method in a REST servlet.
 	 * @param outer The outer object for instantiating top-level non-static inner classes.
+	 * @param locale The session locale.
+	 * 	If <jk>null</jk>, then the locale defined on the context is used.
+	 * @param timeZone The session timezone.
+	 * 	If <jk>null</jk>, then the timezone defined on the context is used.
 	 */
-	public UrlEncodingParserSession(UrlEncodingParserContext ctx, BeanContext beanContext, Object input, ObjectMap op, Method javaMethod, Object outer) {
-		super(ctx, beanContext, input, op, javaMethod, outer);
+	public UrlEncodingParserSession(UrlEncodingParserContext ctx, ObjectMap op, Object input, Method javaMethod, Object outer, Locale locale, TimeZone timeZone) {
+		super(ctx, op, input, javaMethod, outer, locale, timeZone);
 		if (op == null || op.isEmpty()) {
 			expandedParams = ctx.expandedParams;
 		} else {

http://git-wip-us.apache.org/repos/asf/incubator-juneau/blob/bb650bde/juneau-core/src/main/java/org/apache/juneau/urlencoding/UrlEncodingSerializer.java
----------------------------------------------------------------------
diff --git a/juneau-core/src/main/java/org/apache/juneau/urlencoding/UrlEncodingSerializer.java b/juneau-core/src/main/java/org/apache/juneau/urlencoding/UrlEncodingSerializer.java
index 7abf2ac..5b8116c 100644
--- a/juneau-core/src/main/java/org/apache/juneau/urlencoding/UrlEncodingSerializer.java
+++ b/juneau-core/src/main/java/org/apache/juneau/urlencoding/UrlEncodingSerializer.java
@@ -220,7 +220,6 @@ public class UrlEncodingSerializer extends UonSerializer {
 	 */
 	@SuppressWarnings({ "rawtypes", "unchecked" })
 	private SerializerWriter serializeAnything(UrlEncodingSerializerSession session, UonWriter out, Object o) throws Exception {
-		BeanContext bc = session.getBeanContext();
 
 		boolean addTypeProperty;		// Add "_type" attribute to element?
 		ClassMeta<?> aType;			// The actual type
@@ -237,12 +236,12 @@ public class UrlEncodingSerializer extends UonSerializer {
 		// Swap if necessary
 		PojoSwap swap = aType.getPojoSwap();
 		if (swap != null) {
-			o = swap.swap(o, bc);
+			o = swap.swap(session, o);
 
 			// If the getSwapClass() method returns Object, we need to figure out
 			// the actual type now.
 			if (sType.isObject())
-				sType = bc.getClassMetaForObject(o);
+				sType = session.getClassMetaForObject(o);
 		}
 
 		if (sType.isMap()) {
@@ -253,9 +252,9 @@ public class UrlEncodingSerializer extends UonSerializer {
 		} else if (sType.hasToObjectMapMethod()) {
 			serializeMap(session, out, sType.toObjectMap(o), sType);
 		} else if (sType.isBean()) {
-			serializeBeanMap(session, out, bc.forBean(o), addTypeProperty);
+			serializeBeanMap(session, out, session.toBeanMap(o), addTypeProperty);
 		} else if (sType.isCollection()) {
-			serializeMap(session, out, getCollectionMap((Collection)o), bc.getMapClassMeta(Map.class, Integer.class, sType.getElementType()));
+			serializeMap(session, out, getCollectionMap((Collection)o), session.getMapClassMeta(Map.class, Integer.class, sType.getElementType()));
 		} else {
 			// All other types can't be serialized as key/value pairs, so we create a
 			// mock key/value pair with a "_value" key.
@@ -367,7 +366,7 @@ public class UrlEncodingSerializer extends UonSerializer {
 	//--------------------------------------------------------------------------------
 
 	/**
-	 * Converts the specified object to a string using this serializers {@link BeanContext#convertToType(Object, Class)} method
+	 * Converts the specified object to a string using this serializers {@link BeanSession#convertToType(Object, Class)} method
 	 * 	and runs {@link URLEncoder#encode(String,String)} against the results.
 	 * Useful for constructing URL parts.
 	 *
@@ -383,7 +382,7 @@ public class UrlEncodingSerializer extends UonSerializer {
 					return o.toString();
 
 			StringWriter w = new StringWriter();
-			UonSerializerSession s = createSession(w, null, null);
+			UonSerializerSession s = createSession(w, null, null, null, null);
 			super.doSerialize(s, o);
 			return w.toString();
 		} catch (Exception e) {
@@ -397,8 +396,8 @@ public class UrlEncodingSerializer extends UonSerializer {
 	//--------------------------------------------------------------------------------
 
 	@Override /* Serializer */
-	public UrlEncodingSerializerSession createSession(Object output, ObjectMap properties, Method javaMethod) {
-		return new UrlEncodingSerializerSession(getContext(UrlEncodingSerializerContext.class), getBeanContext(), output, properties, javaMethod);
+	public UrlEncodingSerializerSession createSession(Object output, ObjectMap op, Method javaMethod, Locale locale, TimeZone timeZone) {
+		return new UrlEncodingSerializerSession(getContext(UrlEncodingSerializerContext.class), op, output, javaMethod, locale, timeZone);
 	}
 
 	@Override /* Serializer */

http://git-wip-us.apache.org/repos/asf/incubator-juneau/blob/bb650bde/juneau-core/src/main/java/org/apache/juneau/urlencoding/UrlEncodingSerializerContext.java
----------------------------------------------------------------------
diff --git a/juneau-core/src/main/java/org/apache/juneau/urlencoding/UrlEncodingSerializerContext.java b/juneau-core/src/main/java/org/apache/juneau/urlencoding/UrlEncodingSerializerContext.java
index 932447e..5c2c6ff 100644
--- a/juneau-core/src/main/java/org/apache/juneau/urlencoding/UrlEncodingSerializerContext.java
+++ b/juneau-core/src/main/java/org/apache/juneau/urlencoding/UrlEncodingSerializerContext.java
@@ -32,11 +32,31 @@ import org.apache.juneau.*;
  * </ul>
  * <p>
  * See {@link ContextFactory} for more information about context properties.
+ *
+ *
+ * <h6 class='topic' id='ConfigProperties'>Configurable properties on the URL-Encoding serializer</h6>
+ * <table class='styled' style='border-collapse: collapse;'>
+ * 	<tr><th>Setting name</th><th>Description</th><th>Data type</th><th>Default value</th><th>Session overridable</th></tr>
+ * 	<tr>
+ * 		<td>{@link #URLENC_expandedParams}</td>
+ * 		<td>Serialize bean property collections/arrays as separate key/value pairs.</td>
+ * 		<td><code>Boolean</code></td>
+ * 		<td><jk>false</jk></td>
+ * 		<td><jk>true</jk></td>
+ * 	</tr>
+ * </table>
  */
 public class UrlEncodingSerializerContext extends UonSerializerContext {
 
 	/**
-	 * Serialize bean property collections/arrays as separate key/value pairs ({@link Boolean}, default=<jk>false</jk>).
+	 * <b>Configuration property:</b>  Serialize bean property collections/arrays as separate key/value pairs.
+	 * <p>
+	 * <ul>
+	 * 	<li><b>Name:</b> <js>"UrlEncoding.expandedParams"</js>
+	 * 	<li><b>Data type:</b> <code>Boolean</code>
+	 * 	<li><b>Default:</b> <jk>false</jk>
+	 * 	<li><b>Session-overridable:</b> <jk>true</jk>
+	 * </ul>
 	 * <p>
 	 * If <jk>false</jk>, serializing the array <code>[1,2,3]</code> results in <code>?key=$a(1,2,3)</code>.
 	 * If <jk>true</jk>, serializing the same array results in <code>?key=1&key=2&key=3</code>.

http://git-wip-us.apache.org/repos/asf/incubator-juneau/blob/bb650bde/juneau-core/src/main/java/org/apache/juneau/urlencoding/UrlEncodingSerializerSession.java
----------------------------------------------------------------------
diff --git a/juneau-core/src/main/java/org/apache/juneau/urlencoding/UrlEncodingSerializerSession.java b/juneau-core/src/main/java/org/apache/juneau/urlencoding/UrlEncodingSerializerSession.java
index 192122a..c762e90 100644
--- a/juneau-core/src/main/java/org/apache/juneau/urlencoding/UrlEncodingSerializerSession.java
+++ b/juneau-core/src/main/java/org/apache/juneau/urlencoding/UrlEncodingSerializerSession.java
@@ -15,6 +15,7 @@ package org.apache.juneau.urlencoding;
 import static org.apache.juneau.urlencoding.UrlEncodingParserContext.*;
 
 import java.lang.reflect.*;
+import java.util.*;
 
 import org.apache.juneau.*;
 import org.apache.juneau.json.*;
@@ -33,14 +34,17 @@ public class UrlEncodingSerializerSession extends UonSerializerSession {
 	 *
 	 * @param ctx The context creating this session object.
 	 * 	The context contains all the configuration settings for this object.
-	 * @param beanContext The bean context being used.
 	 * @param output The output object.  See {@link JsonSerializerSession#getWriter()} for valid class types.
 	 * @param op The override properties.
 	 * 	These override any context properties defined in the context.
 	 * @param javaMethod The java method that called this parser, usually the method in a REST servlet.
+	 * @param locale The session locale.
+	 * 	If <jk>null</jk>, then the locale defined on the context is used.
+	 * @param timeZone The session timezone.
+	 * 	If <jk>null</jk>, then the timezone defined on the context is used.
 	 */
-	public UrlEncodingSerializerSession(UrlEncodingSerializerContext ctx, BeanContext beanContext, Object output, ObjectMap op, Method javaMethod) {
-		super(ctx, beanContext, output, op, javaMethod);
+	public UrlEncodingSerializerSession(UrlEncodingSerializerContext ctx, ObjectMap op, Object output, Method javaMethod, Locale locale, TimeZone timeZone) {
+		super(ctx, op, output, javaMethod, locale, timeZone);
 		if (op == null || op.isEmpty()) {
 			expandedParams = ctx.expandedParams;
 		} else {
@@ -74,7 +78,7 @@ public class UrlEncodingSerializerSession extends UonSerializerSession {
 	public final boolean shouldUseExpandedParams(Object value) {
 		if (value == null || ! expandedParams)
 			return false;
-		ClassMeta<?> cm = getBeanContext().getClassMetaForObject(value).getSerializedClassMeta();
+		ClassMeta<?> cm = getClassMetaForObject(value).getSerializedClassMeta();
 		if (cm.isArray() || cm.isCollection()) {
 			if (expandedParams)
 				return true;

http://git-wip-us.apache.org/repos/asf/incubator-juneau/blob/bb650bde/juneau-core/src/main/java/org/apache/juneau/utils/PojoIntrospector.java
----------------------------------------------------------------------
diff --git a/juneau-core/src/main/java/org/apache/juneau/utils/PojoIntrospector.java b/juneau-core/src/main/java/org/apache/juneau/utils/PojoIntrospector.java
index de21fb2..44d5580 100644
--- a/juneau-core/src/main/java/org/apache/juneau/utils/PojoIntrospector.java
+++ b/juneau-core/src/main/java/org/apache/juneau/utils/PojoIntrospector.java
@@ -79,7 +79,7 @@ public final class PojoIntrospector {
 	public Object invokeMethod(Method method, Reader args) throws InvocationTargetException, IllegalArgumentException, IllegalAccessException, ParseException, IOException {
 		if (o == null)
 			return null;
-		ClassMeta<?>[] argTypes = p.getBeanContext().getClassMetas(method.getParameterTypes());
+		ClassMeta<?>[] argTypes = p.getBeanContext().createSession().getClassMetas(method.getParameterTypes());
 		Object[] params = args == null ? null : p.parseArgs(args, argTypes);
 		return method.invoke(o, params);
 	}
@@ -108,7 +108,7 @@ public final class PojoIntrospector {
 	public Object invokeMethod(String method, String args) throws NoSuchMethodException, IllegalArgumentException, InvocationTargetException, IllegalAccessException, ParseException, IOException {
 		if (o == null)
 			return null;
-		Method m = p.getBeanContext().getClassMeta(o.getClass()).getPublicMethods().get(method);
+		Method m = p.getBeanContext().createSession().getClassMeta(o.getClass()).getPublicMethods().get(method);
 		if (m == null)
 			throw new NoSuchMethodException(method);
 		return invokeMethod(m, args == null ? null : new StringReader(args));

http://git-wip-us.apache.org/repos/asf/incubator-juneau/blob/bb650bde/juneau-core/src/main/java/org/apache/juneau/utils/PojoQuery.java
----------------------------------------------------------------------
diff --git a/juneau-core/src/main/java/org/apache/juneau/utils/PojoQuery.java b/juneau-core/src/main/java/org/apache/juneau/utils/PojoQuery.java
index 554204c..1d062f4 100644
--- a/juneau-core/src/main/java/org/apache/juneau/utils/PojoQuery.java
+++ b/juneau-core/src/main/java/org/apache/juneau/utils/PojoQuery.java
@@ -199,18 +199,18 @@ public final class PojoQuery {
 
 	private Object input;
 	private ClassMeta type;
-	private BeanContext beanContext;
+	private BeanSession session;
 
 	/**
 	 * Constructor.
 	 *
 	 * @param input The POJO we're going to be filtering.
-	 * @param beanContext The bean context to use to create bean maps for beans.
+	 * @param session The bean session to use to create bean maps for beans.
 	 */
-	public PojoQuery(Object input, BeanContext beanContext) {
+	public PojoQuery(Object input, BeanSession session) {
 		this.input = input;
-		this.type = beanContext.getClassMetaForObject(input);
-		this.beanContext = beanContext;
+		this.type = session.getClassMetaForObject(input);
+		this.session = session;
 	}
 
 	/**
@@ -293,16 +293,16 @@ public final class PojoQuery {
 	private Object replaceWithMutables(Object o) {
 		if (o == null)
 			return null;
-		ClassMeta cm = beanContext.getClassMetaForObject(o);
+		ClassMeta cm = session.getClassMetaForObject(o);
 		if (cm.isCollection()) {
-			ObjectList l = new DelegateList(beanContext.getClassMetaForObject(o));
+			ObjectList l = new DelegateList(session.getClassMetaForObject(o));
 			for (Object o2 : (Collection)o)
 				l.add(replaceWithMutables(o2));
 			return l;
 		}
 		if (cm.isMap() && o instanceof BeanMap) {
 			BeanMap bm = (BeanMap)o;
-			DelegateBeanMap dbm = new DelegateBeanMap(bm.getBean(), beanContext);
+			DelegateBeanMap dbm = new DelegateBeanMap(bm.getBean(), session);
 			for (BeanMapEntry e : (Set<BeanMapEntry>)bm.entrySet()) {
 				ClassMeta ct1 = e.getMeta().getClassMeta();
 				if (ct1.isArray() || ct1.isBean() || ct1.isCollection() || ct1.isMap() || ct1.isObject())
@@ -313,8 +313,8 @@ public final class PojoQuery {
 			return dbm;
 		}
 		if (cm.isBean()) {
-			BeanMap bm = beanContext.forBean(o);
-			DelegateBeanMap dbm = new DelegateBeanMap(bm.getBean(), beanContext);
+			BeanMap bm = session.toBeanMap(o);
+			DelegateBeanMap dbm = new DelegateBeanMap(bm.getBean(), session);
 			for (BeanMapEntry e : (Set<BeanMapEntry>)bm.entrySet()) {
 				ClassMeta ct1 = e.getMeta().getClassMeta();
 				if (ct1.isArray() || ct1.isBean() || ct1.isCollection() || ct1.isMap() || ct1.isObject()) {
@@ -333,7 +333,7 @@ public final class PojoQuery {
 		}
 		if (cm.isMap()) {
 			Map m = (Map)o;
-			DelegateMap dm = new DelegateMap(beanContext.getClassMetaForObject(m));
+			DelegateMap dm = new DelegateMap(session.getClassMetaForObject(m));
 			for (Map.Entry e : (Set<Map.Entry>)m.entrySet())
 				dm.put(e.getKey().toString(), replaceWithMutables(e.getValue()));
 			return dm;
@@ -484,7 +484,7 @@ public final class PojoQuery {
 				Object value = e.getValue();
 				IMatcher matcher = null;
 				if (value instanceof String)
-					matcher = getObjectMatcherForType((String)value, ignoreCase, beanContext.object());
+					matcher = getObjectMatcherForType((String)value, ignoreCase, session.object());
 				else if (value instanceof ObjectMap)
 					matcher = new MapMatcher((ObjectMap)value, ignoreCase);
 				else

http://git-wip-us.apache.org/repos/asf/incubator-juneau/blob/bb650bde/juneau-core/src/main/java/org/apache/juneau/utils/PojoRest.java
----------------------------------------------------------------------
diff --git a/juneau-core/src/main/java/org/apache/juneau/utils/PojoRest.java b/juneau-core/src/main/java/org/apache/juneau/utils/PojoRest.java
index 5efdbca..6f690cf 100644
--- a/juneau-core/src/main/java/org/apache/juneau/utils/PojoRest.java
+++ b/juneau-core/src/main/java/org/apache/juneau/utils/PojoRest.java
@@ -119,7 +119,7 @@ public final class PojoRest {
 	private static final int GET=1, PUT=2, POST=3, DELETE=4;
 
 	private ReaderParser parser = JsonParser.DEFAULT;
-	private final BeanContext bc;
+	private final BeanSession session;
 
 	/** If true, the root cannot be overwritten */
 	private boolean rootLocked = false;
@@ -150,8 +150,8 @@ public final class PojoRest {
 		if (parser == null)
 			parser = JsonParser.DEFAULT;
 		this.parser = parser;
-		this.bc = parser.getBeanContext();
-		this.root = new JsonNode(null, null, o, bc.object());
+		this.session = parser.getBeanContext().createSession();
+		this.root = new JsonNode(null, null, o, session.object());
 	}
 
 	/**
@@ -200,7 +200,7 @@ public final class PojoRest {
 	/**
 	 * Retrieves the element addressed by the URL as the specified object type.
 	 * <p>
-	 * Will convert object to the specified type per {@link BeanContext#convertToType(Object, ClassMeta)}.
+	 * Will convert object to the specified type per {@link BeanSession#convertToType(Object, ClassMeta)}.
 	 *
 	 * @param type The specified object type.
 	 * @param url The URL of the element to retrieve.
@@ -216,7 +216,7 @@ public final class PojoRest {
 	/**
 	 * Retrieves the element addressed by the URL as the specified object type.
 	 * <p>
-	 * Will convert object to the specified type per {@link BeanContext#convertToType(Object, ClassMeta)}.
+	 * Will convert object to the specified type per {@link BeanSession#convertToType(Object, ClassMeta)}.
 	 *
 	 * @param type The specified object type.
 	 * @param url The URL of the element to retrieve.
@@ -230,7 +230,7 @@ public final class PojoRest {
 		Object o = service(GET, url, null);
 		if (o == null)
 			return def;
-		return bc.convertToType(o, type);
+		return session.convertToType(o, type);
 	}
 
 	/**
@@ -495,7 +495,7 @@ public final class PojoRest {
 		Object o = get(url);
 		if (o == null)
 			return null;
-		return bc.getClassMeta(o.getClass()).getPublicMethods().keySet();
+		return session.getClassMeta(o.getClass()).getPublicMethods().keySet();
 	}
 
 	/**
@@ -605,7 +605,7 @@ public final class PojoRest {
 				if (rootLocked)
 					throw new PojoRestException(HTTP_FORBIDDEN, "Cannot overwrite root object");
 				Object o = root.o;
-				root = new JsonNode(null, null, val, bc.object());
+				root = new JsonNode(null, null, val, session.object());
 				return o;
 			}
 			JsonNode n = (parentUrl == null ? root : getNode(parentUrl, root));
@@ -626,14 +626,14 @@ public final class PojoRest {
 					return url;
 				}
 				if (pct.isBean()) {
-					BeanMap m = bc.forBean(po);
+					BeanMap m = session.toBeanMap(po);
 					m.put(n.keyName, o);
 					return url;
 				}
 				throw new PojoRestException(HTTP_BAD_REQUEST, "Cannot perform PUT on ''{0}'' with parent node type ''{1}''", url, pct);
 			}
 			if (cm.isBean())
-				return bc.forBean(o).put(childKey, val);
+				return session.toBeanMap(o).put(childKey, val);
 			throw new PojoRestException(HTTP_BAD_REQUEST, "Cannot perform PUT on ''{0}'' whose parent is of type ''{1}''", url, cm);
 		}
 
@@ -668,7 +668,7 @@ public final class PojoRest {
 					return url + "/" + (o2.length-1);
 				}
 				if (pct.isBean()) {
-					BeanMap m = bc.forBean(po);
+					BeanMap m = session.toBeanMap(po);
 					m.put(childKey, o2);
 					return url + "/" + (o2.length-1);
 				}
@@ -687,7 +687,7 @@ public final class PojoRest {
 				if (rootLocked)
 					throw new PojoRestException(HTTP_FORBIDDEN, "Cannot overwrite root object");
 				Object o = root.o;
-				root = new JsonNode(null, null, null, bc.object());
+				root = new JsonNode(null, null, null, session.object());
 				return o;
 			}
 			JsonNode n = (parentUrl == null ? root : getNode(parentUrl, root));
@@ -708,14 +708,14 @@ public final class PojoRest {
 					return old;
 				}
 				if (pct.isBean()) {
-					BeanMap m = bc.forBean(po);
+					BeanMap m = session.toBeanMap(po);
 					m.put(n.keyName, o2);
 					return old;
 				}
 				throw new PojoRestException(HTTP_BAD_REQUEST, "Cannot perform POST on ''{0}'' with parent node type ''{1}''", url, pct);
 			}
 			if (cm.isBean())
-				return bc.forBean(o).put(childKey, null);
+				return session.toBeanMap(o).put(childKey, null);
 			throw new PojoRestException(HTTP_BAD_REQUEST, "Cannot perform PUT on ''{0}'' whose parent is of type ''{1}''", url, cm);
 		}
 
@@ -764,9 +764,9 @@ public final class PojoRest {
 			this.parent = parent;
 			if (cm == null || cm.isObject()) {
 				if (o == null)
-					cm = bc.object();
+					cm = session.object();
 				else
-					cm = bc.getClassMetaForObject(o);
+					cm = session.getClassMetaForObject(o);
 			}
 			this.cm = cm;
 		}
@@ -808,7 +808,7 @@ public final class PojoRest {
 			o2 = a[key];
 			ct2 = cm.getElementType();
 		} else if (cm.isBean()) {
-			BeanMap m = bc.forBean(o);
+			BeanMap m = session.toBeanMap(o);
 			o2 = m.get(parentKey);
 			BeanPropertyMeta pMeta = m.getPropertyMeta(parentKey);
 			if (pMeta == null)
@@ -829,7 +829,7 @@ public final class PojoRest {
 		if (cm == null)
 			return in;
 		if (cm.isBean() && in instanceof Map)
-			return bc.convertToType(in, cm);
+			return session.convertToType(in, cm);
 		return in;
 	}
 

http://git-wip-us.apache.org/repos/asf/incubator-juneau/blob/bb650bde/juneau-core/src/main/java/org/apache/juneau/xml/XmlParser.java
----------------------------------------------------------------------
diff --git a/juneau-core/src/main/java/org/apache/juneau/xml/XmlParser.java b/juneau-core/src/main/java/org/apache/juneau/xml/XmlParser.java
index 9a7bf88..a1f5b7f 100644
--- a/juneau-core/src/main/java/org/apache/juneau/xml/XmlParser.java
+++ b/juneau-core/src/main/java/org/apache/juneau/xml/XmlParser.java
@@ -58,16 +58,15 @@ public class XmlParser extends ReaderParser {
 
 	private <T> T parseAnything(XmlParserSession session, ClassMeta<T> eType, String currAttr, XMLStreamReader r, Object outer, boolean isRoot, BeanPropertyMeta pMeta) throws Exception {
 
-		BeanContext bc = session.getBeanContext();
 		if (eType == null)
 			eType = (ClassMeta<T>)object();
 		PojoSwap<T,Object> transform = (PojoSwap<T,Object>)eType.getPojoSwap();
 		ClassMeta<?> sType = eType.getSerializedClassMeta();
 		session.setCurrentClass(sType);
-		BeanDictionary bd = (pMeta == null ? bc.getBeanDictionary() : pMeta.getBeanDictionary());
+		BeanDictionary bd = (pMeta == null ? session.getBeanDictionary() : pMeta.getBeanDictionary());
 
 		String wrapperAttr = (isRoot && session.isPreserveRootElement()) ? r.getName().getLocalPart() : null;
-		String typeAttr = r.getAttributeValue(null, bc.getBeanTypePropertyName());
+		String typeAttr = r.getAttributeValue(null, session.getBeanTypePropertyName());
 		int jsonType = getJsonType(typeAttr);
 		String b = r.getAttributeValue(session.getXsiNs(), "nil");
 		if (b == null)
@@ -105,13 +104,13 @@ public class XmlParser extends ReaderParser {
 
 		if (sType.isObject()) {
 			if (jsonType == OBJECT) {
-				ObjectMap m = new ObjectMap(bc);
+				ObjectMap m = new ObjectMap(session);
 				parseIntoMap(session, r, m, string(), object(), pMeta);
 				if (wrapperAttr != null)
-					m = new ObjectMap(bc).append(wrapperAttr, m);
+					m = new ObjectMap(session).append(wrapperAttr, m);
 				o = bd.cast(m);
 			} else if (jsonType == ARRAY)
-				o = parseIntoCollection(session, r, new ObjectList(bc), object(), pMeta);
+				o = parseIntoCollection(session, r, new ObjectList(session), object(), pMeta);
 			else if (jsonType == STRING) {
 				o = session.decodeString(r.getElementText());
 				if (sType.isChar())
@@ -130,23 +129,23 @@ public class XmlParser extends ReaderParser {
 		} else if (sType.isChar()) {
 			o = session.decodeString(r.getElementText()).charAt(0);
 		} else if (sType.isMap()) {
-			Map m = (sType.canCreateNewInstance(outer) ? (Map)sType.newInstance(outer) : new ObjectMap(bc));
+			Map m = (sType.canCreateNewInstance(outer) ? (Map)sType.newInstance(outer) : new ObjectMap(session));
 			o = parseIntoMap(session, r, m, sType.getKeyType(), sType.getValueType(), pMeta);
 			if (wrapperAttr != null)
-				o = new ObjectMap(bc).append(wrapperAttr, m);
+				o = new ObjectMap(session).append(wrapperAttr, m);
 		} else if (sType.isCollection()) {
-			Collection l = (sType.canCreateNewInstance(outer) ? (Collection)sType.newInstance(outer) : new ObjectList(bc));
+			Collection l = (sType.canCreateNewInstance(outer) ? (Collection)sType.newInstance(outer) : new ObjectList(session));
 			o = parseIntoCollection(session, r, l, sType.getElementType(), pMeta);
 		} else if (sType.isNumber()) {
 			o = parseNumber(session.decodeLiteral(r.getElementText()), (Class<? extends Number>)sType.getInnerClass());
 		} else if (sType.canCreateNewInstanceFromObjectMap(outer)) {
-			ObjectMap m = new ObjectMap(bc);
+			ObjectMap m = new ObjectMap(session);
 			parseIntoMap(session, r, m, string(), object(), pMeta);
 			o = sType.newInstanceFromObjectMap(outer, m);
 		} else if (sType.canCreateNewBean(outer)) {
 			if (sType.getExtendedMeta(XmlClassMeta.class).getFormat() == XmlFormat.COLLAPSED) {
 				String fieldName = r.getLocalName();
-				BeanMap<?> m = bc.newBeanMap(outer, sType.getInnerClass());
+				BeanMap<?> m = session.newBeanMap(outer, sType.getInnerClass());
 				BeanPropertyMeta bpm = m.getMeta().getExtendedMeta(XmlBeanMeta.class).getPropertyMeta(fieldName);
 				ClassMeta<?> cm = m.getMeta().getClassMeta();
 				Object value = parseAnything(session, cm, currAttr, r, m.getBean(false), false, null);
@@ -154,22 +153,22 @@ public class XmlParser extends ReaderParser {
 				bpm.set(m, value);
 				o = m.getBean();
 			} else {
-				BeanMap m = bc.newBeanMap(outer, sType.getInnerClass());
+				BeanMap m = session.newBeanMap(outer, sType.getInnerClass());
 				o = parseIntoBean(session, r, m).getBean();
 			}
 		} else if (sType.isArray()) {
 			ArrayList l = (ArrayList)parseIntoCollection(session, r, new ArrayList(), sType.getElementType(), pMeta);
-			o = bc.toArray(sType, l);
+			o = session.toArray(sType, l);
 		} else if (sType.canCreateNewInstanceFromString(outer)) {
 			o = sType.newInstanceFromString(outer, session.decodeString(r.getElementText()));
 		} else if (sType.canCreateNewInstanceFromNumber(outer)) {
-			o = sType.newInstanceFromNumber(outer, parseNumber(session.decodeLiteral(r.getElementText()), sType.getNewInstanceFromNumberClass()));
+			o = sType.newInstanceFromNumber(session, outer, parseNumber(session.decodeLiteral(r.getElementText()), sType.getNewInstanceFromNumberClass()));
 		} else {
 			throw new ParseException(session, "Class ''{0}'' could not be instantiated.  Reason: ''{1}''", sType.getInnerClass().getName(), sType.getNotABeanReason());
 		}
 
 		if (transform != null && o != null)
-			o = transform.unswap(o, eType, bc);
+			o = transform.unswap(session, o, eType);
 
 		if (outer != null)
 			setParent(eType, o, outer);
@@ -178,12 +177,11 @@ public class XmlParser extends ReaderParser {
 	}
 
 	private <K,V> Map<K,V> parseIntoMap(XmlParserSession session, XMLStreamReader r, Map<K,V> m, ClassMeta<K> keyType, ClassMeta<V> valueType, BeanPropertyMeta pMeta) throws Exception {
-		BeanContext bc = session.getBeanContext();
 		int depth = 0;
 		for (int i = 0; i < r.getAttributeCount(); i++) {
 			String a = r.getAttributeLocalName(i);
 			// TODO - Need better handling of namespaces here.
-			if (! (a.equals(bc.getBeanTypePropertyName()))) {
+			if (! (a.equals(session.getBeanTypePropertyName()))) {
 				K key = session.trim(convertAttrToType(session, m, a, keyType));
 				V value = session.trim(convertAttrToType(session, m, r.getAttributeValue(i), valueType));
 				setName(valueType, value, key);
@@ -204,7 +202,7 @@ public class XmlParser extends ReaderParser {
 					if (o instanceof List)
 						((List)o).add(value);
 					else
-						m.put(key, (V)new ObjectList(o, value).setBeanContext(bc));
+						m.put(key, (V)new ObjectList(o, value).setBeanSession(session));
 				} else {
 					m.put(key, value);
 				}
@@ -359,7 +357,6 @@ public class XmlParser extends ReaderParser {
 	}
 
 	private Object getUnknown(XmlParserSession session, XMLStreamReader r) throws Exception {
-		BeanContext bc = session.getBeanContext();
 		if (r.getEventType() != XMLStreamConstants.START_ELEMENT) {
 			throw new XMLStreamException("parser must be on START_ELEMENT to read next text", r.getLocation());
 		}
@@ -367,11 +364,11 @@ public class XmlParser extends ReaderParser {
 
 		// If this element has attributes, then it's always an ObjectMap.
 		if (r.getAttributeCount() > 0) {
-			m = new ObjectMap(bc);
+			m = new ObjectMap(session);
 			for (int i = 0; i < r.getAttributeCount(); i++) {
 				String key = session.decodeString(r.getAttributeLocalName(i));
 				String val = r.getAttributeValue(i);
-				if (! key.equals(bc.getBeanTypePropertyName()))
+				if (! key.equals(session.getBeanTypePropertyName()))
 					m.put(key, val);
 			}
 		}
@@ -388,7 +385,7 @@ public class XmlParser extends ReaderParser {
 				// Oops...this has an element in it.
 				// Parse it as a map.
 				if (m == null)
-					m = new ObjectMap(bc);
+					m = new ObjectMap(session);
 				int depth = 0;
 				do {
 					int event = (eventType == -1 ? r.nextTag() : eventType);
@@ -403,7 +400,7 @@ public class XmlParser extends ReaderParser {
 							if (o instanceof ObjectList)
 								((ObjectList)o).add(value);
 							else
-								m.put(key, new ObjectList(o, value).setBeanContext(bc));
+								m.put(key, new ObjectList(o, value).setBeanSession(session));
 						} else {
 							m.put(key, value);
 						}
@@ -436,28 +433,28 @@ public class XmlParser extends ReaderParser {
 	//--------------------------------------------------------------------------------
 
 	@Override /* Parser */
-	public XmlParserSession createSession(Object input, ObjectMap properties, Method javaMethod, Object outer) {
-		return new XmlParserSession(getContext(XmlParserContext.class), getBeanContext(), input, properties, javaMethod, outer);
+	public XmlParserSession createSession(Object input, ObjectMap op, Method javaMethod, Object outer, Locale locale, TimeZone timeZone) {
+		return new XmlParserSession(getContext(XmlParserContext.class), op, input, javaMethod, outer, locale, timeZone);
 	}
 
 	@Override /* Parser */
 	protected <T> T doParse(ParserSession session, ClassMeta<T> type) throws Exception {
 		XmlParserSession s = (XmlParserSession)session;
-		type = s.getBeanContext().normalizeClassMeta(type);
+		type = session.normalizeClassMeta(type);
 		return parseAnything(s, type, null, s.getXmlStreamReader(), s.getOuter(), true, null);
 	}
 
 	@Override /* ReaderParser */
 	protected <K,V> Map<K,V> doParseIntoMap(ParserSession session, Map<K,V> m, Type keyType, Type valueType) throws Exception {
 		XmlParserSession s = (XmlParserSession)session;
-		ClassMeta cm = s.getBeanContext().getMapClassMeta(m.getClass(), keyType, valueType);
+		ClassMeta cm = session.getMapClassMeta(m.getClass(), keyType, valueType);
 		return parseIntoMap(s, m, cm.getKeyType(), cm.getValueType());
 	}
 
 	@Override /* ReaderParser */
 	protected <E> Collection<E> doParseIntoCollection(ParserSession session, Collection<E> c, Type elementType) throws Exception {
 		XmlParserSession s = (XmlParserSession)session;
-		ClassMeta cm = s.getBeanContext().getCollectionClassMeta(c.getClass(), elementType);
+		ClassMeta cm = session.getCollectionClassMeta(c.getClass(), elementType);
 		return parseIntoCollection(s,c, cm.getElementType());
 	}
 

http://git-wip-us.apache.org/repos/asf/incubator-juneau/blob/bb650bde/juneau-core/src/main/java/org/apache/juneau/xml/XmlParserContext.java
----------------------------------------------------------------------
diff --git a/juneau-core/src/main/java/org/apache/juneau/xml/XmlParserContext.java b/juneau-core/src/main/java/org/apache/juneau/xml/XmlParserContext.java
index 98592c1..6f1c010 100644
--- a/juneau-core/src/main/java/org/apache/juneau/xml/XmlParserContext.java
+++ b/juneau-core/src/main/java/org/apache/juneau/xml/XmlParserContext.java
@@ -39,60 +39,69 @@ import org.apache.juneau.parser.*;
  *
  * <h6 class='topic' id='ConfigProperties'>Configurable properties on the XML parser</h6>
  * <table class='styled' style='border-collapse: collapse;'>
- * 	<tr><th>Setting name</th><th>Description</th><th>Data type</th><th>Default value</th></tr>
+ * 	<tr><th>Setting name</th><th>Description</th><th>Data type</th><th>Default value</th><th>Session overridable</th></tr>
  * 	<tr>
  * 		<td>{@link #XML_xsiNs}</td>
  * 		<td>XMLSchema-instance namespace URI.</td>
  * 		<td><code>String<code></td>
  * 		<td><js>"http://www.w3.org/2001/XMLSchema-instance"</js></td>
+ * 		<td><jk>true</jk></td>
  * 	</tr>
  * 	<tr>
  * 		<td>{@link #XML_trimWhitespace}</td>
  * 		<td>Trim whitespace from text elements.</td>
  * 		<td><code>Boolean<code></td>
  * 		<td><jk>true</jk></td>
+ * 		<td><jk>true</jk></td>
  * 	</tr>
  * 	<tr>
  * 		<td>{@link #XML_validating}</td>
  * 		<td>Enable validation.</td>
  * 		<td><code>Boolean<code></td>
  * 		<td><jk>false</jk></td>
+ * 		<td><jk>true</jk></td>
  * 	</tr>
  * 	<tr>
  * 		<td>{@link #XML_coalescing}</td>
  * 		<td>Enable text element coalescing.</td>
  * 		<td><code>Boolean<code></td>
  * 		<td><jk>false</jk></td>
+ * 		<td><jk>true</jk></td>
  * 	</tr>
  * 	<tr>
  * 		<td>{@link #XML_replaceEntityReferences}</td>
  * 		<td>Replace entity references.</td>
  * 		<td><code>Boolean<code></td>
  * 		<td><jk>true</jk></td>
+ * 		<td><jk>true</jk></td>
  * 	</tr>
  * 	<tr>
  * 		<td>{@link #XML_reporter}</td>
  * 		<td>XML reporter.</td>
  * 		<td>{@link XMLReporter}</td>
  * 		<td><jk>null</jk></td>
+ * 		<td><jk>true</jk></td>
  * 	</tr>
  * 	<tr>
  * 		<td>{@link #XML_resolver}</td>
  * 		<td>XML resolver.</td>
  * 		<td>{@link XMLResolver}</td>
  * 		<td><jk>null</jk></td>
+ * 		<td><jk>true</jk></td>
  * 	</tr>
  * 	<tr>
  * 		<td>{@link #XML_eventAllocator}</td>
  * 		<td>XML event allocator.</td>
  * 		<td>{@link XMLEventAllocator}</td>
  * 		<td><jk>null</jk></td>
+ * 		<td><jk>true</jk></td>
  * 	</tr>
  * 	<tr>
  * 		<td>{@link #XML_preserveRootElement}</td>
  * 		<td>Preserve root element during generalized parsing.</td>
  * 		<td><code>Boolean<code></td>
  * 		<td><jk>false</jk></td>
+ * 		<td><jk>true</jk></td>
  * 	</tr>
  * </table>
  *
@@ -113,6 +122,7 @@ public final class XmlParserContext extends ParserContext {
 	 * 	<li><b>Name:</b> <js>"XmlParser.xsiNs"</js>
 	 * 	<li><b>Data type:</b> <code>String</code>
 	 * 	<li><b>Default:</b> <js>"http://www.w3.org/2001/XMLSchema-instance"</js>
+	 * 	<li><b>Session-overridable:</b> <jk>true</jk>
 	 * </ul>
 	 * <p>
 	 * The XMLSchema namespace.
@@ -126,6 +136,7 @@ public final class XmlParserContext extends ParserContext {
 	 * 	<li><b>Name:</b> <js>"XmlParser.trimWhitespace"</js>
 	 * 	<li><b>Data type:</b> <code>Boolean</code>
 	 * 	<li><b>Default:</b> <jk>true</jk>
+	 * 	<li><b>Session-overridable:</b> <jk>true</jk>
 	 * </ul>
 	 * <p>
 	 * If <jk>true</jk>, whitespace in text elements will be automatically trimmed.
@@ -139,6 +150,7 @@ public final class XmlParserContext extends ParserContext {
 	 * 	<li><b>Name:</b> <js>"XmlParser.validating"</js>
 	 * 	<li><b>Data type:</b> <code>Boolean</code>
 	 * 	<li><b>Default:</b> <jk>false</jk>
+	 * 	<li><b>Session-overridable:</b> <jk>true</jk>
 	 * </ul>
 	 * <p>
 	 * If <jk>true</jk>, XML document will be validated.
@@ -153,6 +165,7 @@ public final class XmlParserContext extends ParserContext {
 	 * 	<li><b>Name:</b> <js>"XmlParser.coalescing"</js>
 	 * 	<li><b>Data type:</b> <code>Boolean</code>
 	 * 	<li><b>Default:</b> <jk>false</jk>
+	 * 	<li><b>Session-overridable:</b> <jk>true</jk>
 	 * </ul>
 	 * <p>
 	 * If <jk>true</jk>, XML text elements will be coalesced.
@@ -167,6 +180,7 @@ public final class XmlParserContext extends ParserContext {
 	 * 	<li><b>Name:</b> <js>"XmlParser.replaceEntityReferences"</js>
 	 * 	<li><b>Data type:</b> <code>Boolean</code>
 	 * 	<li><b>Default:</b> <jk>true</jk>
+	 * 	<li><b>Session-overridable:</b> <jk>true</jk>
 	 * </ul>
 	 * <p>
 	 * If <jk>true</jk>, entity references will be replace during parsing.
@@ -181,6 +195,7 @@ public final class XmlParserContext extends ParserContext {
 	 * 	<li><b>Name:</b> <js>"XmlParser.reporter"</js>
 	 * 	<li><b>Data type:</b> {@link XMLReporter}
 	 * 	<li><b>Default:</b> <jk>null</jk>
+	 * 	<li><b>Session-overridable:</b> <jk>true</jk>
 	 * </ul>
 	 * <p>
 	 * Associates an {@link XMLReporter} with this parser.
@@ -196,6 +211,7 @@ public final class XmlParserContext extends ParserContext {
 	 * 	<li><b>Name:</b> <js>"XmlParser.resolver"</js>
 	 * 	<li><b>Data type:</b> {@link XMLResolver}
 	 * 	<li><b>Default:</b> <jk>null</jk>
+	 * 	<li><b>Session-overridable:</b> <jk>true</jk>
 	 * </ul>
 	 * <p>
 	 * Associates an {@link XMLResolver} with this parser.
@@ -209,6 +225,7 @@ public final class XmlParserContext extends ParserContext {
 	 * 	<li><b>Name:</b> <js>"XmlParser.eventAllocator"</js>
 	 * 	<li><b>Data type:</b> {@link XMLEventAllocator}
 	 * 	<li><b>Default:</b> <jk>null</jk>
+	 * 	<li><b>Session-overridable:</b> <jk>true</jk>
 	 * </ul>
 	 * <p>
 	 * Associates an {@link XMLEventAllocator} with this parser.
@@ -222,6 +239,7 @@ public final class XmlParserContext extends ParserContext {
 	 * 	<li><b>Name:</b> <js>"XmlParser.preserveRootElement"</js>
 	 * 	<li><b>Data type:</b> <code>Boolean</code>
 	 * 	<li><b>Default:</b> <jk>false</jk>
+	 * 	<li><b>Session-overridable:</b> <jk>true</jk>
 	 * </ul>
 	 * <p>
 	 * If <jk>true</jk>, when parsing into a generic {@link ObjectMap}, the map will

http://git-wip-us.apache.org/repos/asf/incubator-juneau/blob/bb650bde/juneau-core/src/main/java/org/apache/juneau/xml/XmlParserSession.java
----------------------------------------------------------------------
diff --git a/juneau-core/src/main/java/org/apache/juneau/xml/XmlParserSession.java b/juneau-core/src/main/java/org/apache/juneau/xml/XmlParserSession.java
index d1bee00..5eadec4 100644
--- a/juneau-core/src/main/java/org/apache/juneau/xml/XmlParserSession.java
+++ b/juneau-core/src/main/java/org/apache/juneau/xml/XmlParserSession.java
@@ -16,6 +16,7 @@ import static org.apache.juneau.xml.XmlParserContext.*;
 
 import java.io.*;
 import java.lang.reflect.*;
+import java.util.*;
 
 import javax.xml.stream.*;
 import javax.xml.stream.util.*;
@@ -48,7 +49,6 @@ public final class XmlParserSession extends ParserSession {
 	 *
 	 * @param ctx The context creating this session object.
 	 * 	The context contains all the configuration settings for this object.
-	 * @param beanContext The bean context being used.
 	 * @param input The input.  Can be any of the following types:
 	 * 	<ul>
 	 * 		<li><jk>null</jk>
@@ -61,9 +61,13 @@ public final class XmlParserSession extends ParserSession {
 	 * 	These override any context properties defined in the context.
 	 * @param javaMethod The java method that called this parser, usually the method in a REST servlet.
 	 * @param outer The outer object for instantiating top-level non-static inner classes.
+	 * @param locale The session locale.
+	 * 	If <jk>null</jk>, then the locale defined on the context is used.
+	 * @param timeZone The session timezone.
+	 * 	If <jk>null</jk>, then the timezone defined on the context is used.
 	 */
-	public XmlParserSession(XmlParserContext ctx, BeanContext beanContext, Object input, ObjectMap op, Method javaMethod, Object outer) {
-		super(ctx, beanContext, input, op, javaMethod, outer);
+	public XmlParserSession(XmlParserContext ctx, ObjectMap op, Object input, Method javaMethod, Object outer, Locale locale, TimeZone timeZone) {
+		super(ctx, op, input, javaMethod, outer, locale, timeZone);
 		if (op == null || op.isEmpty()) {
 			xsiNs = ctx.xsiNs;
 			trimWhitespace = ctx.trimWhitespace;
@@ -175,13 +179,16 @@ public final class XmlParserSession extends ParserSession {
 	 * Silently closes the XML stream.
 	 */
 	@Override /* ParserContext */
-	public void close() throws ParseException {
-		super.close();
-		try {
-			if (xmlStreamReader != null)
-				xmlStreamReader.close();
-		} catch (XMLStreamException e) {
-			// Ignore.
+	public boolean close() {
+		if (super.close()) {
+			try {
+				if (xmlStreamReader != null)
+					xmlStreamReader.close();
+			} catch (XMLStreamException e) {
+				// Ignore.
+			}
+			return true;
 		}
+		return false;
 	}
 }

http://git-wip-us.apache.org/repos/asf/incubator-juneau/blob/bb650bde/juneau-core/src/main/java/org/apache/juneau/xml/XmlSchemaSerializer.java
----------------------------------------------------------------------
diff --git a/juneau-core/src/main/java/org/apache/juneau/xml/XmlSchemaSerializer.java b/juneau-core/src/main/java/org/apache/juneau/xml/XmlSchemaSerializer.java
index 62dea11..a91ad29 100644
--- a/juneau-core/src/main/java/org/apache/juneau/xml/XmlSchemaSerializer.java
+++ b/juneau-core/src/main/java/org/apache/juneau/xml/XmlSchemaSerializer.java
@@ -90,7 +90,7 @@ public class XmlSchemaSerializer extends XmlSerializer {
 	/**
 	 * Returns an XML-Schema validator based on the output returned by {@link #doSerialize(SerializerSession, Object)};
 	 *
-	 * @param session The serializer session object return by {@link #createSession(Object, ObjectMap, Method)}.<br>
+	 * @param session The serializer session object return by {@link #createSession(Object, ObjectMap, Method, Locale, TimeZone)}.<br>
 	 * 	Can be <jk>null</jk>.
 	 * @param o The object to serialize.
 	 * @return The new validator.
@@ -186,7 +186,7 @@ public class XmlSchemaSerializer extends XmlSerializer {
 		}
 
 		private void process(SerializerSession session, Object o) throws IOException {
-			ClassMeta<?> cm = session.getBeanContext().getClassMetaForObject(o);
+			ClassMeta<?> cm = session.getClassMetaForObject(o);
 			Namespace ns = defaultNs;
 			if (cm == null)
 				queueElement(ns, "null", object());
@@ -328,7 +328,6 @@ public class XmlSchemaSerializer extends XmlSerializer {
 			int i = session.getIndent() + 1;
 
 			cm = cm.getSerializedClassMeta();
-			BeanContext bc = cm.getBeanContext();
 
 			w.oTag(i, "complexType")
 				.attr("name", name);
@@ -349,7 +348,7 @@ public class XmlSchemaSerializer extends XmlSerializer {
 				if (session.isAddJsonTypeAttrs() || (session.isAddJsonStringTypeAttrs() && base.equals("string"))) {
 					w.cTag().nl();
 					w.oTag(i+3, "attribute")
-						.attr("name", bc.getBeanTypePropertyName())
+						.attr("name", session.getBeanTypePropertyName())
 						.attr("type", "string")
 						.ceTag().nl();
 					w.eTag(i+2, "extension").nl();
@@ -489,7 +488,7 @@ public class XmlSchemaSerializer extends XmlSerializer {
 
 				if (session.isAddBeanTypeProperties() || session.isAddJsonTypeAttrs()) {
 					w.oTag(i+1, "attribute")
-						.attr("name", bc.getBeanTypePropertyName())
+						.attr("name", session.getBeanTypePropertyName())
 						.attr("type", "string")
 						.ceTag().nl();
 				}
@@ -577,11 +576,11 @@ public class XmlSchemaSerializer extends XmlSerializer {
 	}
 
 	@Override /* Serializer */
-	public XmlSerializerSession createSession(Object output, ObjectMap properties, Method javaMethod) {
+	public XmlSerializerSession createSession(Object output, ObjectMap op, Method javaMethod, Locale locale, TimeZone timeZone) {
 		// This serializer must always have namespaces enabled.
-		if (properties == null)
-			properties = new ObjectMap();
-		properties.put(XmlSerializerContext.XML_enableNamespaces, true);
-		return new XmlSerializerSession(getContext(XmlSerializerContext.class), getBeanContext(), output, properties, javaMethod);
+		if (op == null)
+			op = new ObjectMap();
+		op.put(XmlSerializerContext.XML_enableNamespaces, true);
+		return new XmlSerializerSession(getContext(XmlSerializerContext.class), op, output, javaMethod, locale, timeZone);
 	}
 }

http://git-wip-us.apache.org/repos/asf/incubator-juneau/blob/bb650bde/juneau-core/src/main/java/org/apache/juneau/xml/XmlSerializer.java
----------------------------------------------------------------------
diff --git a/juneau-core/src/main/java/org/apache/juneau/xml/XmlSerializer.java b/juneau-core/src/main/java/org/apache/juneau/xml/XmlSerializer.java
index 83d9a3f..6836fbc 100644
--- a/juneau-core/src/main/java/org/apache/juneau/xml/XmlSerializer.java
+++ b/juneau-core/src/main/java/org/apache/juneau/xml/XmlSerializer.java
@@ -217,7 +217,6 @@ public class XmlSerializer extends WriterSerializer {
 	 * @throws SerializeException
 	 */
 	protected void findNsfMappings(XmlSerializerSession session, Object o) throws SerializeException {
-		BeanContext bc = session.getBeanContext();
 		ClassMeta<?> aType = null;						// The actual type
 		aType = session.push(null, o, null);
 
@@ -238,7 +237,7 @@ public class XmlSerializer extends WriterSerializer {
 			if (aType.isBeanMap()) {
 				bm = (BeanMap)o;
 			} else if (aType.isBean()) {
-				bm = bc.forBean(o);
+				bm = session.toBeanMap(o);
 			} else if (aType.isDelegate()) {
 				ClassMeta<?> innerType = ((Delegate)o).getClassMeta();
 				Namespace ns = innerType.getExtendedMeta(XmlClassMeta.class).getNamespace();
@@ -312,7 +311,6 @@ public class XmlSerializer extends WriterSerializer {
 			ClassMeta eType, String elementName, Namespace elementNamespace, boolean addNamespaceUris,
 			XmlFormat format, BeanPropertyMeta pMeta) throws Exception {
 
-		BeanContext bc = session.getBeanContext();
 		String ts = null;              // The type string (e.g. <type> or <x x='type'>
 		int indent = session.indent;       // Current indentation
 		ClassMeta<?> aType = null;     // The actual type
@@ -342,12 +340,12 @@ public class XmlSerializer extends WriterSerializer {
 			// Swap if necessary
 			PojoSwap swap = aType.getPojoSwap();
 			if (swap != null) {
-				o = swap.swap(o, bc);
+				o = swap.swap(session, o);
 
 				// If the getSwapClass() method returns Object, we need to figure out
 				// the actual type now.
 				if (sType.isObject())
-					sType = bc.getClassMetaForObject(o);
+					sType = session.getClassMetaForObject(o);
 			}
 		} else {
 			sType = eType.getSerializedClassMeta();
@@ -438,7 +436,7 @@ public class XmlSerializer extends WriterSerializer {
 			if (typeName == null && elementName != null && session.isAddJsonTypeAttrs() && (session.isAddJsonStringTypeAttrs() || ! ts.equals("string")))
 				typeName = ts;
 			if (typeName != null && ! typeName.equals(elementName))
-				out.attr(dns, bc.getBeanTypePropertyName(), typeName);
+				out.attr(dns, session.getBeanTypePropertyName(), typeName);
 			if (o == null) {
 				if (! isNullTag)
 					out.attr(xsi, "nil", "true");
@@ -472,7 +470,7 @@ public class XmlSerializer extends WriterSerializer {
 			else if (sType.hasToObjectMapMethod())
 				hasChildren = serializeMap(session, out, sType.toObjectMap(o), sType);
 			else if (sType.isBean())
-				hasChildren = serializeBeanMap(session, out, bc.forBean(o), elementNamespace, isCollapsed);
+				hasChildren = serializeBeanMap(session, out, session.toBeanMap(o), elementNamespace, isCollapsed);
 			else if (sType.isCollection() || (wType != null && wType.isCollection())) {
 				if (isCollapsed)
 					session.indent--;
@@ -663,8 +661,8 @@ public class XmlSerializer extends WriterSerializer {
 	}
 
 	@Override /* Serializer */
-	public XmlSerializerSession createSession(Object output, ObjectMap properties, Method javaMethod) {
-		return new XmlSerializerSession(getContext(XmlSerializerContext.class), getBeanContext(), output, properties, javaMethod);
+	public XmlSerializerSession createSession(Object output, ObjectMap op, Method javaMethod, Locale locale, TimeZone timeZone) {
+		return new XmlSerializerSession(getContext(XmlSerializerContext.class), op, output, javaMethod, locale, timeZone);
 	}
 
 	@Override /* CoreApi */

http://git-wip-us.apache.org/repos/asf/incubator-juneau/blob/bb650bde/juneau-core/src/main/java/org/apache/juneau/xml/XmlSerializerContext.java
----------------------------------------------------------------------
diff --git a/juneau-core/src/main/java/org/apache/juneau/xml/XmlSerializerContext.java b/juneau-core/src/main/java/org/apache/juneau/xml/XmlSerializerContext.java
index 8369796..4ee5b58 100644
--- a/juneau-core/src/main/java/org/apache/juneau/xml/XmlSerializerContext.java
+++ b/juneau-core/src/main/java/org/apache/juneau/xml/XmlSerializerContext.java
@@ -36,60 +36,69 @@ import org.apache.juneau.serializer.*;
  *
  * <h6 class='topic' id='ConfigProperties'>Configurable properties on the XML serializer</h6>
  * <table class='styled' style='border-collapse: collapse;'>
- * 	<tr><th>Setting name</th><th>Description</th><th>Data type</th><th>Default value</th></tr>
+ * 	<tr><th>Setting name</th><th>Description</th><th>Data type</th><th>Default value</th><th>Session overridable</th></tr>
  * 	<tr>
  * 		<td>{@link #XML_addJsonTypeAttrs}</td>
  * 		<td>Add JSON type attributes to output.</td>
  * 		<td><code>Boolean</code></td>
  * 		<td><jk>false</jk></td>
+ * 		<td><jk>true</jk></td>
  * 	</tr>
  * 	<tr>
  * 		<td>{@link #XML_addJsonStringTypeAttrs}</td>
  * 		<td>Add JSON type attributes for strings to output.</td>
  * 		<td><code>Boolean</code></td>
  * 		<td><jk>false</jk></td>
+ * 		<td><jk>true</jk></td>
  * 	</tr>
  * 	<tr>
  * 		<td>{@link #XML_enableNamespaces}</td>
  * 		<td>Enable support for XML namespaces.</td>
  * 		<td><code>Boolean</code></td>
  * 		<td><jk>true</jk></td>
+ * 		<td><jk>true</jk></td>
  * 	</tr>
  * 	<tr>
  * 		<td>{@link #XML_autoDetectNamespaces}</td>
  * 		<td>Auto-detect namespace usage.</td>
  * 		<td><code>Boolean</code></td>
  * 		<td><jk>true</jk></td>
+ * 		<td><jk>true</jk></td>
  * 	</tr>
  * 	<tr>
  * 		<td>{@link #XML_addNamespaceUrisToRoot}</td>
  * 		<td>Add namespace URLs to the root element.</td>
  * 		<td><code>Boolean</code></td>
  * 		<td><jk>true</jk></td>
+ * 		<td><jk>true</jk></td>
  * 	</tr>
  * 	<tr>
  * 		<td>{@link #XML_defaultNamespaceUri}</td>
  * 		<td>Default namespace URI.</td>
  * 		<td><code>String</code></td>
  * 		<td><jk>null</jk></td>
+ * 		<td><jk>true</jk></td>
  * 	</tr>
  * 	<tr>
  * 		<td>{@link #XML_xsNamespace}</td>
  * 		<td>XMLSchema namespace.</td>
  * 		<td>{@link Namespace}</td>
  * 		<td><code>{name:<js>'xs'</js>,uri:<js>'http://www.w3.org/2001/XMLSchema'</js>}</code></td>
+ * 		<td><jk>true</jk></td>
  * 	</tr>
  * 	<tr>
  * 		<td>{@link #XML_xsiNamespace}</td>
  * 		<td>XMLSchema-Instance namespace.</td>
  * 		<td>{@link Namespace}</td>
  * 		<td><code>{name:<js>'xsi'</js>,uri:<js>'http://www.w3.org/2001/XMLSchema-instance'</js>}</code></td>
+ * 		<td><jk>true</jk></td>
  * 	</tr>
  * 	<tr>
  * 		<td>{@link #XML_namespaces}</td>
  * 		<td>Default namespaces.</td>
  * 		<td><code>Set&lt;{@link Namespace}&gt;</code></td>
  * 		<td>empty set</td>
+ * 		<td><jk>true</jk></td>
  * 	</tr>
  * </table>
  *
@@ -110,6 +119,7 @@ public class XmlSerializerContext extends SerializerContext {
 	 * 	<li><b>Name:</b> <js>"XmlSerializer.addJsonTypeAttrs"</js>
 	 * 	<li><b>Data type:</b> <code>Boolean</code>
 	 * 	<li><b>Default:</b> <jk>false</jk>
+	 * 	<li><b>Session-overridable:</b> <jk>true</jk>
 	 * </ul>
 	 * <p>
 	 * If <js>true</jk>, {@code type} attributes will be added to elements in the XML for number/boolean/null nodes.
@@ -123,6 +133,7 @@ public class XmlSerializerContext extends SerializerContext {
 	 * 	<li><b>Name:</b> <js>"XmlSerializer.addJsonStringTypeAttrs"</js>
 	 * 	<li><b>Data type:</b> <code>Boolean</code>
 	 * 	<li><b>Default:</b> <jk>false</jk>
+	 * 	<li><b>Session-overridable:</b> <jk>true</jk>
 	 * </ul>
 	 * <p>
 	 * If <jk>true</jk>, {@code type} attributes will be added to elements in the XML for string nodes.
@@ -141,6 +152,7 @@ public class XmlSerializerContext extends SerializerContext {
 	 * 	<li><b>Name:</b> <js>"XmlSerializer.enableNamespaces"</js>
 	 * 	<li><b>Data type:</b> <code>Boolean</code>
 	 * 	<li><b>Default:</b> <jk>true</jk>
+	 * 	<li><b>Session-overridable:</b> <jk>true</jk>
 	 * </ul>
 	 * <p>
 	 * If not enabled, XML output will not contain any namespaces regardless of any other settings.
@@ -154,6 +166,7 @@ public class XmlSerializerContext extends SerializerContext {
 	 * 	<li><b>Name:</b> <js>"XmlSerializer.autoDetectNamespaces"</js>
 	 * 	<li><b>Data type:</b> <code>Boolean</code>
 	 * 	<li><b>Default:</b> <jk>true</jk>
+	 * 	<li><b>Session-overridable:</b> <jk>true</jk>
 	 * </ul>
 	 * <p>
 	 * Detect namespace usage before serialization.
@@ -182,6 +195,7 @@ public class XmlSerializerContext extends SerializerContext {
 	 * 	<li><b>Name:</b> <js>"XmlSerializer.addNamespaceUrisToRoot"</js>
 	 * 	<li><b>Data type:</b> <code>Boolean</code>
 	 * 	<li><b>Default:</b> <jk>true</jk>
+	 * 	<li><b>Session-overridable:</b> <jk>true</jk>
 	 * </ul>
 	 * <p>
 	 * Use this setting to add {@code xmlns:x} attributes to the root
@@ -198,6 +212,7 @@ public class XmlSerializerContext extends SerializerContext {
 	 * 	<li><b>Name:</b> <js>"XmlSerializer.defaultNamespaceUri"</js>
 	 * 	<li><b>Data type:</b> <code>String</code>
 	 * 	<li><b>Default:</b> <jk>null</jk>
+	 * 	<li><b>Session-overridable:</b> <jk>true</jk>
 	 * </ul>
 	 * <p>
 	 * Specifies the default namespace URI for this document.
@@ -211,6 +226,7 @@ public class XmlSerializerContext extends SerializerContext {
 	 * 	<li><b>Name:</b> <js>"XmlSerializer.xsNamespace"</js>
 	 * 	<li><b>Data type:</b> {@link Namespace}
 	 * 	<li><b>Default:</b> <code>{name:<js>'xs'</js>,uri:<js>'http://www.w3.org/2001/XMLSchema'</js>}</code>
+	 * 	<li><b>Session-overridable:</b> <jk>true</jk>
 	 * </ul>
 	 * <p>
 	 * Specifies the namespace for the <code>XMLSchema</code> namespace, used by the schema generated
@@ -225,6 +241,7 @@ public class XmlSerializerContext extends SerializerContext {
 	 * 	<li><b>Name:</b> <js>"XmlSerializer.xsiNamespace"</js>
 	 * 	<li><b>Data type:</b> {@link Namespace}
 	 * 	<li><b>Default:</b> <code>{name:<js>'xsi'</js>,uri:<js>'http://www.w3.org/2001/XMLSchema-instance'</js>}</code>
+	 * 	<li><b>Session-overridable:</b> <jk>true</jk>
 	 * </ul>
 	 * <p>
 	 * Specifies the namespace of the <code>XMLSchema-instance</code> namespace used for<code>nil=<jk>true</jk></code> attributes.
@@ -238,6 +255,7 @@ public class XmlSerializerContext extends SerializerContext {
 	 * 	<li><b>Name:</b> <js>"XmlSerializer.namespaces"</js>
 	 * 	<li><b>Data type:</b> <code>Set&lt;{@link Namespace}&gt;</code>
 	 * 	<li><b>Default:</b> empty set
+	 * 	<li><b>Session-overridable:</b> <jk>true</jk>
 	 * </ul>
 	 * <p>
 	 * The default list of namespaces associated with this serializer.

http://git-wip-us.apache.org/repos/asf/incubator-juneau/blob/bb650bde/juneau-core/src/main/java/org/apache/juneau/xml/XmlSerializerSession.java
----------------------------------------------------------------------
diff --git a/juneau-core/src/main/java/org/apache/juneau/xml/XmlSerializerSession.java b/juneau-core/src/main/java/org/apache/juneau/xml/XmlSerializerSession.java
index d097452..dfdd942 100644
--- a/juneau-core/src/main/java/org/apache/juneau/xml/XmlSerializerSession.java
+++ b/juneau-core/src/main/java/org/apache/juneau/xml/XmlSerializerSession.java
@@ -16,6 +16,7 @@ import static org.apache.juneau.xml.NamespaceFactory.*;
 import static org.apache.juneau.xml.XmlSerializerContext.*;
 
 import java.lang.reflect.*;
+import java.util.*;
 
 import org.apache.juneau.*;
 import org.apache.juneau.internal.*;
@@ -50,14 +51,17 @@ public class XmlSerializerSession extends SerializerSession {
 	 *
 	 * @param ctx The context creating this session object.
 	 * 	The context contains all the configuration settings for this object.
-	 * @param beanContext The bean context being used.
 	 * @param output The output object.  See {@link JsonSerializerSession#getWriter()} for valid class types.
 	 * @param op The override properties.
 	 * 	These override any context properties defined in the context.
 	 * @param javaMethod The java method that called this parser, usually the method in a REST servlet.
+	 * @param locale The session locale.
+	 * 	If <jk>null</jk>, then the locale defined on the context is used.
+	 * @param timeZone The session timezone.
+	 * 	If <jk>null</jk>, then the timezone defined on the context is used.
 	 */
-	public XmlSerializerSession(XmlSerializerContext ctx, BeanContext beanContext, Object output, ObjectMap op, Method javaMethod) {
-		super(ctx, beanContext, output, op, javaMethod);
+	public XmlSerializerSession(XmlSerializerContext ctx, ObjectMap op, Object output, Method javaMethod, Locale locale, TimeZone timeZone) {
+		super(ctx, op, output, javaMethod, locale, timeZone);
 		if (op == null || op.isEmpty()) {
 			addJsonTypeAttrs = ctx.addJsonTypeAttrs;
 			addJsonStringTypeAttrs = ctx.addJsonStringTypeAttrs;

http://git-wip-us.apache.org/repos/asf/incubator-juneau/blob/bb650bde/juneau-core/src/main/javadoc/overview.html
----------------------------------------------------------------------
diff --git a/juneau-core/src/main/javadoc/overview.html b/juneau-core/src/main/javadoc/overview.html
index 18d2fea..3eb2b90 100644
--- a/juneau-core/src/main/javadoc/overview.html
+++ b/juneau-core/src/main/javadoc/overview.html
@@ -675,13 +675,13 @@
 		
 		<jd>/** Converts a Date object to an ISO8601 string. */</jd>
 		<ja>@Override</ja>
-		<jk>public</jk> String swap(Date o) {
+		<jk>public</jk> String swap(BeanSession session, Date o) {
 			<jk>return</jk> <jf>format</jf>.format(o);
 		}
 		
 		<jd>/** Converts an ISO8601 string to a Date object. */</jd>
 		<ja>@Override</ja>
-		<jk>public</jk> Date unswap(String o) <jk>throws</jk> ParseException {
+		<jk>public</jk> Date unswap(BeanSession session, String o, ClassMeta hint) <jk>throws</jk> ParseException {
 			<jk>try</jk> {
 				<jk>return</jk> <jf>format</jf>.parse(o);
 			} <jk>catch</jk> (java.text.ParseException e) {
@@ -1606,6 +1606,10 @@
 		Adding <l>&amp;plainText=true</l> forces the response <l>Content-Type</l> to be <l>text/plain.</l>
 	<h6 class='figure'>HTML</h6>
 	<img class='bordered' src="doc-files/Server.Html.png">
+	<p>
+		Also, localization can be tested by passing in an <l>Accept-Language</l> header.
+	<h6 class='figure'>HTML/french</h6>
+	<img class='bordered' src="doc-files/Server.Html.french.png">
 	<h6 class='figure'>JSON</h6>
 	<img class='bordered' src="doc-files/Server.Json.png">
 	<h6 class='figure'>XML</h6>
@@ -3254,7 +3258,7 @@
 				.addPojoSwap( 
 					<jk>new</jk> PojoSwap&lt;Person,Integer&gt;() { 
 						<ja>@Override</ja> /* PojoSwap */ 
-						<jk>public</jk> Integer swap(Person p) { 
+						<jk>public</jk> Integer swap(BeanSession session, Person p) { 
 							<jk>return</jk> p.addresses.size(); 
 						} 
 					} 
@@ -4825,7 +4829,7 @@
 
 		<jk>public static class</jk> DoubleSwap <jk>extends</jk> PojoSwap&lt;Double,String&gt; {
 			<ja>@Override</ja> <jc>/* PojoSwap */</jc>
-			<jk>public</jk> String swap(Double o) <jk>throws</jk> SerializeException {
+			<jk>public</jk> String swap(BeanSession session, Double o) <jk>throws</jk> SerializeException {
 				<jk>return</jk> <jsf>FORMAT</jsf>.format(o);
 			}		
 		}
@@ -4981,6 +4985,7 @@
 	
 	<h5 class='toc'>What's new in each release</h5>
 	<ul class='toc'>
+		<li><p><a class='doclink' href='#6.0.1'>6.0.2 (TBD)</a></p>
 		<li><p><a class='doclink' href='#6.0.1'>6.0.1 (TBD)</a></p>
 		<li><p><a class='doclink' href='#6.0.0'>6.0.0 (Oct 3, 2016)</a></p>
 		<li><p><a class='doclink' href='#5.2.0.1'>5.2.0.1 (Mar 23, 2016)</a></p>
@@ -5047,6 +5052,77 @@
 
 
 	<!-- ======================================================================================================== -->
+	<a id="6.0.2"></a>
+	<h3 class='topic' onclick='toggle(this)'>6.0.2 (TBD)</h3>
+	<div class='topic'>
+		<p>
+			Juneau 6.0.2 is a moderate update that provides localized serialization and parsing.
+			For example, dates can now be serialized to and parsed from locale-targeted formats.
+		</p>
+		<p>
+			In particular, this release cleans up the {@link org.apache.juneau.BeanContext} API to match
+			the {@link org.apache.juneau.ContextFactory}/{@link org.apache.juneau.Context}/{@link org.apache.juneau.Session} paradigm
+			previously used in the serializer and parser APIs.
+		</p>
+
+		<h6 class='topic'>org.apache.juneau</h6>
+		<ul class='spaced-list'>
+			<li>{@link org.apache.juneau.BeanContext} class split into separate {@link org.apache.juneau.BeanContext} and {@link org.apache.juneau.BeanSession} classes.
+			<ul>
+				<li>Session object meant to be single-use that can be discarded after use and contains session-level object cache and overridable Locale and TimeZone.
+			</ul>  
+			<li>{@link org.apache.juneau.serializer.SerializerContext} and {@link org.apache.juneau.parser.ParserContext}
+				now extend directly from {@link org.apache.juneau.BeanContext}.
+			<li>{@link org.apache.juneau.serializer.SerializerSession} and {@link org.apache.juneau.parser.ParserSession}
+				now extend directly from {@link org.apache.juneau.BeanSession}.
+			<li>New settings in {@link org.apache.juneau.BeanContext}:
+			<ul>
+				<li>{@link org.apache.juneau.BeanContext#BEAN_debug} - Debug setting.  Replaces individual debug properties in the serializer and parser contexts.
+				<li>{@link org.apache.juneau.BeanContext#BEAN_locale} - Specifies a default locale at the context level.
+				<li>{@link org.apache.juneau.BeanContext#BEAN_timeZone} - Specifies a default timezone at the context level.
+			</ul>
+			<li>Simplified {@link org.apache.juneau.transform.PojoSwap} class.  Now just two methods:
+			<ul>
+				<li>{@link org.apache.juneau.transform.PojoSwap#swap(BeanSession,Object)}
+				<li>{@link org.apache.juneau.transform.PojoSwap#unswap(BeanSession,Object,ClassMeta)}
+			</ul>
+			<li>Several new {@link java.util.Calendar} and {@link java.util.Date} swaps:
+			<ul>
+				<li>{@link org.apache.juneau.transforms.CalendarSwap.ToString},{@link org.apache.juneau.transforms.DateSwap.ToString} - To {@link java.lang.String Strings} using the {@code Date.toString()} method.
+				<li>{@link org.apache.juneau.transforms.CalendarSwap.ISO8601DT},{@link org.apache.juneau.transforms.DateSwap.ISO8601DT} - To ISO8601 date-time strings.
+				<li>{@link org.apache.juneau.transforms.CalendarSwap.ISO8601DTZ},{@link org.apache.juneau.transforms.DateSwap.ISO8601DTZ} - Same as <jsf>ISO8601DT</jsf>, except always serializes in GMT.
+				<li>{@link org.apache.juneau.transforms.CalendarSwap.ISO8601DTP},{@link org.apache.juneau.transforms.DateSwap.ISO8601DTP} - Same as <jsf>ISO8601DT</jsf> except with millisecond precision.
+				<li>{@link org.apache.juneau.transforms.CalendarSwap.ISO8601DTPZ},{@link org.apache.juneau.transforms.DateSwap.ISO8601DTPZ} - Same as <jsf>ISO8601DTZ</jsf> except with millisecond precision.
+				<li>{@link org.apache.juneau.transforms.CalendarSwap.RFC2822DT},{@link org.apache.juneau.transforms.DateSwap.RFC2822DT} - To RFC2822 date-time strings.
+				<li>{@link org.apache.juneau.transforms.CalendarSwap.RFC2822DTZ},{@link org.apache.juneau.transforms.DateSwap.RFC2822DTZ} - Same as <jsf>RFC2822DT</jsf>, except always serializes in GMT.
+				<li>{@link org.apache.juneau.transforms.CalendarSwap.RFC2822D},{@link org.apache.juneau.transforms.DateSwap.RFC2822D} - To RFC2822 date strings.
+				<li>{@link org.apache.juneau.transforms.CalendarSwap.DateTimeSimple},{@link org.apache.juneau.transforms.DateSwap.DateTimeSimple} - To simple <js>"yyyy/MM/dd HH:mm:ss"</js> date-time strings.
+				<li>{@link org.apache.juneau.transforms.CalendarSwap.DateSimple},{@link org.apache.juneau.transforms.DateSwap.DateSimple} - To simple <js>"yyyy/MM/dd"</js> date strings.
+				<li>{@link org.apache.juneau.transforms.CalendarSwap.TimeSimple},{@link org.apache.juneau.transforms.DateSwap.TimeSimple} - To simple <js>"HH:mm:ss"</js> time strings.
+				<li>{@link org.apache.juneau.transforms.CalendarSwap.DateFull},{@link org.apache.juneau.transforms.DateSwap.DateFull} - To {@link java.text.DateFormat#FULL} date strings.
+				<li>{@link org.apache.juneau.transforms.CalendarSwap.DateLong},{@link org.apache.juneau.transforms.DateSwap.DateLong} - To {@link java.text.DateFormat#LONG} date strings.
+				<li>{@link org.apache.juneau.transforms.CalendarSwap.DateMedium},{@link org.apache.juneau.transforms.DateSwap.DateMedium} - To {@link java.text.DateFormat#MEDIUM} date strings.
+				<li>{@link org.apache.juneau.transforms.CalendarSwap.DateShort},{@link org.apache.juneau.transforms.DateSwap.DateShort} - To {@link java.text.DateFormat#SHORT} date strings.
+				<li>{@link org.apache.juneau.transforms.CalendarSwap.TimeFull},{@link org.apache.juneau.transforms.DateSwap.TimeFull} - To {@link java.text.DateFormat#FULL} time strings.
+				<li>{@link org.apache.juneau.transforms.CalendarSwap.TimeLong},{@link org.apache.juneau.transforms.DateSwap.TimeLong} - To {@link java.text.DateFormat#LONG} time strings.
+				<li>{@link org.apache.juneau.transforms.CalendarSwap.TimeMedium},{@link org.apache.juneau.transforms.DateSwap.TimeMedium} - To {@link java.text.DateFormat#MEDIUM} time strings.
+				<li>{@link org.apache.juneau.transforms.CalendarSwap.TimeShort},{@link org.apache.juneau.transforms.DateSwap.TimeShort} - To {@link java.text.DateFormat#SHORT} time strings.
+				<li>{@link org.apache.juneau.transforms.CalendarSwap.DateTimeFull},{@link org.apache.juneau.transforms.DateSwap.DateTimeFull} - To {@link java.text.DateFormat#FULL} date-time strings.
+				<li>{@link org.apache.juneau.transforms.CalendarSwap.DateTimeLong},{@link org.apache.juneau.transforms.DateSwap.DateTimeLong} - To {@link java.text.DateFormat#LONG} date-time strings.
+				<li>{@link org.apache.juneau.transforms.CalendarSwap.DateTimeMedium},{@link org.apache.juneau.transforms.DateSwap.DateTimeMedium} - To {@link java.text.DateFormat#MEDIUM} date-time strings.
+				<li>{@link org.apache.juneau.transforms.CalendarSwap.DateTimeShort},{@link org.apache.juneau.transforms.DateSwap.DateTimeShort} - To {@link java.text.DateFormat#SHORT} date-time strings.
+			</ul>  
+		</ul>
+		
+		<h6 class='topic'>org.apache.juneau.server</h6>
+		<ul class='spaced-list'>
+			<li>{@link org.apache.juneau.server.RestRequest} now passes locale and timezone to serializers/parsers/transforms.
+			<li>New {@link org.apache.juneau.server.RestRequest#getTimeZone()} method.
+		</ul>
+	</div>
+	
+	
+	<!-- ======================================================================================================== -->
 	<a id="6.0.1"></a>
 	<h3 class='topic' onclick='toggle(this)'>6.0.1 (TBD)</h3>
 	<div class='topic'>
@@ -5153,7 +5229,7 @@
 			<li>Serializers and parsers now automatically convert {@link java.lang.Class} objects to readable names via {@link org.apache.juneau.internal.ClassUtils#getReadableClassName(Class)}.
 			<li>Eliminated the <code>ClassFilter</code> class since it's no longer needed.
 			<li>Code and concurrency improvements to {@link org.apache.juneau.serializer.SerializerGroup} and {@link org.apache.juneau.parser.ParserGroup}.
-			<li>Various enhancements to {@link org.apache.juneau.BeanContext#convertToType(Object,Class)}.
+			<li>Various enhancements to <code><del>BeanContext.convertToType(Object,Class)</del></code>.
 			<li>New properties on {@link org.apache.juneau.html.HtmlSerializer}:
 				<ul>
 					<li>{@link org.apache.juneau.html.HtmlSerializerContext#HTML_detectLinksInStrings} - Automatically detect hyperlinks in strings.
@@ -6420,7 +6496,7 @@
 		</p>
 		<ul class='spaced-list'>
 			<li>Improved error handling.  
-			<li>New {@link org.apache.juneau.parser.ParserContext#PARSER_debug} and {@link org.apache.juneau.serializer.SerializerContext#SERIALIZER_debug}
+			<li>New <code><del>ParserContext.PARSER_debug</del></code> and <code><del>SerializerContext.SERIALIZER_debug</del></code>.
 				settings for logging additional information for debugging problems.
 			<li>New {@link org.apache.juneau.serializer.SerializerContext#SERIALIZER_ignoreRecursions} setting for explicitely ignoring recursions when 
 				serializing models.  Previously, the <jsf>SERIALIZER_detectRecursions</jsf> setting did this, but now it simply looks for recursions 
@@ -6642,7 +6718,7 @@
 			<li>Removed lazy-initialization that required locking in {@link org.apache.juneau.ClassMeta}.  
 			<li>New <code>BeanContext.setDefaultParser(ReaderParser)</code> method added for specifying 
 				a default parser to use in a bean context (used when converting beans to <code>Strings</code> using 
-				{@link org.apache.juneau.BeanContext#convertToType(Object,Class)}).
+				<code><del>BeanContext.convertToType(Object,Class)</del></code>.
 				Old behavior simply used the default JSON serializer in these cases.
 			<li>More consistent handling of exceptions across all parsers.
 			<li>Minor changes to {@link org.apache.juneau.server.RestRequest} class.
@@ -7867,7 +7943,7 @@
 				See {@link org.apache.juneau.server.RestServlet} for more information.
 			</li>
 			<li>
-				Enhancements to {@link org.apache.juneau.BeanContext#convertToType(Object,Class)} to be able to convert <code>Strings</code> to classes with 
+				Enhancements to <code><del>BeanContext.convertToType(Object,Class)</del></code> to be able to convert <code>Strings</code> to classes with 
 				<code>fromString(String)</code>/<code>valueOf(String)</code> static methods or <code>T(String)</code> constructors.
 			</li>	
 		</ul>

http://git-wip-us.apache.org/repos/asf/incubator-juneau/blob/bb650bde/juneau-core/src/test/java/org/apache/juneau/AnnotationsTest.java
----------------------------------------------------------------------
diff --git a/juneau-core/src/test/java/org/apache/juneau/AnnotationsTest.java b/juneau-core/src/test/java/org/apache/juneau/AnnotationsTest.java
index 70ac5ef..378f088 100755
--- a/juneau-core/src/test/java/org/apache/juneau/AnnotationsTest.java
+++ b/juneau-core/src/test/java/org/apache/juneau/AnnotationsTest.java
@@ -27,11 +27,11 @@ public class AnnotationsTest {
 	//====================================================================================================
 	@Test
 	public void testBeanWithExplicitProperties() throws Exception {
-		BeanContext bc = BeanContext.DEFAULT;
+		BeanSession session = BeanContext.DEFAULT.createSession();
 		BeanMap bm = null;
 
 		// Basic test
-		bm = bc.newBeanMap(Person1.class).load("{age:21,name:'foobar'}");
+		bm = session.newBeanMap(Person1.class).load("{age:21,name:'foobar'}");
 		assertNotNull(bm);
 		assertNotNull(bm.getBean());
 		assertEquals(bm.get("age"), 21);
@@ -61,11 +61,11 @@ public class AnnotationsTest {
 	//====================================================================================================
 	@Test
 	public void testForOnlyPublicFields() throws Exception {
-		BeanContext bc = BeanContext.DEFAULT;
+		BeanSession session = BeanContext.DEFAULT.createSession();
 		BeanMap bm = null;
 
 		// Make sure only public fields are detected
-		bm = bc.newBeanMap(A.class).load("{publicField:123}");
+		bm = session.newBeanMap(A.class).load("{publicField:123}");
 		assertNotNull("F1", bm);
 		assertNotNull("F2", bm.getBean());
 		assertObjectEquals("{publicField:123}", bm.getBean());


Mime
View raw message