http://git-wip-us.apache.org/repos/asf/incubator-juneau/blob/68dffad1/juneau-core-test/src/test/java/org/apache/juneau/xml/XmlTest.java ---------------------------------------------------------------------- diff --git a/juneau-core-test/src/test/java/org/apache/juneau/xml/XmlTest.java b/juneau-core-test/src/test/java/org/apache/juneau/xml/XmlTest.java index e9f635f..6e8317e 100755 --- a/juneau-core-test/src/test/java/org/apache/juneau/xml/XmlTest.java +++ b/juneau-core-test/src/test/java/org/apache/juneau/xml/XmlTest.java @@ -13,8 +13,6 @@ package org.apache.juneau.xml; import static org.apache.juneau.TestUtils.*; -import static org.apache.juneau.serializer.SerializerContext.*; -import static org.apache.juneau.xml.XmlSerializerContext.*; import static org.apache.juneau.xml.annotation.XmlFormat.*; import static org.junit.Assert.*; @@ -79,12 +77,12 @@ public class XmlTest { +"</object>\n"; ObjectMap m = (ObjectMap) XmlParser.DEFAULT.parse(xml1, Object.class); - String json2 = new JsonSerializer.SimpleReadable().setProperty(SERIALIZER_quoteChar, '"').setProperty(SERIALIZER_trimNullProperties, false).serialize(m); + String json2 = new JsonSerializer.SimpleReadable().setQuoteChar('"').setTrimNullProperties(false).serialize(m); assertEquals(json1, json2); m = (ObjectMap) JsonParser.DEFAULT.parse(json1, Object.class); String xml2 = new XmlSerializer.SqReadable() - .setProperty(SERIALIZER_trimNullProperties, false) + .setTrimNullProperties(false) .serialize(m); assertEquals(xml1, xml2); } @@ -135,9 +133,9 @@ public class XmlTest { ObjectMap m = (ObjectMap) JsonParser.DEFAULT.parse(json1, Object.class); String r = new XmlSerializer.NsSqReadable() - .setProperty(XML_addNamespaceUrisToRoot, true) - .setProperty(XML_defaultNamespace, "http://www.apache.org") - .setProperty(SERIALIZER_trimNullProperties, false) + .setAddNamespaceUrisToRoot(true) + .setDefaultNamespace("http://www.apache.org") + .setTrimNullProperties(false) .serialize(m); assertEquals(xml1, r); } @@ -359,7 +357,7 @@ public class XmlTest { String r = null; r = s.serialize(t); assertEquals("<object f1='1' f2='2' f3='3'/>", r); - s.setProperty(XML_enableNamespaces, true).setProperty(XML_addNamespaceUrisToRoot, true).setProperty(XML_autoDetectNamespaces, true).setProperty(SERIALIZER_trimNullProperties, false); + s.setEnableNamespaces(true).setAddNamespaceUrisToRoot(true).setAutoDetectNamespaces(true).setTrimNullProperties(false); t.f1 = 4; t.f2 = 5; t.f3 = 6; r = s.serialize(t); assertEquals("<object xmlns='http://www.apache.org/2013/Juneau' xmlns:bar='http://bar' xmlns:foo='http://foo' xmlns:baz='http://baz' bar:f1='4' foo:f2='5' baz:f3='6'/>", r); @@ -521,7 +519,7 @@ public class XmlTest { //==================================================================================================== @Test public void testNsOnClass() throws Exception { - XmlSerializer s = new XmlSerializer.Sq().setProperty(XML_autoDetectNamespaces, false); + XmlSerializer s = new XmlSerializer.Sq().setAutoDetectNamespaces(false); XmlParser p = XmlParser.DEFAULT; T1 t = new T1(); @@ -529,23 +527,21 @@ public class XmlTest { assertEquals("<object><f1>1</f1><f2>2</f2><f3>3</f3><f4>4</f4></object>", r); assertTrue(t.equals(p.parse(r, T1.class))); - s.setProperty(XML_enableNamespaces, true).setProperty(XML_addNamespaceUrisToRoot, false); + s.setEnableNamespaces(true).setAddNamespaceUrisToRoot(false); r = s.serialize(t); assertEquals("<object><foo:f1>1</foo:f1><bar:f2>2</bar:f2><foo:f3>3</foo:f3><baz:f4>4</baz:f4></object>", r); // Add namespace URIs to root, but don't auto-detect. // Only xsi should be added to root. - s.setProperty(XML_addNamespaceUrisToRoot, true); + s.setAddNamespaceUrisToRoot(true); r = s.serialize(t); assertEquals("<object xmlns='http://www.apache.org/2013/Juneau'><foo:f1>1</foo:f1><bar:f2>2</bar:f2><foo:f3>3</foo:f3><baz:f4>4</baz:f4></object>", r); // Manually set namespaces - s.setProperty(XML_namespaces, - new Namespace[] { - NamespaceFactory.get("foo","http://foo"), - NamespaceFactory.get("bar","http://bar"), - NamespaceFactory.get("baz","http://baz") - } + s.setNamespaces( + NamespaceFactory.get("foo","http://foo"), + NamespaceFactory.get("bar","http://bar"), + NamespaceFactory.get("baz","http://baz") ); r = s.serialize(t); assertEquals("<object xmlns='http://www.apache.org/2013/Juneau' xmlns:foo='http://foo' xmlns:bar='http://bar' xmlns:baz='http://baz'><foo:f1>1</foo:f1><bar:f2>2</bar:f2><foo:f3>3</foo:f3><baz:f4>4</baz:f4></object>", r); @@ -553,17 +549,17 @@ public class XmlTest { validateXml(t, s); // Auto-detect namespaces. - s = new XmlSerializer.Sq().setProperty(XML_autoDetectNamespaces, true); + s = new XmlSerializer.Sq().setAutoDetectNamespaces(true); r = s.serialize(t); assertEquals("<object><f1>1</f1><f2>2</f2><f3>3</f3><f4>4</f4></object>", r); assertTrue(t.equals(p.parse(r, T1.class))); - s.setProperty(XML_addNamespaceUrisToRoot, true); + s.setAddNamespaceUrisToRoot(true); r = s.serialize(t); assertEquals("<object><f1>1</f1><f2>2</f2><f3>3</f3><f4>4</f4></object>", r); assertTrue(t.equals(p.parse(r, T1.class))); - s.setProperty(XML_enableNamespaces, true); + s.setEnableNamespaces(true); r = s.serialize(t); assertEquals("<object xmlns='http://www.apache.org/2013/Juneau' xmlns:foo='http://foo' xmlns:bar='http://bar' xmlns:baz='http://baz'><foo:f1>1</foo:f1><bar:f2>2</bar:f2><foo:f3>3</foo:f3><baz:f4>4</baz:f4></object>", r); assertTrue(t.equals(p.parse(r, T1.class))); @@ -575,7 +571,7 @@ public class XmlTest { //==================================================================================================== @Test public void testNsOnClassWithElementName() throws Exception { - XmlSerializer s = new XmlSerializer.Sq().setProperty(XML_autoDetectNamespaces, false); + XmlSerializer s = new XmlSerializer.Sq().setAutoDetectNamespaces(false); XmlParser p = XmlParser.DEFAULT; T2 t = new T2(); @@ -583,23 +579,21 @@ public class XmlTest { assertEquals("<T2><f1>1</f1><f2>2</f2><f3>3</f3><f4>4</f4></T2>", r); assertTrue(t.equals(p.parse(r, T2.class))); - s.setProperty(XML_enableNamespaces, true).setProperty(XML_addNamespaceUrisToRoot, false); + s.setEnableNamespaces(true).setAddNamespaceUrisToRoot(false); r = s.serialize(t); assertEquals("<foo:T2><foo:f1>1</foo:f1><bar:f2>2</bar:f2><foo:f3>3</foo:f3><baz:f4>4</baz:f4></foo:T2>", r); // Add namespace URIs to root, but don't auto-detect. // Only xsi should be added to root. - s.setProperty(XML_addNamespaceUrisToRoot, true); + s.setAddNamespaceUrisToRoot(true); r = s.serialize(t); assertEquals("<foo:T2 xmlns='http://www.apache.org/2013/Juneau'><foo:f1>1</foo:f1><bar:f2>2</bar:f2><foo:f3>3</foo:f3><baz:f4>4</baz:f4></foo:T2>", r); // Manually set namespaces - s.setProperty(XML_namespaces, - new Namespace[] { - NamespaceFactory.get("foo","http://foo"), - NamespaceFactory.get("bar","http://bar"), - NamespaceFactory.get("baz","http://baz") - } + s.setNamespaces( + NamespaceFactory.get("foo","http://foo"), + NamespaceFactory.get("bar","http://bar"), + NamespaceFactory.get("baz","http://baz") ); r = s.serialize(t); assertEquals("<foo:T2 xmlns='http://www.apache.org/2013/Juneau' xmlns:foo='http://foo' xmlns:bar='http://bar' xmlns:baz='http://baz'><foo:f1>1</foo:f1><bar:f2>2</bar:f2><foo:f3>3</foo:f3><baz:f4>4</baz:f4></foo:T2>", r); @@ -607,15 +601,15 @@ public class XmlTest { validateXml(t, s); // Auto-detect namespaces. - s = new XmlSerializer.Sq().setProperty(XML_autoDetectNamespaces, true); + s = new XmlSerializer.Sq().setAutoDetectNamespaces(true); r = s.serialize(t); assertEquals("<T2><f1>1</f1><f2>2</f2><f3>3</f3><f4>4</f4></T2>", r); - s.setProperty(XML_addNamespaceUrisToRoot, true); + s.setAddNamespaceUrisToRoot(true); r = s.serialize(t); assertEquals("<T2><f1>1</f1><f2>2</f2><f3>3</f3><f4>4</f4></T2>", r); - s.setProperty(XML_enableNamespaces, true); + s.setEnableNamespaces(true); r = s.serialize(t); assertEquals("<foo:T2 xmlns='http://www.apache.org/2013/Juneau' xmlns:foo='http://foo' xmlns:bar='http://bar' xmlns:baz='http://baz'><foo:f1>1</foo:f1><bar:f2>2</bar:f2><foo:f3>3</foo:f3><baz:f4>4</baz:f4></foo:T2>", r); assertTrue(t.equals(p.parse(r, T2.class))); @@ -637,24 +631,22 @@ public class XmlTest { assertTrue(t.equals(p.parse(r, T3.class))); validateXml(t, s); - s.setProperty(XML_enableNamespaces, true).setProperty(XML_addNamespaceUrisToRoot, false); + s.setEnableNamespaces(true).setAddNamespaceUrisToRoot(false); r = s.serialize(t); assertEquals("<object><p1:f1>1</p1:f1><bar:f2>2</bar:f2><p1:f3>3</p1:f3><baz:f4>4</baz:f4></object>", r); // Add namespace URIs to root, but don't auto-detect. // Only xsi should be added to root. - s.setProperty(XML_addNamespaceUrisToRoot, true).setProperty(XML_autoDetectNamespaces, false); + s.setAddNamespaceUrisToRoot(true).setAutoDetectNamespaces(false); r = s.serialize(t); assertEquals("<object xmlns='http://www.apache.org/2013/Juneau'><p1:f1>1</p1:f1><bar:f2>2</bar:f2><p1:f3>3</p1:f3><baz:f4>4</baz:f4></object>", r); // Manually set namespaces - s.setProperty(XML_autoDetectNamespaces, false); - s.setProperty(XML_namespaces, - new Namespace[] { - NamespaceFactory.get("p1","http://p1"), - NamespaceFactory.get("bar","http://bar"), - NamespaceFactory.get("baz","http://baz") - } + s.setAutoDetectNamespaces(false); + s.setNamespaces( + NamespaceFactory.get("p1","http://p1"), + NamespaceFactory.get("bar","http://bar"), + NamespaceFactory.get("baz","http://baz") ); r = s.serialize(t); assertEquals("<object xmlns='http://www.apache.org/2013/Juneau' xmlns:p1='http://p1' xmlns:bar='http://bar' xmlns:baz='http://baz'><p1:f1>1</p1:f1><bar:f2>2</bar:f2><p1:f3>3</p1:f3><baz:f4>4</baz:f4></object>", r); @@ -662,15 +654,15 @@ public class XmlTest { validateXml(t, s); // Auto-detect namespaces. - s = new XmlSerializer.Sq().setProperty(XML_autoDetectNamespaces, true); + s = new XmlSerializer.Sq().setAutoDetectNamespaces(true); r = s.serialize(t); assertEquals("<object><f1>1</f1><f2>2</f2><f3>3</f3><f4>4</f4></object>", r); - s.setProperty(XML_addNamespaceUrisToRoot, true); + s.setAddNamespaceUrisToRoot(true); r = s.serialize(t); assertEquals("<object><f1>1</f1><f2>2</f2><f3>3</f3><f4>4</f4></object>", r); - s.setProperty(XML_enableNamespaces, true); + s.setEnableNamespaces(true); r = s.serialize(t); assertEquals("<object xmlns='http://www.apache.org/2013/Juneau' xmlns:p1='http://p1' xmlns:bar='http://bar' xmlns:baz='http://baz'><p1:f1>1</p1:f1><bar:f2>2</bar:f2><p1:f3>3</p1:f3><baz:f4>4</baz:f4></object>", r); assertTrue(t.equals(p.parse(r, T3.class))); @@ -682,7 +674,7 @@ public class XmlTest { //==================================================================================================== @Test public void testNsOnPackageNoNsOnClassElementNameOnClass() throws Exception { - XmlSerializer s = new XmlSerializer.Sq().setProperty(XML_autoDetectNamespaces, false); + XmlSerializer s = new XmlSerializer.Sq().setAutoDetectNamespaces(false); XmlParser p = XmlParser.DEFAULT; T4 t = new T4(); @@ -690,24 +682,22 @@ public class XmlTest { assertEquals("<T4><f1>1</f1><f2>2</f2><f3>3</f3><f4>4</f4></T4>", r); assertTrue(t.equals(p.parse(r, T4.class))); - s.setProperty(XML_enableNamespaces, true).setProperty(XML_addNamespaceUrisToRoot, false); + s.setEnableNamespaces(true).setAddNamespaceUrisToRoot(false); r = s.serialize(t); assertEquals("<p1:T4><p1:f1>1</p1:f1><bar:f2>2</bar:f2><p1:f3>3</p1:f3><baz:f4>4</baz:f4></p1:T4>", r); // Add namespace URIs to root, but don't auto-detect. // Only xsi should be added to root. - s.setProperty(XML_addNamespaceUrisToRoot, true); + s.setAddNamespaceUrisToRoot(true); r = s.serialize(t); assertEquals("<p1:T4 xmlns='http://www.apache.org/2013/Juneau'><p1:f1>1</p1:f1><bar:f2>2</bar:f2><p1:f3>3</p1:f3><baz:f4>4</baz:f4></p1:T4>", r); // Manually set namespaces - s.setProperty(XML_namespaces, - new Namespace[] { - NamespaceFactory.get("foo","http://foo"), - NamespaceFactory.get("bar","http://bar"), - NamespaceFactory.get("baz","http://baz"), - NamespaceFactory.get("p1","http://p1") - } + s.setNamespaces( + NamespaceFactory.get("foo","http://foo"), + NamespaceFactory.get("bar","http://bar"), + NamespaceFactory.get("baz","http://baz"), + NamespaceFactory.get("p1","http://p1") ); r = s.serialize(t); assertEquals("<p1:T4 xmlns='http://www.apache.org/2013/Juneau' xmlns:foo='http://foo' xmlns:bar='http://bar' xmlns:baz='http://baz' xmlns:p1='http://p1'><p1:f1>1</p1:f1><bar:f2>2</bar:f2><p1:f3>3</p1:f3><baz:f4>4</baz:f4></p1:T4>", r); @@ -715,15 +705,15 @@ public class XmlTest { validateXml(t, s); // Auto-detect namespaces. - s = new XmlSerializer.Sq().setProperty(XML_autoDetectNamespaces, true); + s = new XmlSerializer.Sq().setAutoDetectNamespaces(true); r = s.serialize(t); assertEquals("<T4><f1>1</f1><f2>2</f2><f3>3</f3><f4>4</f4></T4>", r); - s.setProperty(XML_addNamespaceUrisToRoot, true); + s.setAddNamespaceUrisToRoot(true); r = s.serialize(t); assertEquals("<T4><f1>1</f1><f2>2</f2><f3>3</f3><f4>4</f4></T4>", r); - s.setProperty(XML_enableNamespaces, true); + s.setEnableNamespaces(true); r = s.serialize(t); assertEquals("<p1:T4 xmlns='http://www.apache.org/2013/Juneau' xmlns:p1='http://p1' xmlns:bar='http://bar' xmlns:baz='http://baz'><p1:f1>1</p1:f1><bar:f2>2</bar:f2><p1:f3>3</p1:f3><baz:f4>4</baz:f4></p1:T4>", r); assertTrue(t.equals(p.parse(r, T4.class))); @@ -744,23 +734,21 @@ public class XmlTest { assertTrue(t.equals(p.parse(r, T5.class))); validateXml(t, s); - s.setProperty(XML_enableNamespaces, true).setProperty(XML_addNamespaceUrisToRoot, false).setProperty(XML_autoDetectNamespaces, false); + s.setEnableNamespaces(true).setAddNamespaceUrisToRoot(false).setAutoDetectNamespaces(false); r = s.serialize(t); assertEquals("<foo:T5><foo:f1>1</foo:f1><bar:f2>2</bar:f2><foo:f3>3</foo:f3><baz:f4>4</baz:f4></foo:T5>", r); // Add namespace URIs to root, but don't auto-detect. // Only xsi should be added to root. - s.setProperty(XML_addNamespaceUrisToRoot, true); + s.setAddNamespaceUrisToRoot(true); r = s.serialize(t); assertEquals("<foo:T5 xmlns='http://www.apache.org/2013/Juneau'><foo:f1>1</foo:f1><bar:f2>2</bar:f2><foo:f3>3</foo:f3><baz:f4>4</baz:f4></foo:T5>", r); // Manually set namespaces - s.setProperty(XML_namespaces, - new Namespace[] { - NamespaceFactory.get("foo","http://foo"), - NamespaceFactory.get("bar","http://bar"), - NamespaceFactory.get("baz","http://baz") - } + s.setNamespaces( + NamespaceFactory.get("foo","http://foo"), + NamespaceFactory.get("bar","http://bar"), + NamespaceFactory.get("baz","http://baz") ); r = s.serialize(t); assertEquals("<foo:T5 xmlns='http://www.apache.org/2013/Juneau' xmlns:foo='http://foo' xmlns:bar='http://bar' xmlns:baz='http://baz'><foo:f1>1</foo:f1><bar:f2>2</bar:f2><foo:f3>3</foo:f3><baz:f4>4</baz:f4></foo:T5>", r); @@ -768,17 +756,17 @@ public class XmlTest { validateXml(t, s); // Auto-detect namespaces. - s = new XmlSerializer.Sq().setProperty(XML_autoDetectNamespaces, true); + s = new XmlSerializer.Sq().setAutoDetectNamespaces(true); r = s.serialize(t); assertEquals("<T5><f1>1</f1><f2>2</f2><f3>3</f3><f4>4</f4></T5>", r); validateXml(t, s); - s.setProperty(XML_addNamespaceUrisToRoot, true); + s.setAddNamespaceUrisToRoot(true); r = s.serialize(t); assertEquals("<T5><f1>1</f1><f2>2</f2><f3>3</f3><f4>4</f4></T5>", r); validateXml(t, s); - s.setProperty(XML_enableNamespaces, true); + s.setEnableNamespaces(true); r = s.serialize(t); assertEquals("<foo:T5 xmlns='http://www.apache.org/2013/Juneau' xmlns:foo='http://foo' xmlns:bar='http://bar' xmlns:baz='http://baz'><foo:f1>1</foo:f1><bar:f2>2</bar:f2><foo:f3>3</foo:f3><baz:f4>4</baz:f4></foo:T5>", r); assertTrue(t.equals(p.parse(r, T5.class))); @@ -790,7 +778,7 @@ public class XmlTest { //==================================================================================================== @Test public void testNsOnPackageNsOnClassNoElementNameOnClass() throws Exception { - XmlSerializer s = new XmlSerializer.Sq().setProperty(XML_autoDetectNamespaces, false); + XmlSerializer s = new XmlSerializer.Sq().setAutoDetectNamespaces(false); XmlParser p = XmlParser.DEFAULT; T6 t = new T6(); @@ -798,23 +786,21 @@ public class XmlTest { assertEquals("<object><f1>1</f1><f2>2</f2><f3>3</f3><f4>4</f4></object>", r); assertTrue(t.equals(p.parse(r, T6.class))); - s.setProperty(XML_enableNamespaces, true).setProperty(XML_addNamespaceUrisToRoot, false); + s.setEnableNamespaces(true).setAddNamespaceUrisToRoot(false); r = s.serialize(t); assertEquals("<object><foo:f1>1</foo:f1><bar:f2>2</bar:f2><foo:f3>3</foo:f3><baz:f4>4</baz:f4></object>", r); // Add namespace URIs to root, but don't auto-detect. // Only xsi should be added to root. - s.setProperty(XML_addNamespaceUrisToRoot, true).setProperty(XML_autoDetectNamespaces, false); + s.setAddNamespaceUrisToRoot(true).setAutoDetectNamespaces(false); r = s.serialize(t); assertEquals("<object xmlns='http://www.apache.org/2013/Juneau'><foo:f1>1</foo:f1><bar:f2>2</bar:f2><foo:f3>3</foo:f3><baz:f4>4</baz:f4></object>", r); // Manually set namespaces - s.setProperty(XML_namespaces, - new Namespace[] { - NamespaceFactory.get("foo","http://foo"), - NamespaceFactory.get("bar","http://bar"), - NamespaceFactory.get("baz","http://baz") - } + s.setNamespaces( + NamespaceFactory.get("foo","http://foo"), + NamespaceFactory.get("bar","http://bar"), + NamespaceFactory.get("baz","http://baz") ); r = s.serialize(t); assertEquals("<object xmlns='http://www.apache.org/2013/Juneau' xmlns:foo='http://foo' xmlns:bar='http://bar' xmlns:baz='http://baz'><foo:f1>1</foo:f1><bar:f2>2</bar:f2><foo:f3>3</foo:f3><baz:f4>4</baz:f4></object>", r); @@ -822,17 +808,17 @@ public class XmlTest { validateXml(t, s); // Auto-detect namespaces. - s = new XmlSerializer.Sq().setProperty(XML_autoDetectNamespaces, true); + s = new XmlSerializer.Sq().setAutoDetectNamespaces(true); r = s.serialize(t); assertEquals("<object><f1>1</f1><f2>2</f2><f3>3</f3><f4>4</f4></object>", r); validateXml(t, s); - s.setProperty(XML_addNamespaceUrisToRoot, true); + s.setAddNamespaceUrisToRoot(true); r = s.serialize(t); assertEquals("<object><f1>1</f1><f2>2</f2><f3>3</f3><f4>4</f4></object>", r); validateXml(t, s); - s.setProperty(XML_enableNamespaces, true); + s.setEnableNamespaces(true); r = s.serialize(t); assertEquals("<object xmlns='http://www.apache.org/2013/Juneau' xmlns:foo='http://foo' xmlns:bar='http://bar' xmlns:baz='http://baz'><foo:f1>1</foo:f1><bar:f2>2</bar:f2><foo:f3>3</foo:f3><baz:f4>4</baz:f4></object>", r); assertTrue(t.equals(p.parse(r, T6.class))); @@ -844,7 +830,7 @@ public class XmlTest { //==================================================================================================== @Test public void testComboOfNsAndOverriddenBeanPropertyNames() throws Exception { - XmlSerializer s = new XmlSerializer.Sq().setProperty(XML_autoDetectNamespaces, false); + XmlSerializer s = new XmlSerializer.Sq().setAutoDetectNamespaces(false); XmlParser p = XmlParser.DEFAULT; T7 t = new T7(); @@ -852,39 +838,37 @@ public class XmlTest { assertEquals("<object><g1>1</g1><g2>2</g2><g3>3</g3><g4>4</g4></object>", r); assertTrue(t.equals(p.parse(r, T7.class))); - s.setProperty(XML_enableNamespaces, true).setProperty(XML_addNamespaceUrisToRoot, false); + s.setEnableNamespaces(true).setAddNamespaceUrisToRoot(false); r = s.serialize(t); assertEquals("<object><p1:g1>1</p1:g1><bar:g2>2</bar:g2><p1:g3>3</p1:g3><baz:g4>4</baz:g4></object>", r); // Add namespace URIs to root, but don't auto-detect. // Only xsi should be added to root. - s.setProperty(XML_addNamespaceUrisToRoot, true).setProperty(XML_autoDetectNamespaces, false); + s.setAddNamespaceUrisToRoot(true).setAutoDetectNamespaces(false); r = s.serialize(t); assertEquals("<object xmlns='http://www.apache.org/2013/Juneau'><p1:g1>1</p1:g1><bar:g2>2</bar:g2><p1:g3>3</p1:g3><baz:g4>4</baz:g4></object>", r); // Manually set namespaces - s.setProperty(XML_namespaces, - new Namespace[] { - NamespaceFactory.get("foo","http://foo"), - NamespaceFactory.get("bar","http://bar"), - NamespaceFactory.get("baz","http://baz"), - NamespaceFactory.get("p1","http://p1") - } + s.setNamespaces( + NamespaceFactory.get("foo","http://foo"), + NamespaceFactory.get("bar","http://bar"), + NamespaceFactory.get("baz","http://baz"), + NamespaceFactory.get("p1","http://p1") ); r = s.serialize(t); assertEquals("<object xmlns='http://www.apache.org/2013/Juneau' xmlns:foo='http://foo' xmlns:bar='http://bar' xmlns:baz='http://baz' xmlns:p1='http://p1'><p1:g1>1</p1:g1><bar:g2>2</bar:g2><p1:g3>3</p1:g3><baz:g4>4</baz:g4></object>", r); assertTrue(t.equals(p.parse(r, T7.class))); // Auto-detect namespaces. - s = new XmlSerializer.Sq().setProperty(XML_autoDetectNamespaces, true); + s = new XmlSerializer.Sq().setAutoDetectNamespaces(true); r = s.serialize(t); assertEquals("<object><g1>1</g1><g2>2</g2><g3>3</g3><g4>4</g4></object>", r); - s.setProperty(XML_enableNamespaces, false); + s.setEnableNamespaces(false); r = s.serialize(t); assertEquals("<object><g1>1</g1><g2>2</g2><g3>3</g3><g4>4</g4></object>", r); - s.setProperty(XML_enableNamespaces, true).setProperty(XML_addNamespaceUrisToRoot, true); + s.setEnableNamespaces(true).setAddNamespaceUrisToRoot(true); r = s.serialize(t); assertEquals("<object xmlns='http://www.apache.org/2013/Juneau' xmlns:p1='http://p1' xmlns:bar='http://bar' xmlns:baz='http://baz'><p1:g1>1</p1:g1><bar:g2>2</bar:g2><p1:g3>3</p1:g3><baz:g4>4</baz:g4></object>", r); assertTrue(t.equals(p.parse(r, T7.class))); @@ -896,7 +880,7 @@ public class XmlTest { //==================================================================================================== @Test public void testXmlNsAnnotation() throws Exception { - XmlSerializer s = new XmlSerializer.Sq().setProperty(XML_autoDetectNamespaces, false); + XmlSerializer s = new XmlSerializer.Sq().setAutoDetectNamespaces(false); XmlParser p = XmlParser.DEFAULT; T8 t = new T8(); @@ -904,40 +888,38 @@ public class XmlTest { assertEquals("<object><f1>1</f1><f2>2</f2><f3>3</f3><f4>4</f4></object>", r); assertTrue(t.equals(p.parse(r, T8.class))); - s.setProperty(XML_enableNamespaces, true).setProperty(XML_addNamespaceUrisToRoot, false).setProperty(XML_autoDetectNamespaces, false); + s.setEnableNamespaces(true).setAddNamespaceUrisToRoot(false).setAutoDetectNamespaces(false); r = s.serialize(t); assertEquals("<object><p2:f1>1</p2:f1><p1:f2>2</p1:f2><c1:f3>3</c1:f3><f1:f4>4</f1:f4></object>", r); // Add namespace URIs to root, but don't auto-detect. // Only xsi should be added to root. - s.setProperty(XML_addNamespaceUrisToRoot, true); + s.setAddNamespaceUrisToRoot(true); r = s.serialize(t); assertEquals("<object xmlns='http://www.apache.org/2013/Juneau'><p2:f1>1</p2:f1><p1:f2>2</p1:f2><c1:f3>3</c1:f3><f1:f4>4</f1:f4></object>", r); // Manually set namespaces - s.setProperty(XML_namespaces, - new Namespace[] { - NamespaceFactory.get("foo","http://foo"), - NamespaceFactory.get("bar","http://bar"), - NamespaceFactory.get("baz","http://baz") - } + s.setNamespaces( + NamespaceFactory.get("foo","http://foo"), + NamespaceFactory.get("bar","http://bar"), + NamespaceFactory.get("baz","http://baz") ); r = s.serialize(t); assertEquals("<object xmlns='http://www.apache.org/2013/Juneau' xmlns:foo='http://foo' xmlns:bar='http://bar' xmlns:baz='http://baz'><p2:f1>1</p2:f1><p1:f2>2</p1:f2><c1:f3>3</c1:f3><f1:f4>4</f1:f4></object>", r); // Auto-detect namespaces. - s = new XmlSerializer.Sq().setProperty(XML_autoDetectNamespaces, true); + s = new XmlSerializer.Sq().setAutoDetectNamespaces(true); r = s.serialize(t); assertEquals("<object><f1>1</f1><f2>2</f2><f3>3</f3><f4>4</f4></object>", r); assertTrue(t.equals(p.parse(r, T8.class))); validateXml(t, s); - s.setProperty(XML_addNamespaceUrisToRoot, true); + s.setAddNamespaceUrisToRoot(true); r = s.serialize(t); assertEquals("<object><f1>1</f1><f2>2</f2><f3>3</f3><f4>4</f4></object>", r); validateXml(t, s); - s.setProperty(XML_enableNamespaces, true); + s.setEnableNamespaces(true); r = s.serialize(t); assertEquals("<object xmlns='http://www.apache.org/2013/Juneau' xmlns:p2='http://p2' xmlns:p1='http://p1' xmlns:c1='http://c1' xmlns:f1='http://f1'><p2:f1>1</p2:f1><p1:f2>2</p1:f2><c1:f3>3</c1:f3><f1:f4>4</f1:f4></object>", r); assertTrue(t.equals(p.parse(r, T8.class))); @@ -949,7 +931,7 @@ public class XmlTest { //==================================================================================================== @Test public void testXmlNsOnPackageNsUriInXmlNs() throws Exception { - XmlSerializer s = new XmlSerializer.Sq().setProperty(XML_autoDetectNamespaces, false); + XmlSerializer s = new XmlSerializer.Sq().setAutoDetectNamespaces(false); XmlParser p = XmlParser.DEFAULT; T9 t = new T9(); @@ -957,40 +939,38 @@ public class XmlTest { assertEquals("<object><f1>1</f1></object>", r); assertTrue(t.equals(p.parse(r, T9.class))); - s.setProperty(XML_enableNamespaces, true).setProperty(XML_autoDetectNamespaces, false).setProperty(XML_addNamespaceUrisToRoot, false); + s.setEnableNamespaces(true).setAutoDetectNamespaces(false).setAddNamespaceUrisToRoot(false); r = s.serialize(t); assertEquals("<object><p1:f1>1</p1:f1></object>", r); // Add namespace URIs to root, but don't auto-detect. // Only xsi should be added to root. - s.setProperty(XML_addNamespaceUrisToRoot, true); + s.setAddNamespaceUrisToRoot(true); r = s.serialize(t); assertEquals("<object xmlns='http://www.apache.org/2013/Juneau'><p1:f1>1</p1:f1></object>", r); // Manually set namespaces - s.setProperty(XML_namespaces, - new Namespace[] { - NamespaceFactory.get("foo","http://foo"), - NamespaceFactory.get("bar","http://bar"), - NamespaceFactory.get("baz","http://baz") - } + s.setNamespaces( + NamespaceFactory.get("foo","http://foo"), + NamespaceFactory.get("bar","http://bar"), + NamespaceFactory.get("baz","http://baz") ); r = s.serialize(t); assertEquals("<object xmlns='http://www.apache.org/2013/Juneau' xmlns:foo='http://foo' xmlns:bar='http://bar' xmlns:baz='http://baz'><p1:f1>1</p1:f1></object>", r); // Auto-detect namespaces. - s = new XmlSerializer.Sq().setProperty(XML_autoDetectNamespaces, true); + s = new XmlSerializer.Sq().setAutoDetectNamespaces(true); r = s.serialize(t); assertEquals("<object><f1>1</f1></object>", r); assertTrue(t.equals(p.parse(r, T9.class))); validateXml(t, s); - s.setProperty(XML_addNamespaceUrisToRoot, true); + s.setAddNamespaceUrisToRoot(true); r = s.serialize(t); assertEquals("<object><f1>1</f1></object>", r); validateXml(t, s); - s.setProperty(XML_enableNamespaces, true); + s.setEnableNamespaces(true); r = s.serialize(t); assertEquals("<object xmlns='http://www.apache.org/2013/Juneau' xmlns:p1='http://p1'><p1:f1>1</p1:f1></object>", r); assertTrue(t.equals(p.parse(r, T9.class))); @@ -1017,7 +997,7 @@ public class XmlTest { assertEquals("xf2", t.f2); assertEquals("xf3", t.f3); - s.setProperty(XML_enableNamespaces, true).setProperty(XML_addNamespaceUrisToRoot, true).setProperty(XML_autoDetectNamespaces, true); + s.setEnableNamespaces(true).setAddNamespaceUrisToRoot(true).setAutoDetectNamespaces(true); r = s.serialize(t); assertEquals("<object xmlns='http://www.apache.org/2013/Juneau' xmlns:ns='http://ns' xmlns:nsf1='http://nsf1' xmlns:nsf3='http://nsf3' nsf1:f1='http://xf1' ns:f2='xf2' nsf3:x3='xf3'/>", r); validateXml(t, s);
http://git-wip-us.apache.org/repos/asf/incubator-juneau/blob/68dffad1/juneau-core/src/main/java/org/apache/juneau/BeanContext.java ---------------------------------------------------------------------- diff --git a/juneau-core/src/main/java/org/apache/juneau/BeanContext.java b/juneau-core/src/main/java/org/apache/juneau/BeanContext.java index dd88562..116d6e9 100644 --- a/juneau-core/src/main/java/org/apache/juneau/BeanContext.java +++ b/juneau-core/src/main/java/org/apache/juneau/BeanContext.java @@ -91,250 +91,6 @@ import org.apache.juneau.transform.*; * .getBeanContext(); * </p> * - * <h6 class='topic' id='ConfigProperties'>Properties associated with handling beans on serializers and parsers</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 #BEAN_beansRequireDefaultConstructor}</td> - * <td>Beans require no-arg constructors.</td> - * <td><code>Boolean</code></td> - * <td><jk>false</jk></td> - * <td><jk>false</jk></td> - * </tr> - * <tr> - * <td>{@link #BEAN_beansRequireSerializable}</td> - * <td>Beans require Serializable interface.</td> - * <td><code>Boolean</code></td> - * <td><jk>false</jk></td> - * <td><jk>false</jk></td> - * </tr> - * <tr> - * <td>{@link #BEAN_beansRequireSettersForGetters}</td> - * <td>Beans require setters for getters.</td> - * <td><code>Boolean</code></td> - * <td><jk>false</jk></td> - * <td><jk>false</jk></td> - * </tr> - * <tr> - * <td>{@link #BEAN_beansRequireSomeProperties}</td> - * <td>Beans require at least one property.</td> - * <td><code>Boolean</code></td> - * <td><jk>true</jk></td> - * <td><jk>false</jk></td> - * </tr> - * <tr> - * <td>{@link #BEAN_beanMapPutReturnsOldValue}</td> - * <td>{@link BeanMap#put(String,Object) BeanMap.put()} method will return old property value.</td> - * <td><code>Boolean</code></td> - * <td><jk>false</jk></td> - * <td><jk>false</jk></td> - * </tr> - * <tr> - * <td>{@link #BEAN_beanConstructorVisibility}</td> - * <td>Look for bean constructors with specified minimum visibility.</td> - * <td>{@link Visibility}</td> - * <td>{@link Visibility#PUBLIC}</td> - * <td><jk>false</jk></td> - * </tr> - * <tr> - * <td>{@link #BEAN_beanClassVisibility}</td> - * <td>Look for bean classes with specified minimum visibility.</td> - * <td>{@link Visibility}</td> - * <td>{@link Visibility#PUBLIC}</td> - * <td><jk>false</jk></td> - * </tr> - * <tr> - * <td>{@link #BEAN_beanFieldVisibility}</td> - * <td>Look for bean fields with specified minimum visibility.</td> - * <td>{@link Visibility}</td> - * <td>{@link Visibility#PUBLIC}</td> - * <td><jk>false</jk></td> - * </tr> - * <tr> - * <td>{@link #BEAN_methodVisibility}</td> - * <td>Look for bean methods with specified minimum visibility.</td> - * <td>{@link Visibility}</td> - * <td>{@link Visibility#PUBLIC}</td> - * <td><jk>false</jk></td> - * </tr> - * <tr> - * <td>{@link #BEAN_useJavaBeanIntrospector}</td> - * <td>Use Java {@link Introspector} for determining bean properties.</td> - * <td><code>Boolean</code></td> - * <td><jk>false</jk></td> - * <td><jk>false</jk></td> - * </tr> - * <tr> - * <td>{@link #BEAN_useInterfaceProxies}</td> - * <td>Use interface proxies.</td> - * <td><code>Boolean</code></td> - * <td><jk>true</jk></td> - * <td><jk>false</jk></td> - * </tr> - * <tr> - * <td>{@link #BEAN_ignoreUnknownBeanProperties}</td> - * <td>Ignore unknown properties.</td> - * <td><code>Boolean</code></td> - * <td><jk>false</jk></td> - * <td><jk>false</jk></td> - * </tr> - * <tr> - * <td>{@link #BEAN_ignoreUnknownNullBeanProperties}</td> - * <td>Ignore unknown properties with null values.</td> - * <td><code>Boolean</code></td> - * <td><jk>true</jk></td> - * <td><jk>false</jk></td> - * </tr> - * <tr> - * <td>{@link #BEAN_ignorePropertiesWithoutSetters}</td> - * <td>Ignore bean properties without setters.</td> - * <td><code>Boolean</code></td> - * <td><jk>true</jk></td> - * <td><jk>false</jk></td> - * </tr> - * <tr> - * <td>{@link #BEAN_ignoreInvocationExceptionsOnGetters}</td> - * <td>Ignore invocation errors on getters.</td> - * <td><code>Boolean</code></td> - * <td><jk>false</jk></td> - * <td><jk>false</jk></td> - * </tr> - * <tr> - * <td>{@link #BEAN_ignoreInvocationExceptionsOnSetters}</td> - * <td>Ignore invocation errors on setters.</td> - * <td><code>Boolean</code></td> - * <td><jk>false</jk></td> - * <td><jk>false</jk></td> - * </tr> - * <tr> - * <td>{@link #BEAN_sortProperties}</td> - * <td>Sort bean properties in alphabetical order.</td> - * <td><code>Boolean</code></td> - * <td><jk>false</jk></td> - * <td><jk>false</jk></td> - * </tr> - * <tr> - * <td> - * {@link #BEAN_notBeanPackages}<br> - * {@link #BEAN_notBeanPackages_add}<br> - * {@link #BEAN_notBeanPackages_remove} - * </td> - * <td>Packages whose classes should not be considered beans.</td> - * <td><code>Set<String></code></td> - * <td>See details</td> - * <td><jk>false</jk></td> - * </tr> - * <tr> - * <td> - * {@link #BEAN_notBeanClasses}<br> - * {@link #BEAN_notBeanClasses_add}<br> - * {@link #BEAN_notBeanClasses_remove} - * </td> - * <td>Classes that should not be considered beans.</td> - * <td><code>Set<Class></code></td> - * <td>empty set</td> - * <td><jk>false</jk></td> - * </tr> - * <tr> - * <td> - * {@link #BEAN_beanFilters}<br> - * {@link #BEAN_beanFilters_add}<br> - * {@link #BEAN_beanFilters_remove} - * </td> - * <td>Bean filters to apply to beans.</td> - * <td><code>List<Class></code></td> - * <td>empty list</td> - * <td><jk>false</jk></td> - * </tr> - * <tr> - * <td> - * {@link #BEAN_pojoSwaps}<br> - * {@link #BEAN_pojoSwaps_add}<br> - * {@link #BEAN_pojoSwaps_remove} - * </td> - * <td>POJO swaps to apply to java objects.</td> - * <td><code>List<Class></code></td> - * <td>empty list</td> - * <td><jk>false</jk></td> - * </tr> - * <tr> - * <td> - * {@link #BEAN_implClasses}<br> - * {@link #BEAN_implClasses_put} - * </td> - * <td>Implementation classes for interfaces and abstract classes.</td> - * <td><code>Map<Class,Class></code></td> - * <td>empty map</td> - * <td><jk>false</jk></td> - * </tr> - * <tr> - * <td> - * {@link #BEAN_beanDictionary}<br> - * {@link #BEAN_beanDictionary_add}<br> - * {@link #BEAN_beanDictionary_remove} - * </td> - * <td>Bean lookup dictionary.</td> - * <td><code>List<Class></code></td> - * <td>empty list</td> - * <td><jk>false</jk></td> - * </tr> - * <tr> - * <td> - * {@link #BEAN_beanTypePropertyName} - * </td> - * <td>Name to use for the bean type property used to represent a bean type.</td> - * <td><code>String</code></td> - * <td><js>"_type"</js></td> - * <td><jk>false</jk></td> - * </tr> - * <tr> - * <td> - * {@link #BEAN_defaultParser} - * </td> - * <td>Default parser to use when converting <code>Strings</code> to POJOs.</td> - * <td><code>Class</code></td> - * <td>{@link JsonParser}</td> - * <td><jk>false</jk></td> - * </tr> - * <tr> - * <td> - * {@link #BEAN_locale} - * </td> - * <td>User locale.</td> - * <td><code>Locale</code></td> - * <td>{@link Locale#getDefault()}</td> - * <td><jk>true</jk></td> - * </tr> - * <tr> - * <td> - * {@link #BEAN_timeZone} - * </td> - * <td>User timezone.</td> - * <td><code>TimeZone</code></td> - * <td><jk>null</jk></td> - * <td><jk>true</jk></td> - * </tr> - * <tr> - * <td> - * {@link #BEAN_mediaType} - * </td> - * <td>Default media type value for serializer and parser sessions</td> - * <td>{@link MediaType}</td> - * <td><jk>null</jk></td> - * <td><jk>true</jk></td> - * </tr> - * <tr> - * <td> - * {@link #BEAN_debug} - * </td> - * <td>Debug mode.</td> - * <td><code>Boolean</code></td> - * <td><jk>false</jk></td> - * <td><jk>true</jk></td> - * </tr> - * </table> - * - * * <h5 class='topic'>Bean Maps</h5> * <p> * {@link BeanMap BeanMaps} are wrappers around Java beans that allow properties to be retrieved and @@ -1558,116 +1314,6 @@ public class BeanContext extends Context { return cmObject; } -// -// This code is inherently unsafe (but still potentially useful?) -// -// /** -// * Converts class name strings to ClassMeta objects. -// * -// * <h5 class='section'>Example:</h5> -// * <ul> -// * <li><js>"java.lang.String"</js> -// * <li><js>"com.foo.sample.MyBean[]"</js> -// * <li><js>"java.util.HashMap<java.lang.String,java.lang.Integer>"</js> -// * <li><js>"[Ljava.lang.String;"</js> (i.e. the value of <code>String[].<jk>class</jk>.getName()</code>) -// * </ul> -// * -// * @param s The class name. -// * @return The ClassMeta corresponding to the class name string. -// */ -// protected final ClassMeta<?> getClassMetaFromString(String s) { -// int d = 0; -// if (s == null || s.isEmpty()) -// return null; -// -// // Check for Class.getName() on array class types. -// if (s.charAt(0) == '[') { -// try { -// return getClassMeta(findClass(s)); -// } catch (ClassNotFoundException e) { -// throw new RuntimeException(e); -// } -// } -// -// int i1 = 0; -// int i2 = 0; -// int dim = 0; -// List<ClassMeta<?>> p = null; -// for (int i = 0; i < s.length(); i++) { -// char c = s.charAt(i); -// if (c == '<') { -// if (d == 0) { -// i1 = i; -// i2 = i+1; -// p = new LinkedList<ClassMeta<?>>(); -// } -// d++; -// } else if (c == '>') { -// d--; -// if (d == 0 && p != null) -// p.add(getClassMetaFromString(s.substring(i2, i))); -// } else if (c == ',' && d == 1) { -// if (p != null) -// p.add(getClassMetaFromString(s.substring(i2, i))); -// i2 = i+1; -// } -// if (c == '[') { -// if (i1 == 0) -// i1 = i; -// dim++; -// } -// } -// if (i1 == 0) -// i1 = s.length(); -// try { -// String name = s.substring(0, i1).trim(); -// char x = name.charAt(0); -// Class<?> c = null; -// if (x >= 'b' && x <= 's') { -// if (x == 'b' && name.equals("boolean")) -// c = boolean.class; -// else if (x == 'b' && name.equals("byte")) -// c = byte.class; -// else if (x == 'c' && name.equals("char")) -// c = char.class; -// else if (x == 'd' && name.equals("double")) -// c = double.class; -// else if (x == 'i' && name.equals("int")) -// c = int.class; -// else if (x == 'l' && name.equals("long")) -// c = long.class; -// else if (x == 's' && name.equals("short")) -// c = short.class; -// else -// c = findClass(name); -// } else { -// c = findClass(name); -// } -// -// ClassMeta<?> cm = getClassMeta(c); -// -// if (p != null) { -// if (cm.isMap()) -// cm = new ClassMeta(c, this).setKeyType(p.get(0)).setValueType(p.get(1)); -// if (cm.isCollection()) -// cm = new ClassMeta(c, this).setElementType(p.get(0)); -// } -// -// while (dim > 0) { -// cm = new ClassMeta(Array.newInstance(cm.getInnerClass(), 0).getClass(), this); -// dim--; -// } -// -// return cm; -// } catch (ClassNotFoundException e) { -// throw new RuntimeException(e); -// } -// } -// -// private Class<?> findClass(String name) throws ClassNotFoundException { -// return classLoader == null ? Class.forName(name) : Class.forName(name, true, classLoader); -// } - /** * Returns the {@link PojoSwap} associated with the specified class, or <jk>null</jk> if there is no * pojo swap associated with the class. http://git-wip-us.apache.org/repos/asf/incubator-juneau/blob/68dffad1/juneau-core/src/main/java/org/apache/juneau/ConfigException.java ---------------------------------------------------------------------- diff --git a/juneau-core/src/main/java/org/apache/juneau/ConfigException.java b/juneau-core/src/main/java/org/apache/juneau/ConfigException.java index a3894e6..a9af489 100644 --- a/juneau-core/src/main/java/org/apache/juneau/ConfigException.java +++ b/juneau-core/src/main/java/org/apache/juneau/ConfigException.java @@ -12,9 +12,20 @@ // *************************************************************************************************************************** package org.apache.juneau; -class ConfigException extends FormattedRuntimeException { +import java.text.*; + +/** + * An exception that typically occurs when trying to perform an invalid operation on a configuration property. + */ +public class ConfigException extends FormattedRuntimeException { private static final long serialVersionUID = 1L; + /** + * Constructor + * + * @param message The error message. + * @param args Optional {@link MessageFormat}-style arguments. + */ public ConfigException(String message, Object...args) { super(message, args); } http://git-wip-us.apache.org/repos/asf/incubator-juneau/blob/68dffad1/juneau-core/src/main/java/org/apache/juneau/ContextFactory.java ---------------------------------------------------------------------- diff --git a/juneau-core/src/main/java/org/apache/juneau/ContextFactory.java b/juneau-core/src/main/java/org/apache/juneau/ContextFactory.java index efa69b3..fff9e21 100644 --- a/juneau-core/src/main/java/org/apache/juneau/ContextFactory.java +++ b/juneau-core/src/main/java/org/apache/juneau/ContextFactory.java @@ -622,7 +622,7 @@ public final class ContextFactory extends Lockable { * @param def The default value if the property is not set. * * @return The property value. - * @throws ConfigException - If property has a value that cannot be converted to a boolean. + * @throws ConfigException If property has a value that cannot be converted to a boolean. */ public <T> T getProperty(String name, Class<T> type, T def) { rl.lock(); @@ -649,7 +649,7 @@ public final class ContextFactory extends Lockable { * @param def The default value if the property is not set. * * @return The property value. - * @throws ConfigException - If property has a value that cannot be converted to a boolean. + * @throws ConfigException If property has a value that cannot be converted to a boolean. */ public <K,V> Map<K,V> getMap(String name, Class<K> keyType, Class<V> valType, Map<K,V> def) { rl.lock(); @@ -663,6 +663,7 @@ public final class ContextFactory extends Lockable { } } + //------------------------------------------------------------------------------------- // Convenience methods. //------------------------------------------------------------------------------------- @@ -731,7 +732,7 @@ public final class ContextFactory extends Lockable { * @see ContextFactory#addToProperty(String, Object) * @see BeanContext#BEAN_beanDictionary */ - public ContextFactory addToDictionary(Class<?>...classes) throws LockedException { + public ContextFactory addToBeanDictionary(Class<?>...classes) throws LockedException { checkLock(); addToProperty(BEAN_beanDictionary, classes); return this; @@ -767,6 +768,7 @@ public final class ContextFactory extends Lockable { return c.get(); } + //-------------------------------------------------------------------------------- // Utility classes and methods. //--------------------------------------------------------------------------------
