You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@juneau.apache.org by ja...@apache.org on 2018/07/15 15:16:25 UTC
[juneau] branch master updated: SimpleJsonSerializer, Javadocs.
This is an automated email from the ASF dual-hosted git repository.
jamesbognar pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/juneau.git
The following commit(s) were added to refs/heads/master by this push:
new 6bc49bd SimpleJsonSerializer, Javadocs.
6bc49bd is described below
commit 6bc49bdc0434155c790cddd4e8b8ab91eaae1617
Author: JamesBognar <ja...@apache.org>
AuthorDate: Sun Jul 15 11:16:00 2018 -0400
SimpleJsonSerializer, Javadocs.
---
juneau-build-all.launch | 9 +
juneau-build-javadoc.sh => juneau-build-all.sh | 5 +
juneau-build-javadoc.sh | 4 +
juneau-build.sh | 4 +
.../main/java/org/apache/juneau/config/Config.java | 4 +-
.../org/apache/juneau/config/ConfigBuilder.java | 4 +-
.../java/org/apache/juneau/BeanFilterTest.java | 2 +-
.../test/java/org/apache/juneau/BeanMapTest.java | 10 +-
.../java/org/apache/juneau/ComboRoundTripTest.java | 17 +-
.../java/org/apache/juneau/ComboSerializeTest.java | 12 +-
.../test/java/org/apache/juneau/MaxIndentTest.java | 2 +-
.../a/rttests/RoundTripAddClassAttrsTest.java | 2 +-
.../a/rttests/RoundTripLargeObjectsTest.java | 10 +-
.../org/apache/juneau/a/rttests/RoundTripTest.java | 20 +-
.../a/rttests/RoundTripTransformBeansTest.java | 2 +-
.../apache/juneau/config/ConfigInterfaceTest.java | 2 +-
.../juneau/httppart/OpenApiPartParserTest.java | 12 +-
.../apache/juneau/httppart/UonPartParserTest.java | 2 +-
.../org/apache/juneau/https/MediaRangeTest.java | 2 +-
.../java/org/apache/juneau/jena/CommonTest.java | 14 +-
.../java/org/apache/juneau/jena/CommonXmlTest.java | 4 +-
.../java/org/apache/juneau/jena/RdfParserTest.java | 6 +-
.../test/java/org/apache/juneau/jena/RdfTest.java | 4 +-
.../java/org/apache/juneau/json/CommonTest.java | 6 +-
.../org/apache/juneau/json/JsonParserTest.java | 2 +-
.../juneau/json/JsonSchemaSerializerTest.java | 210 +--
.../test/java/org/apache/juneau/json/JsonTest.java | 8 +-
.../juneau/serializer/UriResolutionTest.java | 2 +-
.../org/apache/juneau/testutils/TestUtils.java | 4 +-
.../apache/juneau/transforms/CalendarSwapTest.java | 2 +-
.../java/org/apache/juneau/utils/PojoRestTest.java | 6 +-
.../java/org/apache/juneau/dto/atom/package.html | 2 +-
.../java/org/apache/juneau/dto/swagger/Items.java | 2 +-
.../main/java/org/apache/juneau/jena/N3Parser.java | 106 +-
.../java/org/apache/juneau/jena/N3Serializer.java | 106 +-
.../java/org/apache/juneau/jena/NTripleParser.java | 106 +-
.../org/apache/juneau/jena/NTripleSerializer.java | 106 +-
.../java/org/apache/juneau/jena/RdfParser.java | 104 +-
.../java/org/apache/juneau/jena/RdfSerializer.java | 127 +-
.../apache/juneau/jena/RdfXmlAbbrevSerializer.java | 61 +
.../java/org/apache/juneau/jena/RdfXmlParser.java | 106 +-
.../org/apache/juneau/jena/RdfXmlSerializer.java | 61 +
.../java/org/apache/juneau/jena/TurtleParser.java | 106 +-
.../org/apache/juneau/jena/TurtleSerializer.java | 106 +-
.../src/main/java/org/apache/juneau/BeanMap.java | 2 +-
.../apache/juneau/BeanProxyInvocationHandler.java | 2 +-
.../main/java/org/apache/juneau/BeanSession.java | 4 +-
.../src/main/java/org/apache/juneau/ClassMeta.java | 4 +-
.../src/main/java/org/apache/juneau/Context.java | 2 +-
.../juneau/InvalidDataConversionException.java | 2 +-
.../main/java/org/apache/juneau/ObjectList.java | 4 +-
.../src/main/java/org/apache/juneau/ObjectMap.java | 2 +-
.../main/java/org/apache/juneau/PropertyStore.java | 2 +-
.../org/apache/juneau/PropertyStoreBuilder.java | 2 +-
.../src/main/java/org/apache/juneau/Session.java | 2 +-
.../main/java/org/apache/juneau/UriContext.java | 2 +-
.../java/org/apache/juneau/annotation/Bean.java | 2 +-
.../java/org/apache/juneau/http/MediaType.java | 2 +-
.../org/apache/juneau/http/annotation/Body.java | 19 +-
.../org/apache/juneau/http/annotation/Contact.java | 2 +-
.../juneau/http/annotation/ExternalDocs.java | 4 +-
.../apache/juneau/http/annotation/FormData.java | 6 +-
.../org/apache/juneau/http/annotation/Header.java | 6 +-
.../org/apache/juneau/http/annotation/Items.java | 4 +-
.../org/apache/juneau/http/annotation/License.java | 2 +-
.../org/apache/juneau/http/annotation/Path.java | 8 +-
.../org/apache/juneau/http/annotation/Query.java | 8 +-
.../apache/juneau/http/annotation/Response.java | 12 +-
.../juneau/http/annotation/ResponseHeader.java | 10 +-
.../juneau/http/annotation/ResponseStatus.java | 2 +-
.../org/apache/juneau/http/annotation/Schema.java | 30 +-
.../apache/juneau/http/annotation/SubItems.java | 4 +-
.../org/apache/juneau/http/annotation/Tag.java | 8 +-
.../apache/juneau/internal/CollectionUtils.java | 2 +-
.../org/apache/juneau/internal/StringUtils.java | 2 +-
.../org/apache/juneau/json/JsonSerializer.java | 60 +-
.../apache/juneau/json/SimpleJsonSerializer.java | 69 +
.../juneau/jsonschema/JsonSchemaSerializer.java | 4 +-
.../main/java/org/apache/juneau/parser/Parser.java | 2 +-
.../juneau/serializer/SerializeException.java | 2 +-
.../org/apache/juneau/serializer/Serializer.java | 6 +-
.../java/org/apache/juneau/utils/StringObject.java | 4 +-
.../java/org/apache/juneau/yaml/proto/package.html | 14 +-
juneau-doc/src/main/javadoc/overview.html | 1482 +++++++++++++++-----
.../juneau/examples/core/rdf/RdfExample.java | 4 +-
.../juneau/examples/rest/ContentComboTestBase.java | 8 +-
.../org/apache/juneau/examples/rest/TestUtils.java | 6 +-
.../juneau/microservice/BasicRestServletJena.java | 18 +-
.../microservice/BasicRestServletJenaGroup.java | 18 +-
.../rest/test/client/InterfaceProxyTest.java | 2 +-
.../rest/test/client/ThirdPartyProxyTest.java | 2 +-
.../apache/juneau/rest/jaxrs/BasicProvider.java | 2 +-
.../org/apache/juneau/rest/BasicRestConfig.java | 37 +-
.../apache/juneau/rest/BasicRestInfoProvider.java | 4 +-
.../org/apache/juneau/rest/BasicRestLogger.java | 4 +-
.../org/apache/juneau/rest/BasicRestServlet.java | 20 +-
.../main/java/org/apache/juneau/rest/Inherit.java | 16 +-
.../src/main/java/org/apache/juneau/rest/None.java | 8 +-
.../org/apache/juneau/rest/RequestFormData.java | 2 +-
.../org/apache/juneau/rest/RequestHeaders.java | 2 +-
.../java/org/apache/juneau/rest/RequestQuery.java | 2 +-
.../java/org/apache/juneau/rest/RestContext.java | 4 +-
.../java/org/apache/juneau/rest/RestLogger.java | 2 +-
.../java/org/apache/juneau/rest/RestServlet.java | 10 -
.../juneau/rest/annotation/MethodSwagger.java | 11 +-
.../juneau/rest/annotation/ResourceSwagger.java | 17 +-
.../apache/juneau/rest/annotation/RestMethod.java | 3 +-
.../juneau/rest/remoteable/RemoteableServlet.java | 2 +-
.../org/apache/juneau/rest/vars/RestInfoVar.java | 2 +-
.../juneau/rest/annotation/BodyAnnotationTest.java | 12 +-
.../rest/annotation/QueryAnnotationTest.java | 2 +-
.../rest/annotation/RestMethodInheritTest.java | 6 +-
.../rest/annotation/RestResourcePojoSwapsTest.java | 2 +-
.../juneau/rest/util/UrlPathPatternTest.java | 2 +-
114 files changed, 2224 insertions(+), 1304 deletions(-)
diff --git a/juneau-build-all.launch b/juneau-build-all.launch
new file mode 100644
index 0000000..a3837ff
--- /dev/null
+++ b/juneau-build-all.launch
@@ -0,0 +1,9 @@
+<?xml version="1.0" encoding="UTF-8" standalone="no"?>
+<launchConfiguration type="org.eclipse.ui.externaltools.ProgramLaunchConfigurationType">
+<stringAttribute key="bad_container_name" value="/juneau-root/ju"/>
+<listAttribute key="org.eclipse.debug.ui.favoriteGroups">
+<listEntry value="org.eclipse.ui.externaltools.launchGroup"/>
+</listAttribute>
+<stringAttribute key="org.eclipse.ui.externaltools.ATTR_LOCATION" value="${workspace_loc:/juneau-root/juneau-build-all.sh}"/>
+<stringAttribute key="org.eclipse.ui.externaltools.ATTR_WORKING_DIRECTORY" value="${workspace_loc:/juneau-root}"/>
+</launchConfiguration>
diff --git a/juneau-build-javadoc.sh b/juneau-build-all.sh
similarity index 84%
copy from juneau-build-javadoc.sh
copy to juneau-build-all.sh
index 85e113b..414fadd 100755
--- a/juneau-build-javadoc.sh
+++ b/juneau-build-all.sh
@@ -13,4 +13,9 @@
. ~/.profile
set -e
+mvn clean install
mvn javadoc:aggregate
+
+echo '*******************************************************************************'
+echo '***** SUCCESS *****************************************************************'
+echo '*******************************************************************************'
diff --git a/juneau-build-javadoc.sh b/juneau-build-javadoc.sh
index 85e113b..9b71b27 100755
--- a/juneau-build-javadoc.sh
+++ b/juneau-build-javadoc.sh
@@ -14,3 +14,7 @@
. ~/.profile
set -e
mvn javadoc:aggregate
+
+echo '*******************************************************************************'
+echo '***** SUCCESS *****************************************************************'
+echo '*******************************************************************************'
diff --git a/juneau-build.sh b/juneau-build.sh
index 87d068f..11b418b 100755
--- a/juneau-build.sh
+++ b/juneau-build.sh
@@ -14,3 +14,7 @@
. ~/.profile
set -e
mvn clean install
+
+echo '*******************************************************************************'
+echo '***** SUCCESS *****************************************************************'
+echo '*******************************************************************************'
diff --git a/juneau-core/juneau-config/src/main/java/org/apache/juneau/config/Config.java b/juneau-core/juneau-config/src/main/java/org/apache/juneau/config/Config.java
index 057d753..5296861 100644
--- a/juneau-core/juneau-config/src/main/java/org/apache/juneau/config/Config.java
+++ b/juneau-core/juneau-config/src/main/java/org/apache/juneau/config/Config.java
@@ -100,7 +100,7 @@ public final class Config extends Context implements ConfigEventListener, Writab
* <ul>
* <li><b>Name:</b> <js>"Config.serializer.o"</js>
* <li><b>Data type:</b> {@link WriterSerializer}
- * <li><b>Default:</b> {@link JsonSerializer#DEFAULT_LAX}
+ * <li><b>Default:</b> {@link SimpleJsonSerializer#DEFAULT}
* <li><b>Methods:</b>
* <ul>
* <li class='jm'>{@link ConfigBuilder#serializer(Class)}
@@ -328,7 +328,7 @@ public final class Config extends Context implements ConfigEventListener, Writab
store = getInstanceProperty(CONFIG_store, ConfigStore.class, ConfigFileStore.DEFAULT);
configMap = store.getMap(name);
configMap.register(this);
- serializer = getInstanceProperty(CONFIG_serializer, WriterSerializer.class, JsonSerializer.DEFAULT_LAX);
+ serializer = getInstanceProperty(CONFIG_serializer, WriterSerializer.class, SimpleJsonSerializer.DEFAULT);
parser = getInstanceProperty(CONFIG_parser, ReaderParser.class, JsonParser.DEFAULT);
beanSession = parser.createBeanSession();
encoder = getInstanceProperty(CONFIG_encoder, ConfigEncoder.class, ConfigXorEncoder.INSTANCE);
diff --git a/juneau-core/juneau-config/src/main/java/org/apache/juneau/config/ConfigBuilder.java b/juneau-core/juneau-config/src/main/java/org/apache/juneau/config/ConfigBuilder.java
index d518c35..680ea68 100644
--- a/juneau-core/juneau-config/src/main/java/org/apache/juneau/config/ConfigBuilder.java
+++ b/juneau-core/juneau-config/src/main/java/org/apache/juneau/config/ConfigBuilder.java
@@ -118,7 +118,7 @@ public class ConfigBuilder extends ContextBuilder {
*
* @param value
* The new value for this property.
- * <br>The default is {@link JsonSerializer#DEFAULT_LAX}.
+ * <br>The default is {@link SimpleJsonSerializer#DEFAULT}.
* @return This object (for method chaining).
*/
public ConfigBuilder serializer(WriterSerializer value) {
@@ -133,7 +133,7 @@ public class ConfigBuilder extends ContextBuilder {
*
* @param value
* The new value for this property.
- * <br>The default is {@link JsonSerializer#DEFAULT_LAX}.
+ * <br>The default is {@link SimpleJsonSerializer#DEFAULT}.
* @return This object (for method chaining).
*/
public ConfigBuilder serializer(Class<? extends WriterSerializer> value) {
diff --git a/juneau-core/juneau-core-test/src/test/java/org/apache/juneau/BeanFilterTest.java b/juneau-core/juneau-core-test/src/test/java/org/apache/juneau/BeanFilterTest.java
index 3e1b8e2..e396f42 100755
--- a/juneau-core/juneau-core-test/src/test/java/org/apache/juneau/BeanFilterTest.java
+++ b/juneau-core/juneau-core-test/src/test/java/org/apache/juneau/BeanFilterTest.java
@@ -27,7 +27,7 @@ public class BeanFilterTest {
//====================================================================================================
@Test
public void testSubTypes() throws Exception {
- JsonSerializer s = JsonSerializer.DEFAULT_LAX.builder().addBeanTypes().addRootType().build();
+ JsonSerializer s = SimpleJsonSerializer.DEFAULT.builder().addBeanTypes().addRootType().build();
JsonParser p = JsonParser.DEFAULT;
A1 a1 = new A1();
diff --git a/juneau-core/juneau-core-test/src/test/java/org/apache/juneau/BeanMapTest.java b/juneau-core/juneau-core-test/src/test/java/org/apache/juneau/BeanMapTest.java
index 55d5cfe..cfbebac 100755
--- a/juneau-core/juneau-core-test/src/test/java/org/apache/juneau/BeanMapTest.java
+++ b/juneau-core/juneau-core-test/src/test/java/org/apache/juneau/BeanMapTest.java
@@ -31,7 +31,7 @@ import org.junit.*;
@SuppressWarnings({"unchecked","rawtypes","serial"})
public class BeanMapTest {
- JsonSerializer serializer = JsonSerializer.DEFAULT_LAX.builder().addBeanTypes().addRootType().build();
+ JsonSerializer serializer = SimpleJsonSerializer.DEFAULT.builder().addBeanTypes().addRootType().build();
BeanContext bc = BeanContext.create()
.beanDictionary(MyBeanDictionaryMap.class)
@@ -525,10 +525,10 @@ public class BeanMapTest {
m.put("s2", new ObjectList("[['foo']]"));
m.put("i", new ObjectList("[1,2,3]"));
m.put("i2", new ObjectList("[[1,2,3],[4,5,6]]"));
- assertEquals("{s:['foo'],s2:[['foo']],i:[1,2,3],i2:[[1,2,3],[4,5,6]]}", JsonSerializer.DEFAULT_LAX.serialize(t));
+ assertEquals("{s:['foo'],s2:[['foo']],i:[1,2,3],i2:[[1,2,3],[4,5,6]]}", SimpleJsonSerializer.DEFAULT.serialize(t));
m.put("i", new ObjectList("[null,null,null]"));
m.put("i2", new ObjectList("[[null,null,null],[null,null,null]]"));
- assertEquals("{s:['foo'],s2:[['foo']],i:[0,0,0],i2:[[0,0,0],[0,0,0]]}", JsonSerializer.DEFAULT_LAX.serialize(t));
+ assertEquals("{s:['foo'],s2:[['foo']],i:[0,0,0],i2:[[0,0,0],[0,0,0]]}", SimpleJsonSerializer.DEFAULT.serialize(t));
}
public static class E {
@@ -1718,7 +1718,7 @@ public class BeanMapTest {
//====================================================================================================
@Test
public void testHiddenProperties() throws Exception {
- JsonSerializer s = JsonSerializer.DEFAULT_LAX;
+ JsonSerializer s = SimpleJsonSerializer.DEFAULT;
BeanMeta bm = s.getBeanMeta(U.class);
assertNotNull(bm.getPropertyMeta("a"));
assertNotNull(bm.getPropertyMeta("b"));
@@ -1821,7 +1821,7 @@ public class BeanMapTest {
//====================================================================================================
@Test
public void testOverriddenPropertyTypes() throws Exception {
- JsonSerializer s = JsonSerializer.DEFAULT_LAX;
+ JsonSerializer s = SimpleJsonSerializer.DEFAULT;
JsonParser p = JsonParser.DEFAULT;
String r;
diff --git a/juneau-core/juneau-core-test/src/test/java/org/apache/juneau/ComboRoundTripTest.java b/juneau-core/juneau-core-test/src/test/java/org/apache/juneau/ComboRoundTripTest.java
index 11a7d4f..d4132d7 100644
--- a/juneau-core/juneau-core-test/src/test/java/org/apache/juneau/ComboRoundTripTest.java
+++ b/juneau-core/juneau-core-test/src/test/java/org/apache/juneau/ComboRoundTripTest.java
@@ -12,7 +12,6 @@
// ***************************************************************************************************************************
package org.apache.juneau;
-import static org.apache.juneau.jena.Constants.*;
import static org.junit.Assert.*;
import java.util.*;
@@ -259,7 +258,7 @@ public abstract class ComboRoundTripTest {
//--------------------------------------------------------------------------------
// JSON
//--------------------------------------------------------------------------------
- WriterSerializer sJson = JsonSerializer.DEFAULT_LAX.builder().addBeanTypes().addRootType().build();
+ WriterSerializer sJson = SimpleJsonSerializer.DEFAULT.builder().addBeanTypes().addRootType().build();
ReaderParser pJson = JsonParser.DEFAULT;
@Test
@@ -301,7 +300,7 @@ public abstract class ComboRoundTripTest {
//--------------------------------------------------------------------------------
// JSON - Readable
//--------------------------------------------------------------------------------
- WriterSerializer sJsonR = JsonSerializer.DEFAULT_LAX_READABLE.builder().addBeanTypes().addRootType().build();
+ WriterSerializer sJsonR = SimpleJsonSerializer.DEFAULT_READABLE.builder().addBeanTypes().addRootType().build();
ReaderParser pJsonR = JsonParser.DEFAULT;
@Test
@@ -647,8 +646,8 @@ public abstract class ComboRoundTripTest {
//--------------------------------------------------------------------------------
// RdfXml
//--------------------------------------------------------------------------------
- WriterSerializer sRdfXml = RdfSerializer.DEFAULT_XMLABBREV.builder().addBeanTypes().addRootType().build();
- ReaderParser pRdfXml = RdfParser.DEFAULT_XML;
+ WriterSerializer sRdfXml = RdfXmlAbbrevSerializer.DEFAULT.builder().addBeanTypes().addRootType().build();
+ ReaderParser pRdfXml = RdfXmlParser.DEFAULT;
@Test
public void g11_serializeRdfXml() throws Exception {
@@ -668,8 +667,8 @@ public abstract class ComboRoundTripTest {
//--------------------------------------------------------------------------------
// RdfXml - 't' property
//--------------------------------------------------------------------------------
- WriterSerializer sRdfXmlT = RdfSerializer.create().language(LANG_RDF_XML_ABBREV).beanTypePropertyName("t").addBeanTypes().addRootType().build();
- ReaderParser pRdfXmlT = RdfParser.create().beanTypePropertyName("t").build();
+ WriterSerializer sRdfXmlT = RdfXmlAbbrevSerializer.create().beanTypePropertyName("t").addBeanTypes().addRootType().build();
+ ReaderParser pRdfXmlT = RdfXmlParser.create().beanTypePropertyName("t").build();
@Test
public void g21_serializeRdfXmlT() throws Exception {
@@ -689,8 +688,8 @@ public abstract class ComboRoundTripTest {
//--------------------------------------------------------------------------------
// RdfXml - Readable
//--------------------------------------------------------------------------------
- WriterSerializer sRdfXmlR = RdfSerializer.create().language(LANG_RDF_XML_ABBREV).ws().addBeanTypes().addRootType().build();
- ReaderParser pRdfXmlR = RdfParser.DEFAULT_XML;
+ WriterSerializer sRdfXmlR = RdfXmlAbbrevSerializer.create().ws().addBeanTypes().addRootType().build();
+ ReaderParser pRdfXmlR = RdfXmlParser.DEFAULT;
@Test
public void g31_serializeRdfXmlR() throws Exception {
diff --git a/juneau-core/juneau-core-test/src/test/java/org/apache/juneau/ComboSerializeTest.java b/juneau-core/juneau-core-test/src/test/java/org/apache/juneau/ComboSerializeTest.java
index fa497f4..c42c7b7 100644
--- a/juneau-core/juneau-core-test/src/test/java/org/apache/juneau/ComboSerializeTest.java
+++ b/juneau-core/juneau-core-test/src/test/java/org/apache/juneau/ComboSerializeTest.java
@@ -12,8 +12,6 @@
// ***************************************************************************************************************************
package org.apache.juneau;
-import static org.apache.juneau.jena.Constants.*;
-
import java.util.*;
import org.apache.juneau.html.*;
@@ -159,7 +157,7 @@ public abstract class ComboSerializeTest {
//--------------------------------------------------------------------------------
// JSON
//--------------------------------------------------------------------------------
- WriterSerializer sJson = JsonSerializer.DEFAULT_LAX;
+ WriterSerializer sJson = SimpleJsonSerializer.DEFAULT;
@Test
public void a11_serializeJson() throws Exception {
@@ -179,7 +177,7 @@ public abstract class ComboSerializeTest {
//--------------------------------------------------------------------------------
// JSON - Readable
//--------------------------------------------------------------------------------
- WriterSerializer sJsonR = JsonSerializer.DEFAULT_LAX_READABLE;
+ WriterSerializer sJsonR = SimpleJsonSerializer.DEFAULT_READABLE;
@Test
public void a31_serializeJsonR() throws Exception {
@@ -339,7 +337,7 @@ public abstract class ComboSerializeTest {
//--------------------------------------------------------------------------------
// RdfXml
//--------------------------------------------------------------------------------
- WriterSerializer sRdfXml = RdfSerializer.DEFAULT_XMLABBREV;
+ WriterSerializer sRdfXml = RdfXmlAbbrevSerializer.DEFAULT;
@Test
public void g11_serializeRdfXml() throws Exception {
@@ -349,7 +347,7 @@ public abstract class ComboSerializeTest {
//--------------------------------------------------------------------------------
// RdfXml - 't' property
//--------------------------------------------------------------------------------
- WriterSerializer sRdfXmlT = RdfSerializer.create().language(LANG_RDF_XML_ABBREV).beanTypePropertyName("t").build();
+ WriterSerializer sRdfXmlT = RdfXmlAbbrevSerializer.create().beanTypePropertyName("t").build();
@Test
public void g21_serializeRdfXmlT() throws Exception {
@@ -359,7 +357,7 @@ public abstract class ComboSerializeTest {
//--------------------------------------------------------------------------------
// RdfXml - Readable
//--------------------------------------------------------------------------------
- WriterSerializer sRdfXmlR = RdfSerializer.create().language(LANG_RDF_XML_ABBREV).ws().build();
+ WriterSerializer sRdfXmlR = RdfXmlAbbrevSerializer.create().ws().build();
@Test
public void g31_serializeRdfXmlR() throws Exception {
diff --git a/juneau-core/juneau-core-test/src/test/java/org/apache/juneau/MaxIndentTest.java b/juneau-core/juneau-core-test/src/test/java/org/apache/juneau/MaxIndentTest.java
index 9b76a53..0720e2f 100644
--- a/juneau-core/juneau-core-test/src/test/java/org/apache/juneau/MaxIndentTest.java
+++ b/juneau-core/juneau-core-test/src/test/java/org/apache/juneau/MaxIndentTest.java
@@ -262,7 +262,7 @@ public class MaxIndentTest {
@Test
public void a1_serializeJson() throws Exception {
- WriterSerializer s = JsonSerializer.DEFAULT_LAX_READABLE.builder().maxIndent(input.maxDepth).build();
+ WriterSerializer s = SimpleJsonSerializer.DEFAULT_READABLE.builder().maxIndent(input.maxDepth).build();
testSerialize("json", s, input.json);
}
diff --git a/juneau-core/juneau-core-test/src/test/java/org/apache/juneau/a/rttests/RoundTripAddClassAttrsTest.java b/juneau-core/juneau-core-test/src/test/java/org/apache/juneau/a/rttests/RoundTripAddClassAttrsTest.java
index 8d2e4ea..1638f4f 100755
--- a/juneau-core/juneau-core-test/src/test/java/org/apache/juneau/a/rttests/RoundTripAddClassAttrsTest.java
+++ b/juneau-core/juneau-core-test/src/test/java/org/apache/juneau/a/rttests/RoundTripAddClassAttrsTest.java
@@ -46,7 +46,7 @@ public class RoundTripAddClassAttrsTest extends RoundTripTest {
0
},
{ /* 1 */
- "JsonSerializer.DEFAULT_LAX/JsonParser.DEFAULT",
+ "JsonSerializer.DEFAULT_SIMPLE/JsonParser.DEFAULT",
new JsonSerializerBuilder().ssq().addBeanTypes(true).addRootType(),
new JsonParserBuilder().useInterfaceProxies(false),
0
diff --git a/juneau-core/juneau-core-test/src/test/java/org/apache/juneau/a/rttests/RoundTripLargeObjectsTest.java b/juneau-core/juneau-core-test/src/test/java/org/apache/juneau/a/rttests/RoundTripLargeObjectsTest.java
index a29bfa4..04204dd 100755
--- a/juneau-core/juneau-core-test/src/test/java/org/apache/juneau/a/rttests/RoundTripLargeObjectsTest.java
+++ b/juneau-core/juneau-core-test/src/test/java/org/apache/juneau/a/rttests/RoundTripLargeObjectsTest.java
@@ -104,31 +104,31 @@ public class RoundTripLargeObjectsTest extends RoundTripTest {
// { /* 9 */
// "Rdf.Xml",
// new RdfSerializer.Xml().setTrimNullProperties(false).setAddLiteralTypes(true),
-// RdfParser.DEFAULT_XML,
+// RdfXmlParser.DEFAULT,
// 0
// },
// { /* 10 */
// "Rdf.XmlAbbrev",
// new RdfSerializer.XmlAbbrev().setTrimNullProperties(false).setAddLiteralTypes(true),
-// RdfParser.DEFAULT_XML,
+// RdfXmlParser.DEFAULT,
// 0
// },
// { /* 11 */
// "Rdf.Turtle",
// new RdfSerializer.Turtle().setTrimNullProperties(false).setAddLiteralTypes(true),
-// RdfParser.DEFAULT_TURTLE,
+// TurtleParser.DEFAULT,
// 0
// },
// { /* 12 */
// "Rdf.NTriple",
// new RdfSerializer.NTriple().setTrimNullProperties(false).setAddLiteralTypes(true),
-// RdfParser.DEFAULT_NTRIPLE,
+// NTripleParser.DEFAULT,
// 0
// },
// { /* 13 */
// "Rdf.N3",
// new RdfSerializer.N3().setTrimNullProperties(false).setAddLiteralTypes(true),
-// RdfParser.DEFAULT_N3,
+// N3Parser.DEFAULT,
// 0
// },
});
diff --git a/juneau-core/juneau-core-test/src/test/java/org/apache/juneau/a/rttests/RoundTripTest.java b/juneau-core/juneau-core-test/src/test/java/org/apache/juneau/a/rttests/RoundTripTest.java
index 1ea81ef..f13617b 100755
--- a/juneau-core/juneau-core-test/src/test/java/org/apache/juneau/a/rttests/RoundTripTest.java
+++ b/juneau-core/juneau-core-test/src/test/java/org/apache/juneau/a/rttests/RoundTripTest.java
@@ -136,32 +136,32 @@ public abstract class RoundTripTest {
},
{ /* 14 */
"Rdf.Xml",
- RdfSerializer.create().trimNullProperties(false).addLiteralTypes().addBeanTypes().addRootType(),
- RdfParser.create().xml(),
+ RdfXmlSerializer.create().trimNullProperties(false).addLiteralTypes().addBeanTypes().addRootType(),
+ RdfXmlParser.create(),
0
},
{ /* 15 */
"Rdf.XmlAbbrev",
- RdfSerializer.create().xmlabbrev().trimNullProperties(false).addLiteralTypes().addBeanTypes().addRootType(),
- RdfParser.create().xml(),
+ RdfXmlAbbrevSerializer.create().trimNullProperties(false).addLiteralTypes().addBeanTypes().addRootType(),
+ RdfXmlParser.create(),
0
},
{ /* 16 */
"Rdf.Turtle",
- RdfSerializer.create().turtle().trimNullProperties(false).addLiteralTypes().addBeanTypes().addRootType(),
- RdfParser.create().turtle(),
+ TurtleSerializer.create().trimNullProperties(false).addLiteralTypes().addBeanTypes().addRootType(),
+ TurtleParser.create(),
0
},
{ /* 17 */
"Rdf.NTriple",
- RdfSerializer.create().ntriple().trimNullProperties(false).addLiteralTypes().addBeanTypes().addRootType(),
- RdfParser.create().ntriple(),
+ NTripleSerializer.create().trimNullProperties(false).addLiteralTypes().addBeanTypes().addRootType(),
+ NTripleParser.create(),
0
},
{ /* 18 */
"Rdf.N3",
- RdfSerializer.create().n3().trimNullProperties(false).addLiteralTypes().addBeanTypes().addRootType(),
- RdfParser.create().n3(),
+ N3Serializer.create().trimNullProperties(false).addLiteralTypes().addBeanTypes().addRootType(),
+ N3Parser.create(),
0
},
{ /* 19 */
diff --git a/juneau-core/juneau-core-test/src/test/java/org/apache/juneau/a/rttests/RoundTripTransformBeansTest.java b/juneau-core/juneau-core-test/src/test/java/org/apache/juneau/a/rttests/RoundTripTransformBeansTest.java
index 1e06b5b..3a93590 100755
--- a/juneau-core/juneau-core-test/src/test/java/org/apache/juneau/a/rttests/RoundTripTransformBeansTest.java
+++ b/juneau-core/juneau-core-test/src/test/java/org/apache/juneau/a/rttests/RoundTripTransformBeansTest.java
@@ -373,7 +373,7 @@ public class RoundTripTransformBeansTest extends RoundTripTest {
@Test
public void testSurrogatesThroughAnnotation() throws Exception {
- JsonSerializer s = JsonSerializer.DEFAULT_LAX;
+ JsonSerializer s = SimpleJsonSerializer.DEFAULT;
JsonParser p = JsonParser.DEFAULT;
Object r;
E1 x = E1.create();
diff --git a/juneau-core/juneau-core-test/src/test/java/org/apache/juneau/config/ConfigInterfaceTest.java b/juneau-core/juneau-core-test/src/test/java/org/apache/juneau/config/ConfigInterfaceTest.java
index fae0e18..b2a8c36 100644
--- a/juneau-core/juneau-core-test/src/test/java/org/apache/juneau/config/ConfigInterfaceTest.java
+++ b/juneau-core/juneau-core-test/src/test/java/org/apache/juneau/config/ConfigInterfaceTest.java
@@ -28,7 +28,7 @@ public class ConfigInterfaceTest {
ConfigInterface proxy;
public ConfigInterfaceTest() throws Exception {
- cf = Config.create().serializer(JsonSerializer.DEFAULT_LAX.builder().addBeanTypes().addRootType().build()).build();
+ cf = Config.create().serializer(SimpleJsonSerializer.DEFAULT.builder().addBeanTypes().addRootType().build()).build();
proxy = cf.getSectionAsInterface("A", ConfigInterface.class);
}
diff --git a/juneau-core/juneau-core-test/src/test/java/org/apache/juneau/httppart/OpenApiPartParserTest.java b/juneau-core/juneau-core-test/src/test/java/org/apache/juneau/httppart/OpenApiPartParserTest.java
index 226f67a..52049b9 100644
--- a/juneau-core/juneau-core-test/src/test/java/org/apache/juneau/httppart/OpenApiPartParserTest.java
+++ b/juneau-core/juneau-core-test/src/test/java/org/apache/juneau/httppart/OpenApiPartParserTest.java
@@ -262,7 +262,7 @@ public class OpenApiPartParserTest {
public static class C3 {
private String f;
public C3(String[] in) {
- f = "C3-" + JsonSerializer.DEFAULT_LAX.toString(in);
+ f = "C3-" + SimpleJsonSerializer.DEFAULT.toString(in);
}
@Override
public String toString() {
@@ -596,7 +596,7 @@ public class OpenApiPartParserTest {
public static class E2 {
private String f;
public E2(Boolean[] in) {
- this.f = "E2-" + JsonSerializer.DEFAULT_LAX.toString(in);
+ this.f = "E2-" + SimpleJsonSerializer.DEFAULT.toString(in);
}
@Override
public String toString() {
@@ -680,7 +680,7 @@ public class OpenApiPartParserTest {
public static class F2 {
private String f;
public F2(Integer[] in) {
- this.f = "F2-" + JsonSerializer.DEFAULT_LAX.toString(in);
+ this.f = "F2-" + SimpleJsonSerializer.DEFAULT.toString(in);
}
@Override
public String toString() {
@@ -702,7 +702,7 @@ public class OpenApiPartParserTest {
public static class F4 {
private String f;
public F4(Long[] in) {
- this.f = "F4-" + JsonSerializer.DEFAULT_LAX.toString(in);
+ this.f = "F4-" + SimpleJsonSerializer.DEFAULT.toString(in);
}
@Override
public String toString() {
@@ -865,7 +865,7 @@ public class OpenApiPartParserTest {
public static class G2 {
private String f;
public G2(Float[] in) {
- this.f = "G2-" + JsonSerializer.DEFAULT_LAX.toString(in);
+ this.f = "G2-" + SimpleJsonSerializer.DEFAULT.toString(in);
}
@Override
public String toString() {
@@ -887,7 +887,7 @@ public class OpenApiPartParserTest {
public static class G4 {
private String f;
public G4(Double[] in) {
- this.f = "G4-" + JsonSerializer.DEFAULT_LAX.toString(in);
+ this.f = "G4-" + SimpleJsonSerializer.DEFAULT.toString(in);
}
@Override
public String toString() {
diff --git a/juneau-core/juneau-core-test/src/test/java/org/apache/juneau/httppart/UonPartParserTest.java b/juneau-core/juneau-core-test/src/test/java/org/apache/juneau/httppart/UonPartParserTest.java
index 9383f08..2b327a6 100644
--- a/juneau-core/juneau-core-test/src/test/java/org/apache/juneau/httppart/UonPartParserTest.java
+++ b/juneau-core/juneau-core-test/src/test/java/org/apache/juneau/httppart/UonPartParserTest.java
@@ -276,7 +276,7 @@ public class UonPartParserTest {
ObjectMap r = UonPartParser.DEFAULT.createSession().parse(HttpPartType.QUERY, in, BeanContext.DEFAULT.createSession().getClassMeta(ObjectMap.class));
- assertEquals("{name:'foo bar'}", JsonSerializer.DEFAULT_LAX.toString(r));
+ assertEquals("{name:'foo bar'}", SimpleJsonSerializer.DEFAULT.toString(r));
}
}
\ No newline at end of file
diff --git a/juneau-core/juneau-core-test/src/test/java/org/apache/juneau/https/MediaRangeTest.java b/juneau-core/juneau-core-test/src/test/java/org/apache/juneau/https/MediaRangeTest.java
index 8ba7acb..7c876b4 100644
--- a/juneau-core/juneau-core-test/src/test/java/org/apache/juneau/https/MediaRangeTest.java
+++ b/juneau-core/juneau-core-test/src/test/java/org/apache/juneau/https/MediaRangeTest.java
@@ -61,6 +61,6 @@ public class MediaRangeTest {
@Test
public void test() {
MediaTypeRange[] r = MediaTypeRange.parse(mediaRange);
- assertEquals(label + " failed", expected, JsonSerializer.DEFAULT_LAX.toString(r));
+ assertEquals(label + " failed", expected, SimpleJsonSerializer.DEFAULT.toString(r));
}
}
diff --git a/juneau-core/juneau-core-test/src/test/java/org/apache/juneau/jena/CommonTest.java b/juneau-core/juneau-core-test/src/test/java/org/apache/juneau/jena/CommonTest.java
index 29551c6..2a4eadc 100755
--- a/juneau-core/juneau-core-test/src/test/java/org/apache/juneau/jena/CommonTest.java
+++ b/juneau-core/juneau-core-test/src/test/java/org/apache/juneau/jena/CommonTest.java
@@ -48,7 +48,7 @@ public class CommonTest {
@Test
public void testTrimNullsFromBeans() throws Exception {
RdfSerializerBuilder s = getBasicSerializer();
- RdfParser p = RdfParser.DEFAULT_XML;
+ RdfParser p = RdfXmlParser.DEFAULT;
A t1 = A.create(), t2;
s.trimNullProperties(false);
@@ -80,7 +80,7 @@ public class CommonTest {
@Test
public void testTrimEmptyMaps() throws Exception {
RdfSerializerBuilder s = getBasicSerializer();
- RdfParser p = RdfParser.DEFAULT_XML;
+ RdfParser p = RdfXmlParser.DEFAULT;
B t1 = B.create(), t2;
String r;
@@ -120,7 +120,7 @@ public class CommonTest {
@Test
public void testTrimEmptyLists() throws Exception {
RdfSerializerBuilder s = getBasicSerializer();
- RdfParser p = RdfParser.DEFAULT_XML;
+ RdfParser p = RdfXmlParser.DEFAULT;
C t1 = C.create(), t2;
String r;
@@ -162,7 +162,7 @@ public class CommonTest {
@Test
public void testTrimEmptyArrays() throws Exception {
RdfSerializerBuilder s = getBasicSerializer();
- RdfParser p = RdfParser.DEFAULT_XML;
+ RdfParser p = RdfXmlParser.DEFAULT;
D t1 = D.create(), t2;
String r;
@@ -202,7 +202,7 @@ public class CommonTest {
@Test
public void testBeanPropertyProperties() throws Exception {
RdfSerializerBuilder s = getBasicSerializer();
- RdfParser p = RdfParser.DEFAULT_XML;
+ RdfParser p = RdfXmlParser.DEFAULT;
E1 t1 = E1.create(), t2;
String r;
@@ -243,7 +243,7 @@ public class CommonTest {
@Test
public void testBeanPropertyProperiesOnListOfBeans() throws Exception {
RdfSerializerBuilder s = getBasicSerializer();
- RdfParser p = RdfParser.DEFAULT_XML;
+ RdfParser p = RdfXmlParser.DEFAULT;
List<F> l1 = new LinkedList<>(), l2;
F t = F.create();
t.x1.add(F.create());
@@ -273,7 +273,7 @@ public class CommonTest {
@Test
public void testURIAttr() throws Exception {
RdfSerializerBuilder s = getBasicSerializer();
- RdfParser p = RdfParser.DEFAULT_XML;
+ RdfParser p = RdfXmlParser.DEFAULT;
G t = new G();
t.uri = new URI("http://uri");
diff --git a/juneau-core/juneau-core-test/src/test/java/org/apache/juneau/jena/CommonXmlTest.java b/juneau-core/juneau-core-test/src/test/java/org/apache/juneau/jena/CommonXmlTest.java
index f46092f..7a79dfc 100755
--- a/juneau-core/juneau-core-test/src/test/java/org/apache/juneau/jena/CommonXmlTest.java
+++ b/juneau-core/juneau-core-test/src/test/java/org/apache/juneau/jena/CommonXmlTest.java
@@ -43,7 +43,7 @@ public class CommonXmlTest {
@Test
public void testBeanUriAnnotation() throws Exception {
RdfSerializerBuilder s = getBasicSerializer();
- RdfParser p = RdfParser.DEFAULT_XML;
+ RdfParser p = RdfXmlParser.DEFAULT;
A t1 = A.create(), t2;
String r;
@@ -71,7 +71,7 @@ public class CommonXmlTest {
@Test
public void testBeanUriAnnotationOnlyUriProperty() throws Exception {
RdfSerializerBuilder s = getBasicSerializer();
- RdfParser p = RdfParser.DEFAULT_XML;
+ RdfParser p = RdfXmlParser.DEFAULT;
B t1 = B.create(), t2;
String r;
diff --git a/juneau-core/juneau-core-test/src/test/java/org/apache/juneau/jena/RdfParserTest.java b/juneau-core/juneau-core-test/src/test/java/org/apache/juneau/jena/RdfParserTest.java
index 347a83a..b6bf7f0 100755
--- a/juneau-core/juneau-core-test/src/test/java/org/apache/juneau/jena/RdfParserTest.java
+++ b/juneau-core/juneau-core-test/src/test/java/org/apache/juneau/jena/RdfParserTest.java
@@ -79,12 +79,12 @@ public class RdfParserTest {
String rdfXml = s.serialize(a);
assertXmlEquals(expected, rdfXml);
- A a2 = RdfParser.DEFAULT_XML.parse(rdfXml, A.class);
+ A a2 = RdfXmlParser.DEFAULT.parse(rdfXml, A.class);
assertEqualObjects(a, a2);
- ObjectMap m = RdfParser.DEFAULT_XML.parse(rdfXml, ObjectMap.class);
- String json = JsonSerializer.DEFAULT_LAX_READABLE.serialize(m);
+ ObjectMap m = RdfXmlParser.DEFAULT.parse(rdfXml, ObjectMap.class);
+ String json = SimpleJsonSerializer.DEFAULT_READABLE.serialize(m);
String e = ""
+ "{\n"
diff --git a/juneau-core/juneau-core-test/src/test/java/org/apache/juneau/jena/RdfTest.java b/juneau-core/juneau-core-test/src/test/java/org/apache/juneau/jena/RdfTest.java
index 1c25b97..1899a09 100755
--- a/juneau-core/juneau-core-test/src/test/java/org/apache/juneau/jena/RdfTest.java
+++ b/juneau-core/juneau-core-test/src/test/java/org/apache/juneau/jena/RdfTest.java
@@ -196,7 +196,7 @@ public class RdfTest {
.set(RDF_rdfxml_tab, 3)
.sq()
.addRootProperty();
- RdfParser p = RdfParser.DEFAULT_XML;
+ RdfParser p = RdfXmlParser.DEFAULT;
//--------------------------------------------------------------------------------
// Normal format - Sequence
@@ -429,7 +429,7 @@ public class RdfTest {
.set(RDF_rdfxml_tab, 3)
.sq()
.addRootProperty();
- RdfParser p = RdfParser.DEFAULT_XML;
+ RdfParser p = RdfXmlParser.DEFAULT;
//--------------------------------------------------------------------------------
// Default on class is Bag - Should only affect DEFAULT properties.
diff --git a/juneau-core/juneau-core-test/src/test/java/org/apache/juneau/json/CommonTest.java b/juneau-core/juneau-core-test/src/test/java/org/apache/juneau/json/CommonTest.java
index bee3582..bbf2bb0 100755
--- a/juneau-core/juneau-core-test/src/test/java/org/apache/juneau/json/CommonTest.java
+++ b/juneau-core/juneau-core-test/src/test/java/org/apache/juneau/json/CommonTest.java
@@ -184,7 +184,7 @@ public class CommonTest {
//====================================================================================================
@Test
public void testBeanPropertyProperies() throws Exception {
- JsonSerializer s = JsonSerializer.DEFAULT_LAX;
+ JsonSerializer s = SimpleJsonSerializer.DEFAULT;
E1 t = new E1();
String r;
@@ -213,7 +213,7 @@ public class CommonTest {
//====================================================================================================
@Test
public void testBeanPropertyProperiesOnListOfBeans() throws Exception {
- JsonSerializer s = JsonSerializer.DEFAULT_LAX;
+ JsonSerializer s = SimpleJsonSerializer.DEFAULT;
List<F> l = new LinkedList<>();
F t = new F();
t.x1.add(new F());
@@ -232,7 +232,7 @@ public class CommonTest {
//====================================================================================================
@Test
public void testURIAttr() throws Exception {
- JsonSerializer s = JsonSerializer.DEFAULT_LAX;
+ JsonSerializer s = SimpleJsonSerializer.DEFAULT;
JsonParser p = JsonParser.DEFAULT;
G t = new G();
diff --git a/juneau-core/juneau-core-test/src/test/java/org/apache/juneau/json/JsonParserTest.java b/juneau-core/juneau-core-test/src/test/java/org/apache/juneau/json/JsonParserTest.java
index 8f8b3cc..757f18c 100755
--- a/juneau-core/juneau-core-test/src/test/java/org/apache/juneau/json/JsonParserTest.java
+++ b/juneau-core/juneau-core-test/src/test/java/org/apache/juneau/json/JsonParserTest.java
@@ -184,7 +184,7 @@ public class JsonParserTest {
public void testPrimitivesAsStrings() throws Exception {
String json;
ReaderParser p = JsonParser.DEFAULT;
- WriterSerializer s = JsonSerializer.DEFAULT_LAX;
+ WriterSerializer s = SimpleJsonSerializer.DEFAULT;
json = "{f1:'1',f2:'1',f3:'true',f4:'true',f5:'1',f6:'1',f7:'1',f8:'1',f9:'1',f10:'1'}";
B b = p.parse(json, B.class);
diff --git a/juneau-core/juneau-core-test/src/test/java/org/apache/juneau/json/JsonSchemaSerializerTest.java b/juneau-core/juneau-core-test/src/test/java/org/apache/juneau/json/JsonSchemaSerializerTest.java
index a51dab8..5289613 100755
--- a/juneau-core/juneau-core-test/src/test/java/org/apache/juneau/json/JsonSchemaSerializerTest.java
+++ b/juneau-core/juneau-core-test/src/test/java/org/apache/juneau/json/JsonSchemaSerializerTest.java
@@ -32,7 +32,7 @@ public class JsonSchemaSerializerTest {
//====================================================================================================
@Test
public void simpleObjects() throws Exception {
- JsonSchemaSerializer s = JsonSchemaSerializer.DEFAULT_LAX;
+ JsonSchemaSerializer s = JsonSchemaSerializer.DEFAULT_SIMPLE;
assertEquals("{type:'integer',format:'int16'}", s.serialize((short)1));
assertEquals("{type:'integer',format:'int32'}", s.serialize(1));
@@ -49,7 +49,7 @@ public class JsonSchemaSerializerTest {
@Test
public void simpleObjects_getSchema() throws Exception {
- JsonSchemaSerializerSession s = JsonSchemaSerializer.DEFAULT_LAX.createSession();
+ JsonSchemaSerializerSession s = JsonSchemaSerializer.DEFAULT_SIMPLE.createSession();
assertObjectEquals("{type:'integer',format:'int16'}", s.getSchema(short.class));
assertObjectEquals("{type:'integer',format:'int16'}", s.getSchema(Short.class));
@@ -81,7 +81,7 @@ public class JsonSchemaSerializerTest {
@Test
public void arrays1d() throws Exception {
- JsonSchemaSerializer s = JsonSchemaSerializer.DEFAULT_LAX;
+ JsonSchemaSerializer s = JsonSchemaSerializer.DEFAULT_SIMPLE;
assertEquals("{type:'array',items:{type:'integer',format:'int16'}}", s.serialize(new short[]{(short)1}));
assertEquals("{type:'array',items:{type:'integer',format:'int16'}}", s.serialize(new Short[]{(short)1}));
@@ -105,7 +105,7 @@ public class JsonSchemaSerializerTest {
@Test
public void arrays1d_getSchema() throws Exception {
- JsonSchemaSerializerSession s = JsonSchemaSerializer.DEFAULT_LAX.createSession();
+ JsonSchemaSerializerSession s = JsonSchemaSerializer.DEFAULT_SIMPLE.createSession();
assertObjectEquals("{type:'array',items:{type:'integer',format:'int16'}}", s.getSchema(short[].class));
assertObjectEquals("{type:'array',items:{type:'integer',format:'int16'}}", s.getSchema(Short[].class));
@@ -129,7 +129,7 @@ public class JsonSchemaSerializerTest {
@Test
public void arrays2d() throws Exception {
- JsonSchemaSerializer s = JsonSchemaSerializer.DEFAULT_LAX;
+ JsonSchemaSerializer s = JsonSchemaSerializer.DEFAULT_SIMPLE;
assertEquals("{type:'array',items:{type:'array',items:{type:'integer',format:'int16'}}}", s.serialize(new short[][]{{(short)1}}));
assertEquals("{type:'array',items:{type:'array',items:{type:'integer',format:'int16'}}}", s.serialize(new Short[][]{{(short)1}}));
@@ -153,7 +153,7 @@ public class JsonSchemaSerializerTest {
@Test
public void arrays2d_getSchema() throws Exception {
- JsonSchemaSerializerSession s = JsonSchemaSerializer.DEFAULT_LAX.createSession();
+ JsonSchemaSerializerSession s = JsonSchemaSerializer.DEFAULT_SIMPLE.createSession();
assertObjectEquals("{type:'array',items:{type:'array',items:{type:'integer',format:'int16'}}}", s.getSchema(short[][].class));
assertObjectEquals("{type:'array',items:{type:'array',items:{type:'integer',format:'int16'}}}", s.getSchema(Short[][].class));
@@ -181,13 +181,13 @@ public class JsonSchemaSerializerTest {
@Test
public void simpleList() throws Exception {
- JsonSchemaSerializer s = JsonSchemaSerializer.DEFAULT_LAX;
+ JsonSchemaSerializer s = JsonSchemaSerializer.DEFAULT_SIMPLE;
assertEquals("{type:'array',items:{type:'integer',format:'int32'}}", s.serialize(new SimpleList()));
}
@Test
public void simpleList_getSchema() throws Exception {
- JsonSchemaSerializerSession s = JsonSchemaSerializer.DEFAULT_LAX.createSession();
+ JsonSchemaSerializerSession s = JsonSchemaSerializer.DEFAULT_SIMPLE.createSession();
assertObjectEquals("{type:'array',items:{type:'integer',format:'int32'}}", s.getSchema(SimpleList.class));
}
@@ -196,13 +196,13 @@ public class JsonSchemaSerializerTest {
@Test
public void simpleList2d() throws Exception {
- JsonSchemaSerializer s = JsonSchemaSerializer.DEFAULT_LAX;
+ JsonSchemaSerializer s = JsonSchemaSerializer.DEFAULT_SIMPLE;
assertEquals("{type:'array',items:{type:'array',items:{type:'integer',format:'int32'}}}", s.serialize(new Simple2dList()));
}
@Test
public void simpleList2d_getSchema() throws Exception {
- JsonSchemaSerializerSession s = JsonSchemaSerializer.DEFAULT_LAX.createSession();
+ JsonSchemaSerializerSession s = JsonSchemaSerializer.DEFAULT_SIMPLE.createSession();
assertObjectEquals("{type:'array',items:{type:'array',items:{type:'integer',format:'int32'}}}", s.getSchema(Simple2dList.class));
}
@@ -215,13 +215,13 @@ public class JsonSchemaSerializerTest {
@Test
public void beanList() throws Exception {
- JsonSchemaSerializer s = JsonSchemaSerializer.DEFAULT_LAX;
+ JsonSchemaSerializer s = JsonSchemaSerializer.DEFAULT_SIMPLE;
assertEquals("{type:'array',items:{type:'object',properties:{f1:{type:'string'}}}}", s.serialize(new BeanList()));
}
@Test
public void beanList_getSchema() throws Exception {
- JsonSchemaSerializerSession s = JsonSchemaSerializer.DEFAULT_LAX.createSession();
+ JsonSchemaSerializerSession s = JsonSchemaSerializer.DEFAULT_SIMPLE.createSession();
assertObjectEquals("{type:'array',items:{type:'object',properties:{f1:{type:'string'}}}}", s.getSchema(BeanList.class));
}
@@ -230,13 +230,13 @@ public class JsonSchemaSerializerTest {
@Test
public void beanList2d() throws Exception {
- JsonSchemaSerializer s = JsonSchemaSerializer.DEFAULT_LAX;
+ JsonSchemaSerializer s = JsonSchemaSerializer.DEFAULT_SIMPLE;
assertEquals("{type:'array',items:{type:'array',items:{type:'object',properties:{f1:{type:'string'}}}}}", s.serialize(new BeanList2d()));
}
@Test
public void beanList2d_getSchema() throws Exception {
- JsonSchemaSerializerSession s = JsonSchemaSerializer.DEFAULT_LAX.createSession();
+ JsonSchemaSerializerSession s = JsonSchemaSerializer.DEFAULT_SIMPLE.createSession();
assertObjectEquals("{type:'array',items:{type:'array',items:{type:'object',properties:{f1:{type:'string'}}}}}", s.getSchema(BeanList2d.class));
}
@@ -249,13 +249,13 @@ public class JsonSchemaSerializerTest {
@Test
public void beanMap() throws Exception {
- JsonSchemaSerializer s = JsonSchemaSerializer.DEFAULT_LAX;
+ JsonSchemaSerializer s = JsonSchemaSerializer.DEFAULT_SIMPLE;
assertEquals("{type:'object',additionalProperties:{type:'object',properties:{f1:{type:'string'}}}}", s.serialize(new BeanMap()));
}
@Test
public void beanMap_getSchema() throws Exception {
- JsonSchemaSerializerSession s = JsonSchemaSerializer.DEFAULT_LAX.createSession();
+ JsonSchemaSerializerSession s = JsonSchemaSerializer.DEFAULT_SIMPLE.createSession();
assertObjectEquals("{type:'object',additionalProperties:{type:'object',properties:{f1:{type:'string'}}}}", s.getSchema(BeanMap.class));
}
@@ -264,13 +264,13 @@ public class JsonSchemaSerializerTest {
@Test
public void beanMap2d() throws Exception {
- JsonSchemaSerializer s = JsonSchemaSerializer.DEFAULT_LAX;
+ JsonSchemaSerializer s = JsonSchemaSerializer.DEFAULT_SIMPLE;
assertEquals("{type:'object',additionalProperties:{type:'object',additionalProperties:{type:'object',properties:{f1:{type:'string'}}}}}", s.serialize(new BeanMap2d()));
}
@Test
public void beanMap2d_getSchema() throws Exception {
- JsonSchemaSerializerSession s = JsonSchemaSerializer.DEFAULT_LAX.createSession();
+ JsonSchemaSerializerSession s = JsonSchemaSerializer.DEFAULT_SIMPLE.createSession();
assertObjectEquals("{type:'object',additionalProperties:{type:'object',additionalProperties:{type:'object',properties:{f1:{type:'string'}}}}}", s.getSchema(BeanMap2d.class));
}
@@ -284,46 +284,46 @@ public class JsonSchemaSerializerTest {
@Test
public void useBeanDefs() throws Exception {
- JsonSchemaSerializer s = JsonSchemaSerializer.DEFAULT_LAX.builder().useBeanDefs().build();
+ JsonSchemaSerializer s = JsonSchemaSerializer.DEFAULT_SIMPLE.builder().useBeanDefs().build();
assertEquals("{'$ref':'#/definitions/SimpleBean'}", s.serialize(new SimpleBean()));
}
@Test
public void useBeanDefs_getSchema() throws Exception {
- JsonSchemaSerializerSession s = JsonSchemaSerializer.DEFAULT_LAX.builder().useBeanDefs().build().createSession();
+ JsonSchemaSerializerSession s = JsonSchemaSerializer.DEFAULT_SIMPLE.builder().useBeanDefs().build().createSession();
assertObjectEquals("{'$ref':'#/definitions/SimpleBean'}", s.getSchema(SimpleBean.class));
assertObjectEquals("{SimpleBean:{type:'object',properties:{f1:{type:'string'}}}}", s.getBeanDefs());
}
@Test
public void useBeanDefs_beanList() throws Exception {
- JsonSchemaSerializer s = JsonSchemaSerializer.DEFAULT_LAX.builder().useBeanDefs().build();
+ JsonSchemaSerializer s = JsonSchemaSerializer.DEFAULT_SIMPLE.builder().useBeanDefs().build();
assertEquals("{type:'array',items:{'$ref':'#/definitions/SimpleBean'}}", s.serialize(new BeanList()));
}
@Test
public void useBeanDefs_beanList_getSchema() throws Exception {
- JsonSchemaSerializerSession s = JsonSchemaSerializer.DEFAULT_LAX.builder().useBeanDefs().build().createSession();
+ JsonSchemaSerializerSession s = JsonSchemaSerializer.DEFAULT_SIMPLE.builder().useBeanDefs().build().createSession();
assertObjectEquals("{type:'array',items:{'$ref':'#/definitions/SimpleBean'}}", s.getSchema(BeanList.class));
assertObjectEquals("{SimpleBean:{type:'object',properties:{f1:{type:'string'}}}}", s.getBeanDefs());
}
@Test
public void useBeanDefs_beanList2d() throws Exception {
- JsonSchemaSerializer s = JsonSchemaSerializer.DEFAULT_LAX.builder().useBeanDefs().build();
+ JsonSchemaSerializer s = JsonSchemaSerializer.DEFAULT_SIMPLE.builder().useBeanDefs().build();
assertEquals("{type:'array',items:{type:'array',items:{'$ref':'#/definitions/SimpleBean'}}}", s.serialize(new BeanList2d()));
}
@Test
public void useBeanDefs_beanList2d_getSchema() throws Exception {
- JsonSchemaSerializerSession s = JsonSchemaSerializer.DEFAULT_LAX.builder().useBeanDefs().build().createSession();
+ JsonSchemaSerializerSession s = JsonSchemaSerializer.DEFAULT_SIMPLE.builder().useBeanDefs().build().createSession();
assertObjectEquals("{type:'array',items:{type:'array',items:{'$ref':'#/definitions/SimpleBean'}}}", s.getSchema(BeanList2d.class));
assertObjectEquals("{SimpleBean:{type:'object',properties:{f1:{type:'string'}}}}", s.getBeanDefs());
}
@Test
public void useBeanDefs_beanArray2d_getSchema() throws Exception {
- JsonSchemaSerializerSession s = JsonSchemaSerializer.DEFAULT_LAX.builder().useBeanDefs().build().createSession();
+ JsonSchemaSerializerSession s = JsonSchemaSerializer.DEFAULT_SIMPLE.builder().useBeanDefs().build().createSession();
assertObjectEquals("{type:'array',items:{type:'array',items:{'$ref':'#/definitions/SimpleBean'}}}", s.getSchema(SimpleBean[][].class));
assertObjectEquals("{SimpleBean:{type:'object',properties:{f1:{type:'string'}}}}", s.getBeanDefs());
}
@@ -334,7 +334,7 @@ public class JsonSchemaSerializerTest {
@Test
public void beanDefsPreloaded() throws Exception {
- JsonSchemaSerializerSession s = JsonSchemaSerializer.DEFAULT_LAX.builder().useBeanDefs().build().createSession();
+ JsonSchemaSerializerSession s = JsonSchemaSerializer.DEFAULT_SIMPLE.builder().useBeanDefs().build().createSession();
s.addBeanDef("SimpleBean", new ObjectMap().append("test", 123));
assertObjectEquals("{'$ref':'#/definitions/SimpleBean'}", s.getSchema(SimpleBean.class));
assertObjectEquals("{SimpleBean:{test:123}}", s.getBeanDefs());
@@ -342,7 +342,7 @@ public class JsonSchemaSerializerTest {
@Test
public void useBeanDefsPreloaded_beanList_getSchema() throws Exception {
- JsonSchemaSerializerSession s = JsonSchemaSerializer.DEFAULT_LAX.builder().useBeanDefs().build().createSession();
+ JsonSchemaSerializerSession s = JsonSchemaSerializer.DEFAULT_SIMPLE.builder().useBeanDefs().build().createSession();
s.addBeanDef("SimpleBean", new ObjectMap().append("test", 123));
assertObjectEquals("{type:'array',items:{'$ref':'#/definitions/SimpleBean'}}", s.getSchema(BeanList.class));
assertObjectEquals("{SimpleBean:{test:123}}", s.getBeanDefs());
@@ -350,7 +350,7 @@ public class JsonSchemaSerializerTest {
@Test
public void useBeanDefsPreloaded_beanList2d_getSchema() throws Exception {
- JsonSchemaSerializerSession s = JsonSchemaSerializer.DEFAULT_LAX.builder().useBeanDefs().build().createSession();
+ JsonSchemaSerializerSession s = JsonSchemaSerializer.DEFAULT_SIMPLE.builder().useBeanDefs().build().createSession();
s.addBeanDef("SimpleBean", new ObjectMap().append("test", 123));
assertObjectEquals("{type:'array',items:{type:'array',items:{'$ref':'#/definitions/SimpleBean'}}}", s.getSchema(BeanList2d.class));
assertObjectEquals("{SimpleBean:{test:123}}", s.getBeanDefs());
@@ -358,7 +358,7 @@ public class JsonSchemaSerializerTest {
@Test
public void useBeanDefsPreloaded_beanArray2d_getSchema() throws Exception {
- JsonSchemaSerializerSession s = JsonSchemaSerializer.DEFAULT_LAX.builder().useBeanDefs().build().createSession();
+ JsonSchemaSerializerSession s = JsonSchemaSerializer.DEFAULT_SIMPLE.builder().useBeanDefs().build().createSession();
s.addBeanDef("SimpleBean", new ObjectMap().append("test", 123));
assertObjectEquals("{type:'array',items:{type:'array',items:{'$ref':'#/definitions/SimpleBean'}}}", s.getSchema(SimpleBean[][].class));
assertObjectEquals("{SimpleBean:{test:123}}", s.getBeanDefs());
@@ -370,14 +370,14 @@ public class JsonSchemaSerializerTest {
@Test
public void customBeanDefMapper() throws Exception {
- JsonSchemaSerializerSession s = JsonSchemaSerializer.DEFAULT_LAX.builder().useBeanDefs().beanDefMapper(CustomBeanDefMapper.class).build().createSession();
+ JsonSchemaSerializerSession s = JsonSchemaSerializer.DEFAULT_SIMPLE.builder().useBeanDefs().beanDefMapper(CustomBeanDefMapper.class).build().createSession();
assertObjectEquals("{'$ref':'#/definitions/org.apache.juneau.json.JsonSchemaSerializerTest$SimpleBean'}", s.getSchema(SimpleBean.class));
assertObjectEquals("{'org.apache.juneau.json.JsonSchemaSerializerTest$SimpleBean':{type:'object',properties:{f1:{type:'string'}}}}", s.getBeanDefs());
}
@Test
public void customBeanDefMapperInstance() throws Exception {
- JsonSchemaSerializerSession s = JsonSchemaSerializer.DEFAULT_LAX.builder().useBeanDefs().beanDefMapper(new CustomBeanDefMapper()).build().createSession();
+ JsonSchemaSerializerSession s = JsonSchemaSerializer.DEFAULT_SIMPLE.builder().useBeanDefs().beanDefMapper(new CustomBeanDefMapper()).build().createSession();
assertObjectEquals("{'$ref':'#/definitions/org.apache.juneau.json.JsonSchemaSerializerTest$SimpleBean'}", s.getSchema(SimpleBean.class));
assertObjectEquals("{'org.apache.juneau.json.JsonSchemaSerializerTest$SimpleBean':{type:'object',properties:{f1:{type:'string'}}}}", s.getBeanDefs());
}
@@ -391,7 +391,7 @@ public class JsonSchemaSerializerTest {
@Test
public void customBeanDefMapper_customURI() throws Exception {
- JsonSchemaSerializerSession s = JsonSchemaSerializer.DEFAULT_LAX.builder().useBeanDefs().beanDefMapper(CustomBeanDefMapper2.class).build().createSession();
+ JsonSchemaSerializerSession s = JsonSchemaSerializer.DEFAULT_SIMPLE.builder().useBeanDefs().beanDefMapper(CustomBeanDefMapper2.class).build().createSession();
assertObjectEquals("{'$ref':'/foo/bar/org.apache.juneau.json.JsonSchemaSerializerTest$SimpleBean'}", s.getSchema(SimpleBean.class));
assertObjectEquals("{'org.apache.juneau.json.JsonSchemaSerializerTest$SimpleBean':{type:'object',properties:{f1:{type:'string'}}}}", s.getBeanDefs());
}
@@ -413,13 +413,13 @@ public class JsonSchemaSerializerTest {
@Test
public void addExample_BEAN_noBeanExample() throws Exception {
- JsonSchemaSerializerSession s = JsonSchemaSerializer.DEFAULT_LAX.builder().addExamplesTo("bean").build().createSession();
+ JsonSchemaSerializerSession s = JsonSchemaSerializer.DEFAULT_SIMPLE.builder().addExamplesTo("bean").build().createSession();
assertObjectEquals("{type:'object',properties:{f1:{type:'string'}}}", s.getSchema(SimpleBean.class));
}
@Test
public void addExample_BEAN_exampleMethod() throws Exception {
- JsonSchemaSerializerSession s = JsonSchemaSerializer.DEFAULT_LAX.builder().addExamplesTo("bean").build().createSession();
+ JsonSchemaSerializerSession s = JsonSchemaSerializer.DEFAULT_SIMPLE.builder().addExamplesTo("bean").build().createSession();
assertObjectEquals("{type:'object',properties:{f1:{type:'string'}},'x-example':{f1:'foobar'}}", s.getSchema(SimpleBeanWithExampleMethod.class));
}
@@ -427,13 +427,13 @@ public class JsonSchemaSerializerTest {
public void addExample_BEAN_exampleMethod_wDefault() throws Exception {
SimpleBeanWithExampleMethod b = new SimpleBeanWithExampleMethod();
b.f1 = "baz";
- JsonSchemaSerializerSession s = JsonSchemaSerializer.DEFAULT_LAX.builder().addExamplesTo("bean").example(SimpleBeanWithExampleMethod.class, b).build().createSession();
+ JsonSchemaSerializerSession s = JsonSchemaSerializer.DEFAULT_SIMPLE.builder().addExamplesTo("bean").example(SimpleBeanWithExampleMethod.class, b).build().createSession();
assertObjectEquals("{type:'object',properties:{f1:{type:'string'}},'x-example':{f1:'baz'}}", s.getSchema(SimpleBeanWithExampleMethod.class));
}
@Test
public void addExample_BEAN_exampleMethod_array2d() throws Exception {
- JsonSchemaSerializerSession s = JsonSchemaSerializer.DEFAULT_LAX.builder().addExamplesTo("bean").build().createSession();
+ JsonSchemaSerializerSession s = JsonSchemaSerializer.DEFAULT_SIMPLE.builder().addExamplesTo("bean").build().createSession();
assertObjectEquals("{type:'array',items:{type:'array',items:{type:'object',properties:{f1:{type:'string'}},'x-example':{f1:'foobar'}}}}", s.getSchema(SimpleBeanWithExampleMethod[][].class));
}
@@ -449,13 +449,13 @@ public class JsonSchemaSerializerTest {
@Test
public void addExample_BEAN_exampleField() throws Exception {
- JsonSchemaSerializerSession s = JsonSchemaSerializer.DEFAULT_LAX.builder().addExamplesTo("bean").build().createSession();
+ JsonSchemaSerializerSession s = JsonSchemaSerializer.DEFAULT_SIMPLE.builder().addExamplesTo("bean").build().createSession();
assertObjectEquals("{type:'object',properties:{f1:{type:'string'}},'x-example':{f1:'foobar'}}", s.getSchema(SimpleBeanWithExampleField.class));
}
@Test
public void addExample_BEAN_exampleField_array2d() throws Exception {
- JsonSchemaSerializerSession s = JsonSchemaSerializer.DEFAULT_LAX.builder().addExamplesTo("bean").build().createSession();
+ JsonSchemaSerializerSession s = JsonSchemaSerializer.DEFAULT_SIMPLE.builder().addExamplesTo("bean").build().createSession();
assertObjectEquals("{type:'array',items:{type:'array',items:{type:'object',properties:{f1:{type:'string'}},'x-example':{f1:'foobar'}}}}", s.getSchema(SimpleBeanWithExampleField[][].class));
}
@@ -473,13 +473,13 @@ public class JsonSchemaSerializerTest {
@Test
public void addExample_BEAN_exampleBeanAnnotation() throws Exception {
- JsonSchemaSerializerSession s = JsonSchemaSerializer.DEFAULT_LAX.builder().addExamplesTo("bean").build().createSession();
+ JsonSchemaSerializerSession s = JsonSchemaSerializer.DEFAULT_SIMPLE.builder().addExamplesTo("bean").build().createSession();
assertObjectEquals("{type:'object',properties:{f1:{type:'string'}},'x-example':{f1:'foobar'}}", s.getSchema(SimpleBeanWithExampleAnnotation.class));
}
@Test
public void addExample_BEAN_exampleBeanAnnotation_2darray() throws Exception {
- JsonSchemaSerializerSession s = JsonSchemaSerializer.DEFAULT_LAX.builder().addExamplesTo("bean").build().createSession();
+ JsonSchemaSerializerSession s = JsonSchemaSerializer.DEFAULT_SIMPLE.builder().addExamplesTo("bean").build().createSession();
assertObjectEquals("{type:'array',items:{type:'array',items:{type:'object',properties:{f1:{type:'string'}},'x-example':{f1:'foobar'}}}}", s.getSchema(SimpleBeanWithExampleAnnotation[][].class));
}
@@ -490,7 +490,7 @@ public class JsonSchemaSerializerTest {
public void addExample_BEAN_exampleBeanProperty() throws Exception {
SimpleBean b = new SimpleBean();
b.f1 = "foobar";
- JsonSchemaSerializerSession s = JsonSchemaSerializer.DEFAULT_LAX.builder().addExamplesTo("bean").example(SimpleBean.class, b).build().createSession();
+ JsonSchemaSerializerSession s = JsonSchemaSerializer.DEFAULT_SIMPLE.builder().addExamplesTo("bean").example(SimpleBean.class, b).build().createSession();
assertObjectEquals("{type:'object',properties:{f1:{type:'string'}},'x-example':{f1:'foobar'}}", s.getSchema(SimpleBean.class));
}
@@ -498,7 +498,7 @@ public class JsonSchemaSerializerTest {
public void addExample_BEAN_exampleBeanProperty_2darray() throws Exception {
SimpleBean b = new SimpleBean();
b.f1 = "foobar";
- JsonSchemaSerializerSession s = JsonSchemaSerializer.DEFAULT_LAX.builder().addExamplesTo("bean").example(SimpleBean.class, b).build().createSession();
+ JsonSchemaSerializerSession s = JsonSchemaSerializer.DEFAULT_SIMPLE.builder().addExamplesTo("bean").example(SimpleBean.class, b).build().createSession();
assertObjectEquals("{type:'array',items:{type:'array',items:{type:'object',properties:{f1:{type:'string'}},'x-example':{f1:'foobar'}}}}", s.getSchema(SimpleBean[][].class));
}
@@ -508,13 +508,13 @@ public class JsonSchemaSerializerTest {
@Test
public void addExample_MAP_noExample() throws Exception {
- JsonSchemaSerializerSession s = JsonSchemaSerializer.DEFAULT_LAX.builder().addExamplesTo("map").build().createSession();
+ JsonSchemaSerializerSession s = JsonSchemaSerializer.DEFAULT_SIMPLE.builder().addExamplesTo("map").build().createSession();
assertObjectEquals("{type:'object',additionalProperties:{type:'object',properties:{f1:{type:'string'}}}}", s.getSchema(BeanMap.class));
}
@Test
public void addExample_MAP_exampleMethod() throws Exception {
- JsonSchemaSerializerSession s = JsonSchemaSerializer.DEFAULT_LAX.builder().addExamplesTo("map").build().createSession();
+ JsonSchemaSerializerSession s = JsonSchemaSerializer.DEFAULT_SIMPLE.builder().addExamplesTo("map").build().createSession();
assertObjectEquals("{type:'object',additionalProperties:{type:'object',properties:{f1:{type:'string'}}},'x-example':{'123':{f1:'foobar'}}}", s.getSchema(BeanMapWithExampleMethod.class));
}
@@ -522,7 +522,7 @@ public class JsonSchemaSerializerTest {
public void addExample_MAP_exampleMethod_wDefault() throws Exception {
BeanMapWithExampleMethod b = new BeanMapWithExampleMethod();
b.put(456, SimpleBeanWithExampleMethod.example());
- JsonSchemaSerializerSession s = JsonSchemaSerializer.DEFAULT_LAX.builder().addExamplesTo("map").example(BeanMapWithExampleMethod.class, b).build().createSession();
+ JsonSchemaSerializerSession s = JsonSchemaSerializer.DEFAULT_SIMPLE.builder().addExamplesTo("map").example(BeanMapWithExampleMethod.class, b).build().createSession();
assertObjectEquals("{type:'object',additionalProperties:{type:'object',properties:{f1:{type:'string'}}},'x-example':{'456':{f1:'foobar'}}}", s.getSchema(BeanMapWithExampleMethod.class));
}
@@ -539,13 +539,13 @@ public class JsonSchemaSerializerTest {
@Test
public void addExample_MAP_exampleField() throws Exception {
- JsonSchemaSerializerSession s = JsonSchemaSerializer.DEFAULT_LAX.builder().addExamplesTo("map").build().createSession();
+ JsonSchemaSerializerSession s = JsonSchemaSerializer.DEFAULT_SIMPLE.builder().addExamplesTo("map").build().createSession();
assertObjectEquals("{type:'object',additionalProperties:{type:'object',properties:{f1:{type:'string'}}},'x-example':{'123':{f1:'foobar'}}}", s.getSchema(BeanMapWithExampleField.class));
}
@Test
public void addExample_MAP_exampleField_array2d() throws Exception {
- JsonSchemaSerializerSession s = JsonSchemaSerializer.DEFAULT_LAX.builder().addExamplesTo("map").build().createSession();
+ JsonSchemaSerializerSession s = JsonSchemaSerializer.DEFAULT_SIMPLE.builder().addExamplesTo("map").build().createSession();
assertObjectEquals("{type:'array',items:{type:'array',items:{type:'object',additionalProperties:{type:'object',properties:{f1:{type:'string'}}},'x-example':{'123':{f1:'foobar'}}}}}", s.getSchema(BeanMapWithExampleField[][].class));
}
@@ -564,13 +564,13 @@ public class JsonSchemaSerializerTest {
@Test
public void addExample_MAP_exampleBeanAnnotation() throws Exception {
- JsonSchemaSerializerSession s = JsonSchemaSerializer.DEFAULT_LAX.builder().addExamplesTo("map").build().createSession();
+ JsonSchemaSerializerSession s = JsonSchemaSerializer.DEFAULT_SIMPLE.builder().addExamplesTo("map").build().createSession();
assertObjectEquals("{type:'object',additionalProperties:{type:'object',properties:{f1:{type:'string'}}},'x-example':{'123':{f1:'baz'}}}", s.getSchema(BeanMapWithExampleAnnotation.class));
}
@Test
public void addExample_MAP_exampleBeanAnnotation_2darray() throws Exception {
- JsonSchemaSerializerSession s = JsonSchemaSerializer.DEFAULT_LAX.builder().addExamplesTo("map").build().createSession();
+ JsonSchemaSerializerSession s = JsonSchemaSerializer.DEFAULT_SIMPLE.builder().addExamplesTo("map").build().createSession();
assertObjectEquals("{type:'array',items:{type:'array',items:{type:'object',additionalProperties:{type:'object',properties:{f1:{type:'string'}}},'x-example':{'123':{f1:'baz'}}}}}", s.getSchema(BeanMapWithExampleAnnotation[][].class));
}
@@ -580,13 +580,13 @@ public class JsonSchemaSerializerTest {
@Test
public void addExample_MAP_exampleBeanProperty() throws Exception {
- JsonSchemaSerializerSession s = JsonSchemaSerializer.DEFAULT_LAX.builder().addExamplesTo("map").example(BeanMap.class, BeanMapWithExampleMethod.example()).build().createSession();
+ JsonSchemaSerializerSession s = JsonSchemaSerializer.DEFAULT_SIMPLE.builder().addExamplesTo("map").example(BeanMap.class, BeanMapWithExampleMethod.example()).build().createSession();
assertObjectEquals("{type:'object',additionalProperties:{type:'object',properties:{f1:{type:'string'}}},'x-example':{'123':{f1:'foobar'}}}", s.getSchema(BeanMap.class));
}
@Test
public void addExample_MAP_exampleBeanProperty_2darray() throws Exception {
- JsonSchemaSerializerSession s = JsonSchemaSerializer.DEFAULT_LAX.builder().addExamplesTo("map").example(BeanMap.class, BeanMapWithExampleMethod.example()).build().createSession();
+ JsonSchemaSerializerSession s = JsonSchemaSerializer.DEFAULT_SIMPLE.builder().addExamplesTo("map").example(BeanMap.class, BeanMapWithExampleMethod.example()).build().createSession();
assertObjectEquals("{type:'array',items:{type:'array',items:{type:'object',additionalProperties:{type:'object',properties:{f1:{type:'string'}}},'x-example':{'123':{f1:'foobar'}}}}}", s.getSchema(BeanMap[][].class));
}
@@ -596,13 +596,13 @@ public class JsonSchemaSerializerTest {
@Test
public void addExample_COLLECTION_noExample() throws Exception {
- JsonSchemaSerializerSession s = JsonSchemaSerializer.DEFAULT_LAX.builder().addExamplesTo("collection").build().createSession();
+ JsonSchemaSerializerSession s = JsonSchemaSerializer.DEFAULT_SIMPLE.builder().addExamplesTo("collection").build().createSession();
assertObjectEquals("{type:'array',items:{type:'object',properties:{f1:{type:'string'}}}}", s.getSchema(BeanList.class));
}
@Test
public void addExample_COLLECTION_exampleMethod() throws Exception {
- JsonSchemaSerializerSession s = JsonSchemaSerializer.DEFAULT_LAX.builder().addExamplesTo("collection").build().createSession();
+ JsonSchemaSerializerSession s = JsonSchemaSerializer.DEFAULT_SIMPLE.builder().addExamplesTo("collection").build().createSession();
assertObjectEquals("{type:'array',items:{type:'object',properties:{f1:{type:'string'}}},'x-example':[{f1:'foobar'}]}", s.getSchema(BeanListWithExampleMethod.class));
}
@@ -612,7 +612,7 @@ public class JsonSchemaSerializerTest {
SimpleBean sb = new SimpleBean();
sb.f1 = "baz";
b.add(sb);
- JsonSchemaSerializerSession s = JsonSchemaSerializer.DEFAULT_LAX.builder().addExamplesTo("collection").example(BeanListWithExampleMethod.class, b).build().createSession();
+ JsonSchemaSerializerSession s = JsonSchemaSerializer.DEFAULT_SIMPLE.builder().addExamplesTo("collection").example(BeanListWithExampleMethod.class, b).build().createSession();
assertObjectEquals("{type:'array',items:{type:'object',properties:{f1:{type:'string'}}},'x-example':[{f1:'baz'}]}", s.getSchema(BeanListWithExampleMethod.class));
}
@@ -629,13 +629,13 @@ public class JsonSchemaSerializerTest {
@Test
public void addExample_COLLECTION_exampleField() throws Exception {
- JsonSchemaSerializerSession s = JsonSchemaSerializer.DEFAULT_LAX.builder().addExamplesTo("collection").build().createSession();
+ JsonSchemaSerializerSession s = JsonSchemaSerializer.DEFAULT_SIMPLE.builder().addExamplesTo("collection").build().createSession();
assertObjectEquals("{type:'array',items:{type:'object',properties:{f1:{type:'string'}}},'x-example':[{f1:'foobar'}]}", s.getSchema(BeanListWithExampleField.class));
}
@Test
public void addExample_ARRAY_exampleField_array2d() throws Exception {
- JsonSchemaSerializerSession s = JsonSchemaSerializer.DEFAULT_LAX.builder().addExamplesTo("array").build().createSession();
+ JsonSchemaSerializerSession s = JsonSchemaSerializer.DEFAULT_SIMPLE.builder().addExamplesTo("array").build().createSession();
assertObjectEquals("{type:'array',items:{type:'array',items:{type:'array',items:{type:'object',properties:{f1:{type:'string'}}}}},'x-example':[[[{f1:'foobar'}]]]}", s.getSchema(BeanListWithExampleField[][].class));
}
@@ -654,13 +654,13 @@ public class JsonSchemaSerializerTest {
@Test
public void addExample_COLLECTION_exampleBeanAnnotation() throws Exception {
- JsonSchemaSerializerSession s = JsonSchemaSerializer.DEFAULT_LAX.builder().addExamplesTo("collection").build().createSession();
+ JsonSchemaSerializerSession s = JsonSchemaSerializer.DEFAULT_SIMPLE.builder().addExamplesTo("collection").build().createSession();
assertObjectEquals("{type:'array',items:{type:'object',properties:{f1:{type:'string'}}},'x-example':[{f1:'baz'}]}", s.getSchema(BeanListWithExampleAnnotation.class));
}
@Test
public void addExample_ARRAY_exampleBeanAnnotation_2darray() throws Exception {
- JsonSchemaSerializerSession s = JsonSchemaSerializer.DEFAULT_LAX.builder().addExamplesTo("array").build().createSession();
+ JsonSchemaSerializerSession s = JsonSchemaSerializer.DEFAULT_SIMPLE.builder().addExamplesTo("array").build().createSession();
assertObjectEquals("{type:'array',items:{type:'array',items:{type:'array',items:{type:'object',properties:{f1:{type:'string'}}}}},'x-example':[[[{f1:'baz'}]]]}", s.getSchema(BeanListWithExampleAnnotation[][].class));
}
@@ -670,13 +670,13 @@ public class JsonSchemaSerializerTest {
@Test
public void addExample_COLLECTION_exampleBeanProperty() throws Exception {
- JsonSchemaSerializerSession s =JsonSchemaSerializer.DEFAULT_LAX.builder().addExamplesTo("collection").example(BeanList.class, BeanListWithExampleMethod.example()).build().createSession();
+ JsonSchemaSerializerSession s =JsonSchemaSerializer.DEFAULT_SIMPLE.builder().addExamplesTo("collection").example(BeanList.class, BeanListWithExampleMethod.example()).build().createSession();
assertObjectEquals("{type:'array',items:{type:'object',properties:{f1:{type:'string'}}},'x-example':[{f1:'foobar'}]}", s.getSchema(BeanList.class));
}
@Test
public void addExample_ARRAY_exampleBeanProperty_2darray() throws Exception {
- JsonSchemaSerializerSession s = JsonSchemaSerializer.DEFAULT_LAX.builder().addExamplesTo("array").example(BeanList.class, BeanListWithExampleMethod.example()).build().createSession();
+ JsonSchemaSerializerSession s = JsonSchemaSerializer.DEFAULT_SIMPLE.builder().addExamplesTo("array").example(BeanList.class, BeanListWithExampleMethod.example()).build().createSession();
assertObjectEquals("{type:'array',items:{type:'array',items:{type:'array',items:{type:'object',properties:{f1:{type:'string'}}}}},'x-example':[[[{f1:'foobar'}]]]}", s.getSchema(BeanList[][].class));
}
@@ -685,14 +685,14 @@ public class JsonSchemaSerializerTest {
//====================================================================================================
@Test
public void addExample_BOOLEAN() throws Exception {
- JsonSchemaSerializerSession s = JsonSchemaSerializer.DEFAULT_LAX.builder().addExamplesTo("boolean").build().createSession();
+ JsonSchemaSerializerSession s = JsonSchemaSerializer.DEFAULT_SIMPLE.builder().addExamplesTo("boolean").build().createSession();
assertObjectEquals("{type:'boolean','x-example':true}", s.getSchema(boolean.class));
assertObjectEquals("{type:'boolean','x-example':true}", s.getSchema(Boolean.class));
}
@Test
public void addExample_BOOLEAN_wDefault() throws Exception {
- JsonSchemaSerializerSession s = JsonSchemaSerializer.DEFAULT_LAX.builder().addExamplesTo("boolean")
+ JsonSchemaSerializerSession s = JsonSchemaSerializer.DEFAULT_SIMPLE.builder().addExamplesTo("boolean")
.example(boolean.class, false)
.example(Boolean.class, false)
.build().createSession();
@@ -702,7 +702,7 @@ public class JsonSchemaSerializerTest {
@Test
public void addExample_BOOLEAN_2darray() throws Exception {
- JsonSchemaSerializerSession s = JsonSchemaSerializer.DEFAULT_LAX.builder().addExamplesTo("boolean").build().createSession();
+ JsonSchemaSerializerSession s = JsonSchemaSerializer.DEFAULT_SIMPLE.builder().addExamplesTo("boolean").build().createSession();
assertObjectEquals("{type:'array',items:{type:'array',items:{type:'boolean','x-example':true}}}", s.getSchema(boolean[][].class));
assertObjectEquals("{type:'array',items:{type:'array',items:{type:'boolean','x-example':true}}}", s.getSchema(Boolean[][].class));
}
@@ -712,7 +712,7 @@ public class JsonSchemaSerializerTest {
//====================================================================================================
@Test
public void addExample_NUMBER() throws Exception {
- JsonSchemaSerializerSession s = JsonSchemaSerializer.DEFAULT_LAX.builder().addExamplesTo("number").build().createSession();
+ JsonSchemaSerializerSession s = JsonSchemaSerializer.DEFAULT_SIMPLE.builder().addExamplesTo("number").build().createSession();
assertObjectEquals("{type:'integer',format:'int16','x-example':1}", s.getSchema(short.class));
assertObjectEquals("{type:'integer',format:'int16','x-example':1}", s.getSchema(Short.class));
assertObjectEquals("{type:'integer',format:'int32','x-example':1}", s.getSchema(int.class));
@@ -727,7 +727,7 @@ public class JsonSchemaSerializerTest {
@Test
public void addExample_NUMBER_wDefault() throws Exception {
- JsonSchemaSerializerSession s = JsonSchemaSerializer.DEFAULT_LAX.builder().addExamplesTo("number")
+ JsonSchemaSerializerSession s = JsonSchemaSerializer.DEFAULT_SIMPLE.builder().addExamplesTo("number")
.example(short.class, (short)2)
.example(Short.class, (short)3)
.example(int.class, 4)
@@ -753,7 +753,7 @@ public class JsonSchemaSerializerTest {
@Test
public void addExample_NUMBER_2darray() throws Exception {
- JsonSchemaSerializerSession s = JsonSchemaSerializer.DEFAULT_LAX.builder().addExamplesTo("number").build().createSession();
+ JsonSchemaSerializerSession s = JsonSchemaSerializer.DEFAULT_SIMPLE.builder().addExamplesTo("number").build().createSession();
assertObjectEquals("{type:'array',items:{type:'array',items:{type:'integer',format:'int16','x-example':1}}}", s.getSchema(short[][].class));
assertObjectEquals("{type:'array',items:{type:'array',items:{type:'integer',format:'int16','x-example':1}}}", s.getSchema(Short[][].class));
assertObjectEquals("{type:'array',items:{type:'array',items:{type:'integer',format:'int32','x-example':1}}}", s.getSchema(int[][].class));
@@ -772,7 +772,7 @@ public class JsonSchemaSerializerTest {
@Test
public void addExample_STRING() throws Exception {
- JsonSchemaSerializerSession s = JsonSchemaSerializer.DEFAULT_LAX.builder().addExamplesTo("string").build().createSession();
+ JsonSchemaSerializerSession s = JsonSchemaSerializer.DEFAULT_SIMPLE.builder().addExamplesTo("string").build().createSession();
assertObjectEquals("{type:'string','x-example':'foo'}", s.getSchema(String.class));
assertObjectEquals("{type:'string','x-example':'foo'}", s.getSchema(StringBuilder.class));
assertObjectEquals("{type:'string','x-example':'a'}", s.getSchema(Character.class));
@@ -781,7 +781,7 @@ public class JsonSchemaSerializerTest {
@Test
public void addExample_STRING_wDefault() throws Exception {
- JsonSchemaSerializerSession s = JsonSchemaSerializer.DEFAULT_LAX.builder().addExamplesTo("string")
+ JsonSchemaSerializerSession s = JsonSchemaSerializer.DEFAULT_SIMPLE.builder().addExamplesTo("string")
.example(String.class, "bar1")
.example(StringBuilder.class, new StringBuilder("bar2"))
.example(Character.class, 'b')
@@ -795,7 +795,7 @@ public class JsonSchemaSerializerTest {
@Test
public void addExample_STRING_2darray() throws Exception {
- JsonSchemaSerializerSession s = JsonSchemaSerializer.DEFAULT_LAX.builder().addExamplesTo("string").build().createSession();
+ JsonSchemaSerializerSession s = JsonSchemaSerializer.DEFAULT_SIMPLE.builder().addExamplesTo("string").build().createSession();
assertObjectEquals("{type:'array',items:{type:'array',items:{type:'string','x-example':'foo'}}}", s.getSchema(String[][].class));
assertObjectEquals("{type:'array',items:{type:'array',items:{type:'string','x-example':'foo'}}}", s.getSchema(StringBuilder[][].class));
assertObjectEquals("{type:'array',items:{type:'array',items:{type:'string','x-example':'a'}}}", s.getSchema(Character[][].class));
@@ -804,7 +804,7 @@ public class JsonSchemaSerializerTest {
@Test
public void addExample_STRING_2darray_wDefault() throws Exception {
- JsonSchemaSerializerSession s = JsonSchemaSerializer.DEFAULT_LAX.builder().addExamplesTo("string")
+ JsonSchemaSerializerSession s = JsonSchemaSerializer.DEFAULT_SIMPLE.builder().addExamplesTo("string")
.example(String.class, "bar1")
.example(StringBuilder.class, new StringBuilder("bar2"))
.example(Character.class, 'b')
@@ -822,37 +822,37 @@ public class JsonSchemaSerializerTest {
@Test
public void addExample_ENUM() throws Exception {
- JsonSchemaSerializerSession s = JsonSchemaSerializer.DEFAULT_LAX.builder().addExamplesTo("enum").build().createSession();
+ JsonSchemaSerializerSession s = JsonSchemaSerializer.DEFAULT_SIMPLE.builder().addExamplesTo("enum").build().createSession();
assertObjectEquals("{type:'string','enum':['one','two','three'],'x-example':'one'}", s.getSchema(TestEnumToString.class));
}
@Test
public void addExample_ENUM_wDefault() throws Exception {
- JsonSchemaSerializerSession s = JsonSchemaSerializer.DEFAULT_LAX.builder().addExamplesTo("enum").example(TestEnumToString.class, TestEnumToString.TWO).build().createSession();
+ JsonSchemaSerializerSession s = JsonSchemaSerializer.DEFAULT_SIMPLE.builder().addExamplesTo("enum").example(TestEnumToString.class, TestEnumToString.TWO).build().createSession();
assertObjectEquals("{type:'string','enum':['one','two','three'],'x-example':'two'}", s.getSchema(TestEnumToString.class));
}
@Test
public void addExample_ENUM_2darray() throws Exception {
- JsonSchemaSerializerSession s = JsonSchemaSerializer.DEFAULT_LAX.builder().addExamplesTo("enum").build().createSession();
+ JsonSchemaSerializerSession s = JsonSchemaSerializer.DEFAULT_SIMPLE.builder().addExamplesTo("enum").build().createSession();
assertObjectEquals("{type:'array',items:{type:'array',items:{type:'string','enum':['one','two','three'],'x-example':'one'}}}", s.getSchema(TestEnumToString[][].class));
}
@Test
public void addExample_ENUM_useEnumNames() throws Exception {
- JsonSchemaSerializerSession s = JsonSchemaSerializer.DEFAULT_LAX.builder().useEnumNames().addExamplesTo("enum").build().createSession();
+ JsonSchemaSerializerSession s = JsonSchemaSerializer.DEFAULT_SIMPLE.builder().useEnumNames().addExamplesTo("enum").build().createSession();
assertObjectEquals("{type:'string','enum':['ONE','TWO','THREE'],'x-example':'ONE'}", s.getSchema(TestEnumToString.class));
}
@Test
public void addExample_ENUM_wDefault_useEnumNames() throws Exception {
- JsonSchemaSerializerSession s = JsonSchemaSerializer.DEFAULT_LAX.builder().useEnumNames().addExamplesTo("enum").example(TestEnumToString.class, TestEnumToString.TWO).build().createSession();
+ JsonSchemaSerializerSession s = JsonSchemaSerializer.DEFAULT_SIMPLE.builder().useEnumNames().addExamplesTo("enum").example(TestEnumToString.class, TestEnumToString.TWO).build().createSession();
assertObjectEquals("{type:'string','enum':['ONE','TWO','THREE'],'x-example':'TWO'}", s.getSchema(TestEnumToString.class));
}
@Test
public void addExample_ENUM_2darray_useEnumNames() throws Exception {
- JsonSchemaSerializerSession s = JsonSchemaSerializer.DEFAULT_LAX.builder().useEnumNames().addExamplesTo("enum").build().createSession();
+ JsonSchemaSerializerSession s = JsonSchemaSerializer.DEFAULT_SIMPLE.builder().useEnumNames().addExamplesTo("enum").build().createSession();
assertObjectEquals("{type:'array',items:{type:'array',items:{type:'string','enum':['ONE','TWO','THREE'],'x-example':'ONE'}}}", s.getSchema(TestEnumToString[][].class));
}
@@ -861,7 +861,7 @@ public class JsonSchemaSerializerTest {
//====================================================================================================
@Test
public void addExample_ANY() throws Exception {
- JsonSchemaSerializerSession s = JsonSchemaSerializer.DEFAULT_LAX.builder().addExamplesTo("any").build().createSession();
+ JsonSchemaSerializerSession s = JsonSchemaSerializer.DEFAULT_SIMPLE.builder().addExamplesTo("any").build().createSession();
assertObjectEquals("{type:'object',properties:{f1:{type:'string','x-example':'foo'}}}", s.getSchema(SimpleBean.class));
assertObjectEquals("{type:'object',additionalProperties:{type:'object',properties:{f1:{type:'string'}}},'x-example':{'123':{f1:'foobar'}}}", s.getSchema(BeanMapWithExampleMethod.class));
assertObjectEquals("{type:'array',items:{type:'object',properties:{f1:{type:'string'}}},'x-example':[{f1:'foobar'}]}", s.getSchema(BeanListWithExampleMethod.class));
@@ -890,13 +890,13 @@ public class JsonSchemaSerializerTest {
@Test
public void addDescription_BEAN() throws Exception {
- JsonSchemaSerializerSession s = JsonSchemaSerializer.DEFAULT_LAX.builder().addDescriptionsTo("bean").build().createSession();
+ JsonSchemaSerializerSession s = JsonSchemaSerializer.DEFAULT_SIMPLE.builder().addDescriptionsTo("bean").build().createSession();
assertObjectEquals("{type:'object',properties:{f1:{type:'string'}},description:'org.apache.juneau.json.JsonSchemaSerializerTest$SimpleBean'}", s.getSchema(SimpleBean.class));
}
@Test
public void addDescription_BEAN_array2d() throws Exception {
- JsonSchemaSerializerSession s = JsonSchemaSerializer.DEFAULT_LAX.builder().addDescriptionsTo("bean").build().createSession();
+ JsonSchemaSerializerSession s = JsonSchemaSerializer.DEFAULT_SIMPLE.builder().addDescriptionsTo("bean").build().createSession();
assertObjectEquals("{type:'array',items:{type:'array',items:{type:'object',properties:{f1:{type:'string'}},description:'org.apache.juneau.json.JsonSchemaSerializerTest$SimpleBean'}}}", s.getSchema(SimpleBean[][].class));
}
@@ -906,13 +906,13 @@ public class JsonSchemaSerializerTest {
@Test
public void addDescription_MAP() throws Exception {
- JsonSchemaSerializerSession s = JsonSchemaSerializer.DEFAULT_LAX.builder().addDescriptionsTo("map").build().createSession();
+ JsonSchemaSerializerSession s = JsonSchemaSerializer.DEFAULT_SIMPLE.builder().addDescriptionsTo("map").build().createSession();
assertObjectEquals("{type:'object',additionalProperties:{type:'object',properties:{f1:{type:'string'}}},description:'org.apache.juneau.json.JsonSchemaSerializerTest$BeanMap<java.lang.Integer,org.apache.juneau.json.JsonSchemaSerializerTest$SimpleBean>'}", s.getSchema(BeanMap.class));
}
@Test
public void addDescription_MAP_2darray() throws Exception {
- JsonSchemaSerializerSession s = JsonSchemaSerializer.DEFAULT_LAX.builder().addDescriptionsTo("map").build().createSession();
+ JsonSchemaSerializerSession s = JsonSchemaSerializer.DEFAULT_SIMPLE.builder().addDescriptionsTo("map").build().createSession();
assertObjectEquals("{type:'array',items:{type:'array',items:{type:'object',additionalProperties:{type:'object',properties:{f1:{type:'string'}}},description:'org.apache.juneau.json.JsonSchemaSerializerTest$BeanMap<java.lang.Integer,org.apache.juneau.json.JsonSchemaSerializerTest$SimpleBean>'}}}", s.getSchema(BeanMap[][].class));
}
@@ -922,19 +922,19 @@ public class JsonSchemaSerializerTest {
@Test
public void addDescription_COLLECTION() throws Exception {
- JsonSchemaSerializerSession s = JsonSchemaSerializer.DEFAULT_LAX.builder().addDescriptionsTo("collection").build().createSession();
+ JsonSchemaSerializerSession s = JsonSchemaSerializer.DEFAULT_SIMPLE.builder().addDescriptionsTo("collection").build().createSession();
assertObjectEquals("{type:'array',items:{type:'object',properties:{f1:{type:'string'}}},description:'org.apache.juneau.json.JsonSchemaSerializerTest$BeanList<org.apache.juneau.json.JsonSchemaSerializerTest$SimpleBean>'}", s.getSchema(BeanList.class));
}
@Test
public void addDescription_COLLECTION_2darray() throws Exception {
- JsonSchemaSerializerSession s = JsonSchemaSerializer.DEFAULT_LAX.builder().addDescriptionsTo("collection").build().createSession();
+ JsonSchemaSerializerSession s = JsonSchemaSerializer.DEFAULT_SIMPLE.builder().addDescriptionsTo("collection").build().createSession();
assertObjectEquals("{type:'array',items:{type:'array',items:{type:'array',items:{type:'object',properties:{f1:{type:'string'}}},description:'org.apache.juneau.json.JsonSchemaSerializerTest$BeanList<org.apache.juneau.json.JsonSchemaSerializerTest$SimpleBean>'}}}", s.getSchema(BeanList[][].class));
}
@Test
public void addDescription_ARRAY() throws Exception {
- JsonSchemaSerializerSession s = JsonSchemaSerializer.DEFAULT_LAX.builder().addDescriptionsTo("array").build().createSession();
+ JsonSchemaSerializerSession s = JsonSchemaSerializer.DEFAULT_SIMPLE.builder().addDescriptionsTo("array").build().createSession();
assertObjectEquals("{type:'array',items:{type:'array',items:{type:'array',items:{type:'object',properties:{f1:{type:'string'}}}}},description:'org.apache.juneau.json.JsonSchemaSerializerTest$BeanList<org.apache.juneau.json.JsonSchemaSerializerTest$SimpleBean>[][]'}", s.getSchema(BeanList[][].class));
}
@@ -943,14 +943,14 @@ public class JsonSchemaSerializerTest {
//====================================================================================================
@Test
public void addDescription_BOOLEAN() throws Exception {
- JsonSchemaSerializerSession s = JsonSchemaSerializer.DEFAULT_LAX.builder().addDescriptionsTo("boolean").build().createSession();
+ JsonSchemaSerializerSession s = JsonSchemaSerializer.DEFAULT_SIMPLE.builder().addDescriptionsTo("boolean").build().createSession();
assertObjectEquals("{type:'boolean',description:'boolean'}", s.getSchema(boolean.class));
assertObjectEquals("{type:'boolean',description:'java.lang.Boolean'}", s.getSchema(Boolean.class));
}
@Test
public void addDescription_BOOLEAN_2darray() throws Exception {
- JsonSchemaSerializerSession s = JsonSchemaSerializer.DEFAULT_LAX.builder().addDescriptionsTo("boolean").build().createSession();
+ JsonSchemaSerializerSession s = JsonSchemaSerializer.DEFAULT_SIMPLE.builder().addDescriptionsTo("boolean").build().createSession();
assertObjectEquals("{type:'array',items:{type:'array',items:{type:'boolean',description:'boolean'}}}", s.getSchema(boolean[][].class));
assertObjectEquals("{type:'array',items:{type:'array',items:{type:'boolean',description:'java.lang.Boolean'}}}", s.getSchema(Boolean[][].class));
}
@@ -960,7 +960,7 @@ public class JsonSchemaSerializerTest {
//====================================================================================================
@Test
public void addDescription_NUMBER() throws Exception {
- JsonSchemaSerializerSession s = JsonSchemaSerializer.DEFAULT_LAX.builder().addDescriptionsTo("number").build().createSession();
+ JsonSchemaSerializerSession s = JsonSchemaSerializer.DEFAULT_SIMPLE.builder().addDescriptionsTo("number").build().createSession();
assertObjectEquals("{type:'integer',format:'int16',description:'short'}", s.getSchema(short.class));
assertObjectEquals("{type:'integer',format:'int16',description:'java.lang.Short'}", s.getSchema(Short.class));
assertObjectEquals("{type:'integer',format:'int32',description:'int'}", s.getSchema(int.class));
@@ -975,7 +975,7 @@ public class JsonSchemaSerializerTest {
@Test
public void addDescription_NUMBER_2darray() throws Exception {
- JsonSchemaSerializerSession s = JsonSchemaSerializer.DEFAULT_LAX.builder().addDescriptionsTo("number").build().createSession();
+ JsonSchemaSerializerSession s = JsonSchemaSerializer.DEFAULT_SIMPLE.builder().addDescriptionsTo("number").build().createSession();
assertObjectEquals("{type:'array',items:{type:'array',items:{type:'integer',format:'int16',description:'short'}}}", s.getSchema(short[][].class));
assertObjectEquals("{type:'array',items:{type:'array',items:{type:'integer',format:'int16',description:'java.lang.Short'}}}", s.getSchema(Short[][].class));
assertObjectEquals("{type:'array',items:{type:'array',items:{type:'integer',format:'int32',description:'int'}}}", s.getSchema(int[][].class));
@@ -994,7 +994,7 @@ public class JsonSchemaSerializerTest {
@Test
public void addDescription_STRING() throws Exception {
- JsonSchemaSerializerSession s = JsonSchemaSerializer.DEFAULT_LAX.builder().addDescriptionsTo("string").build().createSession();
+ JsonSchemaSerializerSession s = JsonSchemaSerializer.DEFAULT_SIMPLE.builder().addDescriptionsTo("string").build().createSession();
assertObjectEquals("{type:'string',description:'java.lang.String'}", s.getSchema(String.class));
assertObjectEquals("{type:'string',description:'java.lang.StringBuilder'}", s.getSchema(StringBuilder.class));
assertObjectEquals("{type:'string',description:'java.lang.Character'}", s.getSchema(Character.class));
@@ -1003,7 +1003,7 @@ public class JsonSchemaSerializerTest {
@Test
public void addDescription_STRING_2darray() throws Exception {
- JsonSchemaSerializerSession s = JsonSchemaSerializer.DEFAULT_LAX.builder().addDescriptionsTo("string").build().createSession();
+ JsonSchemaSerializerSession s = JsonSchemaSerializer.DEFAULT_SIMPLE.builder().addDescriptionsTo("string").build().createSession();
assertObjectEquals("{type:'array',items:{type:'array',items:{type:'string',description:'java.lang.String'}}}", s.getSchema(String[][].class));
assertObjectEquals("{type:'array',items:{type:'array',items:{type:'string',description:'java.lang.StringBuilder'}}}", s.getSchema(StringBuilder[][].class));
assertObjectEquals("{type:'array',items:{type:'array',items:{type:'string',description:'java.lang.Character'}}}", s.getSchema(Character[][].class));
@@ -1016,13 +1016,13 @@ public class JsonSchemaSerializerTest {
@Test
public void addDescription_ENUM() throws Exception {
- JsonSchemaSerializerSession s = JsonSchemaSerializer.DEFAULT_LAX.builder().addDescriptionsTo("enum").build().createSession();
+ JsonSchemaSerializerSession s = JsonSchemaSerializer.DEFAULT_SIMPLE.builder().addDescriptionsTo("enum").build().createSession();
assertObjectEquals("{type:'string','enum':['one','two','three'],description:'org.apache.juneau.testutils.pojos.TestEnumToString'}", s.getSchema(TestEnumToString.class));
}
@Test
public void addDescription_ENUM_2darray() throws Exception {
- JsonSchemaSerializerSession s = JsonSchemaSerializer.DEFAULT_LAX.builder().addDescriptionsTo("enum").build().createSession();
+ JsonSchemaSerializerSession s = JsonSchemaSerializer.DEFAULT_SIMPLE.builder().addDescriptionsTo("enum").build().createSession();
assertObjectEquals("{type:'array',items:{type:'array',items:{type:'string','enum':['one','two','three'],description:'org.apache.juneau.testutils.pojos.TestEnumToString'}}}", s.getSchema(TestEnumToString[][].class));
}
@@ -1031,7 +1031,7 @@ public class JsonSchemaSerializerTest {
//====================================================================================================
@Test
public void addDescription_ANY() throws Exception {
- JsonSchemaSerializerSession s = JsonSchemaSerializer.DEFAULT_LAX.builder().addDescriptionsTo("any").build().createSession();
+ JsonSchemaSerializerSession s = JsonSchemaSerializer.DEFAULT_SIMPLE.builder().addDescriptionsTo("any").build().createSession();
assertObjectEquals("{type:'object',properties:{f1:{type:'string'}},description:'org.apache.juneau.json.JsonSchemaSerializerTest$SimpleBean'}", s.getSchema(SimpleBean.class));
assertObjectEquals("{type:'object',additionalProperties:{type:'object',properties:{f1:{type:'string'}}},description:'org.apache.juneau.json.JsonSchemaSerializerTest$BeanMap<java.lang.Integer,org.apache.juneau.json.JsonSchemaSerializerTest$SimpleBean>'}", s.getSchema(BeanMap.class));
assertObjectEquals("{type:'array',items:{type:'object',properties:{f1:{type:'string'}}},description:'org.apache.juneau.json.JsonSchemaSerializerTest$BeanList<org.apache.juneau.json.JsonSchemaSerializerTest$SimpleBean>'}", s.getSchema(BeanList.class));
@@ -1062,7 +1062,7 @@ public class JsonSchemaSerializerTest {
// If default schema contains 'type', it's considered complete.
@Test
public void defaultSchemas() throws Exception {
- JsonSchemaSerializerSession s = JsonSchemaSerializer.DEFAULT_LAX.builder()
+ JsonSchemaSerializerSession s = JsonSchemaSerializer.DEFAULT_SIMPLE.builder()
.defaultSchema(SimpleBean.class, new ObjectMap().append("type", "bar"))
.defaultSchema(BeanMap.class, new ObjectMap().append("type", "bar"))
.defaultSchema(BeanList.class, new ObjectMap().append("type", "bar"))
@@ -1111,7 +1111,7 @@ public class JsonSchemaSerializerTest {
// If default schema does not contain 'type', the value is augmented
@Test
public void defaultSchemasNoType() throws Exception {
- JsonSchemaSerializerSession s = JsonSchemaSerializer.DEFAULT_LAX.builder()
+ JsonSchemaSerializerSession s = JsonSchemaSerializer.DEFAULT_SIMPLE.builder()
.defaultSchema(SimpleBean.class, new ObjectMap().append("foo", "bar"))
.defaultSchema(BeanMap.class, new ObjectMap().append("foo", "bar"))
.defaultSchema(BeanList.class, new ObjectMap().append("foo", "bar"))
@@ -1163,7 +1163,7 @@ public class JsonSchemaSerializerTest {
@Test
public void allowNestedExamples_enabled() throws Exception {
- JsonSchemaSerializerSession s = JsonSchemaSerializer.DEFAULT_LAX.builder()
+ JsonSchemaSerializerSession s = JsonSchemaSerializer.DEFAULT_SIMPLE.builder()
.allowNestedExamples()
.example(BeanList.class, new BeanList())
.example(SimpleBean.class, new SimpleBean())
@@ -1175,7 +1175,7 @@ public class JsonSchemaSerializerTest {
@Test
public void allowNestedExamples_disabled() throws Exception {
- JsonSchemaSerializerSession s = JsonSchemaSerializer.DEFAULT_LAX.builder()
+ JsonSchemaSerializerSession s = JsonSchemaSerializer.DEFAULT_SIMPLE.builder()
.example(BeanList.class, new BeanList())
.example(SimpleBean.class, new SimpleBean())
.addExamplesTo("collection,bean")
@@ -1190,7 +1190,7 @@ public class JsonSchemaSerializerTest {
@Test
public void allowNestedDescriptions_enabled() throws Exception {
- JsonSchemaSerializerSession s = JsonSchemaSerializer.DEFAULT_LAX.builder()
+ JsonSchemaSerializerSession s = JsonSchemaSerializer.DEFAULT_SIMPLE.builder()
.allowNestedDescriptions()
.addDescriptionsTo("collection,bean")
.build().createSession();
@@ -1200,7 +1200,7 @@ public class JsonSchemaSerializerTest {
@Test
public void allowNestedDescriptions_disabled() throws Exception {
- JsonSchemaSerializerSession s = JsonSchemaSerializer.DEFAULT_LAX.builder()
+ JsonSchemaSerializerSession s = JsonSchemaSerializer.DEFAULT_SIMPLE.builder()
.addDescriptionsTo("collection,bean")
.build().createSession();
@@ -1213,7 +1213,7 @@ public class JsonSchemaSerializerTest {
@Test
public void swaps_int() throws Exception {
- JsonSchemaSerializerSession s = JsonSchemaSerializer.DEFAULT_LAX.builder()
+ JsonSchemaSerializerSession s = JsonSchemaSerializer.DEFAULT_SIMPLE.builder()
.pojoSwaps(IntSwap.class)
.build().createSession();
assertObjectEquals("{type:'integer',format:'int32'}", s.getSchema(SimpleBean.class));
@@ -1229,7 +1229,7 @@ public class JsonSchemaSerializerTest {
@Test
public void jsonSchema_onclass() throws Exception {
- JsonSchemaSerializerSession s = JsonSchemaSerializer.DEFAULT_LAX.builder().build().createSession();
+ JsonSchemaSerializerSession s = JsonSchemaSerializer.DEFAULT_SIMPLE.builder().build().createSession();
assertObjectEquals("{type:'foo',format:'bar',properties:{f1:{type:'integer',format:'int32'}},description:'baz','x-example':{f1:123}}", s.getSchema(A1.class));
}
@@ -1240,7 +1240,7 @@ public class JsonSchemaSerializerTest {
@Test
public void jsonSchema_onbeanfield() throws Exception {
- JsonSchemaSerializerSession s = JsonSchemaSerializer.DEFAULT_LAX.builder().build().createSession();
+ JsonSchemaSerializerSession s = JsonSchemaSerializer.DEFAULT_SIMPLE.builder().build().createSession();
assertObjectEquals("{type:'object',properties:{f1:{type:'foo',format:'bar',description:'baz','x-example':123}}}", s.getSchema(A2.class));
}
@@ -1251,7 +1251,7 @@ public class JsonSchemaSerializerTest {
@Test
public void jsonSchema_onbeangetter() throws Exception {
- JsonSchemaSerializerSession s = JsonSchemaSerializer.DEFAULT_LAX.builder().build().createSession();
+ JsonSchemaSerializerSession s = JsonSchemaSerializer.DEFAULT_SIMPLE.builder().build().createSession();
assertObjectEquals("{type:'object',properties:{f1:{type:'foo',format:'bar',description:'baz','x-example':123}}}", s.getSchema(A3.class));
}
@@ -1264,7 +1264,7 @@ public class JsonSchemaSerializerTest {
@Test
public void jsonSchema_onbeansetter() throws Exception {
- JsonSchemaSerializerSession s = JsonSchemaSerializer.DEFAULT_LAX.builder().build().createSession();
+ JsonSchemaSerializerSession s = JsonSchemaSerializer.DEFAULT_SIMPLE.builder().build().createSession();
assertObjectEquals("{type:'object',properties:{f1:{type:'foo',format:'bar',description:'baz','x-example':123}}}", s.getSchema(A4.class));
}
@@ -1283,7 +1283,7 @@ public class JsonSchemaSerializerTest {
@Test
public void jsonschema_onpojoswap() throws Exception {
- JsonSchemaSerializerSession s = JsonSchemaSerializer.DEFAULT_LAX.builder()
+ JsonSchemaSerializerSession s = JsonSchemaSerializer.DEFAULT_SIMPLE.builder()
.pojoSwaps(SwapWithAnnotation.class)
.build().createSession();
assertObjectEquals("{type:'foo',format:'bar',description:'baz','x-example':123}", s.getSchema(SimpleBean.class));
diff --git a/juneau-core/juneau-core-test/src/test/java/org/apache/juneau/json/JsonTest.java b/juneau-core/juneau-core-test/src/test/java/org/apache/juneau/json/JsonTest.java
index f5b30ad..c2347f1 100755
--- a/juneau-core/juneau-core-test/src/test/java/org/apache/juneau/json/JsonTest.java
+++ b/juneau-core/juneau-core-test/src/test/java/org/apache/juneau/json/JsonTest.java
@@ -162,7 +162,7 @@ public class JsonTest {
+ "\n },"
+ "\n I: 'j'"
+ "\n}";
- assertEquals(e, JsonSerializer.DEFAULT_LAX_READABLE.serialize(m));
+ assertEquals(e, SimpleJsonSerializer.DEFAULT_READABLE.serialize(m));
}
//====================================================================================================
@@ -182,7 +182,7 @@ public class JsonTest {
//====================================================================================================
@Test
public void testEscapingSingleQuotes() throws Exception {
- JsonSerializer s = JsonSerializer.DEFAULT_LAX;
+ JsonSerializer s = SimpleJsonSerializer.DEFAULT;
String r = s.serialize(new ObjectMap().append("f1", "x'x\"x"));
assertEquals("{f1:'x\\'x\"x'}", r);
JsonParser p = JsonParser.DEFAULT;
@@ -194,7 +194,7 @@ public class JsonTest {
//====================================================================================================
@Test
public void testWrapperAttrAnnotationOnBean() throws Exception {
- JsonSerializer s = JsonSerializer.DEFAULT_LAX;
+ JsonSerializer s = SimpleJsonSerializer.DEFAULT;
JsonParser p = JsonParser.DEFAULT;
String r;
@@ -229,7 +229,7 @@ public class JsonTest {
//====================================================================================================
@Test
public void testWrapperAttrAnnotationOnNonBean() throws Exception {
- JsonSerializer s = JsonSerializer.DEFAULT_LAX;
+ JsonSerializer s = SimpleJsonSerializer.DEFAULT;
JsonParser p = JsonParser.DEFAULT;
String r;
diff --git a/juneau-core/juneau-core-test/src/test/java/org/apache/juneau/serializer/UriResolutionTest.java b/juneau-core/juneau-core-test/src/test/java/org/apache/juneau/serializer/UriResolutionTest.java
index 7c53d99..b1c712b 100644
--- a/juneau-core/juneau-core-test/src/test/java/org/apache/juneau/serializer/UriResolutionTest.java
+++ b/juneau-core/juneau-core-test/src/test/java/org/apache/juneau/serializer/UriResolutionTest.java
@@ -581,7 +581,7 @@ public class UriResolutionTest {
TreeMap<String,String> m = p.parse(r, TreeMap.class, String.class, String.class);
- String r2 = JsonSerializer.DEFAULT_LAX.toString(m);
+ String r2 = SimpleJsonSerializer.DEFAULT.toString(m);
TestUtils.assertEquals(results.json, r2, "{0}/{1} parse failed", label, s.getClass().getSimpleName());
} catch (AssertionError e) {
diff --git a/juneau-core/juneau-core-test/src/test/java/org/apache/juneau/testutils/TestUtils.java b/juneau-core/juneau-core-test/src/test/java/org/apache/juneau/testutils/TestUtils.java
index 7681e66..e6d7611 100644
--- a/juneau-core/juneau-core-test/src/test/java/org/apache/juneau/testutils/TestUtils.java
+++ b/juneau-core/juneau-core-test/src/test/java/org/apache/juneau/testutils/TestUtils.java
@@ -368,14 +368,14 @@ public class TestUtils {
}
/**
- * Assert that the object equals the specified string after running it through JsonSerializer.DEFAULT_LAX.toString().
+ * Assert that the object equals the specified string after running it through SimpleJsonSerializer.DEFAULT_LAX.toString().
*/
public static final void assertObjectEquals(String s, Object o) {
assertObjectEquals(s, o, js2);
}
/**
- * Assert that the object equals the specified string after running it through JsonSerializer.DEFAULT_LAX.toString()
+ * Assert that the object equals the specified string after running it through SimpleJsonSerializer.DEFAULT_LAX.toString()
* with BEAN_sortProperties set to true.
*/
public static final void assertSortedObjectEquals(String s, Object o) {
diff --git a/juneau-core/juneau-core-test/src/test/java/org/apache/juneau/transforms/CalendarSwapTest.java b/juneau-core/juneau-core-test/src/test/java/org/apache/juneau/transforms/CalendarSwapTest.java
index a3dacbf..0745dbd 100755
--- a/juneau-core/juneau-core-test/src/test/java/org/apache/juneau/transforms/CalendarSwapTest.java
+++ b/juneau-core/juneau-core-test/src/test/java/org/apache/juneau/transforms/CalendarSwapTest.java
@@ -150,7 +150,7 @@ public class CalendarSwapTest {
//====================================================================================================
@Test
public void testBeanProperyFilterJson() throws Exception {
- WriterSerializer s = JsonSerializer.DEFAULT_LAX;
+ WriterSerializer s = SimpleJsonSerializer.DEFAULT;
ReaderParser p = JsonParser.DEFAULT;
Calendar c = testDate;
diff --git a/juneau-core/juneau-core-test/src/test/java/org/apache/juneau/utils/PojoRestTest.java b/juneau-core/juneau-core-test/src/test/java/org/apache/juneau/utils/PojoRestTest.java
index d7fd1c0..1b52cce 100755
--- a/juneau-core/juneau-core-test/src/test/java/org/apache/juneau/utils/PojoRestTest.java
+++ b/juneau-core/juneau-core-test/src/test/java/org/apache/juneau/utils/PojoRestTest.java
@@ -82,7 +82,7 @@ public class PojoRestTest {
Address a3 = (Address)model.get("/person1/addresses/1");
assertEquals("city B", a3.city);
- serializer = JsonSerializer.DEFAULT_LAX.builder().addBeanTypes().addRootType().build();
+ serializer = SimpleJsonSerializer.DEFAULT.builder().addBeanTypes().addRootType().build();
p = new Person("some name", 123,
new Address("street A", "city A", "state A", 12345, true),
new Address("street B", "city B", "state B", 12345, false)
@@ -834,8 +834,8 @@ public class PojoRestTest {
@Test
public void testGetPublicMethods() throws Exception {
PojoRest model = new PojoRest(new AddressBook().init());
- assertTrue(JsonSerializer.DEFAULT_LAX.toString(model.getPublicMethods("0")).contains("'toString'"));
- assertTrue(JsonSerializer.DEFAULT_LAX.toString(model.getPublicMethods("0/addresses/0/state")).contains("'toString'"));
+ assertTrue(SimpleJsonSerializer.DEFAULT.toString(model.getPublicMethods("0")).contains("'toString'"));
+ assertTrue(SimpleJsonSerializer.DEFAULT.toString(model.getPublicMethods("0/addresses/0/state")).contains("'toString'"));
assertNull(model.getPublicMethods("1"));
}
diff --git a/juneau-core/juneau-dto/src/main/java/org/apache/juneau/dto/atom/package.html b/juneau-core/juneau-dto/src/main/java/org/apache/juneau/dto/atom/package.html
index 911c5c8..0cdc956 100644
--- a/juneau-core/juneau-dto/src/main/java/org/apache/juneau/dto/atom/package.html
+++ b/juneau-core/juneau-dto/src/main/java/org/apache/juneau/dto/atom/package.html
@@ -317,7 +317,7 @@
<h5 class='figure'>ATOM/JSON example</h5>
<p class='bcode'>
<jc>// Get JSON serializer with readable output.</jc>
- JsonSerializer s = JsonSerializer.<jsf>DEFAULT_LAX_READABLE</jsf>;
+ JsonSerializer s = SimpleJsonSerializer.<jsf>DEFAULT_READABLE</jsf>;
<jc>// Serialize to ATOM/JSON</jc>
String atomJson = s.serialize(feed);
diff --git a/juneau-core/juneau-dto/src/main/java/org/apache/juneau/dto/swagger/Items.java b/juneau-core/juneau-dto/src/main/java/org/apache/juneau/dto/swagger/Items.java
index ba9a9cd..74b94a8 100644
--- a/juneau-core/juneau-dto/src/main/java/org/apache/juneau/dto/swagger/Items.java
+++ b/juneau-core/juneau-dto/src/main/java/org/apache/juneau/dto/swagger/Items.java
@@ -168,7 +168,7 @@ public class Items extends SwaggerElement {
if (isStrict() && ! contains(value, VALID_TYPES))
throw new RuntimeException(
"Invalid value passed in to setType(String). Value='"+value+"', valid values="
- + JsonSerializer.DEFAULT_LAX.toString(VALID_TYPES));
+ + SimpleJsonSerializer.DEFAULT.toString(VALID_TYPES));
type = value;
return this;
}
diff --git a/juneau-rest/juneau-rest-server/src/test/java/org/apache/juneau/rest/util/UrlPathPatternTest.java b/juneau-core/juneau-marshall-rdf/src/main/java/org/apache/juneau/jena/N3Parser.java
similarity index 51%
copy from juneau-rest/juneau-rest-server/src/test/java/org/apache/juneau/rest/util/UrlPathPatternTest.java
copy to juneau-core/juneau-marshall-rdf/src/main/java/org/apache/juneau/jena/N3Parser.java
index 8f7dcde..e9a8336 100644
--- a/juneau-rest/juneau-rest-server/src/test/java/org/apache/juneau/rest/util/UrlPathPatternTest.java
+++ b/juneau-core/juneau-marshall-rdf/src/main/java/org/apache/juneau/jena/N3Parser.java
@@ -1,45 +1,61 @@
-// ***************************************************************************************************************************
-// * Licensed to the Apache Software Foundation (ASF) under one or more contributor license agreements. See the NOTICE file *
-// * distributed with this work for additional information regarding copyright ownership. The ASF licenses this file *
-// * to you under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance *
-// * with the License. You may obtain a copy of the License at *
-// * *
-// * http://www.apache.org/licenses/LICENSE-2.0 *
-// * *
-// * Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an *
-// * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the *
-// * specific language governing permissions and limitations under the License. *
-// ***************************************************************************************************************************
-package org.apache.juneau.rest.util;
-
-import static org.junit.Assert.*;
-
-import java.util.*;
-
-import org.apache.juneau.json.*;
-import org.junit.*;
-import org.junit.runners.*;
-
-/**
- * Validates the functionality of the UrlPathPattern class.
- */
-@SuppressWarnings({"javadoc"})
-@FixMethodOrder(MethodSorters.NAME_ASCENDING)
-public class UrlPathPatternTest {
- @Test
- public void testComparison() throws Exception {
- List<UrlPathPattern> l = new LinkedList<>();
-
- l.add(new UrlPathPattern("/foo"));
- l.add(new UrlPathPattern("/foo/*"));
- l.add(new UrlPathPattern("/foo/bar"));
- l.add(new UrlPathPattern("/foo/bar/*"));
- l.add(new UrlPathPattern("/foo/{id}"));
- l.add(new UrlPathPattern("/foo/{id}/*"));
- l.add(new UrlPathPattern("/foo/{id}/bar"));
- l.add(new UrlPathPattern("/foo/{id}/bar/*"));
-
- Collections.sort(l);
- assertEquals("[{patternString:'/foo/bar',vars:[]},{patternString:'/foo/bar/*',vars:[]},{patternString:'/foo/{id}/bar',vars:['id']},{patternString:'/foo/{id}/bar/*',vars:['id']},{patternString:'/foo/{id}',vars:['id']},{patternString:'/foo/{id}/*',vars:['id']},{patternString:'/foo',vars:[]},{patternString:'/foo/*',vars:[]}]", JsonSerializer.DEFAULT_LAX.builder().sortProperties().build().serialize(l));
- }
-}
+// ***************************************************************************************************************************
+// * Licensed to the Apache Software Foundation (ASF) under one or more contributor license agreements. See the NOTICE file *
+// * distributed with this work for additional information regarding copyright ownership. The ASF licenses this file *
+// * to you under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance *
+// * with the License. You may obtain a copy of the License at *
+// * *
+// * http://www.apache.org/licenses/LICENSE-2.0 *
+// * *
+// * Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an *
+// * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the *
+// * specific language governing permissions and limitations under the License. *
+// ***************************************************************************************************************************
+package org.apache.juneau.jena;
+
+import static org.apache.juneau.jena.Constants.*;
+
+import org.apache.juneau.*;
+
+/**
+ * TODO
+ */
+public class N3Parser extends RdfParser {
+
+ //-------------------------------------------------------------------------------------------------------------------
+ // Predefined instances
+ //-------------------------------------------------------------------------------------------------------------------
+
+ /** Default N3 parser, all default settings.*/
+ public static final N3Parser DEFAULT = new N3Parser(PropertyStore.DEFAULT);
+
+ //-------------------------------------------------------------------------------------------------------------------
+ // Instance
+ //-------------------------------------------------------------------------------------------------------------------
+
+ /**
+ * Instantiates a new clean-slate {@link RdfParserBuilder} object.
+ *
+ * <p>
+ * Note that this method creates a builder initialized to all default settings, whereas {@link #builder()} copies
+ * the settings of the object called on.
+ *
+ * @return A new {@link RdfParserBuilder} object.
+ */
+ public static RdfParserBuilder create() {
+ return new RdfParserBuilder().n3();
+ }
+
+ /**
+ * Constructor.
+ *
+ * @param ps The property store containing all the settings for this object.
+ */
+ public N3Parser(PropertyStore ps) {
+ super(
+ ps.builder()
+ .set(RDF_language, LANG_N3)
+ .build(),
+ "text/n3"
+ );
+ }
+}
\ No newline at end of file
diff --git a/juneau-rest/juneau-rest-server/src/test/java/org/apache/juneau/rest/util/UrlPathPatternTest.java b/juneau-core/juneau-marshall-rdf/src/main/java/org/apache/juneau/jena/N3Serializer.java
similarity index 51%
copy from juneau-rest/juneau-rest-server/src/test/java/org/apache/juneau/rest/util/UrlPathPatternTest.java
copy to juneau-core/juneau-marshall-rdf/src/main/java/org/apache/juneau/jena/N3Serializer.java
index 8f7dcde..9ec9743 100644
--- a/juneau-rest/juneau-rest-server/src/test/java/org/apache/juneau/rest/util/UrlPathPatternTest.java
+++ b/juneau-core/juneau-marshall-rdf/src/main/java/org/apache/juneau/jena/N3Serializer.java
@@ -1,45 +1,61 @@
-// ***************************************************************************************************************************
-// * Licensed to the Apache Software Foundation (ASF) under one or more contributor license agreements. See the NOTICE file *
-// * distributed with this work for additional information regarding copyright ownership. The ASF licenses this file *
-// * to you under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance *
-// * with the License. You may obtain a copy of the License at *
-// * *
-// * http://www.apache.org/licenses/LICENSE-2.0 *
-// * *
-// * Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an *
-// * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the *
-// * specific language governing permissions and limitations under the License. *
-// ***************************************************************************************************************************
-package org.apache.juneau.rest.util;
-
-import static org.junit.Assert.*;
-
-import java.util.*;
-
-import org.apache.juneau.json.*;
-import org.junit.*;
-import org.junit.runners.*;
-
-/**
- * Validates the functionality of the UrlPathPattern class.
- */
-@SuppressWarnings({"javadoc"})
-@FixMethodOrder(MethodSorters.NAME_ASCENDING)
-public class UrlPathPatternTest {
- @Test
- public void testComparison() throws Exception {
- List<UrlPathPattern> l = new LinkedList<>();
-
- l.add(new UrlPathPattern("/foo"));
- l.add(new UrlPathPattern("/foo/*"));
- l.add(new UrlPathPattern("/foo/bar"));
- l.add(new UrlPathPattern("/foo/bar/*"));
- l.add(new UrlPathPattern("/foo/{id}"));
- l.add(new UrlPathPattern("/foo/{id}/*"));
- l.add(new UrlPathPattern("/foo/{id}/bar"));
- l.add(new UrlPathPattern("/foo/{id}/bar/*"));
-
- Collections.sort(l);
- assertEquals("[{patternString:'/foo/bar',vars:[]},{patternString:'/foo/bar/*',vars:[]},{patternString:'/foo/{id}/bar',vars:['id']},{patternString:'/foo/{id}/bar/*',vars:['id']},{patternString:'/foo/{id}',vars:['id']},{patternString:'/foo/{id}/*',vars:['id']},{patternString:'/foo',vars:[]},{patternString:'/foo/*',vars:[]}]", JsonSerializer.DEFAULT_LAX.builder().sortProperties().build().serialize(l));
- }
-}
+// ***************************************************************************************************************************
+// * Licensed to the Apache Software Foundation (ASF) under one or more contributor license agreements. See the NOTICE file *
+// * distributed with this work for additional information regarding copyright ownership. The ASF licenses this file *
+// * to you under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance *
+// * with the License. You may obtain a copy of the License at *
+// * *
+// * http://www.apache.org/licenses/LICENSE-2.0 *
+// * *
+// * Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an *
+// * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the *
+// * specific language governing permissions and limitations under the License. *
+// ***************************************************************************************************************************
+package org.apache.juneau.jena;
+
+import static org.apache.juneau.jena.Constants.*;
+
+import org.apache.juneau.*;
+
+/**
+ * TODO
+ */
+public class N3Serializer extends RdfSerializer {
+
+ //-------------------------------------------------------------------------------------------------------------------
+ // Predefined instances
+ //-------------------------------------------------------------------------------------------------------------------
+
+ /** Default N3 serializer, all default settings.*/
+ public static final N3Serializer DEFAULT = new N3Serializer(PropertyStore.DEFAULT);
+
+ //-------------------------------------------------------------------------------------------------------------------
+ // Instance
+ //-------------------------------------------------------------------------------------------------------------------
+
+ /**
+ * Instantiates a new clean-slate {@link RdfSerializerBuilder} object.
+ *
+ * <p>
+ * Note that this method creates a builder initialized to all default settings, whereas {@link #builder()} copies
+ * the settings of the object called on.
+ *
+ * @return A new {@link RdfSerializerBuilder} object.
+ */
+ public static RdfSerializerBuilder create() {
+ return new RdfSerializerBuilder().n3();
+ }
+
+ /**
+ * Constructor.
+ *
+ * @param ps The property store containing all the settings for this object.
+ */
+ public N3Serializer(PropertyStore ps) {
+ super(
+ ps.builder()
+ .set(RDF_language, LANG_N3)
+ .build(),
+ "text/n3", null
+ );
+ }
+}
\ No newline at end of file
diff --git a/juneau-rest/juneau-rest-server/src/test/java/org/apache/juneau/rest/util/UrlPathPatternTest.java b/juneau-core/juneau-marshall-rdf/src/main/java/org/apache/juneau/jena/NTripleParser.java
similarity index 51%
copy from juneau-rest/juneau-rest-server/src/test/java/org/apache/juneau/rest/util/UrlPathPatternTest.java
copy to juneau-core/juneau-marshall-rdf/src/main/java/org/apache/juneau/jena/NTripleParser.java
index 8f7dcde..6bd0db1 100644
--- a/juneau-rest/juneau-rest-server/src/test/java/org/apache/juneau/rest/util/UrlPathPatternTest.java
+++ b/juneau-core/juneau-marshall-rdf/src/main/java/org/apache/juneau/jena/NTripleParser.java
@@ -1,45 +1,61 @@
-// ***************************************************************************************************************************
-// * Licensed to the Apache Software Foundation (ASF) under one or more contributor license agreements. See the NOTICE file *
-// * distributed with this work for additional information regarding copyright ownership. The ASF licenses this file *
-// * to you under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance *
-// * with the License. You may obtain a copy of the License at *
-// * *
-// * http://www.apache.org/licenses/LICENSE-2.0 *
-// * *
-// * Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an *
-// * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the *
-// * specific language governing permissions and limitations under the License. *
-// ***************************************************************************************************************************
-package org.apache.juneau.rest.util;
-
-import static org.junit.Assert.*;
-
-import java.util.*;
-
-import org.apache.juneau.json.*;
-import org.junit.*;
-import org.junit.runners.*;
-
-/**
- * Validates the functionality of the UrlPathPattern class.
- */
-@SuppressWarnings({"javadoc"})
-@FixMethodOrder(MethodSorters.NAME_ASCENDING)
-public class UrlPathPatternTest {
- @Test
- public void testComparison() throws Exception {
- List<UrlPathPattern> l = new LinkedList<>();
-
- l.add(new UrlPathPattern("/foo"));
- l.add(new UrlPathPattern("/foo/*"));
- l.add(new UrlPathPattern("/foo/bar"));
- l.add(new UrlPathPattern("/foo/bar/*"));
- l.add(new UrlPathPattern("/foo/{id}"));
- l.add(new UrlPathPattern("/foo/{id}/*"));
- l.add(new UrlPathPattern("/foo/{id}/bar"));
- l.add(new UrlPathPattern("/foo/{id}/bar/*"));
-
- Collections.sort(l);
- assertEquals("[{patternString:'/foo/bar',vars:[]},{patternString:'/foo/bar/*',vars:[]},{patternString:'/foo/{id}/bar',vars:['id']},{patternString:'/foo/{id}/bar/*',vars:['id']},{patternString:'/foo/{id}',vars:['id']},{patternString:'/foo/{id}/*',vars:['id']},{patternString:'/foo',vars:[]},{patternString:'/foo/*',vars:[]}]", JsonSerializer.DEFAULT_LAX.builder().sortProperties().build().serialize(l));
- }
-}
+// ***************************************************************************************************************************
+// * Licensed to the Apache Software Foundation (ASF) under one or more contributor license agreements. See the NOTICE file *
+// * distributed with this work for additional information regarding copyright ownership. The ASF licenses this file *
+// * to you under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance *
+// * with the License. You may obtain a copy of the License at *
+// * *
+// * http://www.apache.org/licenses/LICENSE-2.0 *
+// * *
+// * Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an *
+// * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the *
+// * specific language governing permissions and limitations under the License. *
+// ***************************************************************************************************************************
+package org.apache.juneau.jena;
+
+import static org.apache.juneau.jena.Constants.*;
+
+import org.apache.juneau.*;
+
+/**
+ * TODO
+ */
+public class NTripleParser extends RdfParser {
+
+ //-------------------------------------------------------------------------------------------------------------------
+ // Predefined instances
+ //-------------------------------------------------------------------------------------------------------------------
+
+ /** Default N-Triple parser, all default settings.*/
+ public static final NTripleParser DEFAULT = new NTripleParser(PropertyStore.DEFAULT);
+
+ //-------------------------------------------------------------------------------------------------------------------
+ // Instance
+ //-------------------------------------------------------------------------------------------------------------------
+
+ /**
+ * Instantiates a new clean-slate {@link RdfParserBuilder} object.
+ *
+ * <p>
+ * Note that this method creates a builder initialized to all default settings, whereas {@link #builder()} copies
+ * the settings of the object called on.
+ *
+ * @return A new {@link RdfParserBuilder} object.
+ */
+ public static RdfParserBuilder create() {
+ return new RdfParserBuilder().ntriple();
+ }
+
+ /**
+ * Constructor.
+ *
+ * @param ps The property store containing all the settings for this object.
+ */
+ public NTripleParser(PropertyStore ps) {
+ super(
+ ps.builder()
+ .set(RDF_language, LANG_NTRIPLE)
+ .build(),
+ "text/n-triple"
+ );
+ }
+}
\ No newline at end of file
diff --git a/juneau-rest/juneau-rest-server/src/test/java/org/apache/juneau/rest/util/UrlPathPatternTest.java b/juneau-core/juneau-marshall-rdf/src/main/java/org/apache/juneau/jena/NTripleSerializer.java
similarity index 50%
copy from juneau-rest/juneau-rest-server/src/test/java/org/apache/juneau/rest/util/UrlPathPatternTest.java
copy to juneau-core/juneau-marshall-rdf/src/main/java/org/apache/juneau/jena/NTripleSerializer.java
index 8f7dcde..7d2a89e 100644
--- a/juneau-rest/juneau-rest-server/src/test/java/org/apache/juneau/rest/util/UrlPathPatternTest.java
+++ b/juneau-core/juneau-marshall-rdf/src/main/java/org/apache/juneau/jena/NTripleSerializer.java
@@ -1,45 +1,61 @@
-// ***************************************************************************************************************************
-// * Licensed to the Apache Software Foundation (ASF) under one or more contributor license agreements. See the NOTICE file *
-// * distributed with this work for additional information regarding copyright ownership. The ASF licenses this file *
-// * to you under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance *
-// * with the License. You may obtain a copy of the License at *
-// * *
-// * http://www.apache.org/licenses/LICENSE-2.0 *
-// * *
-// * Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an *
-// * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the *
-// * specific language governing permissions and limitations under the License. *
-// ***************************************************************************************************************************
-package org.apache.juneau.rest.util;
-
-import static org.junit.Assert.*;
-
-import java.util.*;
-
-import org.apache.juneau.json.*;
-import org.junit.*;
-import org.junit.runners.*;
-
-/**
- * Validates the functionality of the UrlPathPattern class.
- */
-@SuppressWarnings({"javadoc"})
-@FixMethodOrder(MethodSorters.NAME_ASCENDING)
-public class UrlPathPatternTest {
- @Test
- public void testComparison() throws Exception {
- List<UrlPathPattern> l = new LinkedList<>();
-
- l.add(new UrlPathPattern("/foo"));
- l.add(new UrlPathPattern("/foo/*"));
- l.add(new UrlPathPattern("/foo/bar"));
- l.add(new UrlPathPattern("/foo/bar/*"));
- l.add(new UrlPathPattern("/foo/{id}"));
- l.add(new UrlPathPattern("/foo/{id}/*"));
- l.add(new UrlPathPattern("/foo/{id}/bar"));
- l.add(new UrlPathPattern("/foo/{id}/bar/*"));
-
- Collections.sort(l);
- assertEquals("[{patternString:'/foo/bar',vars:[]},{patternString:'/foo/bar/*',vars:[]},{patternString:'/foo/{id}/bar',vars:['id']},{patternString:'/foo/{id}/bar/*',vars:['id']},{patternString:'/foo/{id}',vars:['id']},{patternString:'/foo/{id}/*',vars:['id']},{patternString:'/foo',vars:[]},{patternString:'/foo/*',vars:[]}]", JsonSerializer.DEFAULT_LAX.builder().sortProperties().build().serialize(l));
- }
-}
+// ***************************************************************************************************************************
+// * Licensed to the Apache Software Foundation (ASF) under one or more contributor license agreements. See the NOTICE file *
+// * distributed with this work for additional information regarding copyright ownership. The ASF licenses this file *
+// * to you under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance *
+// * with the License. You may obtain a copy of the License at *
+// * *
+// * http://www.apache.org/licenses/LICENSE-2.0 *
+// * *
+// * Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an *
+// * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the *
+// * specific language governing permissions and limitations under the License. *
+// ***************************************************************************************************************************
+package org.apache.juneau.jena;
+
+import static org.apache.juneau.jena.Constants.*;
+
+import org.apache.juneau.*;
+
+/**
+ * TODO
+ */
+public class NTripleSerializer extends RdfSerializer {
+
+ //-------------------------------------------------------------------------------------------------------------------
+ // Predefined instances
+ //-------------------------------------------------------------------------------------------------------------------
+
+ /** Default N-Triple serializer, all default settings.*/
+ public static final NTripleSerializer DEFAULT = new NTripleSerializer(PropertyStore.DEFAULT);
+
+ //-------------------------------------------------------------------------------------------------------------------
+ // Instance
+ //-------------------------------------------------------------------------------------------------------------------
+
+ /**
+ * Instantiates a new clean-slate {@link RdfSerializerBuilder} object.
+ *
+ * <p>
+ * Note that this method creates a builder initialized to all default settings, whereas {@link #builder()} copies
+ * the settings of the object called on.
+ *
+ * @return A new {@link RdfSerializerBuilder} object.
+ */
+ public static RdfSerializerBuilder create() {
+ return new RdfSerializerBuilder().ntriple();
+ }
+
+ /**
+ * Constructor.
+ *
+ * @param ps The property store containing all the settings for this object.
+ */
+ public NTripleSerializer(PropertyStore ps) {
+ super(
+ ps.builder()
+ .set(RDF_language, LANG_NTRIPLE)
+ .build(),
+ "text/n-triple", null
+ );
+ }
+}
\ No newline at end of file
diff --git a/juneau-core/juneau-marshall-rdf/src/main/java/org/apache/juneau/jena/RdfParser.java b/juneau-core/juneau-marshall-rdf/src/main/java/org/apache/juneau/jena/RdfParser.java
index 3a193d9..e7a3c3e 100644
--- a/juneau-core/juneau-marshall-rdf/src/main/java/org/apache/juneau/jena/RdfParser.java
+++ b/juneau-core/juneau-marshall-rdf/src/main/java/org/apache/juneau/jena/RdfParser.java
@@ -12,8 +12,6 @@
// ***************************************************************************************************************************
package org.apache.juneau.jena;
-import static org.apache.juneau.jena.Constants.*;
-
import java.util.*;
import org.apache.juneau.*;
@@ -28,13 +26,13 @@ import org.apache.juneau.xml.*;
* The following direct subclasses are provided for language-specific parsers:
* <ul class='spaced-list'>
* <li>
- * {@link RdfParser.Xml} - RDF/XML and RDF/XML-ABBREV.
+ * {@link RdfXmlParser} - RDF/XML and RDF/XML-ABBREV.
* <li>
- * {@link RdfParser.NTriple} - N-TRIPLE.
+ * {@link NTripleParser} - N-TRIPLE.
* <li>
- * {@link RdfParser.Turtle} - TURTLE.
+ * {@link TurtleParser} - TURTLE.
* <li>
- * {@link RdfParser.N3} - N3.
+ * {@link N3Parser} - N3.
* </ul>
*
* <h5 class='section'>See Also:</h5>
@@ -93,100 +91,6 @@ public class RdfParser extends ReaderParser implements RdfCommon {
*/
public static final String RDF_trimWhitespace = PREFIX + "trimWhitespace.b";
-
- //-------------------------------------------------------------------------------------------------------------------
- // Predefined instances
- //-------------------------------------------------------------------------------------------------------------------
-
- /** Default XML parser, all default settings.*/
- public static final RdfParser DEFAULT_XML = new Xml(PropertyStore.DEFAULT);
-
- /** Default Turtle parser, all default settings.*/
- public static final RdfParser DEFAULT_TURTLE = new Turtle(PropertyStore.DEFAULT);
-
- /** Default N-Triple parser, all default settings.*/
- public static final RdfParser DEFAULT_NTRIPLE = new NTriple(PropertyStore.DEFAULT);
-
- /** Default N3 parser, all default settings.*/
- public static final RdfParser DEFAULT_N3 = new N3(PropertyStore.DEFAULT);
-
-
- //-------------------------------------------------------------------------------------------------------------------
- // Predefined subclasses
- //-------------------------------------------------------------------------------------------------------------------
-
- /** Consumes RDF/XML input */
- public static class Xml extends RdfParser {
-
- /**
- * Constructor.
- *
- * @param ps The property store containing all the settings for this object.
- */
- public Xml(PropertyStore ps) {
- super(
- ps.builder()
- .set(RDF_language, LANG_RDF_XML)
- .build(),
- "text/xml+rdf"
- );
- }
- }
-
- /** Consumes N-Triple input */
- public static class NTriple extends RdfParser {
-
- /**
- * Constructor.
- *
- * @param ps The property store containing all the settings for this object.
- */
- public NTriple(PropertyStore ps) {
- super(
- ps.builder()
- .set(RDF_language, LANG_NTRIPLE)
- .build(),
- "text/n-triple"
- );
- }
- }
-
- /** Consumes Turtle input */
- public static class Turtle extends RdfParser {
-
- /**
- * Constructor.
- *
- * @param ps The property store containing all the settings for this object.
- */
- public Turtle(PropertyStore ps) {
- super(
- ps.builder()
- .set(RDF_language, LANG_TURTLE)
- .build(),
- "text/turtle"
- );
- }
- }
-
- /** Consumes N3 input */
- public static class N3 extends RdfParser {
-
- /**
- * Constructor.
- *
- * @param ps The property store containing all the settings for this object.
- */
- public N3(PropertyStore ps) {
- super(
- ps.builder()
- .set(RDF_language, LANG_N3)
- .build(),
- "text/n3"
- );
- }
- }
-
//-------------------------------------------------------------------------------------------------------------------
// Instance
//-------------------------------------------------------------------------------------------------------------------
diff --git a/juneau-core/juneau-marshall-rdf/src/main/java/org/apache/juneau/jena/RdfSerializer.java b/juneau-core/juneau-marshall-rdf/src/main/java/org/apache/juneau/jena/RdfSerializer.java
index fca3b75..4c002fd 100644
--- a/juneau-core/juneau-marshall-rdf/src/main/java/org/apache/juneau/jena/RdfSerializer.java
+++ b/juneau-core/juneau-marshall-rdf/src/main/java/org/apache/juneau/jena/RdfSerializer.java
@@ -13,7 +13,6 @@
package org.apache.juneau.jena;
import static org.apache.juneau.internal.CollectionUtils.*;
-import static org.apache.juneau.jena.Constants.*;
import java.util.*;
@@ -30,11 +29,11 @@ import org.apache.juneau.xml.annotation.*;
*
* The following direct subclasses are provided for language-specific serializers:
* <ul>
- * <li>{@link RdfSerializer.Xml} - RDF/XML.
- * <li>{@link RdfSerializer.XmlAbbrev} - RDF/XML-ABBREV.
- * <li>{@link RdfSerializer.NTriple} - N-TRIPLE.
- * <li>{@link RdfSerializer.Turtle} - TURTLE.
- * <li>{@link RdfSerializer.N3} - N3.
+ * <li>{@link RdfXmlSerializer} - RDF/XML.
+ * <li>{@link RdfXmlAbbrevSerializer} - RDF/XML-ABBREV.
+ * <li>{@link NTripleSerializer} - N-TRIPLE.
+ * <li>{@link TurtleSerializer} - TURTLE.
+ * <li>{@link N3Serializer} - N3.
* </ul>
*
* <h5 class='section'>See Also:</h5>
@@ -176,122 +175,6 @@ public class RdfSerializer extends WriterSerializer implements RdfCommon {
*/
public static final String RDF_namespaces = PREFIX + "namespaces.ls";
-
- //-------------------------------------------------------------------------------------------------------------------
- // Predefined instances
- //-------------------------------------------------------------------------------------------------------------------
-
- /** Default RDF/XML serializer, all default settings.*/
- public static final RdfSerializer DEFAULT_XML = new Xml(PropertyStore.DEFAULT);
-
- /** Default Abbreviated RDF/XML serializer, all default settings.*/
- public static final RdfSerializer DEFAULT_XMLABBREV = new XmlAbbrev(PropertyStore.DEFAULT);
-
- /** Default Turtle serializer, all default settings.*/
- public static final RdfSerializer DEFAULT_TURTLE = new Turtle(PropertyStore.DEFAULT);
-
- /** Default N-Triple serializer, all default settings.*/
- public static final RdfSerializer DEFAULT_NTRIPLE = new NTriple(PropertyStore.DEFAULT);
-
- /** Default N3 serializer, all default settings.*/
- public static final RdfSerializer DEFAULT_N3 = new N3(PropertyStore.DEFAULT);
-
-
- //-------------------------------------------------------------------------------------------------------------------
- // Predefined subclasses
- //-------------------------------------------------------------------------------------------------------------------
-
- /** Produces RDF/XML output */
- public static class Xml extends RdfSerializer {
-
- /**
- * Constructor.
- *
- * @param ps The property store containing all the settings for this object.
- */
- public Xml(PropertyStore ps) {
- super(
- ps.builder()
- .set(RDF_language, LANG_RDF_XML)
- .build(),
- "text/xml+rdf", "text/xml+rdf,text/xml+rdf+abbrev;q=0.9"
- );
- }
- }
-
- /** Produces Abbreviated RDF/XML output */
- public static class XmlAbbrev extends RdfSerializer {
-
- /**
- * Constructor.
- *
- * @param ps The property store containing all the settings for this object.
- */
- public XmlAbbrev(PropertyStore ps) {
- super(
- ps.builder()
- .set(RDF_language, LANG_RDF_XML_ABBREV)
- .build(),
- "text/xml+rdf", "text/xml+rdf+abbrev,text/xml+rdf;q=0.9"
- );
- }
- }
-
- /** Produces N-Triple output */
- public static class NTriple extends RdfSerializer {
-
- /**
- * Constructor.
- *
- * @param ps The property store containing all the settings for this object.
- */
- public NTriple(PropertyStore ps) {
- super(
- ps.builder()
- .set(RDF_language, LANG_NTRIPLE)
- .build(),
- "text/n-triple", null
- );
- }
- }
-
- /** Produces Turtle output */
- public static class Turtle extends RdfSerializer {
-
- /**
- * Constructor.
- *
- * @param ps The property store containing all the settings for this object.
- */
- public Turtle(PropertyStore ps) {
- super(
- ps.builder()
- .set(RDF_language, LANG_TURTLE)
- .build(),
- "text/turtle", null
- );
- }
- }
-
- /** Produces N3 output */
- public static class N3 extends RdfSerializer {
-
- /**
- * Constructor.
- *
- * @param ps The property store containing all the settings for this object.
- */
- public N3(PropertyStore ps) {
- super(
- ps.builder()
- .set(RDF_language, LANG_N3)
- .build(),
- "text/n3", null
- );
- }
- }
-
-
//-------------------------------------------------------------------------------------------------------------------
// Instance
//-------------------------------------------------------------------------------------------------------------------
diff --git a/juneau-core/juneau-marshall-rdf/src/main/java/org/apache/juneau/jena/RdfXmlAbbrevSerializer.java b/juneau-core/juneau-marshall-rdf/src/main/java/org/apache/juneau/jena/RdfXmlAbbrevSerializer.java
new file mode 100644
index 0000000..07b6681
--- /dev/null
+++ b/juneau-core/juneau-marshall-rdf/src/main/java/org/apache/juneau/jena/RdfXmlAbbrevSerializer.java
@@ -0,0 +1,61 @@
+// ***************************************************************************************************************************
+// * Licensed to the Apache Software Foundation (ASF) under one or more contributor license agreements. See the NOTICE file *
+// * distributed with this work for additional information regarding copyright ownership. The ASF licenses this file *
+// * to you under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance *
+// * with the License. You may obtain a copy of the License at *
+// * *
+// * http://www.apache.org/licenses/LICENSE-2.0 *
+// * *
+// * Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an *
+// * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the *
+// * specific language governing permissions and limitations under the License. *
+// ***************************************************************************************************************************
+package org.apache.juneau.jena;
+
+import static org.apache.juneau.jena.Constants.*;
+
+import org.apache.juneau.*;
+
+/**
+ * TODO
+ */
+public class RdfXmlAbbrevSerializer extends RdfSerializer {
+
+ //-------------------------------------------------------------------------------------------------------------------
+ // Predefined instances
+ //-------------------------------------------------------------------------------------------------------------------
+
+ /** Default RDF/XML serializer, all default settings.*/
+ public static final RdfXmlAbbrevSerializer DEFAULT = new RdfXmlAbbrevSerializer(PropertyStore.DEFAULT);
+
+ //-------------------------------------------------------------------------------------------------------------------
+ // Instance
+ //-------------------------------------------------------------------------------------------------------------------
+
+ /**
+ * Instantiates a new clean-slate {@link RdfSerializerBuilder} object.
+ *
+ * <p>
+ * Note that this method creates a builder initialized to all default settings, whereas {@link #builder()} copies
+ * the settings of the object called on.
+ *
+ * @return A new {@link RdfSerializerBuilder} object.
+ */
+ public static RdfSerializerBuilder create() {
+ return new RdfSerializerBuilder().xmlabbrev();
+ }
+
+ /**
+ * Constructor.
+ *
+ * @param ps The property store containing all the settings for this object.
+ */
+ public RdfXmlAbbrevSerializer(PropertyStore ps) {
+ super(
+ ps.builder()
+ .set(RDF_language, LANG_RDF_XML_ABBREV)
+ .build(),
+ "text/xml+rdf", "text/xml+rdf+abbrev,text/xml+rdf;q=0.9"
+ );
+ }
+}
\ No newline at end of file
diff --git a/juneau-rest/juneau-rest-server/src/test/java/org/apache/juneau/rest/util/UrlPathPatternTest.java b/juneau-core/juneau-marshall-rdf/src/main/java/org/apache/juneau/jena/RdfXmlParser.java
similarity index 51%
copy from juneau-rest/juneau-rest-server/src/test/java/org/apache/juneau/rest/util/UrlPathPatternTest.java
copy to juneau-core/juneau-marshall-rdf/src/main/java/org/apache/juneau/jena/RdfXmlParser.java
index 8f7dcde..714bb4a 100644
--- a/juneau-rest/juneau-rest-server/src/test/java/org/apache/juneau/rest/util/UrlPathPatternTest.java
+++ b/juneau-core/juneau-marshall-rdf/src/main/java/org/apache/juneau/jena/RdfXmlParser.java
@@ -1,45 +1,61 @@
-// ***************************************************************************************************************************
-// * Licensed to the Apache Software Foundation (ASF) under one or more contributor license agreements. See the NOTICE file *
-// * distributed with this work for additional information regarding copyright ownership. The ASF licenses this file *
-// * to you under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance *
-// * with the License. You may obtain a copy of the License at *
-// * *
-// * http://www.apache.org/licenses/LICENSE-2.0 *
-// * *
-// * Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an *
-// * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the *
-// * specific language governing permissions and limitations under the License. *
-// ***************************************************************************************************************************
-package org.apache.juneau.rest.util;
-
-import static org.junit.Assert.*;
-
-import java.util.*;
-
-import org.apache.juneau.json.*;
-import org.junit.*;
-import org.junit.runners.*;
-
-/**
- * Validates the functionality of the UrlPathPattern class.
- */
-@SuppressWarnings({"javadoc"})
-@FixMethodOrder(MethodSorters.NAME_ASCENDING)
-public class UrlPathPatternTest {
- @Test
- public void testComparison() throws Exception {
- List<UrlPathPattern> l = new LinkedList<>();
-
- l.add(new UrlPathPattern("/foo"));
- l.add(new UrlPathPattern("/foo/*"));
- l.add(new UrlPathPattern("/foo/bar"));
- l.add(new UrlPathPattern("/foo/bar/*"));
- l.add(new UrlPathPattern("/foo/{id}"));
- l.add(new UrlPathPattern("/foo/{id}/*"));
- l.add(new UrlPathPattern("/foo/{id}/bar"));
- l.add(new UrlPathPattern("/foo/{id}/bar/*"));
-
- Collections.sort(l);
- assertEquals("[{patternString:'/foo/bar',vars:[]},{patternString:'/foo/bar/*',vars:[]},{patternString:'/foo/{id}/bar',vars:['id']},{patternString:'/foo/{id}/bar/*',vars:['id']},{patternString:'/foo/{id}',vars:['id']},{patternString:'/foo/{id}/*',vars:['id']},{patternString:'/foo',vars:[]},{patternString:'/foo/*',vars:[]}]", JsonSerializer.DEFAULT_LAX.builder().sortProperties().build().serialize(l));
- }
-}
+// ***************************************************************************************************************************
+// * Licensed to the Apache Software Foundation (ASF) under one or more contributor license agreements. See the NOTICE file *
+// * distributed with this work for additional information regarding copyright ownership. The ASF licenses this file *
+// * to you under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance *
+// * with the License. You may obtain a copy of the License at *
+// * *
+// * http://www.apache.org/licenses/LICENSE-2.0 *
+// * *
+// * Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an *
+// * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the *
+// * specific language governing permissions and limitations under the License. *
+// ***************************************************************************************************************************
+package org.apache.juneau.jena;
+
+import static org.apache.juneau.jena.Constants.*;
+
+import org.apache.juneau.*;
+
+/**
+ * TODO
+ */
+public class RdfXmlParser extends RdfParser {
+
+ //-------------------------------------------------------------------------------------------------------------------
+ // Predefined instances
+ //-------------------------------------------------------------------------------------------------------------------
+
+ /** Default XML parser, all default settings.*/
+ public static final RdfXmlParser DEFAULT = new RdfXmlParser(PropertyStore.DEFAULT);
+
+ //-------------------------------------------------------------------------------------------------------------------
+ // Instance
+ //-------------------------------------------------------------------------------------------------------------------
+
+ /**
+ * Instantiates a new clean-slate {@link RdfParserBuilder} object.
+ *
+ * <p>
+ * Note that this method creates a builder initialized to all default settings, whereas {@link #builder()} copies
+ * the settings of the object called on.
+ *
+ * @return A new {@link RdfParserBuilder} object.
+ */
+ public static RdfParserBuilder create() {
+ return new RdfParserBuilder().xml();
+ }
+
+ /**
+ * Constructor.
+ *
+ * @param ps The property store containing all the settings for this object.
+ */
+ public RdfXmlParser(PropertyStore ps) {
+ super(
+ ps.builder()
+ .set(RDF_language, LANG_RDF_XML)
+ .build(),
+ "text/xml+rdf"
+ );
+ }
+}
\ No newline at end of file
diff --git a/juneau-core/juneau-marshall-rdf/src/main/java/org/apache/juneau/jena/RdfXmlSerializer.java b/juneau-core/juneau-marshall-rdf/src/main/java/org/apache/juneau/jena/RdfXmlSerializer.java
new file mode 100644
index 0000000..ed4a86f
--- /dev/null
+++ b/juneau-core/juneau-marshall-rdf/src/main/java/org/apache/juneau/jena/RdfXmlSerializer.java
@@ -0,0 +1,61 @@
+// ***************************************************************************************************************************
+// * Licensed to the Apache Software Foundation (ASF) under one or more contributor license agreements. See the NOTICE file *
+// * distributed with this work for additional information regarding copyright ownership. The ASF licenses this file *
+// * to you under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance *
+// * with the License. You may obtain a copy of the License at *
+// * *
+// * http://www.apache.org/licenses/LICENSE-2.0 *
+// * *
+// * Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an *
+// * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the *
+// * specific language governing permissions and limitations under the License. *
+// ***************************************************************************************************************************
+package org.apache.juneau.jena;
+
+import static org.apache.juneau.jena.Constants.*;
+
+import org.apache.juneau.*;
+
+/**
+ * TODO
+ */
+public class RdfXmlSerializer extends RdfSerializer {
+
+ //-------------------------------------------------------------------------------------------------------------------
+ // Predefined instances
+ //-------------------------------------------------------------------------------------------------------------------
+
+ /** Default RDF/XML serializer, all default settings.*/
+ public static final RdfXmlSerializer DEFAULT = new RdfXmlSerializer(PropertyStore.DEFAULT);
+
+ //-------------------------------------------------------------------------------------------------------------------
+ // Instance
+ //-------------------------------------------------------------------------------------------------------------------
+
+ /**
+ * Instantiates a new clean-slate {@link RdfSerializerBuilder} object.
+ *
+ * <p>
+ * Note that this method creates a builder initialized to all default settings, whereas {@link #builder()} copies
+ * the settings of the object called on.
+ *
+ * @return A new {@link RdfSerializerBuilder} object.
+ */
+ public static RdfSerializerBuilder create() {
+ return new RdfSerializerBuilder().xml();
+ }
+
+ /**
+ * Constructor.
+ *
+ * @param ps The property store containing all the settings for this object.
+ */
+ public RdfXmlSerializer(PropertyStore ps) {
+ super(
+ ps.builder()
+ .set(RDF_language, LANG_RDF_XML)
+ .build(),
+ "text/xml+rdf", "text/xml+rdf,text/xml+rdf+abbrev;q=0.9"
+ );
+ }
+}
\ No newline at end of file
diff --git a/juneau-rest/juneau-rest-server/src/test/java/org/apache/juneau/rest/util/UrlPathPatternTest.java b/juneau-core/juneau-marshall-rdf/src/main/java/org/apache/juneau/jena/TurtleParser.java
similarity index 51%
copy from juneau-rest/juneau-rest-server/src/test/java/org/apache/juneau/rest/util/UrlPathPatternTest.java
copy to juneau-core/juneau-marshall-rdf/src/main/java/org/apache/juneau/jena/TurtleParser.java
index 8f7dcde..517759c 100644
--- a/juneau-rest/juneau-rest-server/src/test/java/org/apache/juneau/rest/util/UrlPathPatternTest.java
+++ b/juneau-core/juneau-marshall-rdf/src/main/java/org/apache/juneau/jena/TurtleParser.java
@@ -1,45 +1,61 @@
-// ***************************************************************************************************************************
-// * Licensed to the Apache Software Foundation (ASF) under one or more contributor license agreements. See the NOTICE file *
-// * distributed with this work for additional information regarding copyright ownership. The ASF licenses this file *
-// * to you under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance *
-// * with the License. You may obtain a copy of the License at *
-// * *
-// * http://www.apache.org/licenses/LICENSE-2.0 *
-// * *
-// * Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an *
-// * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the *
-// * specific language governing permissions and limitations under the License. *
-// ***************************************************************************************************************************
-package org.apache.juneau.rest.util;
-
-import static org.junit.Assert.*;
-
-import java.util.*;
-
-import org.apache.juneau.json.*;
-import org.junit.*;
-import org.junit.runners.*;
-
-/**
- * Validates the functionality of the UrlPathPattern class.
- */
-@SuppressWarnings({"javadoc"})
-@FixMethodOrder(MethodSorters.NAME_ASCENDING)
-public class UrlPathPatternTest {
- @Test
- public void testComparison() throws Exception {
- List<UrlPathPattern> l = new LinkedList<>();
-
- l.add(new UrlPathPattern("/foo"));
- l.add(new UrlPathPattern("/foo/*"));
- l.add(new UrlPathPattern("/foo/bar"));
- l.add(new UrlPathPattern("/foo/bar/*"));
- l.add(new UrlPathPattern("/foo/{id}"));
- l.add(new UrlPathPattern("/foo/{id}/*"));
- l.add(new UrlPathPattern("/foo/{id}/bar"));
- l.add(new UrlPathPattern("/foo/{id}/bar/*"));
-
- Collections.sort(l);
- assertEquals("[{patternString:'/foo/bar',vars:[]},{patternString:'/foo/bar/*',vars:[]},{patternString:'/foo/{id}/bar',vars:['id']},{patternString:'/foo/{id}/bar/*',vars:['id']},{patternString:'/foo/{id}',vars:['id']},{patternString:'/foo/{id}/*',vars:['id']},{patternString:'/foo',vars:[]},{patternString:'/foo/*',vars:[]}]", JsonSerializer.DEFAULT_LAX.builder().sortProperties().build().serialize(l));
- }
-}
+// ***************************************************************************************************************************
+// * Licensed to the Apache Software Foundation (ASF) under one or more contributor license agreements. See the NOTICE file *
+// * distributed with this work for additional information regarding copyright ownership. The ASF licenses this file *
+// * to you under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance *
+// * with the License. You may obtain a copy of the License at *
+// * *
+// * http://www.apache.org/licenses/LICENSE-2.0 *
+// * *
+// * Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an *
+// * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the *
+// * specific language governing permissions and limitations under the License. *
+// ***************************************************************************************************************************
+package org.apache.juneau.jena;
+
+import static org.apache.juneau.jena.Constants.*;
+
+import org.apache.juneau.*;
+
+/**
+ * TODO
+ */
+public class TurtleParser extends RdfParser {
+
+ //-------------------------------------------------------------------------------------------------------------------
+ // Predefined instances
+ //-------------------------------------------------------------------------------------------------------------------
+
+ /** Default Turtle parser, all default settings.*/
+ public static final TurtleParser DEFAULT = new TurtleParser(PropertyStore.DEFAULT);
+
+ //-------------------------------------------------------------------------------------------------------------------
+ // Instance
+ //-------------------------------------------------------------------------------------------------------------------
+
+ /**
+ * Instantiates a new clean-slate {@link RdfParserBuilder} object.
+ *
+ * <p>
+ * Note that this method creates a builder initialized to all default settings, whereas {@link #builder()} copies
+ * the settings of the object called on.
+ *
+ * @return A new {@link RdfParserBuilder} object.
+ */
+ public static RdfParserBuilder create() {
+ return new RdfParserBuilder().turtle();
+ }
+
+ /**
+ * Constructor.
+ *
+ * @param ps The property store containing all the settings for this object.
+ */
+ public TurtleParser(PropertyStore ps) {
+ super(
+ ps.builder()
+ .set(RDF_language, LANG_TURTLE)
+ .build(),
+ "text/turtle"
+ );
+ }
+}
\ No newline at end of file
diff --git a/juneau-rest/juneau-rest-server/src/test/java/org/apache/juneau/rest/util/UrlPathPatternTest.java b/juneau-core/juneau-marshall-rdf/src/main/java/org/apache/juneau/jena/TurtleSerializer.java
similarity index 50%
copy from juneau-rest/juneau-rest-server/src/test/java/org/apache/juneau/rest/util/UrlPathPatternTest.java
copy to juneau-core/juneau-marshall-rdf/src/main/java/org/apache/juneau/jena/TurtleSerializer.java
index 8f7dcde..79c50b2 100644
--- a/juneau-rest/juneau-rest-server/src/test/java/org/apache/juneau/rest/util/UrlPathPatternTest.java
+++ b/juneau-core/juneau-marshall-rdf/src/main/java/org/apache/juneau/jena/TurtleSerializer.java
@@ -1,45 +1,61 @@
-// ***************************************************************************************************************************
-// * Licensed to the Apache Software Foundation (ASF) under one or more contributor license agreements. See the NOTICE file *
-// * distributed with this work for additional information regarding copyright ownership. The ASF licenses this file *
-// * to you under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance *
-// * with the License. You may obtain a copy of the License at *
-// * *
-// * http://www.apache.org/licenses/LICENSE-2.0 *
-// * *
-// * Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an *
-// * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the *
-// * specific language governing permissions and limitations under the License. *
-// ***************************************************************************************************************************
-package org.apache.juneau.rest.util;
-
-import static org.junit.Assert.*;
-
-import java.util.*;
-
-import org.apache.juneau.json.*;
-import org.junit.*;
-import org.junit.runners.*;
-
-/**
- * Validates the functionality of the UrlPathPattern class.
- */
-@SuppressWarnings({"javadoc"})
-@FixMethodOrder(MethodSorters.NAME_ASCENDING)
-public class UrlPathPatternTest {
- @Test
- public void testComparison() throws Exception {
- List<UrlPathPattern> l = new LinkedList<>();
-
- l.add(new UrlPathPattern("/foo"));
- l.add(new UrlPathPattern("/foo/*"));
- l.add(new UrlPathPattern("/foo/bar"));
- l.add(new UrlPathPattern("/foo/bar/*"));
- l.add(new UrlPathPattern("/foo/{id}"));
- l.add(new UrlPathPattern("/foo/{id}/*"));
- l.add(new UrlPathPattern("/foo/{id}/bar"));
- l.add(new UrlPathPattern("/foo/{id}/bar/*"));
-
- Collections.sort(l);
- assertEquals("[{patternString:'/foo/bar',vars:[]},{patternString:'/foo/bar/*',vars:[]},{patternString:'/foo/{id}/bar',vars:['id']},{patternString:'/foo/{id}/bar/*',vars:['id']},{patternString:'/foo/{id}',vars:['id']},{patternString:'/foo/{id}/*',vars:['id']},{patternString:'/foo',vars:[]},{patternString:'/foo/*',vars:[]}]", JsonSerializer.DEFAULT_LAX.builder().sortProperties().build().serialize(l));
- }
-}
+// ***************************************************************************************************************************
+// * Licensed to the Apache Software Foundation (ASF) under one or more contributor license agreements. See the NOTICE file *
+// * distributed with this work for additional information regarding copyright ownership. The ASF licenses this file *
+// * to you under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance *
+// * with the License. You may obtain a copy of the License at *
+// * *
+// * http://www.apache.org/licenses/LICENSE-2.0 *
+// * *
+// * Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an *
+// * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the *
+// * specific language governing permissions and limitations under the License. *
+// ***************************************************************************************************************************
+package org.apache.juneau.jena;
+
+import static org.apache.juneau.jena.Constants.*;
+
+import org.apache.juneau.*;
+
+/**
+ * TODO
+ */
+public class TurtleSerializer extends RdfSerializer {
+
+ //-------------------------------------------------------------------------------------------------------------------
+ // Predefined instances
+ //-------------------------------------------------------------------------------------------------------------------
+
+ /** Default Turtle serializer, all default settings.*/
+ public static final TurtleSerializer DEFAULT = new TurtleSerializer(PropertyStore.DEFAULT);
+
+ //-------------------------------------------------------------------------------------------------------------------
+ // Instance
+ //-------------------------------------------------------------------------------------------------------------------
+
+ /**
+ * Instantiates a new clean-slate {@link RdfSerializerBuilder} object.
+ *
+ * <p>
+ * Note that this method creates a builder initialized to all default settings, whereas {@link #builder()} copies
+ * the settings of the object called on.
+ *
+ * @return A new {@link RdfSerializerBuilder} object.
+ */
+ public static RdfSerializerBuilder create() {
+ return new RdfSerializerBuilder().turtle();
+ }
+
+ /**
+ * Constructor.
+ *
+ * @param ps The property store containing all the settings for this object.
+ */
+ public TurtleSerializer(PropertyStore ps) {
+ super(
+ ps.builder()
+ .set(RDF_language, LANG_TURTLE)
+ .build(),
+ "text/turtle", null
+ );
+ }
+}
\ No newline at end of file
diff --git a/juneau-core/juneau-marshall/src/main/java/org/apache/juneau/BeanMap.java b/juneau-core/juneau-marshall/src/main/java/org/apache/juneau/BeanMap.java
index 93cff4a..c7fe3e8 100644
--- a/juneau-core/juneau-marshall/src/main/java/org/apache/juneau/BeanMap.java
+++ b/juneau-core/juneau-marshall/src/main/java/org/apache/juneau/BeanMap.java
@@ -168,7 +168,7 @@ public class BeanMap<T> extends AbstractMap<String,Object> implements Delegate<T
put(e.getKey(), e.getValue());
propertyCache = null;
} catch (IllegalArgumentException e) {
- throw new BeanRuntimeException(e, meta.classMeta.innerClass, "IllegalArgumentException occurred on call to class constructor ''{0}'' with argument types ''{1}''", c.getName(), JsonSerializer.DEFAULT_LAX.toString(ClassUtils.getClasses(args)));
+ throw new BeanRuntimeException(e, meta.classMeta.innerClass, "IllegalArgumentException occurred on call to class constructor ''{0}'' with argument types ''{1}''", c.getName(), SimpleJsonSerializer.DEFAULT.toString(ClassUtils.getClasses(args)));
} catch (Exception e) {
throw new BeanRuntimeException(e);
}
diff --git a/juneau-core/juneau-marshall/src/main/java/org/apache/juneau/BeanProxyInvocationHandler.java b/juneau-core/juneau-marshall/src/main/java/org/apache/juneau/BeanProxyInvocationHandler.java
index e9b6a8e..e843717 100644
--- a/juneau-core/juneau-marshall/src/main/java/org/apache/juneau/BeanProxyInvocationHandler.java
+++ b/juneau-core/juneau-marshall/src/main/java/org/apache/juneau/BeanProxyInvocationHandler.java
@@ -69,7 +69,7 @@ public class BeanProxyInvocationHandler<T> implements InvocationHandler {
return Integer.valueOf(this.beanProps.hashCode());
if (hasName(method, "toString") && (paramTypes.length == 0))
- return JsonSerializer.DEFAULT_LAX.toString(this.beanProps);
+ return SimpleJsonSerializer.DEFAULT.toString(this.beanProps);
String prop = this.meta.getterProps.get(method);
if (prop != null)
diff --git a/juneau-core/juneau-marshall/src/main/java/org/apache/juneau/BeanSession.java b/juneau-core/juneau-marshall/src/main/java/org/apache/juneau/BeanSession.java
index ce05f84..eb51268 100644
--- a/juneau-core/juneau-marshall/src/main/java/org/apache/juneau/BeanSession.java
+++ b/juneau-core/juneau-marshall/src/main/java/org/apache/juneau/BeanSession.java
@@ -570,8 +570,8 @@ public class BeanSession extends Session {
if (from.isByteArray()) {
return (T) new String((byte[])value);
} else if (from.isMapOrBean() || from.isCollectionOrArray()) {
- if (JsonSerializer.DEFAULT_LAX != null)
- return (T)JsonSerializer.DEFAULT_LAX.serialize(value);
+ if (SimpleJsonSerializer.DEFAULT != null)
+ return (T)SimpleJsonSerializer.DEFAULT.serialize(value);
} else if (from.isClass()) {
return (T)((Class<?>)value).getName();
}
diff --git a/juneau-core/juneau-marshall/src/main/java/org/apache/juneau/ClassMeta.java b/juneau-core/juneau-marshall/src/main/java/org/apache/juneau/ClassMeta.java
index 61eae25..2dfccbd 100644
--- a/juneau-core/juneau-marshall/src/main/java/org/apache/juneau/ClassMeta.java
+++ b/juneau-core/juneau-marshall/src/main/java/org/apache/juneau/ClassMeta.java
@@ -1036,10 +1036,10 @@ public final class ClassMeta<T> implements Type {
return JsonParser.DEFAULT.parse(s, this);
}
if (example instanceof Map && isMapOrBean()) {
- return JsonParser.DEFAULT.parse(JsonSerializer.DEFAULT_LAX_READABLE.toString(example), this);
+ return JsonParser.DEFAULT.parse(SimpleJsonSerializer.DEFAULT_READABLE.toString(example), this);
}
if (example instanceof Collection && isCollectionOrArray()) {
- return JsonParser.DEFAULT.parse(JsonSerializer.DEFAULT_LAX_READABLE.serialize(example), this);
+ return JsonParser.DEFAULT.parse(SimpleJsonSerializer.DEFAULT_READABLE.serialize(example), this);
}
}
if (exampleMethod != null)
diff --git a/juneau-core/juneau-marshall/src/main/java/org/apache/juneau/Context.java b/juneau-core/juneau-marshall/src/main/java/org/apache/juneau/Context.java
index e5d390e..e047ee7 100644
--- a/juneau-core/juneau-marshall/src/main/java/org/apache/juneau/Context.java
+++ b/juneau-core/juneau-marshall/src/main/java/org/apache/juneau/Context.java
@@ -521,7 +521,7 @@ public abstract class Context {
@Override /* Object */
public String toString() {
try {
- return asMap().toString(JsonSerializer.DEFAULT_LAX_READABLE);
+ return asMap().toString(SimpleJsonSerializer.DEFAULT_READABLE);
} catch (SerializeException e) {
return e.getLocalizedMessage();
}
diff --git a/juneau-core/juneau-marshall/src/main/java/org/apache/juneau/InvalidDataConversionException.java b/juneau-core/juneau-marshall/src/main/java/org/apache/juneau/InvalidDataConversionException.java
index c36ca1c..b94e390 100644
--- a/juneau-core/juneau-marshall/src/main/java/org/apache/juneau/InvalidDataConversionException.java
+++ b/juneau-core/juneau-marshall/src/main/java/org/apache/juneau/InvalidDataConversionException.java
@@ -63,6 +63,6 @@ public final class InvalidDataConversionException extends FormattedRuntimeExcept
private static String getValue(Object o) {
if (o instanceof Class)
return "'" + getReadableClassName((Class<?>)o) + "'";
- return JsonSerializer.DEFAULT_LAX == null ? "'" + o.toString() + "'" : JsonSerializer.DEFAULT_LAX.toString(o);
+ return SimpleJsonSerializer.DEFAULT == null ? "'" + o.toString() + "'" : SimpleJsonSerializer.DEFAULT.toString(o);
}
}
diff --git a/juneau-core/juneau-marshall/src/main/java/org/apache/juneau/ObjectList.java b/juneau-core/juneau-marshall/src/main/java/org/apache/juneau/ObjectList.java
index b7d087d..165d0d0 100644
--- a/juneau-core/juneau-marshall/src/main/java/org/apache/juneau/ObjectList.java
+++ b/juneau-core/juneau-marshall/src/main/java/org/apache/juneau/ObjectList.java
@@ -756,7 +756,7 @@ public class ObjectList extends LinkedList<Object> {
@Override /* Object */
public String toString() {
try {
- return this.toString(JsonSerializer.DEFAULT_LAX);
+ return this.toString(SimpleJsonSerializer.DEFAULT);
} catch (SerializeException e) {
return e.getLocalizedMessage();
}
@@ -785,7 +785,7 @@ public class ObjectList extends LinkedList<Object> {
*/
public Object cast(ClassMeta<?> cm) {
try {
- return JsonParser.DEFAULT.parse(JsonSerializer.DEFAULT_LAX.serialize(this), cm);
+ return JsonParser.DEFAULT.parse(SimpleJsonSerializer.DEFAULT.serialize(this), cm);
} catch (ParseException | SerializeException e) {
throw new RuntimeException(e);
}
diff --git a/juneau-core/juneau-marshall/src/main/java/org/apache/juneau/ObjectMap.java b/juneau-core/juneau-marshall/src/main/java/org/apache/juneau/ObjectMap.java
index aed5dff..c415277 100644
--- a/juneau-core/juneau-marshall/src/main/java/org/apache/juneau/ObjectMap.java
+++ b/juneau-core/juneau-marshall/src/main/java/org/apache/juneau/ObjectMap.java
@@ -1569,7 +1569,7 @@ public class ObjectMap extends LinkedHashMap<String,Object> {
@Override /* Object */
public String toString() {
try {
- return this.toString(JsonSerializer.DEFAULT_LAX);
+ return this.toString(SimpleJsonSerializer.DEFAULT);
} catch (SerializeException e) {
return e.getLocalizedMessage();
}
diff --git a/juneau-core/juneau-marshall/src/main/java/org/apache/juneau/PropertyStore.java b/juneau-core/juneau-marshall/src/main/java/org/apache/juneau/PropertyStore.java
index 6c2cc12..d253633 100644
--- a/juneau-core/juneau-marshall/src/main/java/org/apache/juneau/PropertyStore.java
+++ b/juneau-core/juneau-marshall/src/main/java/org/apache/juneau/PropertyStore.java
@@ -926,6 +926,6 @@ public final class PropertyStore {
@Override /* Object */
public String toString() {
- return JsonSerializer.DEFAULT_LAX.toString(this);
+ return SimpleJsonSerializer.DEFAULT.toString(this);
}
}
diff --git a/juneau-core/juneau-marshall/src/main/java/org/apache/juneau/PropertyStoreBuilder.java b/juneau-core/juneau-marshall/src/main/java/org/apache/juneau/PropertyStoreBuilder.java
index cb2bf4c..c9c0b24 100644
--- a/juneau-core/juneau-marshall/src/main/java/org/apache/juneau/PropertyStoreBuilder.java
+++ b/juneau-core/juneau-marshall/src/main/java/org/apache/juneau/PropertyStoreBuilder.java
@@ -821,7 +821,7 @@ public class PropertyStoreBuilder {
}
static String string(Object value) {
- return JsonSerializer.DEFAULT_LAX.toString(value);
+ return SimpleJsonSerializer.DEFAULT.toString(value);
}
static String className(Object value) {
diff --git a/juneau-core/juneau-marshall/src/main/java/org/apache/juneau/Session.java b/juneau-core/juneau-marshall/src/main/java/org/apache/juneau/Session.java
index 783a1c9..cd0aea9 100644
--- a/juneau-core/juneau-marshall/src/main/java/org/apache/juneau/Session.java
+++ b/juneau-core/juneau-marshall/src/main/java/org/apache/juneau/Session.java
@@ -304,7 +304,7 @@ public abstract class Session {
@Override /* Object */
public String toString() {
try {
- return asMap().toString(JsonSerializer.DEFAULT_LAX_READABLE);
+ return asMap().toString(SimpleJsonSerializer.DEFAULT_READABLE);
} catch (SerializeException e) {
return e.getLocalizedMessage();
}
diff --git a/juneau-core/juneau-marshall/src/main/java/org/apache/juneau/UriContext.java b/juneau-core/juneau-marshall/src/main/java/org/apache/juneau/UriContext.java
index 6f1e075..f6d3dfc 100644
--- a/juneau-core/juneau-marshall/src/main/java/org/apache/juneau/UriContext.java
+++ b/juneau-core/juneau-marshall/src/main/java/org/apache/juneau/UriContext.java
@@ -362,6 +362,6 @@ public class UriContext {
@Override /* Object */
public String toString() {
- return JsonSerializer.DEFAULT_LAX.toString(this);
+ return SimpleJsonSerializer.DEFAULT.toString(this);
}
}
diff --git a/juneau-core/juneau-marshall/src/main/java/org/apache/juneau/annotation/Bean.java b/juneau-core/juneau-marshall/src/main/java/org/apache/juneau/annotation/Bean.java
index 9f541f3..dc9cabe 100644
--- a/juneau-core/juneau-marshall/src/main/java/org/apache/juneau/annotation/Bean.java
+++ b/juneau-core/juneau-marshall/src/main/java/org/apache/juneau/annotation/Bean.java
@@ -122,7 +122,7 @@ public @interface Bean {
* }
*
* <jc>// Produces "{f0:'f0'}"</jc>
- * String json = JsonSerializer.<jsf>DEFAULT_LAX</jsf>.serialize(<jk>new</jk> A1());
+ * String json = SimpleJsonSerializer.<jsf>DEFAULT</jsf>.serialize(<jk>new</jk> A1());
* </p>
*
* <p>
diff --git a/juneau-core/juneau-marshall/src/main/java/org/apache/juneau/http/MediaType.java b/juneau-core/juneau-marshall/src/main/java/org/apache/juneau/http/MediaType.java
index 42bb7ce..1bd743a 100644
--- a/juneau-core/juneau-marshall/src/main/java/org/apache/juneau/http/MediaType.java
+++ b/juneau-core/juneau-marshall/src/main/java/org/apache/juneau/http/MediaType.java
@@ -249,7 +249,7 @@ public class MediaType implements Comparable<MediaType> {
* comparing media type.
* <ul>
* <li>We want the {@link JsonSerializer} (<js>"text/json"</js>) class to be able to handle requests for <js>"text/json+foo"</js>.
- * <li>We want to make sure {@link org.apache.juneau.json.JsonSerializer.Simple} (<js>"text/json+simple"</js>) does not handle
+ * <li>We want to make sure {@link org.apache.juneau.json.SimpleJsonSerializer} (<js>"text/json+simple"</js>) does not handle
* requests for <js>"text/json"</js>.
* </ul>
* More token matches should result in a higher match number.
diff --git a/juneau-core/juneau-marshall/src/main/java/org/apache/juneau/http/annotation/Body.java b/juneau-core/juneau-marshall/src/main/java/org/apache/juneau/http/annotation/Body.java
index daf3e46..d281c8c 100644
--- a/juneau-core/juneau-marshall/src/main/java/org/apache/juneau/http/annotation/Body.java
+++ b/juneau-core/juneau-marshall/src/main/java/org/apache/juneau/http/annotation/Body.java
@@ -93,10 +93,7 @@ import org.apache.juneau.serializer.*;
* </p>
*
* <p>
- * This is used to populate the auto-generated Swagger documentation and UI:
- *
- * <p>
- * <img class='bordered' src='doc-files/Body_Swagger.png' style='width:860px'>
+ * This is used to populate the auto-generated Swagger documentation and UI.
*
* <p>
* This annotation can be applied to the following:
@@ -329,7 +326,7 @@ public @interface Body {
* <h5 class='section'>Notes:</h5>
* <ul class='spaced-list'>
* <li>
- * The format is a {@link JsonSerializer#DEFAULT_LAX Simple-JSON} object.
+ * The format is a <a class='doclink' href='../../../../../overview-summary.html#juneau-marshall.JsonDetails.SimplifiedJson'>Simplified JSON</a> object.
* <br>Multiple lines are concatenated with newlines.
* <li>
* The leading/trailing <code>{ }</code> characters are optional.
@@ -353,7 +350,7 @@ public @interface Body {
* A serialized example of the body of a request.
*
* <p>
- * This is the {@link JsonSerializer#DEFAULT_LAX Simple-JSON} or String representation of an example of the body.
+ * This is the <a class='doclink' href='../../../../../overview-summary.html#juneau-marshall.JsonDetails.SimplifiedJson'>Simplified JSON</a> or String representation of an example of the body.
*
* <p>
* This value is converted to a POJO and then serialized to all the registered serializers on the REST method to produce examples for all
@@ -437,7 +434,7 @@ public @interface Body {
* <h5 class='section'>Notes:</h5>
* <ul class='spaced-list'>
* <li>
- * The format is any {@link JsonSerializer#DEFAULT_LAX Simple-JSON} if the object can be converted to a POJO using {@link JsonParser#DEFAULT} or a simple String if the object
+ * The format is any <a class='doclink' href='../../../../../overview-summary.html#juneau-marshall.JsonDetails.SimplifiedJson'>Simplified JSON</a> if the object can be converted to a POJO using {@link JsonParser#DEFAULT} or a simple String if the object
* can be converted from a String.
* <br>Multiple lines are concatenated with newlines.
* <li>
@@ -451,7 +448,7 @@ public @interface Body {
* Serialized examples of the body of a request.
*
* <p>
- * This is a {@link JsonSerializer#DEFAULT_LAX Simple-JSON} object whose keys are media types and values are string representations of that value.
+ * This is a <a class='doclink' href='../../../../../overview-summary.html#juneau-marshall.JsonDetails.SimplifiedJson'>Simplified JSON</a> object whose keys are media types and values are string representations of that value.
*
* <p>
* In general you won't need to populate this value directly since it will automatically be calculated based on the value provided in the {@link #example()} field.
@@ -469,7 +466,7 @@ public @interface Body {
* <h5 class='section'>Notes:</h5>
* <ul class='spaced-list'>
* <li>
- * The format is a {@link JsonSerializer#DEFAULT_LAX Simple-JSON} object with string keys (media type) and string values (example for that media type) .
+ * The format is a <a class='doclink' href='../../../../../overview-summary.html#juneau-marshall.JsonDetails.SimplifiedJson'>Simplified JSON</a> object with string keys (media type) and string values (example for that media type) .
* <li>
* The leading/trailing <code>{ }</code> characters are optional.
* <li>
@@ -488,7 +485,7 @@ public @interface Body {
* Free-form value for the Swagger <a class="doclink" href="https://swagger.io/specification/v2/#parameterObject">Parameter</a> object.
*
* <p>
- * This is a {@link JsonSerializer#DEFAULT_LAX Simple-JSON} object that makes up the swagger information for this parameter-info.
+ * This is a <a class='doclink' href='../../../../../overview-summary.html#juneau-marshall.JsonDetails.SimplifiedJson'>Simplified JSON</a> object that makes up the swagger information for this parameter-info.
*
* <p>
* The following are completely equivalent ways of defining the swagger description of the body:
@@ -536,7 +533,7 @@ public @interface Body {
* <h5 class='section'>Notes:</h5>
* <ul class='spaced-list'>
* <li>
- * The format is a {@link JsonSerializer#DEFAULT_LAX Simple-JSON} object.
+ * The format is a <a class='doclink' href='../../../../../overview-summary.html#juneau-marshall.JsonDetails.SimplifiedJson'>Simplified JSON</a> object.
* <li>
* Automatic validation is NOT performed on input based on attributes in this value.
* <li>
diff --git a/juneau-core/juneau-marshall/src/main/java/org/apache/juneau/http/annotation/Contact.java b/juneau-core/juneau-marshall/src/main/java/org/apache/juneau/http/annotation/Contact.java
index 507b570..e0b1b0f 100644
--- a/juneau-core/juneau-marshall/src/main/java/org/apache/juneau/http/annotation/Contact.java
+++ b/juneau-core/juneau-marshall/src/main/java/org/apache/juneau/http/annotation/Contact.java
@@ -168,7 +168,7 @@ public @interface Contact {
* <h5 class='section'>Notes:</h5>
* <ul class='spaced-list'>
* <li>
- * The format is a {@link JsonSerializer#DEFAULT_LAX Simple-JSON} object.
+ * The format is a <a class='doclink' href='../../../../../overview-summary.html#juneau-marshall.JsonDetails.SimplifiedJson'>Simplified JSON</a> object.
* <li>
* The leading/trailing <code>{ }</code> characters are optional.
* <br>The following two example are considered equivalent:
diff --git a/juneau-core/juneau-marshall/src/main/java/org/apache/juneau/http/annotation/ExternalDocs.java b/juneau-core/juneau-marshall/src/main/java/org/apache/juneau/http/annotation/ExternalDocs.java
index dcb2dc5..4e3e511 100644
--- a/juneau-core/juneau-marshall/src/main/java/org/apache/juneau/http/annotation/ExternalDocs.java
+++ b/juneau-core/juneau-marshall/src/main/java/org/apache/juneau/http/annotation/ExternalDocs.java
@@ -65,7 +65,7 @@ public @interface ExternalDocs {
* Free-form value for the Swagger <a class="doclink" href="https://swagger.io/specification/v2/#externalDocumentationObject">ExternalDocumentation</a> object.
*
* <p>
- * This is a {@link JsonSerializer#DEFAULT_LAX Simple-JSON} object that makes up the swagger information for this field.
+ * This is a <a class='doclink' href='../../../../../overview-summary.html#juneau-marshall.JsonDetails.SimplifiedJson'>Simplified JSON</a> object that makes up the swagger information for this field.
*
* <p>
* The following are completely equivalent ways of defining the swagger description of documentation:
@@ -114,7 +114,7 @@ public @interface ExternalDocs {
* <h5 class='section'>Notes:</h5>
* <ul class='spaced-list'>
* <li>
- * The format is a {@link JsonSerializer#DEFAULT_LAX Simple-JSON} object.
+ * The format is a <a class='doclink' href='../../../../../overview-summary.html#juneau-marshall.JsonDetails.SimplifiedJson'>Simplified JSON</a> object.
* <li>
* The leading/trailing <code>{ }</code> characters are optional.
* <br>The following two example are considered equivalent:
diff --git a/juneau-core/juneau-marshall/src/main/java/org/apache/juneau/http/annotation/FormData.java b/juneau-core/juneau-marshall/src/main/java/org/apache/juneau/http/annotation/FormData.java
index 1287565..ac9b4fe 100644
--- a/juneau-core/juneau-marshall/src/main/java/org/apache/juneau/http/annotation/FormData.java
+++ b/juneau-core/juneau-marshall/src/main/java/org/apache/juneau/http/annotation/FormData.java
@@ -687,7 +687,7 @@ public @interface FormData {
* If validation is not met during serialization or parsing, the part serializer/parser will throw a {@link SchemaValidationException}.
*
* <p>
- * The format is a {@link JsonSerializer#DEFAULT_LAX Simple-JSON} array or comma-delimited list.
+ * The format is a <a class='doclink' href='../../../../../overview-summary.html#juneau-marshall.JsonDetails.SimplifiedJson'>Simplified JSON</a> array or comma-delimited list.
* <br>Multiple lines are concatenated with newlines.
*
* <h5 class='section'>Examples:</h5>
@@ -738,7 +738,7 @@ public @interface FormData {
* <h5 class='section'>Notes:</h5>
* <ul class='spaced-list'>
* <li>
- * The format is a {@link JsonSerializer#DEFAULT_LAX Simple-JSON} object or plain text string.
+ * The format is a <a class='doclink' href='../../../../../overview-summary.html#juneau-marshall.JsonDetails.SimplifiedJson'>Simplified JSON</a> object or plain text string.
* <br>Multiple lines are concatenated with newlines.
* <li>
* Supports <a class="doclink" href="../../../../../overview-summary.html#DefaultRestSvlVariables">initialization-time and request-time variables</a>
@@ -799,7 +799,7 @@ public @interface FormData {
* <li>
* Automatic validation is NOT performed on input based on attributes in this value.
* <li>
- * The format is a {@link JsonSerializer#DEFAULT_LAX Simple-JSON} object.
+ * The format is a <a class='doclink' href='../../../../../overview-summary.html#juneau-marshall.JsonDetails.SimplifiedJson'>Simplified JSON</a> object.
* <li>
* The leading/trailing <code>{ }</code> characters are optional.
* <br>The following two example are considered equivalent:
diff --git a/juneau-core/juneau-marshall/src/main/java/org/apache/juneau/http/annotation/Header.java b/juneau-core/juneau-marshall/src/main/java/org/apache/juneau/http/annotation/Header.java
index c908c49..ffd22a7 100644
--- a/juneau-core/juneau-marshall/src/main/java/org/apache/juneau/http/annotation/Header.java
+++ b/juneau-core/juneau-marshall/src/main/java/org/apache/juneau/http/annotation/Header.java
@@ -651,7 +651,7 @@ public @interface Header {
* If validation is not met during serialization or parsing, the part serializer/parser will throw a {@link SchemaValidationException}.
*
* <p>
- * The format is a {@link JsonSerializer#DEFAULT_LAX Simple-JSON} array or comma-delimited list.
+ * The format is a <a class='doclink' href='../../../../../overview-summary.html#juneau-marshall.JsonDetails.SimplifiedJson'>Simplified JSON</a> array or comma-delimited list.
* <br>Multiple lines are concatenated with newlines.
*
* <h5 class='section'>Examples:</h5>
@@ -703,7 +703,7 @@ public @interface Header {
* <h5 class='section'>Notes:</h5>
* <ul class='spaced-list'>
* <li>
- * The format is a {@link JsonSerializer#DEFAULT_LAX Simple-JSON} object or plain text string.
+ * The format is a <a class='doclink' href='../../../../../overview-summary.html#juneau-marshall.JsonDetails.SimplifiedJson'>Simplified JSON</a> object or plain text string.
* <br>Multiple lines are concatenated with newlines.
* <li>
* Supports <a class="doclink" href="../../../../../overview-summary.html#DefaultRestSvlVariables">initialization-time and request-time variables</a>
@@ -764,7 +764,7 @@ public @interface Header {
* <li>
* Note that the only swagger field you can't specify using this value is <js>"name"</js> whose value needs to be known during servlet initialization.
* <li>
- * The format is a {@link JsonSerializer#DEFAULT_LAX Simple-JSON} object.
+ * The format is a <a class='doclink' href='../../../../../overview-summary.html#juneau-marshall.JsonDetails.SimplifiedJson'>Simplified JSON</a> object.
* <li>
* Automatic validation is NOT performed on input based on attributes in this value.
* <li>
diff --git a/juneau-core/juneau-marshall/src/main/java/org/apache/juneau/http/annotation/Items.java b/juneau-core/juneau-marshall/src/main/java/org/apache/juneau/http/annotation/Items.java
index fcaaff4..d25dcfc 100644
--- a/juneau-core/juneau-marshall/src/main/java/org/apache/juneau/http/annotation/Items.java
+++ b/juneau-core/juneau-marshall/src/main/java/org/apache/juneau/http/annotation/Items.java
@@ -286,7 +286,7 @@ public @interface Items {
* Free-form value for the Swagger <a class="doclink" href="https://swagger.io/specification/v2/#itemsObject">Items</a> object.
*
* <p>
- * This is a {@link JsonSerializer#DEFAULT_LAX Simple-JSON} object that makes up the swagger information for this field.
+ * This is a <a class='doclink' href='../../../../../overview-summary.html#juneau-marshall.JsonDetails.SimplifiedJson'>Simplified JSON</a> object that makes up the swagger information for this field.
*
* <p>
* The following are completely equivalent ways of defining the swagger description of an Items object:
@@ -353,7 +353,7 @@ public @interface Items {
* <li>
* Note that the only swagger field you can't specify using this value is <js>"name"</js> whose value needs to be known during servlet initialization.
* <li>
- * The format is a {@link JsonSerializer#DEFAULT_LAX Simple-JSON} object.
+ * The format is a <a class='doclink' href='../../../../../overview-summary.html#juneau-marshall.JsonDetails.SimplifiedJson'>Simplified JSON</a> object.
* <li>
* The leading/trailing <code>{ }</code> characters are optional.
* <br>The following two example are considered equivalent:
diff --git a/juneau-core/juneau-marshall/src/main/java/org/apache/juneau/http/annotation/License.java b/juneau-core/juneau-marshall/src/main/java/org/apache/juneau/http/annotation/License.java
index 294be99..e94befb 100644
--- a/juneau-core/juneau-marshall/src/main/java/org/apache/juneau/http/annotation/License.java
+++ b/juneau-core/juneau-marshall/src/main/java/org/apache/juneau/http/annotation/License.java
@@ -118,7 +118,7 @@ public @interface License {
* <h5 class='section'>Notes:</h5>
* <ul class='spaced-list'>
* <li>
- * The format is a {@link JsonSerializer#DEFAULT_LAX Simple-JSON} object.
+ * The format is a <a class='doclink' href='../../../../../overview-summary.html#juneau-marshall.JsonDetails.SimplifiedJson'>Simplified JSON</a> object.
* <li>
* The leading/trailing <code>{ }</code> characters are optional.
* <br>The following two example are considered equivalent:
diff --git a/juneau-core/juneau-marshall/src/main/java/org/apache/juneau/http/annotation/Path.java b/juneau-core/juneau-marshall/src/main/java/org/apache/juneau/http/annotation/Path.java
index 5942833..7a17097 100644
--- a/juneau-core/juneau-marshall/src/main/java/org/apache/juneau/http/annotation/Path.java
+++ b/juneau-core/juneau-marshall/src/main/java/org/apache/juneau/http/annotation/Path.java
@@ -554,7 +554,7 @@ public @interface Path {
* If validation is not met during serialization or parsing, the part serializer/parser will throw a {@link SchemaValidationException}.
*
* <p>
- * The format is a {@link JsonSerializer#DEFAULT_LAX Simple-JSON} array or comma-delimited list.
+ * The format is a <a class='doclink' href='../../../../../overview-summary.html#juneau-marshall.JsonDetails.SimplifiedJson'>Simplified JSON</a> array or comma-delimited list.
* <br>Multiple lines are concatenated with newlines.
*
* <h5 class='section'>Examples:</h5>
@@ -608,7 +608,7 @@ public @interface Path {
* <h5 class='section'>Notes:</h5>
* <ul class='spaced-list'>
* <li>
- * The format is a {@link JsonSerializer#DEFAULT_LAX Simple-JSON} object or plain text string.
+ * The format is a <a class='doclink' href='../../../../../overview-summary.html#juneau-marshall.JsonDetails.SimplifiedJson'>Simplified JSON</a> object or plain text string.
* <br>Multiple lines are concatenated with newlines.
* <li>
* Supports <a class="doclink" href="../../../../../overview-summary.html#DefaultRestSvlVariables">initialization-time and request-time variables</a>
@@ -621,7 +621,7 @@ public @interface Path {
* Free-form value for the Swagger <a class="doclink" href="https://swagger.io/specification/v2/#parameterObject">Parameter</a> object.
*
* <p>
- * This is a {@link JsonSerializer#DEFAULT_LAX Simple-JSON} object that makes up the swagger information for this field.
+ * This is a <a class='doclink' href='../../../../../overview-summary.html#juneau-marshall.JsonDetails.SimplifiedJson'>Simplified JSON</a> object that makes up the swagger information for this field.
*
* <p>
* The following are completely equivalent ways of defining the swagger description of the Path object:
@@ -671,7 +671,7 @@ public @interface Path {
* <li>
* Note that the only swagger field you can't specify using this value is <js>"name"</js> whose value needs to be known during servlet initialization.
* <li>
- * The format is a {@link JsonSerializer#DEFAULT_LAX Simple-JSON} object.
+ * The format is a <a class='doclink' href='../../../../../overview-summary.html#juneau-marshall.JsonDetails.SimplifiedJson'>Simplified JSON</a> object.
* <li>
* Automatic validation is NOT performed on input based on attributes in this value.
* <li>
diff --git a/juneau-core/juneau-marshall/src/main/java/org/apache/juneau/http/annotation/Query.java b/juneau-core/juneau-marshall/src/main/java/org/apache/juneau/http/annotation/Query.java
index a443954..d976ec8 100644
--- a/juneau-core/juneau-marshall/src/main/java/org/apache/juneau/http/annotation/Query.java
+++ b/juneau-core/juneau-marshall/src/main/java/org/apache/juneau/http/annotation/Query.java
@@ -681,7 +681,7 @@ public @interface Query {
* If validation is not met during serialization or parsing, the part serializer/parser will throw a {@link SchemaValidationException}.
*
* <p>
- * The format is a {@link JsonSerializer#DEFAULT_LAX Simple-JSON} array or comma-delimited list.
+ * The format is a <a class='doclink' href='../../../../../overview-summary.html#juneau-marshall.JsonDetails.SimplifiedJson'>Simplified JSON</a> array or comma-delimited list.
* <br>Multiple lines are concatenated with newlines.
*
* <h5 class='section'>Examples:</h5>
@@ -733,7 +733,7 @@ public @interface Query {
* <h5 class='section'>Notes:</h5>
* <ul class='spaced-list'>
* <li>
- * The format is a {@link JsonSerializer#DEFAULT_LAX Simple-JSON} object or plain text string.
+ * The format is a <a class='doclink' href='../../../../../overview-summary.html#juneau-marshall.JsonDetails.SimplifiedJson'>Simplified JSON</a> object or plain text string.
* <br>Multiple lines are concatenated with newlines.
* <li>
* Supports <a class="doclink" href="../../../../../overview-summary.html#DefaultRestSvlVariables">initialization-time and request-time variables</a>
@@ -746,7 +746,7 @@ public @interface Query {
* Free-form value for the Swagger <a class="doclink" href="https://swagger.io/specification/v2/#parameterObject">Parameter</a> object.
*
* <p>
- * This is a {@link JsonSerializer#DEFAULT_LAX Simple-JSON} object that makes up the swagger information for this field.
+ * This is a <a class='doclink' href='../../../../../overview-summary.html#juneau-marshall.JsonDetails.SimplifiedJson'>Simplified JSON</a> object that makes up the swagger information for this field.
*
* <p>
* The following are completely equivalent ways of defining the swagger description of the Query object:
@@ -808,7 +808,7 @@ public @interface Query {
* <li>
* Automatic validation is NOT performed on input based on attributes in this value.
* <li>
- * The format is a {@link JsonSerializer#DEFAULT_LAX Simple-JSON} object.
+ * The format is a <a class='doclink' href='../../../../../overview-summary.html#juneau-marshall.JsonDetails.SimplifiedJson'>Simplified JSON</a> object.
* <li>
* The leading/trailing <code>{ }</code> characters are optional.
* <br>The following two example are considered equivalent:
diff --git a/juneau-core/juneau-marshall/src/main/java/org/apache/juneau/http/annotation/Response.java b/juneau-core/juneau-marshall/src/main/java/org/apache/juneau/http/annotation/Response.java
index e6911e9..afa9fb2 100644
--- a/juneau-core/juneau-marshall/src/main/java/org/apache/juneau/http/annotation/Response.java
+++ b/juneau-core/juneau-marshall/src/main/java/org/apache/juneau/http/annotation/Response.java
@@ -159,7 +159,7 @@ public @interface Response {
* <h5 class='section'>Notes:</h5>
* <ul class='spaced-list'>
* <li>
- * The format is a {@link JsonSerializer#DEFAULT_LAX Simple-JSON} object.
+ * The format is a <a class='doclink' href='../../../../../overview-summary.html#juneau-marshall.JsonDetails.SimplifiedJson'>Simplified JSON</a> object.
* <br>Multiple lines are concatenated with newlines.
* <li>
* The leading/trailing <code>{ }</code> characters are optional.
@@ -186,7 +186,7 @@ public @interface Response {
* <h5 class='section'>Notes:</h5>
* <ul class='spaced-list'>
* <li>
- * The format is any {@link JsonSerializer#DEFAULT_LAX Simple-JSON}.
+ * The format is any <a class='doclink' href='../../../../../overview-summary.html#juneau-marshall.JsonDetails.SimplifiedJson'>Simplified JSON</a>.
* <br>Multiple lines are concatenated with newlines.
* <li>
* The leading/trailing <code>{ }</code> characters are optional.
@@ -206,12 +206,12 @@ public @interface Response {
* TODO
*
* <p>
- * The format is a {@link JsonSerializer#DEFAULT_LAX Simple-JSON} object with keys as media types and values as string representations of the body response.
+ * The format is a <a class='doclink' href='../../../../../overview-summary.html#juneau-marshall.JsonDetails.SimplifiedJson'>Simplified JSON</a> object with keys as media types and values as string representations of the body response.
*
* <h5 class='section'>Notes:</h5>
* <ul class='spaced-list'>
* <li>
- * The format is a {@link JsonSerializer#DEFAULT_LAX Simple-JSON} object.
+ * The format is a <a class='doclink' href='../../../../../overview-summary.html#juneau-marshall.JsonDetails.SimplifiedJson'>Simplified JSON</a> object.
* <br>Multiple lines are concatenated with newlines.
* <li>
* The leading/trailing <code>{ }</code> characters are optional.
@@ -226,7 +226,7 @@ public @interface Response {
* Free-form value for the Swagger <a class="doclink" href="https://swagger.io/specification/v2/#responseObject">Response</a> object.
*
* <p>
- * This is a {@link JsonSerializer#DEFAULT_LAX Simple-JSON} object that makes up the swagger information for this field.
+ * This is a <a class='doclink' href='../../../../../overview-summary.html#juneau-marshall.JsonDetails.SimplifiedJson'>Simplified JSON</a> object that makes up the swagger information for this field.
*
* <p>
* The following are completely equivalent ways of defining the swagger description of the Response object:
@@ -283,7 +283,7 @@ public @interface Response {
* <li>
* Note that the only swagger field you can't specify using this value is <js>"code"</js> whose value needs to be known during servlet initialization.
* <li>
- * The format is a {@link JsonSerializer#DEFAULT_LAX Simple-JSON} object.
+ * The format is a <a class='doclink' href='../../../../../overview-summary.html#juneau-marshall.JsonDetails.SimplifiedJson'>Simplified JSON</a> object.
* <li>
* The leading/trailing <code>{ }</code> characters are optional.
* <br>The following two example are considered equivalent:
diff --git a/juneau-core/juneau-marshall/src/main/java/org/apache/juneau/http/annotation/ResponseHeader.java b/juneau-core/juneau-marshall/src/main/java/org/apache/juneau/http/annotation/ResponseHeader.java
index 0455f6e..4e14d80 100644
--- a/juneau-core/juneau-marshall/src/main/java/org/apache/juneau/http/annotation/ResponseHeader.java
+++ b/juneau-core/juneau-marshall/src/main/java/org/apache/juneau/http/annotation/ResponseHeader.java
@@ -381,7 +381,7 @@ public @interface ResponseHeader {
* <h5 class='section'>Notes:</h5>
* <ul class='spaced-list'>
* <li>
- * The format is a {@link JsonSerializer#DEFAULT_LAX Simple-JSON} object.
+ * The format is a <a class='doclink' href='../../../../../overview-summary.html#juneau-marshall.JsonDetails.SimplifiedJson'>Simplified JSON</a> object.
* <br>Multiple lines are concatenated with newlines.
* <li>
* Supports <a class="doclink" href="../../../../../overview-summary.html#DefaultRestSvlVariables">initialization-time and request-time variables</a>
@@ -396,7 +396,7 @@ public @interface ResponseHeader {
* <h5 class='section'>Notes:</h5>
* <ul class='spaced-list'>
* <li>
- * The format is any {@link JsonSerializer#DEFAULT_LAX Simple-JSON}.
+ * The format is any <a class='doclink' href='../../../../../overview-summary.html#juneau-marshall.JsonDetails.SimplifiedJson'>Simplified JSON</a>.
* <br>Multiple lines are concatenated with newlines.
* <li>
* Supports <a class="doclink" href="../../../../../overview-summary.html#DefaultRestSvlVariables">initialization-time and request-time variables</a>
@@ -411,7 +411,7 @@ public @interface ResponseHeader {
* <h5 class='section'>Notes:</h5>
* <ul class='spaced-list'>
* <li>
- * The format is a {@link JsonSerializer#DEFAULT_LAX Simple-JSON} array or comma-delimited list.
+ * The format is a <a class='doclink' href='../../../../../overview-summary.html#juneau-marshall.JsonDetails.SimplifiedJson'>Simplified JSON</a> array or comma-delimited list.
* <br>Multiple lines are concatenated with newlines.
* <li>
* Supports <a class="doclink" href="../../../../../overview-summary.html#DefaultRestSvlVariables">initialization-time and request-time variables</a>
@@ -430,7 +430,7 @@ public @interface ResponseHeader {
* <h5 class='section'>Notes:</h5>
* <ul class='spaced-list'>
* <li>
- * The format is a {@link JsonSerializer#DEFAULT_LAX Simple-JSON} object or plain text string.
+ * The format is a <a class='doclink' href='../../../../../overview-summary.html#juneau-marshall.JsonDetails.SimplifiedJson'>Simplified JSON</a> object or plain text string.
* <br>Multiple lines are concatenated with newlines.
* <li>
* Supports <a class="doclink" href="../../../../../overview-summary.html#DefaultRestSvlVariables">initialization-time and request-time variables</a>
@@ -491,7 +491,7 @@ public @interface ResponseHeader {
* <li>
* Note that the only swagger field you can't specify using this value is <js>"name"</js> whose value needs to be known during servlet initialization.
* <li>
- * The format is a {@link JsonSerializer#DEFAULT_LAX Simple-JSON} object.
+ * The format is a <a class='doclink' href='../../../../../overview-summary.html#juneau-marshall.JsonDetails.SimplifiedJson'>Simplified JSON</a> object.
* <li>
* The leading/trailing <code>{ }</code> characters are optional.
* <br>The following two example are considered equivalent:
diff --git a/juneau-core/juneau-marshall/src/main/java/org/apache/juneau/http/annotation/ResponseStatus.java b/juneau-core/juneau-marshall/src/main/java/org/apache/juneau/http/annotation/ResponseStatus.java
index 5d4cf3f..395d1b9 100644
--- a/juneau-core/juneau-marshall/src/main/java/org/apache/juneau/http/annotation/ResponseStatus.java
+++ b/juneau-core/juneau-marshall/src/main/java/org/apache/juneau/http/annotation/ResponseStatus.java
@@ -189,7 +189,7 @@ public @interface ResponseStatus {
* <li>
* Note that the only swagger field you can't specify using this value is <js>"code"</js> whose value needs to be known during servlet initialization.
* <li>
- * The format is a {@link JsonSerializer#DEFAULT_LAX Simple-JSON} object.
+ * The format is a <a class='doclink' href='../../../../../overview-summary.html#juneau-marshall.JsonDetails.SimplifiedJson'>Simplified JSON</a> object.
* <li>
* The leading/trailing <code>{ }</code> characters are optional.
* <br>The following two example are considered equivalent:
diff --git a/juneau-core/juneau-marshall/src/main/java/org/apache/juneau/http/annotation/Schema.java b/juneau-core/juneau-marshall/src/main/java/org/apache/juneau/http/annotation/Schema.java
index d33ab89..2267b0a 100644
--- a/juneau-core/juneau-marshall/src/main/java/org/apache/juneau/http/annotation/Schema.java
+++ b/juneau-core/juneau-marshall/src/main/java/org/apache/juneau/http/annotation/Schema.java
@@ -139,7 +139,7 @@ public @interface Schema {
* <h5 class='section'>Notes:</h5>
* <ul class='spaced-list'>
* <li>
- * The format is any {@link JsonSerializer#DEFAULT_LAX Simple-JSON}.
+ * The format is any <a class='doclink' href='../../../../../overview-summary.html#juneau-marshall.JsonDetails.SimplifiedJson'>Simplified JSON</a>.
* <br>Multiple lines are concatenated with newlines.
* <li>
* Supports <a class="doclink" href="../../../../../overview-summary.html#DefaultRestSvlVariables">initialization-time and request-time variables</a>
@@ -317,7 +317,7 @@ public @interface Schema {
* <h5 class='section'>Notes:</h5>
* <ul class='spaced-list'>
* <li>
- * The format is a {@link JsonSerializer#DEFAULT_LAX Simple-JSON} object.
+ * The format is a <a class='doclink' href='../../../../../overview-summary.html#juneau-marshall.JsonDetails.SimplifiedJson'>Simplified JSON</a> object.
* <br>Multiple lines are concatenated with newlines.
* <li>
* Supports <a class="doclink" href="../../../../../overview-summary.html#DefaultRestSvlVariables">initialization-time and request-time variables</a>
@@ -333,7 +333,7 @@ public @interface Schema {
* <h5 class='section'>Notes:</h5>
* <ul class='spaced-list'>
* <li>
- * The format is a {@link JsonSerializer#DEFAULT_LAX Simple-JSON} object.
+ * The format is a <a class='doclink' href='../../../../../overview-summary.html#juneau-marshall.JsonDetails.SimplifiedJson'>Simplified JSON</a> object.
* <br>Multiple lines are concatenated with newlines.
* <li>
* Supports <a class="doclink" href="../../../../../overview-summary.html#DefaultRestSvlVariables">initialization-time and request-time variables</a>
@@ -383,7 +383,7 @@ public @interface Schema {
* <h5 class='section'>Notes:</h5>
* <ul class='spaced-list'>
* <li>
- * The format is a {@link JsonSerializer#DEFAULT_LAX Simple-JSON} array or comma-delimited list.
+ * The format is a <a class='doclink' href='../../../../../overview-summary.html#juneau-marshall.JsonDetails.SimplifiedJson'>Simplified JSON</a> array or comma-delimited list.
* <br>Multiple lines are concatenated with newlines.
* <li>
* Supports <a class="doclink" href="../../../../../overview-summary.html#DefaultRestSvlVariables">initialization-time and request-time variables</a>
@@ -446,7 +446,7 @@ public @interface Schema {
* <h5 class='section'>Notes:</h5>
* <ul class='spaced-list'>
* <li>
- * The format is a {@link JsonSerializer#DEFAULT_LAX Simple-JSON} object.
+ * The format is a <a class='doclink' href='../../../../../overview-summary.html#juneau-marshall.JsonDetails.SimplifiedJson'>Simplified JSON</a> object.
* <br>Multiple lines are concatenated with newlines.
* <li>
* Supports <a class="doclink" href="../../../../../overview-summary.html#DefaultRestSvlVariables">initialization-time and request-time variables</a>
@@ -461,7 +461,7 @@ public @interface Schema {
* <h5 class='section'>Notes:</h5>
* <ul class='spaced-list'>
* <li>
- * The format is a {@link JsonSerializer#DEFAULT_LAX Simple-JSON} object.
+ * The format is a <a class='doclink' href='../../../../../overview-summary.html#juneau-marshall.JsonDetails.SimplifiedJson'>Simplified JSON</a> object.
* <br>Multiple lines are concatenated with newlines.
* <li>
* Supports <a class="doclink" href="../../../../../overview-summary.html#DefaultRestSvlVariables">initialization-time and request-time variables</a>
@@ -476,7 +476,7 @@ public @interface Schema {
* <h5 class='section'>Notes:</h5>
* <ul class='spaced-list'>
* <li>
- * The format is a {@link JsonSerializer#DEFAULT_LAX Simple-JSON} object.
+ * The format is a <a class='doclink' href='../../../../../overview-summary.html#juneau-marshall.JsonDetails.SimplifiedJson'>Simplified JSON</a> object.
* <br>Multiple lines are concatenated with newlines.
* <li>
* Supports <a class="doclink" href="../../../../../overview-summary.html#DefaultRestSvlVariables">initialization-time and request-time variables</a>
@@ -491,7 +491,7 @@ public @interface Schema {
* <h5 class='section'>Notes:</h5>
* <ul class='spaced-list'>
* <li>
- * The format is a {@link JsonSerializer#DEFAULT_LAX Simple-JSON} object.
+ * The format is a <a class='doclink' href='../../../../../overview-summary.html#juneau-marshall.JsonDetails.SimplifiedJson'>Simplified JSON</a> object.
* <br>Multiple lines are concatenated with newlines.
* <li>
* Supports <a class="doclink" href="../../../../../overview-summary.html#DefaultRestSvlVariables">initialization-time and request-time variables</a>
@@ -506,7 +506,7 @@ public @interface Schema {
* <h5 class='section'>Notes:</h5>
* <ul class='spaced-list'>
* <li>
- * The format is a {@link JsonSerializer#DEFAULT_LAX Simple-JSON} object.
+ * The format is a <a class='doclink' href='../../../../../overview-summary.html#juneau-marshall.JsonDetails.SimplifiedJson'>Simplified JSON</a> object.
* <br>Multiple lines are concatenated with newlines.
* <li>
* Supports <a class="doclink" href="../../../../../overview-summary.html#DefaultRestSvlVariables">initialization-time and request-time variables</a>
@@ -521,7 +521,7 @@ public @interface Schema {
* <h5 class='section'>Notes:</h5>
* <ul class='spaced-list'>
* <li>
- * The format is a {@link JsonSerializer#DEFAULT_LAX Simple-JSON} object.
+ * The format is a <a class='doclink' href='../../../../../overview-summary.html#juneau-marshall.JsonDetails.SimplifiedJson'>Simplified JSON</a> object.
* <br>Multiple lines are concatenated with newlines.
* <li>
* Supports <a class="doclink" href="../../../../../overview-summary.html#DefaultRestSvlVariables">initialization-time and request-time variables</a>
@@ -536,7 +536,7 @@ public @interface Schema {
* <h5 class='section'>Notes:</h5>
* <ul class='spaced-list'>
* <li>
- * The format is a {@link JsonSerializer#DEFAULT_LAX Simple-JSON} object.
+ * The format is a <a class='doclink' href='../../../../../overview-summary.html#juneau-marshall.JsonDetails.SimplifiedJson'>Simplified JSON</a> object.
* <br>Multiple lines are concatenated with newlines.
* <li>
* Supports <a class="doclink" href="../../../../../overview-summary.html#DefaultRestSvlVariables">initialization-time and request-time variables</a>
@@ -551,7 +551,7 @@ public @interface Schema {
* <h5 class='section'>Notes:</h5>
* <ul class='spaced-list'>
* <li>
- * The format is a {@link JsonSerializer#DEFAULT_LAX Simple-JSON} object.
+ * The format is a <a class='doclink' href='../../../../../overview-summary.html#juneau-marshall.JsonDetails.SimplifiedJson'>Simplified JSON</a> object.
* <br>Multiple lines are concatenated with newlines.
* <li>
* Supports <a class="doclink" href="../../../../../overview-summary.html#DefaultRestSvlVariables">initialization-time and request-time variables</a>
@@ -570,7 +570,7 @@ public @interface Schema {
* <h5 class='section'>Notes:</h5>
* <ul class='spaced-list'>
* <li>
- * The format is a {@link JsonSerializer#DEFAULT_LAX Simple-JSON} object or plain text string.
+ * The format is a <a class='doclink' href='../../../../../overview-summary.html#juneau-marshall.JsonDetails.SimplifiedJson'>Simplified JSON</a> object or plain text string.
* <br>Multiple lines are concatenated with newlines.
* <li>
* Supports <a class="doclink" href="../../../../../overview-summary.html#DefaultRestSvlVariables">initialization-time and request-time variables</a>
@@ -588,7 +588,7 @@ public @interface Schema {
* <h5 class='section'>Notes:</h5>
* <ul class='spaced-list'>
* <li>
- * The format is a {@link JsonSerializer#DEFAULT_LAX Simple-JSON} object.
+ * The format is a <a class='doclink' href='../../../../../overview-summary.html#juneau-marshall.JsonDetails.SimplifiedJson'>Simplified JSON</a> object.
* <br>Multiple lines are concatenated with newlines.
* <li>
* Supports <a class="doclink" href="../../../../../overview-summary.html#DefaultRestSvlVariables">initialization-time and request-time variables</a>
@@ -647,7 +647,7 @@ public @interface Schema {
* <h5 class='section'>Notes:</h5>
* <ul class='spaced-list'>
* <li>
- * The format is a {@link JsonSerializer#DEFAULT_LAX Simple-JSON} object.
+ * The format is a <a class='doclink' href='../../../../../overview-summary.html#juneau-marshall.JsonDetails.SimplifiedJson'>Simplified JSON</a> object.
* <li>
* The leading/trailing <code>{ }</code> characters are optional.
* <br>The following two example are considered equivalent:
diff --git a/juneau-core/juneau-marshall/src/main/java/org/apache/juneau/http/annotation/SubItems.java b/juneau-core/juneau-marshall/src/main/java/org/apache/juneau/http/annotation/SubItems.java
index 8e96127..d31e47a 100644
--- a/juneau-core/juneau-marshall/src/main/java/org/apache/juneau/http/annotation/SubItems.java
+++ b/juneau-core/juneau-marshall/src/main/java/org/apache/juneau/http/annotation/SubItems.java
@@ -281,7 +281,7 @@ public @interface SubItems {
* Free-form value for the Swagger <a class="doclink" href="https://swagger.io/specification/v2/#itemsObject">Items</a> object.
*
* <p>
- * This is a {@link JsonSerializer#DEFAULT_LAX Simple-JSON} object that makes up the swagger information for this field.
+ * This is a <a class='doclink' href='../../../../../overview-summary.html#juneau-marshall.JsonDetails.SimplifiedJson'>Simplified JSON</a> object that makes up the swagger information for this field.
*
* <p>
* The following are completely equivalent ways of defining the swagger description of an Items object:
@@ -348,7 +348,7 @@ public @interface SubItems {
* <li>
* Note that the only swagger field you can't specify using this value is <js>"name"</js> whose value needs to be known during servlet initialization.
* <li>
- * The format is a {@link JsonSerializer#DEFAULT_LAX Simple-JSON} object.
+ * The format is a <a class='doclink' href='../../../../../overview-summary.html#juneau-marshall.JsonDetails.SimplifiedJson'>Simplified JSON</a> object.
* <li>
* The leading/trailing <code>{ }</code> characters are optional.
* <br>The following two example are considered equivalent:
diff --git a/juneau-core/juneau-marshall/src/main/java/org/apache/juneau/http/annotation/Tag.java b/juneau-core/juneau-marshall/src/main/java/org/apache/juneau/http/annotation/Tag.java
index c26be29..26d3005 100644
--- a/juneau-core/juneau-marshall/src/main/java/org/apache/juneau/http/annotation/Tag.java
+++ b/juneau-core/juneau-marshall/src/main/java/org/apache/juneau/http/annotation/Tag.java
@@ -85,7 +85,7 @@ public @interface Tag {
* <h5 class='section'>Notes:</h5>
* <ul class='spaced-list'>
* <li>
- * The format is a {@link JsonSerializer#DEFAULT_LAX Simple-JSON} object.
+ * The format is a <a class='doclink' href='../../../../../overview-summary.html#juneau-marshall.JsonDetails.SimplifiedJson'>Simplified JSON</a> object.
* <br>Multiple lines are concatenated with newlines.
* <li>
* Supports <a class="doclink" href="../../../../../overview-summary.html#DefaultRestSvlVariables">initialization-time and request-time variables</a>
@@ -100,7 +100,7 @@ public @interface Tag {
* <h5 class='section'>Notes:</h5>
* <ul class='spaced-list'>
* <li>
- * The format is a {@link JsonSerializer#DEFAULT_LAX Simple-JSON} object.
+ * The format is a <a class='doclink' href='../../../../../overview-summary.html#juneau-marshall.JsonDetails.SimplifiedJson'>Simplified JSON</a> object.
* <br>Multiple lines are concatenated with newlines.
* <li>
* Supports <a class="doclink" href="../../../../../overview-summary.html#DefaultRestSvlVariables">initialization-time and request-time variables</a>
@@ -113,7 +113,7 @@ public @interface Tag {
* Free-form value for the Swagger <a class="doclink" href="https://swagger.io/specification/v2/#tagObject">Tag</a> object.
*
* <p>
- * This is a {@link JsonSerializer#DEFAULT_LAX Simple-JSON} object that makes up the swagger information for this Tag object.
+ * This is a <a class='doclink' href='../../../../../overview-summary.html#juneau-marshall.JsonDetails.SimplifiedJson'>Simplified JSON</a> object that makes up the swagger information for this Tag object.
*
* <p>
* The following are completely equivalent ways of defining the swagger description of the resource tags:
@@ -176,7 +176,7 @@ public @interface Tag {
* <h5 class='section'>Notes:</h5>
* <ul class='spaced-list'>
* <li>
- * The format is a {@link JsonSerializer#DEFAULT_LAX Simple-JSON} object.
+ * The format is a <a class='doclink' href='../../../../../overview-summary.html#juneau-marshall.JsonDetails.SimplifiedJson'>Simplified JSON</a> object.
* <li>
* The leading/trailing <code>{ }</code> characters are optional.
* <br>The following two example are considered equivalent:
diff --git a/juneau-core/juneau-marshall/src/main/java/org/apache/juneau/internal/CollectionUtils.java b/juneau-core/juneau-marshall/src/main/java/org/apache/juneau/internal/CollectionUtils.java
index 3d987d1..b3769b3 100644
--- a/juneau-core/juneau-marshall/src/main/java/org/apache/juneau/internal/CollectionUtils.java
+++ b/juneau-core/juneau-marshall/src/main/java/org/apache/juneau/internal/CollectionUtils.java
@@ -261,7 +261,7 @@ public final class CollectionUtils {
}
static String string(Object value) {
- return JsonSerializer.DEFAULT_LAX.toString(value);
+ return SimpleJsonSerializer.DEFAULT.toString(value);
}
static String className(Object value) {
diff --git a/juneau-core/juneau-marshall/src/main/java/org/apache/juneau/internal/StringUtils.java b/juneau-core/juneau-marshall/src/main/java/org/apache/juneau/internal/StringUtils.java
index 40f620a..fada226 100644
--- a/juneau-core/juneau-marshall/src/main/java/org/apache/juneau/internal/StringUtils.java
+++ b/juneau-core/juneau-marshall/src/main/java/org/apache/juneau/internal/StringUtils.java
@@ -2198,7 +2198,7 @@ public final class StringUtils {
return o.toString();
ClassMeta<?> cm = BeanContext.DEFAULT.getClassMetaForObject(o);
if (cm.isMapOrBean() || cm.isCollectionOrArray())
- return JsonSerializer.DEFAULT_LAX.toString(o);
+ return SimpleJsonSerializer.DEFAULT.toString(o);
if (cm.isClass())
return ((Class<?>)o).getName();
if (cm.isMethod())
diff --git a/juneau-core/juneau-marshall/src/main/java/org/apache/juneau/json/JsonSerializer.java b/juneau-core/juneau-marshall/src/main/java/org/apache/juneau/json/JsonSerializer.java
index f9243c2..870f4b6 100644
--- a/juneau-core/juneau-marshall/src/main/java/org/apache/juneau/json/JsonSerializer.java
+++ b/juneau-core/juneau-marshall/src/main/java/org/apache/juneau/json/JsonSerializer.java
@@ -67,9 +67,9 @@ import org.apache.juneau.serializer.*;
* The following direct subclasses are provided for convenience:
* <ul class='spaced-list'>
* <li>
- * {@link Simple} - Default serializer, single quotes, simple mode.
+ * {@link SimpleJsonSerializer} - Default serializer, single quotes, simple mode.
* <li>
- * {@link SimpleReadable} - Default serializer, single quotes, simple mode, with whitespace.
+ * {@link SimpleJsonSerializer.Readable} - Default serializer, single quotes, simple mode, with whitespace.
* </ul>
*
* <h5 class='section'>Example:</h5>
@@ -249,7 +249,6 @@ public class JsonSerializer extends WriterSerializer {
*/
public static final String JSON_simpleMode = PREFIX + "simpleMode.b";
-
//-------------------------------------------------------------------------------------------------------------------
// Predefined instances
//-------------------------------------------------------------------------------------------------------------------
@@ -260,19 +259,6 @@ public class JsonSerializer extends WriterSerializer {
/** Default serializer, all default settings.*/
public static final JsonSerializer DEFAULT_READABLE = new Readable(PropertyStore.DEFAULT);
- /** Default serializer, single quotes, {@link #JSON_simpleMode simple mode}. */
- public static final JsonSerializer DEFAULT_LAX = new Simple(PropertyStore.DEFAULT);
-
- /** Default serializer, single quotes, simple mode, with whitespace. */
- public static final JsonSerializer DEFAULT_LAX_READABLE = new SimpleReadable(PropertyStore.DEFAULT);
-
- /**
- * Default serializer, single quotes, simple mode, with whitespace and recursion detection.
- * Note that recursion detection introduces a small performance penalty.
- */
- public static final JsonSerializer DEFAULT_LAX_READABLE_SAFE = new SimpleReadableSafe(PropertyStore.DEFAULT);
-
-
//-------------------------------------------------------------------------------------------------------------------
// Predefined subclasses
//-------------------------------------------------------------------------------------------------------------------
@@ -292,56 +278,18 @@ public class JsonSerializer extends WriterSerializer {
}
}
- /** Default serializer, single quotes, simple mode. */
- public static class Simple extends JsonSerializer {
-
- /**
- * Constructor.
- *
- * @param ps The property store containing all the settings for this object.
- */
- public Simple(PropertyStore ps) {
- super(
- ps.builder()
- .set(JSON_simpleMode, true)
- .set(WSERIALIZER_quoteChar, '\'')
- .build(),
- "application/json", "application/json+simple,text/json+simple,application/json;q=0.9,text/json;q=0.9"
- );
- }
- }
-
- /** Default serializer, single quotes, simple mode, with whitespace. */
- public static class SimpleReadable extends JsonSerializer {
-
- /**
- * Constructor.
- *
- * @param ps The property store containing all the settings for this object.
- */
- public SimpleReadable(PropertyStore ps) {
- super(
- ps.builder()
- .set(JSON_simpleMode, true)
- .set(WSERIALIZER_quoteChar, '\'')
- .set(SERIALIZER_useWhitespace, true)
- .build()
- );
- }
- }
-
/**
* Default serializer, single quotes, simple mode, with whitespace and recursion detection.
* Note that recursion detection introduces a small performance penalty.
*/
- public static class SimpleReadableSafe extends JsonSerializer {
+ public static class ReadableSafe extends JsonSerializer {
/**
* Constructor.
*
* @param ps The property store containing all the settings for this object.
*/
- public SimpleReadableSafe(PropertyStore ps) {
+ public ReadableSafe(PropertyStore ps) {
super(
ps.builder()
.set(JSON_simpleMode, true)
diff --git a/juneau-core/juneau-marshall/src/main/java/org/apache/juneau/json/SimpleJsonSerializer.java b/juneau-core/juneau-marshall/src/main/java/org/apache/juneau/json/SimpleJsonSerializer.java
new file mode 100644
index 0000000..a984580
--- /dev/null
+++ b/juneau-core/juneau-marshall/src/main/java/org/apache/juneau/json/SimpleJsonSerializer.java
@@ -0,0 +1,69 @@
+// ***************************************************************************************************************************
+// * Licensed to the Apache Software Foundation (ASF) under one or more contributor license agreements. See the NOTICE file *
+// * distributed with this work for additional information regarding copyright ownership. The ASF licenses this file *
+// * to you under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance *
+// * with the License. You may obtain a copy of the License at *
+// * *
+// * http://www.apache.org/licenses/LICENSE-2.0 *
+// * *
+// * Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an *
+// * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the *
+// * specific language governing permissions and limitations under the License. *
+// ***************************************************************************************************************************
+package org.apache.juneau.json;
+
+import org.apache.juneau.*;
+
+/**
+ * TODO
+ */
+public class SimpleJsonSerializer extends JsonSerializer {
+
+ //-------------------------------------------------------------------------------------------------------------------
+ // Predefined instances
+ //-------------------------------------------------------------------------------------------------------------------
+
+ /** Default serializer, single quotes, {@link #JSON_simpleMode simple mode}. */
+ public static final JsonSerializer DEFAULT = new SimpleJsonSerializer(PropertyStore.DEFAULT);
+
+ /** Default serializer, single quotes, simple mode, with whitespace. */
+ public static final JsonSerializer DEFAULT_READABLE = new Readable(PropertyStore.DEFAULT);
+
+ //-------------------------------------------------------------------------------------------------------------------
+ // Predefined subclasses
+ //-------------------------------------------------------------------------------------------------------------------
+
+ /** Default serializer, single quotes, simple mode, with whitespace. */
+ public static class Readable extends JsonSerializer {
+
+ /**
+ * Constructor.
+ *
+ * @param ps The property store containing all the settings for this object.
+ */
+ public Readable(PropertyStore ps) {
+ super(
+ ps.builder()
+ .set(JSON_simpleMode, true)
+ .set(WSERIALIZER_quoteChar, '\'')
+ .set(SERIALIZER_useWhitespace, true)
+ .build()
+ );
+ }
+ }
+
+ /**
+ * Constructor.
+ *
+ * @param ps The property store containing all the settings for this object.
+ */
+ public SimpleJsonSerializer(PropertyStore ps) {
+ super(
+ ps.builder()
+ .set(JSON_simpleMode, true)
+ .set(WSERIALIZER_quoteChar, '\'')
+ .build(),
+ "application/json", "application/json+simple,text/json+simple,application/json;q=0.9,text/json;q=0.9"
+ );
+ }
+}
\ No newline at end of file
diff --git a/juneau-core/juneau-marshall/src/main/java/org/apache/juneau/jsonschema/JsonSchemaSerializer.java b/juneau-core/juneau-marshall/src/main/java/org/apache/juneau/jsonschema/JsonSchemaSerializer.java
index 70f3657..b11ee44 100644
--- a/juneau-core/juneau-marshall/src/main/java/org/apache/juneau/jsonschema/JsonSchemaSerializer.java
+++ b/juneau-core/juneau-marshall/src/main/java/org/apache/juneau/jsonschema/JsonSchemaSerializer.java
@@ -254,10 +254,10 @@ public class JsonSchemaSerializer extends JsonSerializer {
public static final JsonSchemaSerializer DEFAULT_READABLE = new Readable(PropertyStore.DEFAULT);
/** Default serializer, single quotes, simple mode. */
- public static final JsonSchemaSerializer DEFAULT_LAX = new Simple(PropertyStore.DEFAULT);
+ public static final JsonSchemaSerializer DEFAULT_SIMPLE = new Simple(PropertyStore.DEFAULT);
/** Default serializer, single quotes, simple mode, with whitespace. */
- public static final JsonSchemaSerializer DEFAULT_LAX_READABLE = new SimpleReadable(PropertyStore.DEFAULT);
+ public static final JsonSchemaSerializer DEFAULT_SIMPLE_READABLE = new SimpleReadable(PropertyStore.DEFAULT);
//-------------------------------------------------------------------------------------------------------------------
diff --git a/juneau-core/juneau-marshall/src/main/java/org/apache/juneau/parser/Parser.java b/juneau-core/juneau-marshall/src/main/java/org/apache/juneau/parser/Parser.java
index bbf5cf8..b6cf7e8 100644
--- a/juneau-core/juneau-marshall/src/main/java/org/apache/juneau/parser/Parser.java
+++ b/juneau-core/juneau-marshall/src/main/java/org/apache/juneau/parser/Parser.java
@@ -270,7 +270,7 @@ public abstract class Parser extends BeanContext {
* MyParserListener l = s.getListener(MyParserListener.<jk>class</jk>);
*
* <jc>// Dump the results to the console.</jc>
- * JsonSerializer.<jsf>DEFAULT_LAX</jsf>.println(l.<jf>events</jf>);
+ * SimpleJsonSerializer.<jsf>DEFAULT</jsf>.println(l.<jf>events</jf>);
* }
* </p>
*/
diff --git a/juneau-core/juneau-marshall/src/main/java/org/apache/juneau/serializer/SerializeException.java b/juneau-core/juneau-marshall/src/main/java/org/apache/juneau/serializer/SerializeException.java
index bb2b03d..8836536 100644
--- a/juneau-core/juneau-marshall/src/main/java/org/apache/juneau/serializer/SerializeException.java
+++ b/juneau-core/juneau-marshall/src/main/java/org/apache/juneau/serializer/SerializeException.java
@@ -72,7 +72,7 @@ public class SerializeException extends FormattedException {
if (session != null) {
Map<String,Object> m = session.getLastLocation();
if (m != null && ! m.isEmpty())
- msg = "Serialize exception occurred at " + JsonSerializer.DEFAULT_LAX.toString(m) + ". " + msg;
+ msg = "Serialize exception occurred at " + SimpleJsonSerializer.DEFAULT.toString(m) + ". " + msg;
}
return msg;
}
diff --git a/juneau-core/juneau-marshall/src/main/java/org/apache/juneau/serializer/Serializer.java b/juneau-core/juneau-marshall/src/main/java/org/apache/juneau/serializer/Serializer.java
index 18a3641..ee257e6 100644
--- a/juneau-core/juneau-marshall/src/main/java/org/apache/juneau/serializer/Serializer.java
+++ b/juneau-core/juneau-marshall/src/main/java/org/apache/juneau/serializer/Serializer.java
@@ -360,7 +360,7 @@ public abstract class Serializer extends BeanContext {
* MySerializerListener l = ss.getListener(MySerializerListener.<jk>class</jk>);
*
* <jc>// Dump the results to the console.</jc>
- * JsonSerializer.<jsf>DEFAULT_LAX</jsf>.println(l.<jf>events</jf>);
+ * SimpleJsonSerializer.<jsf>DEFAULT</jsf>.println(l.<jf>events</jf>);
* }
* </p>
*/
@@ -657,7 +657,7 @@ public abstract class Serializer extends BeanContext {
* m.put(<js>" foo "</js>, <js>" bar "</js>);
*
* <jc>// Produces "{foo:'bar'}"</jc>
- * String json = JsonSerializer.<jsf>DEFAULT_LAX</jsf>.toString(m);
+ * String json = SimpleJsonSerializer.<jsf>DEFAULT</jsf>.toString(m);
* </p>
*/
public static final String SERIALIZER_trimStrings = PREFIX + "trimStrings.b";
@@ -1110,7 +1110,7 @@ public abstract class Serializer extends BeanContext {
*
* <p>
* This method is specified to override the content type for this serializer.
- * For example, the {@link org.apache.juneau.json.JsonSerializer.Simple} class returns that it handles media type
+ * For example, the {@link org.apache.juneau.json.SimpleJsonSerializer} class returns that it handles media type
* <js>"text/json+simple"</js>, but returns <js>"text/json"</js> as the actual content type.
* This allows clients to request specific 'flavors' of content using specialized <code>Accept</code> header values.
*
diff --git a/juneau-core/juneau-marshall/src/main/java/org/apache/juneau/utils/StringObject.java b/juneau-core/juneau-marshall/src/main/java/org/apache/juneau/utils/StringObject.java
index 0ff3fb9..69316ba 100644
--- a/juneau-core/juneau-marshall/src/main/java/org/apache/juneau/utils/StringObject.java
+++ b/juneau-core/juneau-marshall/src/main/java/org/apache/juneau/utils/StringObject.java
@@ -52,12 +52,12 @@ public class StringObject implements CharSequence, Writable {
}
/**
- * Constructor with default serializer {@link JsonSerializer#DEFAULT_LAX}
+ * Constructor with default serializer {@link SimpleJsonSerializer#DEFAULT}
*
* @param o The object to be serialized.
*/
public StringObject(Object o) {
- this(JsonSerializer.DEFAULT_LAX, o);
+ this(SimpleJsonSerializer.DEFAULT, o);
}
@Override /* Object */
diff --git a/juneau-core/juneau-marshall/src/main/java/org/apache/juneau/yaml/proto/package.html b/juneau-core/juneau-marshall/src/main/java/org/apache/juneau/yaml/proto/package.html
index 03ef0ed..07e55e8 100644
--- a/juneau-core/juneau-marshall/src/main/java/org/apache/juneau/yaml/proto/package.html
+++ b/juneau-core/juneau-marshall/src/main/java/org/apache/juneau/yaml/proto/package.html
@@ -283,7 +283,7 @@
</p>
<p class='bcode'>
<jc>// Use serializer with readable output, simple mode.</jc>
- JsonSerializer s = JsonSerializer.<jsf>DEFAULT_LAX_READABLE</jsf>;
+ JsonSerializer s = SimpleJsonSerializer.<jsf>DEFAULT_READABLE</jsf>;
<jc>// Create our bean.</jc>
Person p = <jk>new</jk> Person(1, <js>"John Smith"</js>);
@@ -445,7 +445,7 @@
</p>
<p class='bcode'>
<jc>// Use serializer with readable output, simple mode.</jc>
- JsonSerializer s = JsonSerializer.<jsf>DEFAULT_LAX_READABLE</jsf>;
+ JsonSerializer s = SimpleJsonSerializer.<jsf>DEFAULT_READABLE</jsf>;
<jc>// Create our bean.</jc>
Person p = <jk>new</jk> Person(1, <js>"John Smith"</js>, <js>"http://sample/addressBook/person/1"</js>,
@@ -545,7 +545,7 @@
</p>
<p class='bcode'>
<jc>// Get the schema serializer for one of the default JSON serializers.</jc>
- JsonSchemaSerializer s = JsonSerializer.<jsf>DEFAULT_LAX_READABLE</jsf>.getSchemaSerializer();
+ JsonSchemaSerializer s = SimpleJsonSerializer.<jsf>DEFAULT_READABLE</jsf>.getSchemaSerializer();
<jc>// Create our bean.</jc>
Person p = <jk>new</jk> Person(1, <js>"John Smith"</js>, <js>"http://sample/addressBook/person/1"</js>,
@@ -677,7 +677,7 @@
</p>
<p class='bcode'>
<jc>// Clone an existing serializer and set property for detecting recursions.</jc>
- JsonSerializer s = JsonSerializer.<jsf>DEFAULT_LAX_READABLE</jsf>.builder().detectRecursions(<jk>true</jk>).build();
+ JsonSerializer s = SimpleJsonSerializer.<jsf>DEFAULT_READABLE</jsf>.builder().detectRecursions(<jk>true</jk>).build();
<jc>// Create a recursive loop.</jc>
A a = <jk>new</jk> A();
@@ -774,7 +774,7 @@
</p>
<p class='bcode'>
<jc>// Use serializer with readable output, simple mode.</jc>
- JsonSerializer s = JsonSerializer.<jsf>DEFAULT_LAX_READABLE</jsf>;
+ JsonSerializer s = SimpleJsonSerializer.<jsf>DEFAULT_READABLE</jsf>;
<jc>// Create our bean.</jc>
Person p = <jk>new</jk> Person(1, <js>"John Smith"</js>, <js>"http://sample/addressBook/person/1"</js>,
@@ -825,7 +825,7 @@
Person p = JsonParser.<jsf>DEFAULT</jsf>.parse(json, Person.<jk>class</jk>);
<jc>// Render it back as JSON.</jc>
- json = JsonSerializer.<jsf>DEFAULT_LAX_READABLE</jsf>.serialize(p);
+ json = SimpleJsonSerializer.<jsf>DEFAULT_READABLE</jsf>.serialize(p);
</p>
<p>
We print it back out to JSON to show that all the data has been preserved:
@@ -908,7 +908,7 @@
ObjectMap m = JsonParser.<jsf>DEFAULT</jsf>.parse(json, ObjectMap.<jk>class</jk>);
<jc>// Convert it back to JSON.</jc>
- String json = JsonSerializer.<jsf>DEFAULT_LAX_READABLE</jsf>.serialize(m);
+ String json = SimpleJsonSerializer.<jsf>DEFAULT_READABLE</jsf>.serialize(m);
</p>
<p>
What we end up with is the exact same output.
diff --git a/juneau-doc/src/main/javadoc/overview.html b/juneau-doc/src/main/javadoc/overview.html
index c39323e..bb3b830 100644
--- a/juneau-doc/src/main/javadoc/overview.html
+++ b/juneau-doc/src/main/javadoc/overview.html
@@ -132,6 +132,7 @@
<ol>
<li><p><a class='doclink' href='#juneau-marshall.JsonDetails.JsonMethodology'>JSON Methodology</a></p>
<li><p><a class='doclink' href='#juneau-marshall.JsonDetails.JsonSerializers'>JSON Serializers</a></p>
+ <li><p><a class='doclink' href='#juneau-marshall.JsonDetails.SimplifiedJson'>Simplified JSON</a></p>
<li><p><a class='doclink' href='#juneau-marshall.JsonDetails.JsonParsers'>JSON Parsers</a></p>
<li><p><a class='doclink' href='#juneau-marshall.JsonDetails.JsonAnnotation'>@Json Annotation</a></p>
<li><p><a class='doclink' href='#juneau-marshall.JsonDetails.JsonSchema'>JSON-Schema Support</a></p>
@@ -291,10 +292,23 @@
<li><p><a class='doclink' href='#juneau-rest-server.HandlingMultiPartFormPosts'>Handling Multi-Part Form Posts</a></p>
</ol>
<li><p><a class='doclink' href='#juneau-rest-server.FormData'>@FormData</a></p>
+ <li><p><a class='doclink' href='#juneau-rest-server.HasFormData'>@HasFormData</a></p>
<li><p><a class='doclink' href='#juneau-rest-server.Query'>@Query</a></p>
+ <li><p><a class='doclink' href='#juneau-rest-server.HasQuery'>@HasQuery</a></p>
<li><p><a class='doclink' href='#juneau-rest-server.Header'>@Header</a></p>
+ <li><p><a class='doclink' href='#juneau-rest-server.Path'>@Path</a></p>
+ <li><p><a class='doclink' href='#juneau-rest-server.PathRemainder'>@PathRemainder</a></p>
+ <li><p><a class='doclink' href='#juneau-rest-server.SwaggerSchemaPartParsing'>Swagger Schema Part Parsing</a></p>
+ <li><p><a class='doclink' href='#juneau-rest-server.Response'>@Response</a></p>
+ <li><p><a class='doclink' href='#juneau-rest-server.Responses'>@Responses</a></p>
+ <li><p><a class='doclink' href='#juneau-rest-server.ResponseHeader'>@ResponseHeader</a></p>
+ <li><p><a class='doclink' href='#juneau-rest-server.ResponseStatus'>@ResponseStatus</a></p>
+ <li><p><a class='doclink' href='#juneau-rest-server.ResponseStatuses'>@ResponseStatuses</a></p>
+ <li><p><a class='doclink' href='#juneau-rest-server.SwaggerSchemaPartSerializing'>Swagger Schema Part Serializing</a></p>
<li><p><a class='doclink' href='#juneau-rest-server.Serializers'>Serializers</a></p>
+ <li><p><a class='doclink' href='#juneau-rest-server.PartSerializers'>PartSerializers</a></p>
<li><p><a class='doclink' href='#juneau-rest-server.Parsers'>Parsers</a></p>
+ <li><p><a class='doclink' href='#juneau-rest-server.PartParsers'>PartParsers</a></p>
<li><p><a class='doclink' href='#juneau-rest-server.Properties'>Properties</a></p>
<li><p><a class='doclink' href='#juneau-rest-server.Transforms'>Transforms</a></p>
<li><p><a class='doclink' href='#juneau-rest-server.Guards'>Guards</a></p>
@@ -813,6 +827,64 @@
<br>Extensible support for other data types such as <code>Calendars</code>, <code>Dates</code>,
<code>Iterators</code> is available through the use of POJO swaps (described later).
</p>
+ <p>
+ The class hierarchy for the serializers (excluding specialized subclasses) are:
+ </p>
+ <ul class='doctree'>
+ <li class='jac'>{@link org.apache.juneau.serializer.Serializer}
+ <ul>
+ <li class='jac'>{@link org.apache.juneau.serializer.WriterSerializer}
+ <ul>
+ <li class='jc'>{@link org.apache.juneau.json.JsonSerializer}
+ <ul>
+ <li class='jc'>{@link org.apache.juneau.jsonschema.JsonSchemaSerializer}
+ <li class='jc'>{@link org.apache.juneau.json.SimpleJsonSerializer}
+ </ul>
+ <li class='jc'>{@link org.apache.juneau.plaintext.PlainTextSerializer}
+ <li class='jc'>{@link org.apache.juneau.jena.RdfSerializer}
+ <ul>
+ <li class='jc'>{@link org.apache.juneau.jena.N3Serializer}
+ <li class='jc'>{@link org.apache.juneau.jena.NTripleSerializer}
+ <li class='jc'>{@link org.apache.juneau.jena.RdfXmlSerializer}
+ <li class='jc'>{@link org.apache.juneau.jena.RdfXmlAbbrevSerializer}
+ <li class='jc'>{@link org.apache.juneau.jena.TurtleSerializer}
+ </ul>
+ <li class='jc'>{@link org.apache.juneau.uon.UonSerializer}
+ <ul>
+ <li class='jc'>{@link org.apache.juneau.httppart.UonPartSerializer}
+ <ul>
+ <li class='jc'>{@link org.apache.juneau.httppart.OpenApiPartSerializer}
+ <li class='jc'>{@link org.apache.juneau.httppart.SimpleUonPartSerializer}
+ </ul>
+ <li class='jc'>{@link org.apache.juneau.urlencoding.UrlEncodingSerializer}
+ </ul>
+ <li class='jc'>{@link org.apache.juneau.xml.XmlSerializer}
+ <ul>
+ <li class='jc'>{@link org.apache.juneau.html.HtmlSerializer}
+ <ul>
+ <li class='jc'>{@link org.apache.juneau.html.HtmlStrippedDocSerializer}
+ <ul>
+ <li class='jc'>{@link org.apache.juneau.html.HtmlDocSerializer}
+ <ul>
+ <li class='jc'>{@link org.apache.juneau.htmlschema.HtmlSchemaDocSerializer}
+ </ul>
+ </ul>
+ </ul>
+ <li class='jc'>{@link org.apache.juneau.soap.SoapXmlSerializer}
+ <li class='jc'>{@link org.apache.juneau.xml.XmlDocSerializer}
+ <li class='jc'>{@link org.apache.juneau.xmlschema.XmlSchemaSerializer}
+ <ul>
+ <li class='jc'>{@link org.apache.juneau.xmlschema.XmlSchemaDocSerializer}
+ </ul>
+ </ul>
+ </ul>
+ <li class='jac'>{@link org.apache.juneau.serializer.OutputStreamSerializer}
+ <ul>
+ <li class='jc'>{@link org.apache.juneau.jso.JsoSerializer}
+ <li class='jc'>{@link org.apache.juneau.msgpack.MsgPackSerializer}
+ </ul>
+ </ul>
+ </ul>
</div>
<!-- === 2.2 - Parsers ============================================================================== -->
@@ -1082,10 +1154,13 @@
<li class='jc'>{@link org.apache.juneau.json.JsonSerializer}
<ul>
<li class='jf'>{@link org.apache.juneau.json.JsonSerializer#DEFAULT DEFAULT}
- <li class='jf'>{@link org.apache.juneau.json.JsonSerializer#DEFAULT_LAX DEFAULT_LAX}
<li class='jf'>{@link org.apache.juneau.json.JsonSerializer#DEFAULT_READABLE DEFAULT_READABLE}
- <li class='jf'>{@link org.apache.juneau.json.JsonSerializer#DEFAULT_LAX_READABLE DEFAULT_LAX_READABLE}
- <li class='jf'>{@link org.apache.juneau.json.JsonSerializer#DEFAULT_LAX_READABLE_SAFE DEFAULT_LAX_READABLE_SAFE}
+ </ul>
+ </li>
+ <li class='jc'>{@link org.apache.juneau.json.SimpleJsonSerializer}
+ <ul>
+ <li class='jf'>{@link org.apache.juneau.json.SimpleJsonSerializer#DEFAULT DEFAULT}
+ <li class='jf'>{@link org.apache.juneau.json.SimpleJsonSerializer#DEFAULT_READABLE DEFAULT_READABLE}
</ul>
</li>
<li class='jc'>{@link org.apache.juneau.json.JsonParser}
@@ -1100,7 +1175,8 @@
</p>
<p class='bcode w800'>
<jc>// Serialize a POJO to LAX JSON.</jc>
- String json = JsonSerializer.<jsf>DEFAULT_LAX</jsf>.serialize(myPojo);
+ String json = SimpleJsonSerializer.<jsf>DEFAULT</jsf>
+.serialize(myPojo);
</p>
<p>
For performance reasons, serializers and parsers are immutable.
@@ -1108,7 +1184,8 @@
</p>
<p class='bcode w800'>
<jc>// Clone and customize an existing serializer.</jc>
- WriterSerializer s = JsonSerializer.<jsf>DEFAULT_LAX</jsf>
+ WriterSerializer s = SimpleJsonSerializer.<jsf>DEFAULT</jsf>
+
.builder() <jc>// Create a new builder with copied settings.</jc>
.quoteChar(<js>'"'</js>) <jc>// Use a different quote character.</jc>
.build();
@@ -2127,7 +2204,8 @@
<jk>public</jk> String <jf>f1</jf> = <js>"f1"</js>;
}
- JsonSerializer s = JsonSerializer.<jsf>DEFAULT_LAX</jsf>;
+ JsonSerializer s = SimpleJsonSerializer.<jsf>DEFAULT</jsf>
+;
A1 a1 = <jk>new</jk> A1();
String r = s.serialize(a1);
<jsm>assertEquals</jsm>(<js>"{f0:'f0'}"</js>, r); <jc>// Note f1 is not serialized.</jc>
@@ -3022,7 +3100,8 @@
}
<jc>// Produces "{f1:{'foo':'bar'}}"</jc>
- String json = JsonSerializer.<jsf>DEFAULT_LAX</jsf>.toString(<jk>new</jk> MyBean());
+ String json = SimpleJsonSerializer.<jsf>DEFAULT</jsf>
+.toString(<jk>new</jk> MyBean());
</p>
<p>
Note that if you're serializing Readers and InputStreams, it's up to you to make sure you're producing
@@ -3200,7 +3279,8 @@
MyInterface[] x = <jk>new</jk> MyInterface[]{ <jk>new</jk> MyClass1(), <jk>new</jk> MyClass2() };
<jc>// Produces "[{mytype:'C1',...},{mytype:'C2',...}]"</jc>
- String json = JsonSerializer.<jsf>DEFAULT_LAX</jsf>.serialize(x);
+ String json = SimpleJsonSerializer.<jsf>DEFAULT</jsf>
+.serialize(x);
</p>
<ul class='doctree'>
<li class='info'>
@@ -3259,7 +3339,8 @@
When serialized, the subtype is serialized as a virtual <js>"_type"</js> property:
</p>
<p class='bcode w800'>
- JsonSerializer s = JsonSerializer.<jsf>DEFAULT_LAX</jsf>;
+ JsonSerializer s = SimpleJsonSerializer.<jsf>DEFAULT</jsf>
+;
A1 a1 = <jk>new</jk> A1();
a1.<jf>f1</jf> = <js>"f1"</js>;
String r = s.serialize(a1);
@@ -3367,7 +3448,7 @@
</p>
<p class='bcode w800'>
<jc>// Clone an existing serializer and set property for detecting recursions.</jc>
- JsonSerializer s = JsonSerializer.<jsf>DEFAULT_LAX_READABLE</jsf>.builder().detectRecursions(<jk>true</jk>).build();
+ JsonSerializer s = SimpleJsonSerializer.<jsf>DEFAULT_READABLE</jsf>.builder().detectRecursions(<jk>true</jk>).build();
<jc>// Create a recursive loop.</jc>
A a = <jk>new</jk> A();
@@ -3453,7 +3534,7 @@
ObjectMap m = JsonParser.<jsf>DEFAULT</jsf>.parse(json, ObjectMap.<jk>class</jk>);
<jc>// Convert it back to JSON.</jc>
- String json = JsonSerializer.<jsf>DEFAULT_LAX_READABLE</jsf>.serialize(m);
+ String json = SimpleJsonSerializer.<jsf>DEFAULT_READABLE</jsf>.serialize(m);
</p>
<p>
What we end up with is the exact same output.
@@ -4010,7 +4091,7 @@
]
}
</p>
- <h5 class='figure'>Lax JSON</h5>
+ <h5 class='figure'>Simplified JSON</h5>
<p class='bcode w800'>
{
name: <js>'John Smith'</js>,
@@ -4130,17 +4211,26 @@
<li class='jc'>{@link org.apache.juneau.json.JsonSerializer}
<ul>
<li class='jf'>{@link org.apache.juneau.json.JsonSerializer#DEFAULT DEFAULT}
- <li class='jf'>{@link org.apache.juneau.json.JsonSerializer#DEFAULT_LAX DEFAULT_LAX}
- <li class='jf'>{@link org.apache.juneau.json.JsonSerializer#DEFAULT_LAX_READABLE DEFAULT_LAX_READABLE}
- <li class='jf'>{@link org.apache.juneau.json.JsonSerializer#DEFAULT_LAX_READABLE_SAFE DEFAULT_LAX_READABLE_SAFE}
<li class='jf'>{@link org.apache.juneau.json.JsonSerializer#DEFAULT_READABLE DEFAULT_READABLE}
</ul>
+ <li class='jc'>{@link org.apache.juneau.json.SimpleJsonSerializer}
+ <ul>
+ <li class='jf'>{@link org.apache.juneau.json.SimpleJsonSerializer#DEFAULT DEFAULT}
+ <li class='jf'>{@link org.apache.juneau.json.SimpleJsonSerializer#DEFAULT_READABLE DEFAULT_READABLE}
+ </ul>
</ul>
</div>
- <!-- === 2.15.3 - JSON Parsers ================================================================== -->
+ <!-- === 2.15.3 - Simplified JSON ============================================================== -->
+
+ <h4 class='topic' onclick='toggle(this)'><a href='#juneau-marshall.JsonDetails.SimplifiedJson' id='juneau-marshall.JsonDetails.SimplifiedJson'>2.15.3 - Simplified JSON</a></h4>
+ <div class='topic'>
+ TODO
+ </div>
+
+ <!-- === 2.15.4 - JSON Parsers ================================================================== -->
- <h4 class='topic' onclick='toggle(this)'><a href='#juneau-marshall.JsonDetails.JsonParsers' id='juneau-marshall.JsonDetails.JsonParsers'>2.15.3 - JSON Parsers</a></h4>
+ <h4 class='topic' onclick='toggle(this)'><a href='#juneau-marshall.JsonDetails.JsonParsers' id='juneau-marshall.JsonDetails.JsonParsers'>2.15.4 - JSON Parsers</a></h4>
<div class='topic'>
<p>
The {@link org.apache.juneau.json.JsonParser} class is used to parse JSON into POJOs.
@@ -4183,9 +4273,9 @@
</ul>
</div>
- <!-- === 2.15.4 - @Json Annotation ============================================================== -->
+ <!-- === 2.15.5 - @Json Annotation ============================================================== -->
- <h4 class='topic' onclick='toggle(this)'><a href='#juneau-marshall.JsonDetails.JsonAnnotation' id='juneau-marshall.JsonDetails.JsonAnnotation'>2.15.4 - @Json Annotation</a></h4>
+ <h4 class='topic' onclick='toggle(this)'><a href='#juneau-marshall.JsonDetails.JsonAnnotation' id='juneau-marshall.JsonDetails.JsonAnnotation'>2.15.5 - @Json Annotation</a></h4>
<div class='topic'>
<p>
The {@link org.apache.juneau.json.annotation.Json#wrapperAttr() @Json(wrapperAttr)} annotation
@@ -4226,9 +4316,9 @@
</table>
</div>
- <!-- === 2.15.5 - JSON-Schema Support =========================================================== -->
+ <!-- === 2.15.6 - JSON-Schema Support =========================================================== -->
- <h4 class='topic' onclick='toggle(this)'><a href='#juneau-marshall.JsonDetails.JsonSchema' id='juneau-marshall.JsonDetails.JsonSchema'>2.15.5 - JSON-Schema Support</a></h4>
+ <h4 class='topic' onclick='toggle(this)'><a href='#juneau-marshall.JsonDetails.JsonSchema' id='juneau-marshall.JsonDetails.JsonSchema'>2.15.6 - JSON-Schema Support</a></h4>
<div class='topic'>
<p>
Juneau provides the {@link org.apache.juneau.jsonschema.JsonSchemaSerializer} class for generating JSON-Schema
@@ -4269,7 +4359,7 @@
</p>
<p class='bcode w800'>
<jc>// Get the one of the default schema serializers.</jc>
- JsonSchemaSerializer s = JsonSchemaSerializer.<jsf>DEFAULT_LAX_READABLE</jsf>;
+ JsonSchemaSerializer s = JsonSchemaSerializer.<jsf>DEFAULT_SIMPLE_READABLE</jsf>;
<jc>// Get the JSON Schema for the POJO.</jc>
String jsonSchema = s.serialize(<jk>new</jk> Person());
@@ -7866,7 +7956,7 @@
// @prefix j: <http://www.apache.org/juneau/> .
// [] jp:age "21" ;
// jp:name "John Smith" .</jc>
- String rdfN3 = RdfSerializer.<jsf>DEFAULT_N3</jsf>.serialize(p);
+ String rdfN3 = N3Serializer.<jsf>DEFAULT</jsf>.serialize(p);
<jc>// Produces:
// _:A3bf53c85X3aX157cf407e2dX3aXX2dX7ffd <http://www.apache.org/juneaubp/name> "John Smith" .
@@ -7892,11 +7982,11 @@
<ul class='doctree'>
<li class='jc'>{@link org.apache.juneau.jena.RdfSerializer}
<ul>
- <li class='jc'>{@link org.apache.juneau.jena.RdfSerializer.Xml}
- <li class='jc'>{@link org.apache.juneau.jena.RdfSerializer.XmlAbbrev}
- <li class='jc'>{@link org.apache.juneau.jena.RdfSerializer.NTriple}
- <li class='jc'>{@link org.apache.juneau.jena.RdfSerializer.Turtle}
- <li class='jc'>{@link org.apache.juneau.jena.RdfSerializer.N3}
+ <li class='jc'>{@link org.apache.juneau.jena.RdfXmlSerializer}
+ <li class='jc'>{@link org.apache.juneau.jena.RdfXmlAbbrevSerializer}
+ <li class='jc'>{@link org.apache.juneau.jena.N3Serializer}
+ <li class='jc'>{@link org.apache.juneau.jena.NTripleSerializer}
+ <li class='jc'>{@link org.apache.juneau.jena.TurtleSerializer}
</ul>
</ul>
@@ -7952,13 +8042,26 @@
<ul class='doctree'>
<li class='jc'>{@link org.apache.juneau.jena.RdfSerializer}
<ul>
- <li class='jf'>{@link org.apache.juneau.jena.RdfSerializer#DEFAULT_JUNEAU_NS DEFAULT_JUNEAU_NS}
- <li class='jf'>{@link org.apache.juneau.jena.RdfSerializer#DEFAULT_JUNEAUBP_NS DEFAULT_JUNEAUBP_NS}
- <li class='jf'>{@link org.apache.juneau.jena.RdfSerializer#DEFAULT_N3 DEFAULT_N3}
- <li class='jf'>{@link org.apache.juneau.jena.RdfSerializer#DEFAULT_NTRIPLE DEFAULT_NTRIPLE}
- <li class='jf'>{@link org.apache.juneau.jena.RdfSerializer#DEFAULT_TURTLE DEFAULT_TURTLE}
- <li class='jf'>{@link org.apache.juneau.jena.RdfSerializer#DEFAULT_XML DEFAULT_XML}
- <li class='jf'>{@link org.apache.juneau.jena.RdfSerializer#DEFAULT_XMLABBREV DEFAULT_XMLABBREV}
+ <li class='jc'>{@link org.apache.juneau.jena.RdfXmlSerializer}
+ <ul>
+ <li class='jf'>{@link org.apache.juneau.jena.RdfXmlSerializer#DEFAULT DEFAULT}
+ </ul>
+ <li class='jc'>{@link org.apache.juneau.jena.RdfXmlAbbrevSerializer}
+ <ul>
+ <li class='jf'>{@link org.apache.juneau.jena.RdfXmlAbbrevSerializer#DEFAULT DEFAULT}
+ </ul>
+ <li class='jc'>{@link org.apache.juneau.jena.N3Serializer}
+ <ul>
+ <li class='jf'>{@link org.apache.juneau.jena.N3Serializer#DEFAULT DEFAULT}
+ </ul>
+ <li class='jc'>{@link org.apache.juneau.jena.NTripleSerializer}
+ <ul>
+ <li class='jf'>{@link org.apache.juneau.jena.NTripleSerializer#DEFAULT DEFAULT}
+ </ul>
+ <li class='jc'>{@link org.apache.juneau.jena.TurtleSerializer}
+ <ul>
+ <li class='jf'>{@link org.apache.juneau.jena.TurtleSerializer#DEFAULT DEFAULT}
+ </ul>
</ul>
</ul>
<p>
@@ -7978,10 +8081,10 @@
<ul class='doctree'>
<li class='jc'>{@link org.apache.juneau.jena.RdfParser}
<ul>
- <li class='jc'>{@link org.apache.juneau.jena.RdfParser.Xml}
- <li class='jc'>{@link org.apache.juneau.jena.RdfParser.NTriple}
- <li class='jc'>{@link org.apache.juneau.jena.RdfParser.Turtle}
- <li class='jc'>{@link org.apache.juneau.jena.RdfParser.N3}
+ <li class='jc'>{@link org.apache.juneau.jena.RdfXmlParser}
+ <li class='jc'>{@link org.apache.juneau.jena.NTripleParser}
+ <li class='jc'>{@link org.apache.juneau.jena.TurtleParser}
+ <li class='jc'>{@link org.apache.juneau.jena.N3Parser}
</ul>
</ul>
<p>
@@ -8032,6 +8135,30 @@
<li class='jf'>{@link org.apache.juneau.jena.RdfParser#RDF_trimWhitespace RDF_trimWhitespace}
</ul>
</ul>
+ <p>
+ The following pre-configured parsers are provided for convenience:
+ </p>
+ <ul class='doctree'>
+ <li class='jc'>{@link org.apache.juneau.jena.RdfParser}
+ <ul>
+ <li class='jc'>{@link org.apache.juneau.jena.RdfXmlParser}
+ <ul>
+ <li class='jf'>{@link org.apache.juneau.jena.RdfXmlParser#DEFAULT DEFAULT}
+ </ul>
+ <li class='jc'>{@link org.apache.juneau.jena.N3Parser}
+ <ul>
+ <li class='jf'>{@link org.apache.juneau.jena.N3Parser#DEFAULT DEFAULT}
+ </ul>
+ <li class='jc'>{@link org.apache.juneau.jena.NTripleParser}
+ <ul>
+ <li class='jf'>{@link org.apache.juneau.jena.NTripleParser#DEFAULT DEFAULT}
+ </ul>
+ <li class='jc'>{@link org.apache.juneau.jena.TurtleParser}
+ <ul>
+ <li class='jf'>{@link org.apache.juneau.jena.TurtleParser#DEFAULT DEFAULT}
+ </ul>
+ </ul>
+ </ul>
</div>
<!-- === 3.1.4 - @Rdf Annotation ================================================================ -->
@@ -9452,7 +9579,7 @@
URL key4 = c.getObject(<js>"Section1/key4"</js>, URL.<jk>class</jk>);
</p>
<p>
- Beans are represented as {@link org.apache.juneau.json.JsonSerializer#DEFAULT_LAX Lax JSON} by default:
+ Beans are represented as <a class='doclink' href='#juneau-marshall.JsonDetails.SimplifiedJson'>Simplified JSON</a> by default:
</p>
<p class='bcode w800'>
<jc>// Contact information</jc>
@@ -10938,7 +11065,32 @@
<li class='jm'><code><jk>public</jk> T(RestContextBuilder)</code>
</ul>
<p>
- And even that restriction is relaxed if you implement your own REST resource resolver (described later).
+ And even that requirement is relaxed if you implement your own REST resource resolver (described later).
+ </p>
+ <p>
+ For example:
+ </p>
+ <p class='bcode w800'>
+ <jc>// Top level resource is deployed like any other servlet and must subclass from RestServlet.</jc>
+ <ja>@RestResource</ja>(
+ path=<js>"/top"</js>,
+ children={
+ ChildResource.<jk>class</jk> <jc>// Accessed via URI "/top/child"</jc>
+ }
+ )
+ <jk>public class</jk> TopLevelResource <jk>extends</jk> BasicRestServlet {...}
+ </p>
+ <p class='bcode w800'>
+ <jc>// Child resources can inherit from RestServlet but it's not a requirement.</jc>
+ <ja>@RestResource</ja>(
+ path=<js>"/child"</js>
+ )
+ <jk>public class</jk> ChildResource <jk>extends</jk> WhateverYouWant {...}
+ </p>
+ <p>
+ That's all there is to it!
+ There's no code scanning, module configuration/initialization classes, or anything complex like that.
+ It's just a servlet.
</p>
<!-- === 7.3.1 - RestServlet ==================================================================== -->
@@ -10960,19 +11112,19 @@
extend from one of the preconfigured default servlets such as {@link org.apache.juneau.rest.BasicRestServlet}.
<br>The <l>RestServlet</l> class by itself is not configured with any serializers and parsers, and therefore
not very useful on it's own.
- <br>However, the class does provide a couple of convenience methods to be aware of:
+ However, the class does provide a couple of convenience methods to be aware of:
</p>
<ul class='doctree'>
<li class='jac'><code>{@link org.apache.juneau.rest.RestServlet} <jk>extends</jk> HttpServlet</code>
<ul>
- <li class='jf'>{@link org.apache.juneau.rest.RestServlet#log(Level,String,Object...) log(Level,String,Object...)}
- <li class='jf'>{@link org.apache.juneau.rest.RestServlet#log(Level,Throwable,String,Object...) log(Level,Throwable,String,Object...)}
- <li class='jf'>{@link org.apache.juneau.rest.RestServlet#getContext() getContext()}
+ <li class='jm'>{@link org.apache.juneau.rest.RestServlet#init(ServletConfig) init(ServletConfig)} - Can override to provide custom initialization.
+ <li class='jm'>{@link org.apache.juneau.rest.RestServlet#service(HttpServletRequest,HttpServletResponse) service(HttpServletRequest,HttpServletResponse)} - Can override to provide custom request handling.
+ <li class='jm'>{@link org.apache.juneau.rest.RestServlet#destroy() destroy()} - Can override to provide custom cleanup.
+ <li class='jm'>{@link org.apache.juneau.rest.RestServlet#getContext() getContext()} - Returns all aspects of the configuration of your resource pulled from all annotations on the class/parent-classes and methods.
+ <li class='jm'>{@link org.apache.juneau.rest.RestServlet#log(Level,String,Object...) log(Level,String,Object...)} - Convenience logging method.
+ <li class='jm'>{@link org.apache.juneau.rest.RestServlet#log(Level,Throwable,String,Object...) log(Level,Throwable,String,Object...)} - Convenience logging method.
</ul>
</ul>
- <p>
- Since this is a servlet, you also have the ability to intercept calls to the <l>init</l> and <l>service</l> methods
- in your subclass.
</div>
<!-- === 7.3.2 - BasicRestServlet =============================================================== -->
@@ -10988,16 +11140,90 @@
<li>Some basic HTML boilerplate for the HTML representation of your POJOs.
<li>Support for auto-generated Swagger documentation through OPTIONS page requests.
<li>Configuration of default CSS stylesheets.
+ <li>Default contents for HTML views.
</ul>
<p>
- The entirety of the class is shown below.
+ The contents of the class is shown below.
<br>You should notice that very little code is being used and everything is configurable through
annotations:
</p>
<p class='bcode w800'>
<ja>@RestResource</ja>(
+
+ <jc>// Allow OPTIONS requests to be simulated using ?method=OPTIONS query parameter. </jc>
+ allowedMethodParams=<js>"OPTIONS"</js>,
+
+ <jc>// HTML-page specific settings.</jc>
+ htmldoc=<ja>@HtmlDoc</ja>(
+ <jc>// Basic page navigation links.</jc>
+ navlinks={
+ <js>"up: request:/.."</js>,
+ <js>"options: servlet:/?method=OPTIONS"</js>
+ }
+ ),
+
+ <jc>// POJO swaps to apply to all serializers/parsers.</jc>
+ pojoSwaps={
+ <jc>// Use the SwaggerUI swap when rendering Swagger beans.</jc>
+ SwaggerUI.<jk>class</jk>
+ },
+
+ <jc>// Properties to apply to all serializers/parsers and REST-specific API objects.</jc>
+ properties={
+ <jc>// Add descriptions to the following types when not specified:</jc>
+ <ja>@Property</ja>(name=<jsf>JSONSCHEMA_addDescriptionsTo</jsf>, value=<js>"bean,collection,array,map,enum"</js>),
+
+ <jc>// Automatically add examples to the following types:</jc>
+ <ja>@Property</ja>(name=<jsf>JSONSCHEMA_addExamplesTo</jsf>, value=<js>"bean,collection,array,map"</js>),
+
+ <jc>// Don't generate schema information on the Swagger bean itself or HTML beans.</jc>
+ <ja>@Property</ja>(name=<jsf>INFOPROVIDER_ignoreTypes</jsf>, value="<js>Swagger,org.apache.juneau.dto.html5.*"</js>)
+ },
+
+ <jc>// Shortcut for boolean properties.</jc>
+ flags={
+ <jc>// Use $ref references for bean definitions to reduce duplication in Swagger.</jc>
+ <jsf>JSONSCHEMA_useBeanDefs</jsf>
+ }
+ )
+ <jk>public abstract class</jk> BasicRestServlet <jk>extends</jk> RestServlet <jk>implements</jk> BasicRestConfig {
+
+ <jd>/**
+ * [OPTIONS /*] - Show resource options.
+ *
+ * @param req The HTTP request.
+ * @return A bean containing the contents for the OPTIONS page.
+ */</jd>
+ <ja>@RestMethod</ja>(name=<jsf>OPTIONS</jsf>, path=<js>"/*"</js>,
+ summary=<js>"Swagger documentation"</js>,
+ description=<js>"Swagger documentation for this resource."</js>,
+ htmldoc=<ja>@HtmlDoc</ja>(
+ <jc>// Override the nav links for the swagger page.</jc>
+ navlinks={
+ <js>"back: servlet:/"</js>,
+ <js>"json: servlet:/?method=OPTIONS&Accept=text/json&plainText=true"</js>
+ },
+ <jc>// Never show aside contents of page inherited from class.</jc>
+ aside=<js>"NONE"</js>
+ )
+ )
+ <jk>public</jk> Swagger getOptions(RestRequest req) {
+ <jc>// Localized Swagger for this resource is available through the RestRequest object.</jc>
+ <jk>return</jk> req.getSwagger();
+ }
+ }
+ </p>
+ <p>
+ Additional annotations are pulled in from the {@link org.apache.juneau.rest.BasicRestConfig} interface which simply
+ exists to define a common set of annotations.
+ Notice that it has no code at all.
+ </p>
+ <p class='bcode w800'>
+ <ja>@RestResource</ja>(
+
+ <jc>// Default serializers for all Java methods in the class.</jc>
serializers={
- HtmlDocSerializer.<jk>class</jk>,
+ HtmlDocSerializer.<jk>class</jk>,
HtmlStrippedDocSerializer.<jk>class</jk>,
HtmlSchemaDocSerializer.<jk>class</jk>,
JsonSerializer.<jk>class</jk>,
@@ -11011,67 +11237,84 @@
SoapXmlSerializer.<jk>class</jk>,
PlainTextSerializer.<jk>class</jk>
},
+
+ <jc>// Default parsers for all Java methods in the class.</jc>
parsers={
JsonParser.<jk>class</jk>,
+ JsonParser.Simple.<jk>class</jk>,
XmlParser.<jk>class</jk>,
HtmlParser.<jk>class</jk>,
UonParser.<jk>class</jk>,
UrlEncodingParser.<jk>class</jk>,
- MsgPackParser<jk>.class</jk>,
+ MsgPackParser.<jk>class</jk>,
PlainTextParser.<jk>class</jk>
},
+
+ <jc>// Properties to apply to all serializers/parsers and REST-specific API objects.</jc>
properties={
- <jc>// URI-resolution is disabled by default. Need to enable it.</jc>
+ <jc>// Enable automatic resolution of URI objects to root-relative values.</jc>
<ja>@Property</ja>(name=<jsf>SERIALIZER_uriResolution</jsf>, value=<js>"ROOT_RELATIVE"</js>)
},
- allowedMethodParams=<js>"OPTIONS"</js>,
+
+ <jc>// HTML-page specific settings</jc>
htmldoc=<ja>@HtmlDoc</ja>(
+
+ <jc>// Default page header contents.</jc>
header={
- <js>"<h1>$R{resourceTitle}</h1>"</js>,
- <js>"<h2>$R{methodSummary,resourceDescription}</h2>"</js>,
- <js>"<a href='http://juneau.apache.org'><img src='$U{servlet:/htdocs/juneau.png}' style='position:absolute;top:5;right:5;background-color:transparent;height:30px'/></a>"</js>
+ <js>"<h1>$R{resourceTitle}</h1>"</js>, <jc>// Use @RestResource(title)</jc>
+ <js>"<h2>$R{methodSummary,resourceDescription}</h2>"</js>, <jc>// Use either @RestMethod(summary) or @RestResource(description)</jc>
+ <js>"$C{REST/header}"</js> <jc>// Extra header HTML defined in external config file.</jc>
},
+
+ <jc>// Basic page navigation links.</jc>
navlinks={
- <js>"up: request:/.."</js>,
- <js>"options: servlet:/?method=OPTIONS"</js>
+ <js>"up: request:/.."</js>
},
- stylesheet=<js>"servlet:/styles/light.css"</js>,
+
+ <jc>// Default stylesheet to use for the page.
+ // Can be overridden from external config file.
+ // Default is DevOps look-and-feel (aka Depression look-and-feel).</jc>
+ stylesheet=<js>"$C{REST/theme,servlet:/htdocs/themes/devops.css}"</js>,
+
+ <jc>// Default contents to add to the <head> section of the HTML page.
+ // Use it to add a favicon link to the page.</jc>
head={
- <js>"<link rel='icon' href='$U{servlet:/htdocs/juneau.png}'/>"</js>
- }
+ <js>"<link rel='icon' href='$U{$C{REST/favicon}}'/>"</js>
+ },
+
+ <jc>// No default page footer contents.
+ // Can be overridden from external config file.</jc>
+ footer=<js>"$C{REST/footer}"</js>,
+
+ <jc>// By default, table cell contents should not wrap.</jc>
+ nowrap=<js>"true"</js>
),
-
+
<jc>// Optional external configuration file.</jc>
config=<js>"$S{juneau.configFile}"</js>,
<jc>// These are static files that are served up by the servlet under the specified sub-paths.
- // For example, "/servletPath/htdocs/javadoc.css" resolves to the file "[servlet-package]/htdocs/javadoc.css"</jc>
- staticFiles={<js>"htdocs:htdocs"</js>,<js>"styles:styles"</js>}
+ // For example, "/servletPath/htdocs/javadoc.css" resolves to the file "[servlet-package]/htdocs/javadoc.css"
+ // By default, we define static files through the external configuration file.</jc>
+ staticFiles={<js>"$C{REST/staticFiles}"</js>}
)
- <jk>public abstract class</jk> BasicRestServlet <jk>extends</jk> RestServlet {
-
- <jc>// Show resource options.</jc>
- <ja>@RestMethod</ja>(name=<jsf>OPTIONS</jsf>, path=<js>"/*"</js>,
- htmldoc=<ja>@HtmlDoc</ja>(
- navlinks={
- <js>"back: servlet:/"</js>,
- <js>"json: servlet:/?method=OPTIONS&Accept=text/json&plainText=true"</js>
- },
- aside=<js>"NONE"</js>
- ),
- summary=<js>"Swagger documentation",</js>
- description=<js>"Auto-generated swagger documentation for this resource"</js>
- )
- <jk>public</jk> Swagger getOptions(RestRequest req) {
- <jk>return</jk> req.getSwagger();
- }
- }
+ <jk>public interface</jk> BasicRestConfig {}
</p>
<p>
Your top-level resource will simply extend from this class, as shown in the Hello World example
from a couple sections back.
</p>
<p>
+ It's important to notice that the <ja>@RestResource</ja> annotation is inheritable and overridable from parent
+ class and interfaces.
+ They'll all get merged into a single set of annotation values for the resource class.
+ </p>
+ <p>
+ Not shown but equally important is that all of the annotations shown have programmatic equivalents via the {@link org.apache.juneau.rest.RestContextBuilder} class
+ which can be manipulated during servlet initialization.
+ <br>(As a general rule, all annotations throughout Juneau have programmatic equivalents.)
+ </p>
+ <p>
There's a lot going on in this class.
<br>But not to worry, the details will be described later.
</p>
@@ -11310,6 +11553,7 @@
resource classes that can be extended by all your child resources so that they all share common
settings.
</p>
+ <h5 class='figure'>Inheritance rules</h5>
<table class='styled w800'>
<tr>
<th><l>Annotation</l></th>
@@ -11334,13 +11578,17 @@
<tr>
<td>{@link org.apache.juneau.rest.annotation.RestResource#beanFilters() beanFilters()}</td>
<td>
- Bean filters on child are combined with those on parent class.
+ Bean filters on child override those on parent class.
+ <br>{@link org.apache.juneau.rest.Inherit} class can be used to inherit and augment values from parent.
+ <br>{@link org.apache.juneau.rest.None} class can be used to suppress inheriting from parent.
</td>
</tr>
<tr>
<td>{@link org.apache.juneau.rest.annotation.RestResource#pojoSwaps() pojoSwaps()}</td>
<td>
- POJO swaps on child are combined with those on parent class.
+ POJO swaps on child override those on parent class.
+ <br>{@link org.apache.juneau.rest.Inherit} class can be used to inherit and augment values from parent.
+ <br>{@link org.apache.juneau.rest.None} class can be used to suppress inheriting from parent.
</td>
</tr>
<tr>
@@ -11354,14 +11602,18 @@
<tr>
<td>{@link org.apache.juneau.rest.annotation.RestResource#serializers() serializers()}</td>
<td>
- Serializers on child are combined with those on parent class.
+ Serializers on child override those on parent class.
+ <br>{@link org.apache.juneau.rest.Inherit} class can be used to inherit and augment values from parent.
+ <br>{@link org.apache.juneau.rest.None} class can be used to suppress inheriting from parent.
<br>Serializers on methods take precedence over those on classes.
</td>
</tr>
<tr>
<td>{@link org.apache.juneau.rest.annotation.RestResource#parsers() parsers()}</td>
<td>
- Parsers on child are combined with those on parent class.
+ Parsers on child override those on parent class.
+ <br>{@link org.apache.juneau.rest.Inherit} class can be used to inherit and augment values from parent.
+ <br>{@link org.apache.juneau.rest.None} class can be used to suppress inheriting from parent.
<br>Parsers on methods take precedence over those on classes.
</td>
</tr>
@@ -11481,8 +11733,8 @@
}
</p>
<p>
- Warning: This class is huge.
- <br>Through it, you can configure bean/serializer/parser settings, define config files, children,
+ Warning: The builder class is huge.
+ Through it, you can configure bean/serializer/parser settings, define config files, children,
resource finders, info providers, etc...
</p>
</div>
@@ -11518,7 +11770,7 @@
<ul class='spaced-list'>
<li>
<b>Parameters based on class types:</b>
- <ul>
+ <ul class='spaced-list'>
<li><b>Request/response objects:</b>
<ul>
<li class='jc'>{@link org.apache.juneau.rest.RestRequest} - The request object.
@@ -11596,15 +11848,15 @@
</ul>
<li><b>Annotated parameters:</b>
<ul>
- <li class='ja'><code><del>org.apache.juneau.rest.annotation.Path</del></code> - Variables in matched URL path patterns.
- <li class='ja'><code><del>org.apache.juneau.rest.annotation.FormData</del></code> - Multipart form post parameter values.
- <li class='ja'><code><del>org.apache.juneau.rest.annotation.HasFormData</del></code> - Denotes whether the form data parameter exists.
- <li class='ja'><code><del>org.apache.juneau.rest.annotation.Query</del></code> - Query parameters. Using this prevents the HTTP body from being processed as a URL-Encoded form post.
- <li class='ja'><code><del>org.apache.juneau.rest.annotation.HasQuery</del></code> - Denotes whether the query parameter exists.
- <li class='ja'><code><del>org.apache.juneau.rest.annotation.Header</del></code> - A header value.
- <li class='ja'><code><del>org.apache.juneau.rest.annotation.Method</del></code> - The HTTP method name.
- <li class='ja'><code><del>org.apache.juneau.rest.annotation.PathRemainder</del></code> - The remainder value after path pattern match.
- <li class='ja'><code><del>org.apache.juneau.rest.annotation.Body</del></code> - The HTTP content parsed as a POJO.
+ <li class='ja'>{@link org.apache.juneau.http.annotation.Path} - Variables in matched URL path patterns.
+ <li class='ja'>{@link org.apache.juneau.http.annotation.PathRemainder} - The remainder value after path pattern match.
+ <li class='ja'>{@link org.apache.juneau.http.annotation.FormData} - Multipart form post parameter values.
+ <li class='ja'>{@link org.apache.juneau.http.annotation.HasFormData} - Denotes whether the form data parameter exists.
+ <li class='ja'>{@link org.apache.juneau.http.annotation.Query} - Query parameters. Using this prevents the HTTP body from being processed as a URL-Encoded form post.
+ <li class='ja'>{@link org.apache.juneau.http.annotation.HasQuery} - Denotes whether the query parameter exists.
+ <li class='ja'>{@link org.apache.juneau.http.annotation.Header} - A header value.
+ <li class='ja'>{@link org.apache.juneau.http.annotation.Body} - The HTTP content parsed as a POJO.
+ <li class='ja'>{@link org.apache.juneau.rest.annotation.Method} - The HTTP method name.
</ul>
</ul>
<h5 class='figure'>Example:</h5>
@@ -11660,19 +11912,19 @@
<ul class='doctree'>
<li class='jc'><code>{@link org.apache.juneau.rest.RestRequest} <jk>extends</jk> HttpServletRequest</code>
<ul>
- <li class='jm'>{@link org.apache.juneau.rest.RestRequest#getHeaders() getHeaders()}
- <li class='jm'>{@link org.apache.juneau.rest.RestRequest#getQuery() getQuery()}
- <li class='jm'>{@link org.apache.juneau.rest.RestRequest#getFormData() getFormData()}
- <li class='jm'>{@link org.apache.juneau.rest.RestRequest#getBody() getBody()}
- <li class='jm'>{@link org.apache.juneau.rest.RestRequest#getPathMatch() getPathMatch()}
- <li class='jm'>{@link org.apache.juneau.rest.RestRequest#getLogger() getLogger()}
- <li class='jm'>{@link org.apache.juneau.rest.RestRequest#getInfoProvider() getInfoProvider()}
- <li class='jm'>{@link org.apache.juneau.rest.RestRequest#getSwagger() getSwagger()}
- <li class='jm'>{@link org.apache.juneau.rest.RestRequest#getConfig() getConfig()}
- <li class='jm'>{@link org.apache.juneau.rest.RestRequest#getVarResolverSession() getVarResolverSession()}
- <li class='jm'>{@link org.apache.juneau.rest.RestRequest#getMessageBundle() getMessageBundle()}
- <li class='jm'>{@link org.apache.juneau.rest.RestRequest#getProperties() getProperties()}
- <li class='jm'>{@link org.apache.juneau.rest.RestRequest#getClasspathReaderResource(String,boolean,MediaType) getClasspathReaderResource(String,boolean,MediaType)}
+ <li class='jm'>{@link org.apache.juneau.rest.RestRequest#getHeaders() getHeaders()} - HTTP request headers.
+ <li class='jm'>{@link org.apache.juneau.rest.RestRequest#getQuery() getQuery()} - Query parameters.
+ <li class='jm'>{@link org.apache.juneau.rest.RestRequest#getFormData() getFormData()} - Form-data parameters.
+ <li class='jm'>{@link org.apache.juneau.rest.RestRequest#getBody() getBody()} - HTTP request body.
+ <li class='jm'>{@link org.apache.juneau.rest.RestRequest#getPathMatch() getPathMatch()} - Path match variables.
+ <li class='jm'>{@link org.apache.juneau.rest.RestRequest#getLogger() getLogger()} - Logging.
+ <li class='jm'>{@link org.apache.juneau.rest.RestRequest#getInfoProvider() getInfoProvider()} - Swagger documentation provider.
+ <li class='jm'>{@link org.apache.juneau.rest.RestRequest#getSwagger() getSwagger()} - Generated Swagger information.
+ <li class='jm'>{@link org.apache.juneau.rest.RestRequest#getConfig() getConfig()} - External configuration API.
+ <li class='jm'>{@link org.apache.juneau.rest.RestRequest#getVarResolverSession() getVarResolverSession()} - String variable resolver.
+ <li class='jm'>{@link org.apache.juneau.rest.RestRequest#getMessageBundle() getMessageBundle()} - Localized messages.
+ <li class='jm'>{@link org.apache.juneau.rest.RestRequest#getProperties() getProperties()} - Configuration properties.
+ <li class='jm'>{@link org.apache.juneau.rest.RestRequest#getClasspathReaderResource(String,boolean,MediaType) getClasspathReaderResource(String,boolean,MediaType)} - Various methods for retrieving static files from classpath.
</ul>
</ul>
</div>
@@ -11691,15 +11943,14 @@
<jk>public</jk> Object myMethod(RestResponse req) {...}
</p>
<p>
- The important methods on this class are shown below:
+ Some important methods on this class are:
</p>
<ul class='doctree'>
<li class='jc'><code>{@link org.apache.juneau.rest.RestResponse} <jk>extends</jk> HttpServletResponse</code>
<ul>
- <li class='jm'>{@link org.apache.juneau.rest.RestResponse#setOutput(Object) setOutput(Object)}
- <li class='jm'>{@link org.apache.juneau.rest.RestResponse#getProperties() getProperties()}
- <li class='jm'>{@link org.apache.juneau.rest.RestResponse#getHtmlDocBuilder() getHtmlDocBuilder()}
- <li class='jm'>{@link org.apache.juneau.rest.RestResponse#getDirectWriter(String) getDirectWriter(String)}
+ <li class='jm'>{@link org.apache.juneau.rest.RestResponse#setOutput(Object) setOutput(Object)} - Set response output programmatically.
+ <li class='jm'>{@link org.apache.juneau.rest.RestResponse#getHtmlDocBuilder() getHtmlDocBuilder()} - Set HTTP page contents programmatically.
+ <li class='jm'>{@link org.apache.juneau.rest.RestResponse#getDirectWriter(String) getDirectWriter(String)} - Direct access to underlying response writer.
</ul>
</ul>
</div>
@@ -11726,20 +11977,25 @@
}
</p>
<p>
- The important methods on this class are:
+ Some important methods on this class are:
</p>
<ul class='doctree'>
<li class='jc'>{@link org.apache.juneau.rest.RequestBody}
<ul>
- <li class='jm'>{@link org.apache.juneau.rest.RequestBody#getReader() getReader()}
- <li class='jm'>{@link org.apache.juneau.rest.RequestBody#getInputStream() getInputStream()}
- <li class='jm'>{@link org.apache.juneau.rest.RequestBody#asType(Class) asType(Class)}
- <li class='jm'>{@link org.apache.juneau.rest.RequestBody#asType(Type,Type...) asType(Type,Type...)}
- <li class='jm'>{@link org.apache.juneau.rest.RequestBody#asString() asString()}
- <li class='jm'>{@link org.apache.juneau.rest.RequestBody#asHex() asHex()}
- <li class='jm'>{@link org.apache.juneau.rest.RequestBody#asSpacedHex() asSpacedHex()}
+ <li class='jm'>{@link org.apache.juneau.rest.RequestBody#getReader() getReader()} - Get body as a Reader.
+ <li class='jm'>{@link org.apache.juneau.rest.RequestBody#getInputStream() getInputStream()} - Get body as an InputStream.
+ <li class='jm'>{@link org.apache.juneau.rest.RequestBody#asType(Class) asType(Class)} - Get body converted to a POJO.
+ <li class='jm'>{@link org.apache.juneau.rest.RequestBody#asType(Type,Type...) asType(Type,Type...)} - Get body converted to a map or collection of POJOs.
+ <li class='jm'>{@link org.apache.juneau.rest.RequestBody#asString() asString()} - Get body as a simple string.
+ <li class='jm'>{@link org.apache.juneau.rest.RequestBody#asHex() asHex()} - Get body as a hex-encoded string.
+ <li class='jm'>{@link org.apache.juneau.rest.RequestBody#asSpacedHex() asSpacedHex()} - Get body as spaced-hex-encoded string.
</ul>
</ul>
+
+ <h5 class='section'>See Also:</h5>
+ <ul>
+ <li class='ja'>{@link org.apache.juneau.http.annotation.Body}
+ </ul>
</div>
<!-- === 7.6.5 - RequestHeaders ================================================================= -->
@@ -11770,19 +12026,24 @@
}
</p>
<p>
- The important methods on this class are:
+ Some important methods on this class are:
</p>
<ul class='doctree'>
<li class='jc'><code>{@link org.apache.juneau.rest.RequestHeaders} <jk>extends</jk> TreeMap<String,String[]></code>
<ul>
- <li class='jm'>{@link org.apache.juneau.rest.RequestHeaders#get(String,Class) get(String,Class)}
- <li class='jm'>{@link org.apache.juneau.rest.RequestHeaders#get(String,Type,Type...) get(String,Type,Type)}
- <li class='jm'>{@link org.apache.juneau.rest.RequestHeaders#getString(String,String) getString(String,String)}
- <li class='jm'>{@link org.apache.juneau.rest.RequestHeaders#getInt(String,int) getInt(String,int)}
- <li class='jm'>{@link org.apache.juneau.rest.RequestHeaders#getBoolean(String,boolean) getBoolean(String,boolean)}
- <li class='jm'>{@link org.apache.juneau.rest.RequestHeaders#addDefault(String,Object) addDefault(String,Object)}
+ <li class='jm'>{@link org.apache.juneau.rest.RequestHeaders#get(String,Class) get(String,Class)} - Get header value converted to a POJO.
+ <li class='jm'>{@link org.apache.juneau.rest.RequestHeaders#get(String,Type,Type...) get(String,Type,Type)} - Get header value converted to a map or collection of POJOs.
+ <li class='jm'>{@link org.apache.juneau.rest.RequestHeaders#getString(String,String) getString(String,String)} - Get header value as a simple string.
+ <li class='jm'>{@link org.apache.juneau.rest.RequestHeaders#getInt(String,int) getInt(String,int)} - Get header value as an integer.
+ <li class='jm'>{@link org.apache.juneau.rest.RequestHeaders#getBoolean(String,boolean) getBoolean(String,boolean)} - Get header value as a boolean.
+ <li class='jm'>{@link org.apache.juneau.rest.RequestHeaders#addDefault(String,Object) addDefault(String,Object)} - Programmatically set a default value for a header.
</ul>
</ul>
+
+ <h5 class='section'>See Also:</h5>
+ <ul>
+ <li class='ja'>{@link org.apache.juneau.http.annotation.Header}
+ </ul>
</div>
<!-- === 7.6.6 - RequestQuery =================================================================== -->
@@ -11813,23 +12074,29 @@
that the former will NOT load the body of the request on FORM POSTS and will only look at parameters
found in the query string.
<br>This can be useful in cases where you're mixing GET parameters and FORM POSTS and you don't want to
- inadvertantly read the body of the request to get a query parameter.
+ inadvertently read the body of the request to get a query parameter.
</p>
<p>
- The important methods on this class are:
+ Some important methods on this class are:
</p>
<ul class='doctree'>
<li class='jc'><code>{@link org.apache.juneau.rest.RequestQuery} <jk>extends</jk> LinkedHashMap<String,String[]></code>
<ul>
- <li class='jm'>{@link org.apache.juneau.rest.RequestQuery#get(String,Class) get(String,Class)}
- <li class='jm'>{@link org.apache.juneau.rest.RequestQuery#get(String,Type,Type...) get(String,Type,Type)}
- <li class='jm'>{@link org.apache.juneau.rest.RequestQuery#getString(String,String) getString(String,String)}
- <li class='jm'>{@link org.apache.juneau.rest.RequestQuery#getInt(String,int) getInt(String,int)}
- <li class='jm'>{@link org.apache.juneau.rest.RequestQuery#getBoolean(String,boolean) getBoolean(String,boolean)}
- <li class='jm'>{@link org.apache.juneau.rest.RequestQuery#addDefault(String,Object) addDefault(String,Object)}
- <li class='jm'>{@link org.apache.juneau.rest.RequestQuery#getSearchArgs() getSearchArgs()}
+ <li class='jm'>{@link org.apache.juneau.rest.RequestQuery#get(String,Class) get(String,Class)} - Get query parameter value converted to a POJO.
+ <li class='jm'>{@link org.apache.juneau.rest.RequestQuery#get(String,Type,Type...) get(String,Type,Type)} - Get query parameter value converted to a map or collection of POJOs.
+ <li class='jm'>{@link org.apache.juneau.rest.RequestQuery#getString(String,String) getString(String,String)} - Get query parameter value as a simple string.
+ <li class='jm'>{@link org.apache.juneau.rest.RequestQuery#getInt(String,int) getInt(String,int)} - Get query parameter value as an integer.
+ <li class='jm'>{@link org.apache.juneau.rest.RequestQuery#getBoolean(String,boolean) getBoolean(String,boolean)} - Get query parameter value as a boolean.
+ <li class='jm'>{@link org.apache.juneau.rest.RequestQuery#addDefault(String,Object) addDefault(String,Object)} - Programmatically set a default value for a query parameter.
+ <li class='jm'>{@link org.apache.juneau.rest.RequestQuery#getSearchArgs() getSearchArgs()} - Returns query parameter search arguments.
</ul>
</ul>
+
+ <h5 class='section'>See Also:</h5>
+ <ul>
+ <li class='ja'>{@link org.apache.juneau.http.annotation.Query}
+ <li class='ja'>{@link org.apache.juneau.http.annotation.HasQuery}
+ </ul>
</div>
<!-- === 7.6.7 - RequestFormData ================================================================ -->
@@ -11859,19 +12126,25 @@
Note that this object does NOT take GET parameters into account and only returns values found in the body of the request.
</p>
<p>
- The important methods on this class are:
+ Some important methods on this class are:
</p>
<ul class='doctree'>
<li class='jc'><code>{@link org.apache.juneau.rest.RequestFormData} <jk>extends</jk> LinkedHashMap<String,String[]></code>
<ul>
- <li class='jm'>{@link org.apache.juneau.rest.RequestFormData#get(String,Class) get(String,Class)}
- <li class='jm'>{@link org.apache.juneau.rest.RequestFormData#get(String,Type,Type...) get(String,Type,Type)}
- <li class='jm'>{@link org.apache.juneau.rest.RequestFormData#getString(String,String) getString(String,String)}
- <li class='jm'>{@link org.apache.juneau.rest.RequestFormData#getInt(String,int) getInt(String,int)}
- <li class='jm'>{@link org.apache.juneau.rest.RequestFormData#getBoolean(String,boolean) getBoolean(String,boolean)}
- <li class='jm'>{@link org.apache.juneau.rest.RequestFormData#addDefault(String,Object) addDefault(String,Object)}
+ <li class='jm'>{@link org.apache.juneau.rest.RequestFormData#get(String,Class) get(String,Class)} - Get form-data parameter values converted to a POJO.
+ <li class='jm'>{@link org.apache.juneau.rest.RequestFormData#get(String,Type,Type...) get(String,Type,Type)} - Get form-data parameter value converted to a map or collection of POJOs.
+ <li class='jm'>{@link org.apache.juneau.rest.RequestFormData#getString(String,String) getString(String,String)} - Get form-data parameter value as a simple string.
+ <li class='jm'>{@link org.apache.juneau.rest.RequestFormData#getInt(String,int) getInt(String,int)} - Get form-data parameter value as an integer.
+ <li class='jm'>{@link org.apache.juneau.rest.RequestFormData#getBoolean(String,boolean) getBoolean(String,boolean)} - Get form-data parameter value as a boolean.
+ <li class='jm'>{@link org.apache.juneau.rest.RequestFormData#addDefault(String,Object) addDefault(String,Object)} - Programmatically set a default value for a form-data parameter.
</ul>
</ul>
+
+ <h5 class='section'>See Also:</h5>
+ <ul>
+ <li class='ja'>{@link org.apache.juneau.http.annotation.FormData}
+ <li class='ja'>{@link org.apache.juneau.http.annotation.HasFormData}
+ </ul>
</div>
<!-- === 7.6.8 - @RestMethod.path() ============================================================= -->
@@ -12010,19 +12283,25 @@
}
</p>
<p>
- The important methods on this class are:
+ Some important methods on this class are:
</p>
<ul class='doctree'>
<li class='jc'><code>{@link org.apache.juneau.rest.RequestPathMatch} <jk>extends</jk> TreeMap<String,String></code>
<ul>
- <li class='jm'>{@link org.apache.juneau.rest.RequestPathMatch#get(String,Class) get(String,Class)}
- <li class='jm'>{@link org.apache.juneau.rest.RequestPathMatch#get(String,Type,Type...) get(String,Type,Type)}
- <li class='jm'>{@link org.apache.juneau.rest.RequestPathMatch#getString(String) getString(String)}
- <li class='jm'>{@link org.apache.juneau.rest.RequestPathMatch#getInt(String) getInt(String)}
- <li class='jm'>{@link org.apache.juneau.rest.RequestPathMatch#getBoolean(String) getBoolean(String)}
- <li class='jm'>{@link org.apache.juneau.rest.RequestPathMatch#getRemainder() getRemainder()}
+ <li class='jm'>{@link org.apache.juneau.rest.RequestPathMatch#get(String,Class) get(String,Class)} - Get path match variable converted to a POJO.
+ <li class='jm'>{@link org.apache.juneau.rest.RequestPathMatch#get(String,Type,Type...) get(String,Type,Type)} - Get path match variable converted to a map or collection of POJOs.
+ <li class='jm'>{@link org.apache.juneau.rest.RequestPathMatch#getString(String) getString(String)} - Get patch match variable as a simple string.
+ <li class='jm'>{@link org.apache.juneau.rest.RequestPathMatch#getInt(String) getInt(String)} - Get path match variable as an integer.
+ <li class='jm'>{@link org.apache.juneau.rest.RequestPathMatch#getBoolean(String) getBoolean(String)} - Get path match variable as a boolean.
+ <li class='jm'>{@link org.apache.juneau.rest.RequestPathMatch#getRemainder() getRemainder()} - Get the path match remainder.
</ul>
</ul>
+
+ <h5 class='section'>See Also:</h5>
+ <ul>
+ <li class='ja'>{@link org.apache.juneau.http.annotation.Path}
+ <li class='ja'>{@link org.apache.juneau.http.annotation.PathRemainder}
+ </ul>
</div>
<!-- === 7.6.10 - Method Return Types =========================================================== -->
@@ -12333,13 +12612,23 @@
<p>
The {@link org.apache.juneau.http.annotation.Body @Body} annotation is used to identify POJOs to be used as the body of an HTTP request.
</p>
- <h5 class='figure'>Example:</h5>
+ <p>
+ This annotation can be applied at the following locations:
+ </p>
+ <ul class='spaced-list'>
+ <li>
+ Parameters on a {@link org.apache.juneau.rest.annotation.RestMethod @RestMethod}.
+ <li>
+ POJO classes.
+ </ul>
+ <h5 class='figure'>Examples:</h5>
<p class='bcode w800'>
+ <jc>// Defined on parameter</jc>
<ja>@RestMethod</ja>(name=<jsf>POST</jsf>)
- <jk>public void</jk> addPerson(<ja>@Body</ja> Person person) {... }
-
- <jc>// ...or...</jc>
-
+ <jk>public void</jk> addPerson(<ja>@Body</ja> Person person) {...}
+ </p>
+ <p class='bcode w800'>
+ <jc>// Defined on POJO class</jc>
<ja>@RestMethod</ja>(name=<jsf>POST</jsf>)
<jk>public void</jk> addPerson(Person person) {...}
@@ -12356,15 +12645,6 @@
...
}
</p>
- <p>
- This annotation can be applied at the following locations:
- </p>
- <ul class='spaced-list'>
- <li>
- Parameters on a {@link org.apache.juneau.rest.annotation.RestMethod @RestMethod}.
- <li>
- POJO classes.
- </ul>
<p>
Any of the following types can be used for the parameter or POJO class (matched in the specified order):
@@ -12411,35 +12691,20 @@
<li><code><jk>public static</jk> T <jsm>forString</jsm>(String in) {...}</code>
</ul>
<br><code>Content-Type</code> must not be present or match an existing parser so that it's not parsed as a POJO.
+ <li>
+ Objects convertible from data types inferred from Swagger schema annotations using the registered {@link org.apache.juneau.rest.RestContext#REST_partParser}.
+ <br>
+ <br><code>Content-Type</code> must not be present or match an existing parser so that it's not parsed as a POJO.
</ol>
- <p>
- Special note should be taken on using {@link java.lang.String} as the body object:
- </p>
- <p class='bcode w800'>
- <ja>@RestMethod</ja>(name=<jsf>POST</jsf>)
- <jk>public void</jk> add(<ja>@Body</ja> String body) {
- ...
- }
- </p>
- <p>
- In the case above, when the <code>Content-Type</code> header is present and matches a parser, the body will be parsed into a <code>String</code> using the matched parser
- using rule #3 above.
- <br>For example, passing in a body of <js>"'foo'"</js> with the header <code>Content-Type: application/json</code> will result in the body being populated with
- <js>"foo"</js>.
- </p>
- <p>
- When the <code>Content-Type</code> header is not present or is <code>text/plain</code>, the body is pass as-is using rule #6 above.
- <br>For example, passing in a body of <js>"'foo'"</js> with no <code>Content-Type</code> header will result in the body being populated with
- <js>"'foo'"</js>.
- </p>
- <p>
- The <ja>@Body</ja> annotation can also be used on POJO classes used as parameters on a REST method.
- <br>This can be useful if you're reusing the same POJOs often in your REST interface and don't want to redefine your Swagger on each method.
- </p>
<h5 class='figure'>Examples:</h5>
<p class='bcode w800'>
- <ja>@Body</ja>(description=<js>"POJO convertible from String"</js>)</ja>
+ <jc>// POJO convertible from string</jc>
+ <ja>@RestMethod</ja>(name=<jsf>PUT</jsf>, path=<js>"/echoPojo"</js>)
+ <jk>public</jk> MyPojo echo(<ja>@Body</ja> MyPojo p) {
+ <jk>return</jk> p;
+ }
+
<jk>public static class</jk> MyPojo {
<jk>private</jk> String <jf>val</jf>;
<jk>public</jk> MyPojo(String val) {
@@ -12449,36 +12714,37 @@
<jk>return</jk> <jf>val</jf>;
}
}
-
- <ja>@RestMethod</ja>(name=<jsf>PUT</jsf>, path=<js>"/echoPojo"</js>)
- <jk>public</jk> MyPojo echo(MyPojo p) {
- <jk>return</jk> p;
- }
</p>
<p class='bcode w800'>
- <ja>@Body</ja>(description=<js>"Bean POJO"</js>)</ja>
- <jk>public static class</jk> MyBean {
- <jk>public</jk> String <jf>f1</jf>;
- }
-
+ <jc>// Parsable bean</jc>
<ja>@RestMethod</ja>(name=<jsf>PUT</jsf>, path=<js>"/echoBean"</js>)
- <jk>public</jk> MyBean echo(MyBean b) {
+ <jk>public</jk> MyBean echo(<ja>@Body</ja> MyBean b) {
<jk>return</jk> b;
}
+
+ <jk>public static class</jk> MyBean {
+ <jk>public</jk> String <jf>f1</jf>;
+ }
</p>
<p class='bcode w800'>
- <ja>@Body</ja>(description=<js>"Bean list"</js>)</ja>
- <jk>public static class</jk> MyBeanList <jk>extends</jk> LinkedList<MyBean> {}
-
+ <jc>// List of parsable beans</jc>
<ja>@RestMethod</ja>(name=<jsf>PUT</jsf>, path=<js>"/echoBeanList"</js>)
- <jk>public</jk> MyBeanList echo(MyBeanList l) {
+ <jk>public</jk> MyBeanList echo(<ja>@Body</ja> MyBeanList l) {
<jk>return</jk> l;
}
+
+ <jk>public static class</jk> MyBeanList <jk>extends</jk> LinkedList<MyBean> {}
+
</p>
<p class='bcode w800'>
- <ja>@Body</ja>(description=<js>"POJO convertible from input stream"</js>)</ja>
- <jk>public static class</jk> MyPojo {
- <jk>private</jk> String <jf>val</jf>;
+ <jc>// POJO convertible from an input stream</jc>
+ <ja>@RestMethod</ja>(name=<jsf>PUT</jsf>, path=<js>"/echoPojo"</js>)
+ <jk>public</jk> MyPojo echo(<ja>@Body</ja> MyPojo p) {
+ <jk>return</jk> p;
+ }
+
+ <jk>public static class</jk> MyPojo {
+ <jk>private</jk> String <jf>val</jf>;
<jk>public</jk> MyPojo(InputStream is) {
<jk>this</jk>.<jf>val</jf> = IOUtils.<jsm>read</jsm>(is);
}
@@ -12486,29 +12752,9 @@
<jk>return</jk> <jf>val</jf>;
}
}
-
- <ja>@RestMethod</ja>(name=<jsf>PUT</jsf>, path=<js>"/echoPojo"</js>)
- <jk>public</jk> MyPojo echo(MyPojo p) {
- <jk>return</jk> p;
- }
</p>
- <p>
- Several of the attributes on the <ja>@Body</ja> annotation are used for specifying additional information for the auto-generated Swagger documentation.
- <br>These do not have any affects on the running code except for the generated Swagger:
- </p>
- <ul class='doctree'>
- <li class='ja'>{@link org.apache.juneau.http.annotation.Body}
- <ul>
- <li class='jf'>{@link org.apache.juneau.http.annotation.Body#description() description()}
- <li class='jf'>{@link org.apache.juneau.http.annotation.Body#required() required()}
- <li class='jf'>{@link org.apache.juneau.http.annotation.Body#schema() schema()}
- <li class='jf'>{@link org.apache.juneau.http.annotation.Body#example() example()}
- <li class='jf'>{@link org.apache.juneau.http.annotation.Body#examples() examples()}
- </ul>
- </ul>
-
- <h5 class='section'>Notes:</h5>
+ <h5 class='section'>Other Notes:</h5>
<ul class='spaced-list'>
<li>
Annotation parameter values will be aggregated when used on POJO parent and child classes.
@@ -12516,22 +12762,21 @@
<li>
Annotation parameter values will be aggregated when used on both POJOs and REST methods.
<br>Values on methods override values on POJO classes.
- <li>
- A future feature enhancement exists for enabling Swagger validation of the request body using the annotation values above.
</ul>
<h5 class='section'>See Also:</h5>
<ul>
<li class='ja'>{@link org.apache.juneau.http.annotation.Body}
<li class='jc'>{@link org.apache.juneau.rest.RequestBody}
+ <li class='link'><a class='doclink' href='#juneau-rest-server.SwaggerSchemaPartParsing'>Swagger Schema Part Parsing</a>
</ul>
-
+
<!-- === 7.7.1 - Handling Form Posts ============================================================ -->
<h4 class='topic' onclick='toggle(this)'><a href='#juneau-rest-server.HandlingFormPosts' id='juneau-rest-server.HandlingFormPosts'>7.7.1 - Handling Form Posts</a></h4>
<div class='topic'>
<p>
- The best way to handle a form post is by using an input bean.
+ The best way to handle a form post is usually by using an input bean.
<br>The samples include a <l>UrlEncodedFormResource</l> class that takes in URL-Encoded form post of the
form <l>"aString=foo&aNumber=123&aDate=2001-07-04T15:30:45Z"</l>.
<br>The code is shown here:
@@ -12632,7 +12877,7 @@
</p>
</div>
</div>
-
+
<!-- === 7.8 - @FormData ============================================================================ -->
<h3 class='topic' onclick='toggle(this)'><a href='#juneau-rest-server.FormData' id='juneau-rest-server.FormData'>7.8 - @FormData</a></h3>
@@ -12663,7 +12908,7 @@
<p>
The registered {@link org.apache.juneau.rest.RestContext#REST_partParser} is used to convert strings
to POJOs and controls what POJO types are supported.
- <br>As a general rule, any POJO convertible from a String is supported.
+ <br>By default, this is the {@link org.apache.juneau.httppart.OpenApiPartParser} which supports the standard Swagger-based rules for parsing.
</p>
<ul class='doctree'>
<li class='warn'>
@@ -12678,12 +12923,20 @@
<li class='ja'>{@link org.apache.juneau.http.annotation.FormData}
<li class='ja'>{@link org.apache.juneau.http.annotation.HasFormData}
<li class='jc'>{@link org.apache.juneau.rest.RequestFormData}
+ <li class='link'><a class='doclink' href='#juneau-rest-server.SwaggerSchemaPartParsing'>Swagger Schema Part Parsing</a>
</ul>
</div>
- <!-- === 7.9 - @Query =============================================================================== -->
+ <!-- === 7.9 - @HasFormData ============================================================================= -->
+
+ <h3 class='topic' onclick='toggle(this)'><a href='#juneau-rest-server.HasFormData' id='juneau-rest-server.HasFormData'>7.9 - @HasFormData</a></h3>
+ <div class='topic'>
+ TODO
+ </div>
+
+ <!-- === 7.10 - @Query =============================================================================== -->
- <h3 class='topic' onclick='toggle(this)'><a href='#juneau-rest-server.Query' id='juneau-rest-server.Query'>7.9 - @Query</a></h3>
+ <h3 class='topic' onclick='toggle(this)'><a href='#juneau-rest-server.Query' id='juneau-rest-server.Query'>7.10 - @Query</a></h3>
<div class='topic'>
<p>
The {@link org.apache.juneau.http.annotation.Query @Query} annotation is used to retrieve request URL query parameters.
@@ -12718,19 +12971,62 @@
<p>
The registered {@link org.apache.juneau.rest.RestContext#REST_partParser} is used to convert strings
to POJOs and controls what POJO types are supported.
- <br>As a general rule, any POJO convertible from a String is supported.
+ <br>By default, this is the {@link org.apache.juneau.httppart.OpenApiPartParser} which supports the standard Swagger-based rules for parsing.
</p>
<h5 class='section'>See Also:</h5>
<ul>
<li class='ja'>{@link org.apache.juneau.http.annotation.Query}
<li class='ja'>{@link org.apache.juneau.http.annotation.HasQuery}
<li class='jc'>{@link org.apache.juneau.rest.RequestQuery}
+ <li class='link'><a class='doclink' href='#juneau-rest-server.SwaggerSchemaPartParsing'>Swagger Schema Part Parsing</a>
+ </ul>
+ </div>
+
+ <!-- === 7.11 - @HasQuery =========================================================================== -->
+
+ <h3 class='topic' onclick='toggle(this)'><a href='#juneau-rest-server.HasQuery' id='juneau-rest-server.HasQuery'>7.11 - @HasQuery</a></h3>
+ <div class='topic'>
+ TODO
+ </div>
+
+ <!-- === 7.12 - @Header ============================================================================= -->
+
+ <h3 class='topic' onclick='toggle(this)'><a href='#juneau-rest-server.Header' id='juneau-rest-server.Header'>7.12 - @Header</a></h3>
+ <div class='topic'>
+ <p>
+ The {@link org.apache.juneau.http.annotation.Header @Header} annotation is used to retrieve request headers.
+ </p>
+ <h5 class='figure'>Example:</h5>
+ <p class='bcode w800'>
+ <ja>@RestMethod</ja>(name=<jsf>GET</jsf>)
+ <jk>public void</jk> doGet(RestRequest req, RestResponse res, <ja>@Header</ja>(<js>"ETag"</js>) UUID etag) {...}
+ </p>
+ <p>
+ This is functionally equivalent to the following code:
+ </p>
+ <p class='bcode w800'>
+ <ja>@RestMethod</ja>(name=<jsf>GET</jsf>)
+ <jk>public void</jk> doPostPerson(RestRequest req, RestResponse res) {
+ RequestHeaders h = req.getHeaders();
+ UUID etag = h.get(<js>"ETag"</js>, UUID.<jk>class</jk>);
+ }
+ </p>
+ <p>
+ The registered {@link org.apache.juneau.rest.RestContext#REST_partParser} is used to convert strings
+ to POJOs and controls what POJO types are supported.
+ <br>By default, this is the {@link org.apache.juneau.httppart.OpenApiPartParser} which supports the standard Swagger-based rules for parsing.
+ </p>
+ <h5 class='section'>See Also:</h5>
+ <ul>
+ <li class='ja'>{@link org.apache.juneau.http.annotation.Header}
+ <li class='jc'>{@link org.apache.juneau.rest.RequestHeaders}
+ <li class='link'><a class='doclink' href='#juneau-rest-server.SwaggerSchemaPartParsing'>Swagger Schema Part Parsing</a>
</ul>
</div>
- <!-- === 7.10 - @Header ============================================================================= -->
+ <!-- === 7.13 - @Path =============================================================================== -->
- <h3 class='topic' onclick='toggle(this)'><a href='#juneau-rest-server.Header' id='juneau-rest-server.Header'>7.10 - @Header</a></h3>
+ <h3 class='topic' onclick='toggle(this)'><a href='#juneau-rest-server.Path' id='juneau-rest-server.Path'>7.13 - @Path</a></h3>
<div class='topic'>
<p>
The {@link org.apache.juneau.http.annotation.Header @Header} annotation is used to retrieve request headers.
@@ -12753,18 +13049,529 @@
<p>
The registered {@link org.apache.juneau.rest.RestContext#REST_partParser} is used to convert strings
to POJOs and controls what POJO types are supported.
- <br>As a general rule, any POJO convertible from a String is supported.
+ <br>By default, this is the {@link org.apache.juneau.httppart.OpenApiPartParser} which supports the standard Swagger-based rules for parsing.
</p>
<h5 class='section'>See Also:</h5>
<ul>
<li class='ja'>{@link org.apache.juneau.http.annotation.Header}
<li class='jc'>{@link org.apache.juneau.rest.RequestHeaders}
+ <li class='link'><a class='doclink' href='#juneau-rest-server.SwaggerSchemaPartParsing'>Swagger Schema Part Parsing</a>
+ </ul>
+ </div>
+
+ <!-- === 7.14 - @PathRemainer ======================================================================= -->
+
+ <h3 class='topic' onclick='toggle(this)'><a href='#juneau-rest-server.PathRemainer' id='juneau-rest-server.PathRemainer'>7.14 - @PathRemainer</a></h3>
+ <div class='topic'>
+ </div>
+
+ <!-- === 7.15 - Swagger Schema Part Parsing ========================================================= -->
+
+ <h3 class='topic' onclick='toggle(this)'><a href='#juneau-rest-server.SwaggerSchemaPartParsing' id='juneau-rest-server.SwaggerSchemaPartParsing'>7.15 - Swagger Schema Part Parsing</a></h3>
+ <div class='topic'>
+ <p>
+ Parameters annotated with any of the following also support parsing based on Swagger-schemas:
+ </p>
+ <ul class='doctree'>
+ <li class='ja'>{@link org.apache.juneau.http.annotation.Body Body}
+ <li class='ja'>{@link org.apache.juneau.http.annotation.Header Header}
+ <li class='ja'>{@link org.apache.juneau.http.annotation.Query Query}
+ <li class='ja'>{@link org.apache.juneau.http.annotation.FormData FormData}
+ <li class='ja'>{@link org.apache.juneau.http.annotation.Path Path}
+ </ul>
+ <p>
+ For example, the following shows how a pipe-delimited list of comma-delimited numbers (e.g. <js>"1,2,3|4,5,6|7,8,9"</js>) in an HTTP body can be converted to a 2-dimensional array of <code>Longs</code>:
+ </p>
+ <p class='bcode w800'>
+ <ja>@RestMethod</ja>(method=<js>"POST"</js>, path=<js>"/2dLongArray"</js>)
+ <jk>public void</jk> post2dLongArray(
+ <ja>@Body</ja>(
+ schema=<ja>@Schema</ja>(
+ items=<ja>@Items</ja>(
+ collectionFormat=<js>"pipes"</js>,
+ items=<ja>@SubItems</ja>(
+ collectionFormat=<js>"csv"</js>,
+ type=<js>"integer"</js>,
+ format=<js>"int64"</js>,
+ minimum=<js>"0"</js>,
+ maximum=<js>"100"</js>
+ minLength=1,
+ maxLength=10
+ )
+ )
+ minLength=1,
+ maxLength=10
+ )
+ )
+ Long[][] body
+ ) {...}
+ </p>
+ <p>
+ Input will be converted based on the types and formats defined in the schema definition.
+ <br>Input validations such as <code>minLength/maxLength</code> that don't match the input will result in automatic <code>400 Bad Request</code> responses.
+ </p>
+ <p>
+ The equivalent for a form-data post entry is shown below:
+ </p>
+ <p class='bcode w800'>
+ <ja>@RestMethod</ja>(method=<js>"POST"</js>, path=<js>"/2dLongArray"</js>)
+ <jk>public void</jk> post2dLongArray(
+ <ja>@FormData</ja>(
+ name=<js>"2dLongArrayEntry"</js>,
+ collectionFormat=<js>"pipes"</js>,
+ items=<ja>@SubItems</ja>(
+ collectionFormat=<js>"csv"</js>,
+ type=<js>"integer"</js>,
+ format=<js>"int64"</js>,
+ minimum=<js>"0"</js>,
+ maximum=<js>"100"</js>
+ minLength=1,
+ maxLength=10
+ )
+ minLength=1,
+ maxLength=10
+ )
+ )
+ Long[][] formEntry
+ ) {...}
+ </p>
+ <p>
+ The annotations used for defining the schema for an HTTP part are:
+ </p>
+ <ul class='doctree'>
+ <li class='ja'>{@link org.apache.juneau.http.annotation.Body Body}
+ <ul>
+ <li class='jf'>{@link org.apache.juneau.http.annotation.Body#parser() parser()} - Override the part parser.
+ <li class='jf'>{@link org.apache.juneau.http.annotation.Body#required() required()} - Input validation. Body must be present.
+ <li class='jf'>{@link org.apache.juneau.http.annotation.Body#schema() schema()} - The schema.
+ </ul>
+ <li class='ja'>{@link org.apache.juneau.http.annotation.Header Header}
+ <ul>
+ <li class='jf'>{@link org.apache.juneau.http.annotation.Header#_default() _default()} - Default value if not present.
+ <li class='jf'>{@link org.apache.juneau.http.annotation.Header#_enum() _enum()} - Input validation. Must match one of the values.
+ <li class='jf'>{@link org.apache.juneau.http.annotation.Header#allowEmptyValue() allowEmptyValue()} - Input validation. Allow empty value.
+ <li class='jf'>{@link org.apache.juneau.http.annotation.Header#collectionFormat() collectionFormat()} - How collections of items are formatted.
+ <li class='jf'>{@link org.apache.juneau.http.annotation.Header#exclusiveMaximum() exclusiveMaximum()} - Input validation. Whether maximum is exclusive.
+ <li class='jf'>{@link org.apache.juneau.http.annotation.Header#exclusiveMinimum() exclusiveMinimum()} - Input validation. Whether minimum is exclusive.
+ <li class='jf'>{@link org.apache.juneau.http.annotation.Header#format() format()} - The schema type format.
+ <li class='jf'>{@link org.apache.juneau.http.annotation.Header#items() items()} - The schema of items in a collection.
+ <li class='jf'>{@link org.apache.juneau.http.annotation.Header#maximum() maximum()} - Input validation. Maximum numeric value.
+ <li class='jf'>{@link org.apache.juneau.http.annotation.Header#maxItems() maxItems()} - Input validation. Maximum number of items in a collection.
+ <li class='jf'>{@link org.apache.juneau.http.annotation.Header#maxLength() maxLength()} - Input validation. Maximum length of a string.
+ <li class='jf'>{@link org.apache.juneau.http.annotation.Header#minimum() minimum()} - Input validation. Minimum numeric value.
+ <li class='jf'>{@link org.apache.juneau.http.annotation.Header#minItems() minItems()} - Input validation. Minimum number of items in a collection.
+ <li class='jf'>{@link org.apache.juneau.http.annotation.Header#minLength() minLength()} - Input validation. Minimum length of a string.
+ <li class='jf'>{@link org.apache.juneau.http.annotation.Header#multipleOf() multipleOf()} - Input validation. Number must be a multiple of.
+ <li class='jf'>{@link org.apache.juneau.http.annotation.Header#name() name()} - Header name.
+ <li class='jf'>{@link org.apache.juneau.http.annotation.Header#parser() parser()} - Override the part parser.
+ <li class='jf'>{@link org.apache.juneau.http.annotation.Header#pattern() pattern()} - Input validation. Must match regular expression.
+ <li class='jf'>{@link org.apache.juneau.http.annotation.Header#required() required()} - Input validation. Header must be present.
+ <li class='jf'>{@link org.apache.juneau.http.annotation.Header#type() type()} - The schema type.
+ <li class='jf'>{@link org.apache.juneau.http.annotation.Header#uniqueItems() uniqueItems()} - Input validation. Collections must contain unique items only.
+ </ul>
+ <li class='ja'>{@link org.apache.juneau.http.annotation.FormData FormData}
+ <ul>
+ <li class='jf'>{@link org.apache.juneau.http.annotation.FormData#_default() _default()} - Default value if not present.
+ <li class='jf'>{@link org.apache.juneau.http.annotation.FormData#_enum() _enum()} - Input validation. Must match one of the values.
+ <li class='jf'>{@link org.apache.juneau.http.annotation.FormData#allowEmptyValue() allowEmptyValue()} - Input validation. Allow empty value.
+ <li class='jf'>{@link org.apache.juneau.http.annotation.FormData#collectionFormat() collectionFormat()} - How collections of items are formatted.
+ <li class='jf'>{@link org.apache.juneau.http.annotation.FormData#exclusiveMaximum() exclusiveMaximum()} - Input validation. Whether maximum is exclusive.
+ <li class='jf'>{@link org.apache.juneau.http.annotation.FormData#exclusiveMinimum() exclusiveMinimum()} - Input validation. Whether minimum is exclusive.
+ <li class='jf'>{@link org.apache.juneau.http.annotation.FormData#format() format()} - The schema type format.
+ <li class='jf'>{@link org.apache.juneau.http.annotation.FormData#items() items()} - The schema of items in a collection.
+ <li class='jf'>{@link org.apache.juneau.http.annotation.FormData#maximum() maximum()} - Input validation. Maximum numeric value.
+ <li class='jf'>{@link org.apache.juneau.http.annotation.FormData#maxItems() maxItems()} - Input validation. Maximum number of items in a collection.
+ <li class='jf'>{@link org.apache.juneau.http.annotation.FormData#maxLength() maxLength()} - Input validation. Maximum length of a string.
+ <li class='jf'>{@link org.apache.juneau.http.annotation.FormData#minimum() minimum()} - Input validation. Minimum numeric value.
+ <li class='jf'>{@link org.apache.juneau.http.annotation.FormData#minItems() minItems()} - Input validation. Minimum number of items in a collection.
+ <li class='jf'>{@link org.apache.juneau.http.annotation.FormData#minLength() minLength()} - Input validation. Minimum length of a string.
+ <li class='jf'>{@link org.apache.juneau.http.annotation.FormData#multipleOf() multipleOf()} - Input validation. Number must be a multiple of.
+ <li class='jf'>{@link org.apache.juneau.http.annotation.FormData#name() name()} - Form data entry name.
+ <li class='jf'>{@link org.apache.juneau.http.annotation.FormData#parser() parser()} - Override the part parser.
+ <li class='jf'>{@link org.apache.juneau.http.annotation.FormData#pattern() pattern()} - Input validation. Must match regular expression.
+ <li class='jf'>{@link org.apache.juneau.http.annotation.FormData#required() required()} - Input validation. Form data entry must be present.
+ <li class='jf'>{@link org.apache.juneau.http.annotation.FormData#type() type()} - The schema type.
+ <li class='jf'>{@link org.apache.juneau.http.annotation.FormData#uniqueItems() uniqueItems()} - Input validation. Collections must contain unique items only.
+ </ul>
+ <li class='ja'>{@link org.apache.juneau.http.annotation.Query Query}
+ <ul>
+ <li class='jf'>{@link org.apache.juneau.http.annotation.Query#_default() _default()} - Default value if not present.
+ <li class='jf'>{@link org.apache.juneau.http.annotation.Query#_enum() _enum()} - Input validation. Must match one of the values.
+ <li class='jf'>{@link org.apache.juneau.http.annotation.Query#allowEmptyValue() allowEmptyValue()} - Input validation. Allow empty value.
+ <li class='jf'>{@link org.apache.juneau.http.annotation.Query#collectionFormat() collectionFormat()} - How collections of items are formatted.
+ <li class='jf'>{@link org.apache.juneau.http.annotation.Query#exclusiveMaximum() exclusiveMaximum()} - Input validation. Whether maximum is exclusive.
+ <li class='jf'>{@link org.apache.juneau.http.annotation.Query#exclusiveMinimum() exclusiveMinimum()} - Input validation. Whether minimum is exclusive.
+ <li class='jf'>{@link org.apache.juneau.http.annotation.Query#format() format()} - The schema type format.
+ <li class='jf'>{@link org.apache.juneau.http.annotation.Query#items() items()} - The schema of items in a collection.
+ <li class='jf'>{@link org.apache.juneau.http.annotation.Query#maximum() maximum()} - Input validation. Maximum numeric value.
+ <li class='jf'>{@link org.apache.juneau.http.annotation.Query#maxItems() maxItems()} - Input validation. Maximum number of items in a collection.
+ <li class='jf'>{@link org.apache.juneau.http.annotation.Query#maxLength() maxLength()} - Input validation. Maximum length of a string.
+ <li class='jf'>{@link org.apache.juneau.http.annotation.Query#minimum() minimum()} - Input validation. Minimum numeric value.
+ <li class='jf'>{@link org.apache.juneau.http.annotation.Query#minItems() minItems()} - Input validation. Minimum number of items in a collection.
+ <li class='jf'>{@link org.apache.juneau.http.annotation.Query#minLength() minLength()} - Input validation. Minimum length of a string.
+ <li class='jf'>{@link org.apache.juneau.http.annotation.Query#multipleOf() multipleOf()} - Input validation. Number must be a multiple of.
+ <li class='jf'>{@link org.apache.juneau.http.annotation.Query#name() name()} - Query parameter name.
+ <li class='jf'>{@link org.apache.juneau.http.annotation.Query#parser() parser()} - Override the part parser.
+ <li class='jf'>{@link org.apache.juneau.http.annotation.Query#pattern() pattern()} - Input validation. Must match regular expression.
+ <li class='jf'>{@link org.apache.juneau.http.annotation.Query#required() required()} - Input validation. Query parameter must be present.
+ <li class='jf'>{@link org.apache.juneau.http.annotation.Query#type() type()} - The schema type.
+ <li class='jf'>{@link org.apache.juneau.http.annotation.Query#uniqueItems() uniqueItems()} - Input validation. Collections must contain unique items only.
+ </ul>
+ <li class='ja'>{@link org.apache.juneau.http.annotation.Path Path}
+ <ul>
+ <li class='jf'>{@link org.apache.juneau.http.annotation.Path#_enum() _enum()} - Input validation. Must match one of the values.
+ <li class='jf'>{@link org.apache.juneau.http.annotation.Path#collectionFormat() collectionFormat()} - How collections of items are formatted.
+ <li class='jf'>{@link org.apache.juneau.http.annotation.Path#exclusiveMaximum() exclusiveMaximum()} - Input validation. Whether maximum is exclusive.
+ <li class='jf'>{@link org.apache.juneau.http.annotation.Path#exclusiveMinimum() exclusiveMinimum()} - Input validation. Whether minimum is exclusive.
+ <li class='jf'>{@link org.apache.juneau.http.annotation.Path#format() format()} - The schema type format.
+ <li class='jf'>{@link org.apache.juneau.http.annotation.Path#items() items()} - The schema of items in a collection.
+ <li class='jf'>{@link org.apache.juneau.http.annotation.Path#maximum() maximum()} - Input validation. Maximum numeric value.
+ <li class='jf'>{@link org.apache.juneau.http.annotation.Path#maxLength() maxLength()} - Input validation. Maximum length of a string.
+ <li class='jf'>{@link org.apache.juneau.http.annotation.Path#minimum() minimum()} - Input validation. Minimum numeric value.
+ <li class='jf'>{@link org.apache.juneau.http.annotation.Path#minLength() minLength()} - Input validation. Minimum length of a string.
+ <li class='jf'>{@link org.apache.juneau.http.annotation.Path#multipleOf() multipleOf()} - Input validation. Number must be a multiple of.
+ <li class='jf'>{@link org.apache.juneau.http.annotation.Path#name() name()} - Path variable name.
+ <li class='jf'>{@link org.apache.juneau.http.annotation.Path#parser() parser()} - Override the part parser.
+ <li class='jf'>{@link org.apache.juneau.http.annotation.Path#pattern() pattern()} - Input validation. Must match regular expression.
+ <li class='jf'>{@link org.apache.juneau.http.annotation.Path#type() type()} - The schema type.
+ </ul>
+ </ul>
+ <p>
+ The sub-annotations used in the annotation above are:
+ </p>
+ <ul class='doctree'>
+ <li class='ja'>{@link org.apache.juneau.http.annotation.Schema Schema}
+ <ul>
+ <li class='jf'>{@link org.apache.juneau.http.annotation.Schema#_default() _default()} - Default value if not present.
+ <li class='jf'>{@link org.apache.juneau.http.annotation.Schema#_enum() _enum()} - Input validation. Must match one of the values.
+ <li class='jf'>{@link org.apache.juneau.http.annotation.Schema#exclusiveMaximum() exclusiveMaximum()} - Input validation. Whether maximum is exclusive.
+ <li class='jf'>{@link org.apache.juneau.http.annotation.Schema#exclusiveMinimum() exclusiveMinimum()} - Input validation. Whether minimum is exclusive.
+ <li class='jf'>{@link org.apache.juneau.http.annotation.Schema#format() format()} - The schema type format.
+ <li class='jf'>{@link org.apache.juneau.http.annotation.Schema#items() items()} - The schema of items in a collection.
+ <li class='jf'>{@link org.apache.juneau.http.annotation.Schema#maximum() maximum()} - Input validation. Maximum numeric value.
+ <li class='jf'>{@link org.apache.juneau.http.annotation.Schema#maxItems() maxItems()} - Input validation. Maximum number of items in a collection.
+ <li class='jf'>{@link org.apache.juneau.http.annotation.Schema#maxLength() maxLength()} - Input validation. Maximum length of a string.
+ <li class='jf'>{@link org.apache.juneau.http.annotation.Schema#minimum() minimum()} - Input validation. Minimum numeric value.
+ <li class='jf'>{@link org.apache.juneau.http.annotation.Schema#minItems() minItems()} - Input validation. Minimum number of items in a collection.
+ <li class='jf'>{@link org.apache.juneau.http.annotation.Schema#minLength() minLength()} - Input validation. Minimum length of a string.
+ <li class='jf'>{@link org.apache.juneau.http.annotation.Schema#multipleOf() multipleOf()} - Input validation. Number must be a multiple of.
+ <li class='jf'>{@link org.apache.juneau.http.annotation.Schema#pattern() pattern()} - Input validation. Must match regular expression.
+ <li class='jf'>{@link org.apache.juneau.http.annotation.Schema#pattern() properties()} - Schema of properties of this item.
+ <li class='jf'>{@link org.apache.juneau.http.annotation.Schema#required() required()} - Whether this value is required.
+ <li class='jf'>{@link org.apache.juneau.http.annotation.Schema#type() type()} - The schema type.
+ <li class='jf'>{@link org.apache.juneau.http.annotation.Schema#uniqueItems() uniqueItems()} - Input validation. Collections must contain unique items only.
+ </ul>
+ <li class='ja'>{@link org.apache.juneau.http.annotation.Items Items}
+ <ul>
+ <li class='jf'>{@link org.apache.juneau.http.annotation.Items#_default() _default()} - Default value if not present.
+ <li class='jf'>{@link org.apache.juneau.http.annotation.Items#_enum() _enum()} - Input validation. Must match one of the values.
+ <li class='jf'>{@link org.apache.juneau.http.annotation.Items#collectionFormat() collectionFormat()} - How collections of items are formatted.
+ <li class='jf'>{@link org.apache.juneau.http.annotation.Items#exclusiveMaximum() exclusiveMaximum()} - Input validation. Whether maximum is exclusive.
+ <li class='jf'>{@link org.apache.juneau.http.annotation.Items#exclusiveMinimum() exclusiveMinimum()} - Input validation. Whether minimum is exclusive.
+ <li class='jf'>{@link org.apache.juneau.http.annotation.Items#format() format()} - The schema type format.
+ <li class='jf'>{@link org.apache.juneau.http.annotation.Items#items() items()} - The schema of items in a collection.
+ <li class='jf'>{@link org.apache.juneau.http.annotation.Items#maximum() maximum()} - Input validation. Maximum numeric value.
+ <li class='jf'>{@link org.apache.juneau.http.annotation.Items#maxItems() maxItems()} - Input validation. Maximum number of items in a collection.
+ <li class='jf'>{@link org.apache.juneau.http.annotation.Items#maxLength() maxLength()} - Input validation. Maximum length of a string.
+ <li class='jf'>{@link org.apache.juneau.http.annotation.Items#minimum() minimum()} - Input validation. Minimum numeric value.
+ <li class='jf'>{@link org.apache.juneau.http.annotation.Items#minItems() minItems()} - Input validation. Minimum number of items in a collection.
+ <li class='jf'>{@link org.apache.juneau.http.annotation.Items#minLength() minLength()} - Input validation. Minimum length of a string.
+ <li class='jf'>{@link org.apache.juneau.http.annotation.Items#multipleOf() multipleOf()} - Input validation. Number must be a multiple of.
+ <li class='jf'>{@link org.apache.juneau.http.annotation.Items#pattern() pattern()} - Input validation. Must match regular expression.
+ <li class='jf'>{@link org.apache.juneau.http.annotation.Items#type() type()} - The schema type.
+ <li class='jf'>{@link org.apache.juneau.http.annotation.Items#uniqueItems() uniqueItems()} - Input validation. Collections must contain unique items only.
+ </ul>
+ </ul>
+ <p>
+ Warning....here's where things get complex (in case you weren't already confused)...
+ </p>
+ <p>
+ When using Swagger schemas to define the body of a request, the list of valid POJO types expands significantly depending on the type and format
+ of the value or items/entries of the value.
+ </p>
+ <p>
+ For example, instead of <code>Longs</code> in the example above, we could also define a 2-dimensional array of POJOs convertible from <code>Longs</code>:
+ </p>
+ <p class='bcode w800'>
+ <ja>@RestMethod</ja>(method=<js>"POST"</js>, path=<js>"/2dLongArray"</js>)
+ <jk>public void</jk> post2dLongArray(<ja>@Body</ja>(...) MyPojo[][] body) {...}
+
+ <jc>// POJO convertible from a Long.</jc>
+ <jk>public class</jk> MyPojo {
+ <jk>public</jk> MyPojo(Long input) {...}
+ }
+ </p>
+ <p>
+ Or even POJOs that take in arrays of <code>Longs[]</code>:
+ </p>
+ <p class='bcode w800'>
+ <ja>@RestMethod</ja>(method=<js>"POST"</js>, path=<js>"/2dLongArray"</js>)
+ <jk>public void</jk> post2dLongArray(<ja>@Body</ja>(...) MyPojo[] body) {...}
+
+ <jc>// POJO convertible from a Long[].</jc>
+ <jk>public class</jk> MyPojo {
+ <jk>public</jk> MyPojo(Long[] input) {...}
+ }
+ </p>
+ <p>
+ Or even POJOs that take in the whole 2-dimensional array:
+ </p>
+ <p class='bcode w800'>
+ <ja>@RestMethod</ja>(method=<js>"POST"</js>, path=<js>"/2dLongArray"</js>)
+ <jk>public void</jk> post2dLongArray(<ja>@Body</ja>(...) MyPojo body) {...}
+
+ <jc>// POJO convertible from a Long[][].</jc>
+ <jk>public class</jk> MyPojo {
+ <jk>public</jk> MyPojo(Long[][] input) {...}
+ }
+ </p>
+ <p>
+ As you can see, the complexity of possible input types expands significantly.
+ <br>Here are the rules of POJO types allowed for various type/format combinations:
+ </p>
+ <table class='styled w800'>
+ <tr><th>Type</th><th>Format</th><th>Valid parameter types</th></tr>
+ <tr class='dark bb'>
+ <td rowspan="4"><code>string</code></td>
+ <td>
+ <code>byte</code>
+ <br><code>binary</code>
+ <br><code>binary-spaced</br>
+ </td>
+ <td>
+ <ul>
+ <li><code><jk>byte</jk>[]</code> (default)
+ <li>{@link java.io.InputStream} - Returns a {@link java.io.ByteArrayInputStream}.
+ <li>{@link java.io.Reader} - Returns a {@link java.io.InputStreamReader} wrapped around a {@link java.io.ByteArrayInputStream}.
+ <li>{@link java.lang.String} - Constructed using {@link java.lang.String#String(byte[])}.
+ <li>{@link java.lang.Object} - Returns the default <code><jk>byte</jk>[]</code>.
+ <li>Any POJO transformable from a <code><jk>byte</jk>[]</code> (via constructors or static create methods).
+ </ul>
+ </td>
+ </tr>
+ <tr class='dark bb'>
+ <td>
+ <code>date</code>
+ <br><code>date-time</code>
+ </td>
+ <td>
+ <ul>
+ <li>{@link java.util.Calendar} (default)
+ <li>{@link java.util.Date}
+ <li>{@link java.util.GregorianCalendar}
+ <li>{@link java.lang.String} - Converted using {@link java.util.Calendar#toString()}.
+ <li>{@link java.lang.Object} - Returns the default {@link java.util.Calendar}.
+ <li>Any POJO transformable from a {@link java.util.Calendar} (via constructors or static create methods).
+ </ul>
+ </td>
+ </tr>
+ <tr class='dark bb'>
+ <td><code>uon</code></td>
+ <td>
+ <ul>
+ <li>Any <a href='#juneau-marshall.PojoCategories'>parsable POJO</a>.
+ </ul>
+ </td>
+ </tr>
+ <tr class='dark bb'>
+ <td>none specified</td>
+ <td>
+ <ul>
+ <li>{@link java.lang.String} (default)
+ <li>{@link java.lang.Object} - Returns the default {@link java.lang.String}.
+ <li>Any POJO transformable from a {@link java.lang.String} (via constructors or static create methods).
+ </ul>
+ </td>
+ </tr>
+ <tr class='light bb'>
+ <td ><code>boolean</code></td>
+ <td>
+
+ </td>
+ <td>
+ <ul>
+ <li>{@link java.lang.Boolean} (default)
+ <li><jk>boolean</jk>
+ <li>{@link java.lang.String}
+ <li>{@link java.lang.Object} - Returns the default {@link java.lang.Boolean}.
+ <li>Any POJO transformable from a {@link java.lang.Boolean} (via constructors, static create methods).
+ </ul>
+ </td>
+ </tr>
+ <tr class='dark bb'>
+ <td rowspan=2><code>integer</code></td>
+ <td>
+ <code>int32</code>
+ </td>
+ <td>
+ <ul>
+ <li>{@link java.lang.Integer} (default)
+ <li>Any subclass of {@link java.lang.Number}
+ <li>Any primitive number: (e.g <jk>int</jk>, <jk>float</jk>...)
+ <li>{@link java.lang.String}
+ <li>{@link java.lang.Object} - Returns the default {@link java.lang.Integer}.
+ <li>Any POJO transformable from an {@link java.lang.Integer} (via constructors, static create methods).
+ </ul>
+ </td>
+ </tr>
+ <tr class='dark bb'>
+ <td>
+ <code>int64</code>
+ </td>
+ <td>
+ <ul>
+ <li>{@link java.lang.Long} (default)
+ <li>Any subclass of {@link java.lang.Number}
+ <li>Any primitive number: (e.g <jk>int</jk>, <jk>float</jk>...)
+ <li>{@link java.lang.String}
+ <li>{@link java.lang.Object} - Returns the default {@link java.lang.Long}.
+ <li>Any POJO transformable from an {@link java.lang.Long} (via constructors, static create methods).
+ </ul>
+ </td>
+ </tr>
+ <tr class='light bb'>
+ <td rowspan=2><code>number</code></td>
+ <td>
+ <code>float</code>
+ </td>
+ <td>
+ <ul>
+ <li>{@link java.lang.Float} (default)
+ <li>Any subclass of {@link java.lang.Number}
+ <li>Any primitive number: (e.g <jk>int</jk>, <jk>float</jk>...)
+ <li>{@link java.lang.String}
+ <li>{@link java.lang.Object} - Returns the default {@link java.lang.Float}.
+ <li>Any POJO transformable from an {@link java.lang.Float} (via constructors, static create methods).
+ </ul>
+ </td>
+ </tr>
+ <tr class='light bb'>
+ <td>
+ <code>double</code>
+ </td>
+ <td>
+ <ul>
+ <li>{@link java.lang.Double} (default)
+ <li>Any subclass of {@link java.lang.Number}
+ <li>Any primitive number: (e.g <jk>int</jk>, <jk>float</jk>...)
+ <li>{@link java.lang.String}
+ <li>{@link java.lang.Object} - Returns the default {@link java.lang.Double}.
+ <li>Any POJO transformable from an {@link java.lang.Double} (via constructors, static create methods).
+ </ul>
+ </td>
+ </tr>
+ <tr class='dark bb'>
+ <td ><code>array</code></td>
+ <td>
+
+ </td>
+ <td>
+ <ul>
+ <li>Arrays or Collections of anything on this list.
+ <li>Any POJO transformable from arrays of the default types (e.g. <code>Integer[]</code>, <code>Boolean[][]</code>, etc...).
+ </ul>
+ </td>
+ </tr>
+ <tr class='light bb'>
+ <td ><code>object</code></td>
+ <td>
+
+ </td>
+ <td>
+ <ul>
+ <li>Beans with properties of anything on this list.
+ <li>Maps with string keys.
+ </ul>
+ </td>
+ </tr>
+ </table>
+ <p>
+ Several of the attributes on the <ja>@Body</ja> annotation are used for specifying additional information for the auto-generated Swagger documentation.
+ <br>These do not have any affects on the running code except for the generated Swagger:
+ </p>
+ <ul class='doctree'>
+ <li class='ja'>{@link org.apache.juneau.http.annotation.Body}
+ <ul>
+ <li class='jf'>{@link org.apache.juneau.http.annotation.Body#api() api()} - Free-form JSON swagger.
+ <li class='jf'>{@link org.apache.juneau.http.annotation.Body#description() description()} - Description
+ <li class='jf'>{@link org.apache.juneau.http.annotation.Body#example() example()} - Defines a serialized POJO example (in JSON format) used to populate examples per language type.
+ <li class='jf'>{@link org.apache.juneau.http.annotation.Body#examples() examples()} - Map of examples per language type.
+ <li class='jf'>{@link org.apache.juneau.http.annotation.Body#schema() schema()} - The swagger schema ({@link org.apache.juneau.http.annotation.Schema Schema}).
+ </ul>
+ <li class='ja'>{@link org.apache.juneau.http.annotation.Schema Schema}
+ <ul>
+ <li class='jf'>{@link org.apache.juneau.http.annotation.Schema#$ref() $ref()} - Reference to schema definition.
+ <li class='jf'>{@link org.apache.juneau.http.annotation.Schema#description() description()} - Description
+ <li class='jf'>{@link org.apache.juneau.http.annotation.Schema#example() example()} - Defines a serialized POJO example (in JSON format) used to populate examples per language type.
+ <li class='jf'>{@link org.apache.juneau.http.annotation.Schema#examples() examples()} - Map of examples per language type.
+ <li class='jf'>{@link org.apache.juneau.http.annotation.Schema#externalDocs() externalDocs()} - External documentation.
+ <li class='jf'>{@link org.apache.juneau.http.annotation.Schema#title() title()} - Title.
+ <li class='jf'>{@link org.apache.juneau.http.annotation.Schema#value() value()} - Free-form JSON swagger.
+ <li class='jf'>{@link org.apache.juneau.http.annotation.Schema#xml() xml()} - XML schema.
+ </ul>
+ <li class='ja'>{@link org.apache.juneau.http.annotation.Items Items}
+ <ul>
+ <li class='jf'>{@link org.apache.juneau.http.annotation.Items#$ref() $ref()} - Reference to schema definition.
+ <li class='jf'>{@link org.apache.juneau.http.annotation.Items#value() value()} - Free-form JSON swagger.
+ </ul>
+ </ul>
+
+ <h5 class='section'>Other Notes:</h5>
+ <ul class='spaced-list'>
+ <li>
+ Annotation parameter values will be aggregated when used on POJO parent and child classes.
+ <br>Values on child classes override values on parent classes.
+ <li>
+ Annotation parameter values will be aggregated when used on both POJOs and REST methods.
+ <br>Values on methods override values on POJO classes.
</ul>
</div>
- <!-- === 7.11 - Serializers ========================================================================= -->
+ <!-- === 7.16 - @Response =========================================================================== -->
+
+ <h3 class='topic' onclick='toggle(this)'><a href='#juneau-rest-server.Response' id='juneau-rest-server.Response'>7.16 - @Response</a></h3>
+ <div class='topic'>
+ TODO
+ </div>
+
+ <!-- === 7.17 - @Responses ========================================================================== -->
+
+ <h3 class='topic' onclick='toggle(this)'><a href='#juneau-rest-server.Responses' id='juneau-rest-server.Responses'>7.17 - @Responses</a></h3>
+ <div class='topic'>
+ TODO
+ </div>
+
+ <!-- === 7.18 - @ResponseHeader ===================================================================== -->
+
+ <h3 class='topic' onclick='toggle(this)'><a href='#juneau-rest-server.ResponseHeader' id='juneau-rest-server.ResponseHeader'>7.18 - @ResponseHeader</a></h3>
+ <div class='topic'>
+ TODO
+ </div>
+
+ <!-- === 7.19 - @ResponseStatus ===================================================================== -->
+
+ <h3 class='topic' onclick='toggle(this)'><a href='#juneau-rest-server.ResponseStatus' id='juneau-rest-server.ResponseStatus'>7.19 - @ResponseStatus</a></h3>
+ <div class='topic'>
+ TODO
+ </div>
+
+ <!-- === 7.20 - @ResponseStatuses =================================================================== -->
+
+ <h3 class='topic' onclick='toggle(this)'><a href='#juneau-rest-server.ResponseStatuses' id='juneau-rest-server.ResponseStatuses'>7.20 - @ResponseStatuses</a></h3>
+ <div class='topic'>
+ TODO
+ </div>
+
+ <!-- === 7.21 - Swagger Schema Part Serializing ===================================================== -->
- <h3 class='topic' onclick='toggle(this)'><a href='#juneau-rest-server.Serializers' id='juneau-rest-server.Serializers'>7.11 - Serializers</a></h3>
+ <h3 class='topic' onclick='toggle(this)'><a href='#juneau-rest-server.SwaggerSchemaPartSerializing' id='juneau-rest-server.SwaggerSchemaPartSerializing'>7.21 - Swagger Schema Part Serializing</a></h3>
+ <div class='topic'>
+ TODO
+ </div>
+
+ <!-- === 7.22 - Serializers ========================================================================= -->
+
+ <h3 class='topic' onclick='toggle(this)'><a href='#juneau-rest-server.Serializers' id='juneau-rest-server.Serializers'>7.22 - Serializers</a></h3>
<div class='topic'>
<p>
REST resources use the {@link org.apache.juneau.serializer.Serializer} API for defining serializers for
@@ -12830,9 +13637,16 @@
</ul>
</div>
- <!-- === 7.12 - Parsers ============================================================================= -->
+ <!-- === 7.23 - PartSerializers ========================================================================= -->
+
+ <h3 class='topic' onclick='toggle(this)'><a href='#juneau-rest-server.PartSerializers' id='juneau-rest-server.PartSerializers'>7.23 - Part Serializers</a></h3>
+ <div class='topic'>
+ TODO
+ </div>
- <h3 class='topic' onclick='toggle(this)'><a href='#juneau-rest-server.Parsers' id='juneau-rest-server.Parsers'>7.12 - Parsers</a></h3>
+ <!-- === 7.24 - Parsers ============================================================================= -->
+
+ <h3 class='topic' onclick='toggle(this)'><a href='#juneau-rest-server.Parsers' id='juneau-rest-server.Parsers'>7.24 - Parsers</a></h3>
<div class='topic'>
<p>
REST resources use the {@link org.apache.juneau.parser.Parser} API for defining parsers for parsing request
@@ -12896,9 +13710,15 @@
</ul>
</div>
- <!-- === 7.13 - Properties ========================================================================== -->
+ <!-- === 7.25 - PartParsers ========================================================================= -->
+
+ <h3 class='topic' onclick='toggle(this)'><a href='#juneau-rest-server.PartParsers' id='juneau-rest-server.PartParsers'>7.25 - Part Parsers</a></h3>
+ <div class='topic'>
+ </div>
+
+ <!-- === 7.26 - Properties ========================================================================== -->
- <h3 class='topic' onclick='toggle(this)'><a href='#juneau-rest-server.Properties' id='juneau-rest-server.Properties'>7.13 - Properties</a></h3>
+ <h3 class='topic' onclick='toggle(this)'><a href='#juneau-rest-server.Properties' id='juneau-rest-server.Properties'>7.26 - Properties</a></h3>
<div class='topic'>
<p>
As shown in previous sections, Juneau serializers and parsers are highly-configurable through properties.
@@ -13013,9 +13833,9 @@
</ul>
</div>
- <!-- === 7.14 - Transforms ========================================================================== -->
+ <!-- === 7.27 - Transforms ========================================================================== -->
- <h3 class='topic' onclick='toggle(this)'><a href='#juneau-rest-server.Transforms' id='juneau-rest-server.Transforms'>7.14 - Transforms</a></h3>
+ <h3 class='topic' onclick='toggle(this)'><a href='#juneau-rest-server.Transforms' id='juneau-rest-server.Transforms'>7.27 - Transforms</a></h3>
<div class='topic'>
<p>
The Juneau serializers and parsers can be configured on how to handle POJOs through the use of Transforms.
@@ -13070,9 +13890,9 @@
</p>
</div>
- <!-- === 7.15 - Guards ============================================================================== -->
+ <!-- === 7.28 - Guards ============================================================================== -->
- <h3 class='topic' onclick='toggle(this)'><a href='#juneau-rest-server.Guards' id='juneau-rest-server.Guards'>7.15 - Guards</a></h3>
+ <h3 class='topic' onclick='toggle(this)'><a href='#juneau-rest-server.Guards' id='juneau-rest-server.Guards'>7.28 - Guards</a></h3>
<div class='topic'>
<p>
Guards are classes that control access to REST classes and methods.
@@ -13149,9 +13969,9 @@
</ul>
</div>
- <!-- === 7.16 - Converters ========================================================================== -->
+ <!-- === 7.29 - Converters ========================================================================== -->
- <h3 class='topic' onclick='toggle(this)'><a href='#juneau-rest-server.Converters' id='juneau-rest-server.Converters'>7.16 - Converters</a></h3>
+ <h3 class='topic' onclick='toggle(this)'><a href='#juneau-rest-server.Converters' id='juneau-rest-server.Converters'>7.29 - Converters</a></h3>
<div class='topic'>
<p>
Converters can be thought of as "post-processors" for POJOs before they get passed to the serializers.
@@ -13254,9 +14074,9 @@
</ul>
</div>
- <!-- === 7.17 - Messages ============================================================================ -->
+ <!-- === 7.30 - Messages ============================================================================ -->
- <h3 class='topic' onclick='toggle(this)'><a href='#juneau-rest-server.Messages' id='juneau-rest-server.Messages'>7.17 - Messages</a></h3>
+ <h3 class='topic' onclick='toggle(this)'><a href='#juneau-rest-server.Messages' id='juneau-rest-server.Messages'>7.30 - Messages</a></h3>
<div class='topic'>
<p>
The {@link org.apache.juneau.rest.annotation.RestResource#messages @RestResource.messages()} annotation is used to associate a resource bundle with a servlet class.
@@ -13304,9 +14124,9 @@
</ul>
</div>
- <!-- === 7.18 - Encoders ============================================================================ -->
+ <!-- === 7.31 - Encoders ============================================================================ -->
- <h3 class='topic' onclick='toggle(this)'><a href='#juneau-rest-server.Encoders' id='juneau-rest-server.Encoders'>7.18 - Encoders</a></h3>
+ <h3 class='topic' onclick='toggle(this)'><a href='#juneau-rest-server.Encoders' id='juneau-rest-server.Encoders'>7.31 - Encoders</a></h3>
<div class='topic'>
<p>
The {@link org.apache.juneau.rest.annotation.RestResource#encoders @RestResource.encoders()} annotation can
@@ -13342,9 +14162,9 @@
</ul>
</div>
- <!-- === 7.19 - SVL Variables ======================================================================= -->
+ <!-- === 7.32 - SVL Variables ======================================================================= -->
- <h3 class='topic' onclick='toggle(this)'><a href='#juneau-rest-server.SvlVariables' id='juneau-rest-server.SvlVariables'>7.19 - SVL Variables</a></h3>
+ <h3 class='topic' onclick='toggle(this)'><a href='#juneau-rest-server.SvlVariables' id='juneau-rest-server.SvlVariables'>7.32 - SVL Variables</a></h3>
<div class='topic'>
<p>
In the previous examples, there were several cases where embedded variables were contained within
@@ -13591,9 +14411,9 @@
</table>
</div>
- <!-- === 7.20 - Configuration Files ================================================================= -->
+ <!-- === 7.33 - Configuration Files ================================================================= -->
- <h3 class='topic' onclick='toggle(this)'><a href='#juneau-rest-server.ConfigurationFiles' id='juneau-rest-server.ConfigurationFiles'>7.20 - Configuration Files</a></h3>
+ <h3 class='topic' onclick='toggle(this)'><a href='#juneau-rest-server.ConfigurationFiles' id='juneau-rest-server.ConfigurationFiles'>7.33 - Configuration Files</a></h3>
<div class='topic'>
<p>
The Server API provides methods for associating configuration files with REST servlets so that
@@ -13761,9 +14581,9 @@
</ul>
</div>
- <!-- === 7.21 - Static files ======================================================================== -->
+ <!-- === 7.34 - Static files ======================================================================== -->
- <h3 class='topic' onclick='toggle(this)'><a href='#juneau-rest-server.StaticFiles' id='juneau-rest-server.StaticFiles'>7.21 - Static files</a>/h3>
+ <h3 class='topic' onclick='toggle(this)'><a href='#juneau-rest-server.StaticFiles' id='juneau-rest-server.StaticFiles'>7.34 - Static files</a>/h3>
<div class='topic'>
<p>
The {@link org.apache.juneau.rest.annotation.RestResource#staticFiles @RestResource.staticFiles()}
@@ -13813,9 +14633,9 @@
</ul>
</div>
- <!-- === 7.22 - Client Versioning =================================================================== -->
+ <!-- === 7.35 - Client Versioning =================================================================== -->
- <h3 class='topic' onclick='toggle(this)'><a href='#juneau-rest-server.ClientVersioning' id='juneau-rest-server.ClientVersioning'>7.22 - Client Versioning</a></h3>
+ <h3 class='topic' onclick='toggle(this)'><a href='#juneau-rest-server.ClientVersioning' id='juneau-rest-server.ClientVersioning'>7.35 - Client Versioning</a></h3>
<div class='topic'>
<p>
Client version headers are used to support backwards compatibility for breaking REST interface changes.
@@ -13860,9 +14680,9 @@
</ul>
</div>
- <!-- === 7.23 - OPTIONS pages and Swagger =========================================================== -->
+ <!-- === 7.36 - OPTIONS pages and Swagger =========================================================== -->
- <h3 class='topic' onclick='toggle(this)'><a href='#juneau-rest-server.OptionsPages' id='juneau-rest-server.OptionsPages'>7.23 - OPTIONS pages and Swagger</a></h3>
+ <h3 class='topic' onclick='toggle(this)'><a href='#juneau-rest-server.OptionsPages' id='juneau-rest-server.OptionsPages'>7.36 - OPTIONS pages and Swagger</a></h3>
<div class='topic'>
<p>
One of the most useful features of Juneau is the ability to generate Swagger-based OPTIONS pages for self-documenting designs
@@ -13900,9 +14720,9 @@
This page is constructed using the Info Provider API described next.
</p>
- <!-- === 7.23.1 - RestInfoProvider ============================================================== -->
+ <!-- === 7.36.1 - RestInfoProvider ============================================================== -->
- <h4 class='topic' onclick='toggle(this)'><a href='#juneau-rest-server.RestInfoProvider' id='juneau-rest-server.RestInfoProvider'>7.23.1 - RestInfoProvider</a></h4>
+ <h4 class='topic' onclick='toggle(this)'><a href='#juneau-rest-server.RestInfoProvider' id='juneau-rest-server.RestInfoProvider'>7.36.1 - RestInfoProvider</a></h4>
<div class='topic'>
<p>
The {@link org.apache.juneau.rest.RestInfoProvider} class is used to find the title
@@ -13949,9 +14769,9 @@
</p>
</div>
- <!-- === 7.23.2 - BasicRestInfoProvider ========================================================= -->
+ <!-- === 7.36.2 - BasicRestInfoProvider ========================================================= -->
- <h4 class='topic' onclick='toggle(this)'><a href='#juneau-rest-server.BasicRestInfoProvider' id='juneau-rest-server.BasicRestInfoProvider'>7.23.2 - BasicRestInfoProvider</a></h4>
+ <h4 class='topic' onclick='toggle(this)'><a href='#juneau-rest-server.BasicRestInfoProvider' id='juneau-rest-server.BasicRestInfoProvider'>7.36.2 - BasicRestInfoProvider</a></h4>
<div class='topic'>
<p>
The {@link org.apache.juneau.rest.BasicRestInfoProvider} class is the default implementation of the
@@ -14030,9 +14850,9 @@
</div>
</div>
- <!-- === 7.24 - @HtmlDoc ============================================================================ -->
+ <!-- === 7.37 - @HtmlDoc ============================================================================ -->
- <h3 class='topic' onclick='toggle(this)'><a href='#juneau-rest-server.HtmlDocAnnotation' id='juneau-rest-server.HtmlDocAnnotation'>7.24 - @HtmlDoc</a></h3>
+ <h3 class='topic' onclick='toggle(this)'><a href='#juneau-rest-server.HtmlDocAnnotation' id='juneau-rest-server.HtmlDocAnnotation'>7.37 - @HtmlDoc</a></h3>
<div class='topic'>
<p>
The {@link org.apache.juneau.rest.annotation.HtmlDoc @HtmlDoc} annotation is used to customize the HTML
@@ -14153,9 +14973,9 @@
<li class='jc'>{@link org.apache.juneau.rest.HtmlDocBuilder}
</ul>
- <!-- === 7.24.1 - Widgets ======================================================================= -->
+ <!-- === 7.37.1 - Widgets ======================================================================= -->
- <h4 class='topic' onclick='toggle(this)'><a href='#juneau-rest-server.Widgets' id='juneau-rest-server.Widgets'>7.24.1 - Widgets</a></h4>
+ <h4 class='topic' onclick='toggle(this)'><a href='#juneau-rest-server.Widgets' id='juneau-rest-server.Widgets'>7.37.1 - Widgets</a></h4>
<div class='topic'>
<p>
The {@link org.apache.juneau.rest.widget.Widget} class allows you to add arbitrary HTML, CSS, and Javascript
@@ -14273,16 +15093,16 @@
</ul>
</div>
- <!-- === 7.24.2 - Predefined Widgets ============================================================ -->
+ <!-- === 7.37.2 - Predefined Widgets ============================================================ -->
- <h4 class='topic' onclick='toggle(this)'><a href='#juneau-rest-server.PredefinedWidgets' id='juneau-rest-server.PredefinedWidgets'>7.24.2 - Predefined Widgets</a></h4>
+ <h4 class='topic' onclick='toggle(this)'><a href='#juneau-rest-server.PredefinedWidgets' id='juneau-rest-server.PredefinedWidgets'>7.37.2 - Predefined Widgets</a></h4>
<div class='topic'>
TODO
</div>
- <!-- === 7.24.3 - UI Customization ============================================================== -->
+ <!-- === 7.37.3 - UI Customization ============================================================== -->
- <h4 class='topic' onclick='toggle(this)'><a href='#juneau-rest-server.UiCustomization' id='juneau-rest-server.UiCustomization'>7.24.3 - UI Customization</a></h4>
+ <h4 class='topic' onclick='toggle(this)'><a href='#juneau-rest-server.UiCustomization' id='juneau-rest-server.UiCustomization'>7.37.3 - UI Customization</a></h4>
<div class='topic'>
<p>
The HTML views of POJOs can somewhat be considered a rudimentary User Interface.
@@ -14408,9 +15228,9 @@
</p>
</div>
- <!-- === 7.24.4 - Stylesheets =================================================================== -->
+ <!-- === 7.37.4 - Stylesheets =================================================================== -->
- <h4 class='topic' onclick='toggle(this)'><a href='#juneau-rest-server.Stylesheets' id='juneau-rest-server.Stylesheets'>7.24.4 - Stylesheets</a></h4>
+ <h4 class='topic' onclick='toggle(this)'><a href='#juneau-rest-server.Stylesheets' id='juneau-rest-server.Stylesheets'>7.37.4 - Stylesheets</a></h4>
<div class='topic'>
<p>
The sample root page renders in the default "devops" look-and-feel:
@@ -14524,9 +15344,9 @@
</div>
</div>
- <!-- === 7.25 - Default Headers ===================================================================== -->
+ <!-- === 7.38 - Default Headers ===================================================================== -->
- <h3 class='topic' onclick='toggle(this)'><a href='#juneau-rest-server.DefaultHeaders' id='juneau-rest-server.DefaultHeaders'>7.25 - Default Headers</a></h3>
+ <h3 class='topic' onclick='toggle(this)'><a href='#juneau-rest-server.DefaultHeaders' id='juneau-rest-server.DefaultHeaders'>7.38 - Default Headers</a></h3>
<div class='topic'>
<p>
The following annotations are provided for specifying default header values for requests and responses:
@@ -14571,9 +15391,9 @@
</ul>
</div>
- <!-- === 7.26 - Logging and Error Handling ========================================================== -->
+ <!-- === 7.39 - Logging and Error Handling ========================================================== -->
- <h3 class='topic' onclick='toggle(this)'><a href='#juneau-rest-server.LoggingAndErrorHandling' id='juneau-rest-server.LoggingAndErrorHandling'>7.26 - Logging and Error Handling</a></h3>
+ <h3 class='topic' onclick='toggle(this)'><a href='#juneau-rest-server.LoggingAndErrorHandling' id='juneau-rest-server.LoggingAndErrorHandling'>7.39 - Logging and Error Handling</a></h3>
<div class='topic'>
<p>
The {@link org.apache.juneau.rest.RestContext#REST_logger} property allows you to configure
@@ -14599,7 +15419,7 @@
</ul>
<p>
The {@link org.apache.juneau.rest.RestLogger#logObjects(Level,String,Object[]) logObjects()} method is particularly useful because it allows you to pass in POJOs as arguments
- that serialized using {@link org.apache.juneau.json.JsonSerializer#DEFAULT_LAX_READABLE}, but only
+ that serialized using {@link org.apache.juneau.json.SimpleJsonSerializer#DEFAULT_READABLE}, but only
if the message is actually logged.
</p>
@@ -14634,9 +15454,9 @@
</ul>
</div>
- <!-- === 7.27 - HTTP Status Codes =================================================================== -->
+ <!-- === 7.40 - HTTP Status Codes =================================================================== -->
- <h3 class='topic' onclick='toggle(this)'><a href='#juneau-rest-server.HttpStatusCodes' id='juneau-rest-server.HttpStatusCodes'>7.27 - HTTP Status Codes</a></h3>
+ <h3 class='topic' onclick='toggle(this)'><a href='#juneau-rest-server.HttpStatusCodes' id='juneau-rest-server.HttpStatusCodes'>7.40 - HTTP Status Codes</a></h3>
<div class='topic'>
<p>
By default, a 200 (OK) status is automatically set as the HTTP status when a Java method executes
@@ -14702,9 +15522,9 @@
</table>
</div>
- <!-- === 7.28 - Overloading HTTP Methods ============================================================ -->
+ <!-- === 7.41 - Overloading HTTP Methods ============================================================ -->
- <h3 class='topic' onclick='toggle(this)'><a href='#juneau-rest-server.OverloadingHttpMethods' id='juneau-rest-server.OverloadingHttpMethods'>7.28 - Overloading HTTP Methods</a></h3>
+ <h3 class='topic' onclick='toggle(this)'><a href='#juneau-rest-server.OverloadingHttpMethods' id='juneau-rest-server.OverloadingHttpMethods'>7.41 - Overloading HTTP Methods</a></h3>
<div class='topic'>
<p>
Through the use of the built-in <l>"method"</l> GET parameter, you can implement requests beyond the basic
@@ -14731,9 +15551,9 @@
</p>
</div>
- <!-- === 7.29 - Built-in Parameters ================================================================= -->
+ <!-- === 7.42 - Built-in Parameters ================================================================= -->
- <h3 class='topic' onclick='toggle(this)'><a href='#juneau-rest-server.BuiltInParameters' id='juneau-rest-server.BuiltInParameters'>7.29 - Built-in Parameters</a></h3>
+ <h3 class='topic' onclick='toggle(this)'><a href='#juneau-rest-server.BuiltInParameters' id='juneau-rest-server.BuiltInParameters'>7.42 - Built-in Parameters</a></h3>
<div class='topic'>
<p>
The following URL parameters have special meaning and can be passed in through the URL of the request:
@@ -14796,9 +15616,9 @@
</table>
</div>
- <!-- === 7.30 - Custom Serializers and Parsers ====================================================== -->
+ <!-- === 7.43 - Custom Serializers and Parsers ====================================================== -->
- <h3 class='topic' onclick='toggle(this)'><a href='#juneau-rest-server.CustomSerializersAndParsers' id='juneau-rest-server.CustomSerializersAndParsers'>7.30 - Custom Serializers and Parsers</a></h3>
+ <h3 class='topic' onclick='toggle(this)'><a href='#juneau-rest-server.CustomSerializersAndParsers' id='juneau-rest-server.CustomSerializersAndParsers'>7.43 - Custom Serializers and Parsers</a></h3>
<div class='topic'>
<p>
A very easy-to-use API is provided for defining your own serializers and parsers at both the servlet and
@@ -14922,9 +15742,9 @@
</p>
</div>
- <!-- === 7.31 - Using with OSGi ===================================================================== -->
+ <!-- === 7.44 - Using with OSGi ===================================================================== -->
- <h3 class='topic' onclick='toggle(this)'><a href='#juneau-rest-server.UsingWithOsgi' id='juneau-rest-server.UsingWithOsgi'>7.31 - Using with OSGi</a></h3>
+ <h3 class='topic' onclick='toggle(this)'><a href='#juneau-rest-server.UsingWithOsgi' id='juneau-rest-server.UsingWithOsgi'>7.44 - Using with OSGi</a></h3>
<div class='topic'>
<p>
Since REST servlets are basically just <l>HttpServlets</l>, incorporating them into an OSGi environment
@@ -14989,9 +15809,9 @@
</p>
</div>
- <!-- === 7.32 - Remoteable Proxies ================================================================== -->
+ <!-- === 7.45 - Remoteable Proxies ================================================================== -->
- <h3 class='topic' onclick='toggle(this)'><a href='#juneau-rest-server.RemoteableProxies' id='juneau-rest-server.RemoteableProxies'>7.32 - Remoteable Proxies</a></h3>
+ <h3 class='topic' onclick='toggle(this)'><a href='#juneau-rest-server.RemoteableProxies' id='juneau-rest-server.RemoteableProxies'>7.45 - Remoteable Proxies</a></h3>
<div class='topic'>
<p>
The Remoteable Service API allows for client side code to use interface proxies for calling methods on POJOs on
@@ -15173,9 +15993,9 @@
<br>Most of the time you don't even need to modify your existing Java implementation code.
</p>
- <!-- === 7.32.1 - Client Side =================================================================== -->
+ <!-- === 7.45.1 - Client Side =================================================================== -->
- <h4 class='topic' onclick='toggle(this)'><a href='#juneau-rest-server.RemoteableProxiesClientSide' id='juneau-rest-server.RemoteableProxiesClientSide'>7.32.1 - Client Side</a></h4>
+ <h4 class='topic' onclick='toggle(this)'><a href='#juneau-rest-server.RemoteableProxiesClientSide' id='juneau-rest-server.RemoteableProxiesClientSide'>7.45.1 - Client Side</a></h4>
<div class='topic'>
<p>
Remoteable interface proxies are retrieved through the existing {@link org.apache.juneau.rest.client.RestClient}
@@ -15213,9 +16033,9 @@
</p>
</div>
- <!-- === 7.32.2 - Server Side =================================================================== -->
+ <!-- === 7.45.2 - Server Side =================================================================== -->
- <h4 class='topic' onclick='toggle(this)'><a href='#juneau-rest-server.RemoteableProxiesServerSide' id='juneau-rest-server.RemoteableProxiesServerSide'>7.32.2 - Server Side</a></h4>
+ <h4 class='topic' onclick='toggle(this)'><a href='#juneau-rest-server.RemoteableProxiesServerSide' id='juneau-rest-server.RemoteableProxiesServerSide'>7.45.2 - Server Side</a></h4>
<div class='topic'>
<p>
The server side is only slightly more complex, but boasts useful debugging and discovery capabilities.
@@ -15297,7 +16117,7 @@
AddressBook.<jsm>toCalendar</jsm>(<js>"Aug 1, 1999"</js>),
<jk>new</jk> CreateAddress(<js>"Test street"</js>, <js>"Test city"</js>, <js>"Test state"</js>, 12345, <jk>true</jk>))
};
- String asJson = JsonSerializer.<jsf>DEFAULT_LAX_READABLE</jsf>.toString(args);
+ String asJson = SimpleJsonSerializer.<jsf>DEFAULT_READABLE</jsf>.toString(args);
System.<jsf>err</jsf>.println(asJson);
</p>
<p>
@@ -15398,9 +16218,9 @@
<img class='bordered w800' src='doc-files/juneau-rest-server.RemoteableProxiesServerSide.9.png'>
</div>
- <!-- === 7.32.3 - @Remoteable Annotation ======================================================== -->
+ <!-- === 7.45.3 - @Remoteable Annotation ======================================================== -->
- <h4 class='topic' onclick='toggle(this)'><a href='#juneau-rest-server.RemoteableProxiesRemoteableAnnotation' id='juneau-rest-server.RemoteableProxiesRemoteableAnnotation'>7.32.3 - @Remoteable Annotation</a></h4>
+ <h4 class='topic' onclick='toggle(this)'><a href='#juneau-rest-server.RemoteableProxiesRemoteableAnnotation' id='juneau-rest-server.RemoteableProxiesRemoteableAnnotation'>7.45.3 - @Remoteable Annotation</a></h4>
<div class='topic'>
<p>
What if you want fine-tuned control over which methods are exposed in an interface instead of just all public
@@ -15448,9 +16268,9 @@
</div>
</div>
- <!-- === 7.33 - Server-less Unit Testing of REST Interfaces ========================================= -->
+ <!-- === 7.46 - Server-less Unit Testing of REST Interfaces ========================================= -->
- <h3 class='topic' onclick='toggle(this)'><a href='#juneau-rest-server.UnitTesting' id='juneau-rest-server.UnitTesting'>7.33 - Server-less Unit Testing of REST Interfaces</a></h3>
+ <h3 class='topic' onclick='toggle(this)'><a href='#juneau-rest-server.UnitTesting' id='juneau-rest-server.UnitTesting'>7.46 - Server-less Unit Testing of REST Interfaces</a></h3>
<div class='topic'>
<p>
The {@link org.apache.juneau.rest.mock.MockRest} class is a simple yet powerful interface for creating serverless
@@ -15636,9 +16456,9 @@
</p>
</div>
- <!-- === 7.34 - Using with Spring and Injection frameworks ========================================== -->
+ <!-- === 7.47 - Using with Spring and Injection frameworks ========================================== -->
- <h3 class='topic' onclick='toggle(this)'><a href='#juneau-rest-server.Injection' id='juneau-rest-server.Injection'>7.34 - Using with Spring and Injection frameworks</a></h3>
+ <h3 class='topic' onclick='toggle(this)'><a href='#juneau-rest-server.Injection' id='juneau-rest-server.Injection'>7.47 - Using with Spring and Injection frameworks</a></h3>
<div class='topic'>
<p>
The Juneau REST server API is compatible with dependency injection frameworks such as Spring.
@@ -15743,9 +16563,9 @@
</p>
</div>
- <!-- === 7.35 - Using HTTP/2 feature ================================================================ -->
+ <!-- === 7.48 - Using HTTP/2 feature ================================================================ -->
- <h3 class='topic' onclick='toggle(this)'><a href='#juneau-rest-server.HTTP2' id='juneau-rest-server.HTTP2'>7.35 - Using HTTP/2 features</a></h3>
+ <h3 class='topic' onclick='toggle(this)'><a href='#juneau-rest-server.HTTP2' id='juneau-rest-server.HTTP2'>7.48 - Using HTTP/2 features</a></h3>
<div class='topic'>
<p>
Juneau is built as a veneer on top of the Servlet API, allowing you to use low-level Servlet APIs
@@ -15758,9 +16578,9 @@
</p>
</div>
- <!-- === 7.36 - Predefined Helper Beans ============================================================= -->
+ <!-- === 7.49 - Predefined Helper Beans ============================================================= -->
- <h3 class='topic' onclick='toggle(this)'><a href='#juneau-rest-server.PredefinedHelperBeans' id='juneau-rest-server.PredefinedHelperBeans'>7.36 - Predefined Helper Beans</a></h3>
+ <h3 class='topic' onclick='toggle(this)'><a href='#juneau-rest-server.PredefinedHelperBeans' id='juneau-rest-server.PredefinedHelperBeans'>7.49 - Predefined Helper Beans</a></h3>
<div class='topic'>
<p>
The {@link org.apache.juneau.rest.helper} package contains some reusable beans that are useful for
@@ -15856,9 +16676,9 @@
<img class='bordered' src='doc-files/juneau-rest-server.PredefinedLabelBeans.3.png' style='width:92px'/>
</div>
- <!-- === 7.37 - Other Notes ========================================================================= -->
+ <!-- === 7.50 - Other Notes ========================================================================= -->
- <h3 class='topic' onclick='toggle(this)'><a href='#juneau-rest-server.OtherNotes' id='juneau-rest-server.OtherNotes'>7.37 - Other Notes</a></h3>
+ <h3 class='topic' onclick='toggle(this)'><a href='#juneau-rest-server.OtherNotes' id='juneau-rest-server.OtherNotes'>7.50 - Other Notes</a></h3>
<div class='topic'>
<ul class='spaced-list'>
<li>
@@ -21674,6 +22494,21 @@
the {@link org.apache.juneau.http.annotation} package.
<br>This fixes a long-standing problem where it was easy to mix up using client-side annotations in server-side code, and vis-versa.
<br>Additionally, much work has been done on these annotations to add support for Swagger-style validations and documentation.
+ <li>
+ The <code>JsonSerializer.Simple</code> class has been moved into the top-level {@link org.apache.juneau.json.SimpleJsonSerializer} class.
+ <li>
+ RDF serializer subclasses have been moved into top-level classes:
+ <ul>
+ <li><code>RdfSerializer.Xml</code> -> {@link org.apache.juneau.jena.RdfXmlSerializer}
+ <li><code>RdfSerializer.XmlAbbrev</code> -> {@link org.apache.juneau.jena.RdfXmlAbbrevSerializer}
+ <li><code>RdfSerializer.N3</code> -> {@link org.apache.juneau.jena.N3Serializer}
+ <li><code>RdfSerializer.NTriple</code> -> {@link org.apache.juneau.jena.NTripleSerializer}
+ <li><code>RdfSerializer.Turtle</code> -> {@link org.apache.juneau.jena.TurtleSerializer}
+ <li><code>RdfParser.Xml</code> -> {@link org.apache.juneau.jena.RdfXmlParser}
+ <li><code>RdfParser.N3</code> -> {@link org.apache.juneau.jena.N3Parser}
+ <li><code>RdfParser.NTriple</code> -> {@link org.apache.juneau.jena.NTripleParser}
+ <li><code>RdfParser.Turtle</code> -> {@link org.apache.juneau.jena.TurtleParser}
+ </ul>
</ul>
<h5 class='topic w800'>juneau-dto</h5>
@@ -22858,7 +23693,8 @@
}
<jc>// Produces "{foo:'bar'}"</jc>
- String json = JsonSerializer.<jsf>DEFAULT_LAX</jsf>.toString(<jk>new</jk> MyBean());
+ String json = SimpleJsonSerializer.<jsf>DEFAULT</jsf>
+.toString(<jk>new</jk> MyBean());
</p>
<br>This feature helps with the implementation of language-agnostic template support such as for
using FreeMaker to serialize POJOs to HTML.
@@ -23728,10 +24564,12 @@
<jc>/* Cloning an existing serializer or parser */ </jc>
<jc>// Old way</jc>
- WriterSerializer s = JsonSerializer.<jsf>DEFAULT_LAX</jsf>.clone().setUseWhitespace(<jk>true</jk>).pojoSwaps(BSwap.<jk>class</jk>).lock();
+ WriterSerializer s = SimpleJsonSerializer.<jsf>DEFAULT</jsf>
+.clone().setUseWhitespace(<jk>true</jk>).pojoSwaps(BSwap.<jk>class</jk>).lock();
<jc>// New way</jc>
- WriterSerializer s = JsonSerializer.<jsf>DEFAULT_LAX</jsf>.builder().ws().pojoSwaps(BSwap.<jk>class</jk>).build();
+ WriterSerializer s = SimpleJsonSerializer.<jsf>DEFAULT</jsf>
+.builder().ws().pojoSwaps(BSwap.<jk>class</jk>).build();
</p>
<li>Also introduced the following builder classes and related architecture changes to make the built objects unmodifiable:
<ul>
@@ -26797,7 +27635,7 @@
<li>New <code>RestServletProperties.REST_useStackTraceHashes</code> property to prevent the same stack trace from being logged multiple times.</li>
<li>New <code>RestServletProperties.REST_renderResponseStackTraces</code> property for preventing stack traces in responses for security reasons.</li>
<li>New overridable <code>RestServlet.onError(HttpServletRequest,HttpServletResponse,RestException,boolean)</code> and <code><del>RestServlet.onSuccess(RestRequest,RestResponse,long)</del></code> methods for plugging in your own logging and peformance monitoring.</li>
- <li>Eliminated <code>RestServlet.getInitParams()</code> method, since it's now redundant with {@link org.apache.juneau.rest.RestServlet#getProperties()}.</li>
+ <li>Eliminated <code>RestServlet.getInitParams()</code> method, since it's now redundant with <code><del>RestServlet.getProperties()</del></code>.</li>
<li>Header parameters passed as URL parameters are now case-insensitive.</li>
</ul>
</div>
diff --git a/juneau-examples/juneau-examples-core/src/main/java/org/apache/juneau/examples/core/rdf/RdfExample.java b/juneau-examples/juneau-examples-core/src/main/java/org/apache/juneau/examples/core/rdf/RdfExample.java
index f1d2cd8..8cc031d 100644
--- a/juneau-examples/juneau-examples-core/src/main/java/org/apache/juneau/examples/core/rdf/RdfExample.java
+++ b/juneau-examples/juneau-examples-core/src/main/java/org/apache/juneau/examples/core/rdf/RdfExample.java
@@ -20,7 +20,7 @@
package org.apache.juneau.examples.core.rdf;
import org.apache.juneau.examples.core.pojo.Pojo;
-import org.apache.juneau.jena.RdfSerializer;
+import org.apache.juneau.jena.*;
/**
* TODO
@@ -36,7 +36,7 @@ public class RdfExample {
public static void main(String[] args) throws Exception {
Pojo pojo = new Pojo("rdf","This is RDF format.");
// this creates an RDF serializer with the default XML structure
- RdfSerializer rdfSerializer = RdfSerializer.DEFAULT_XML;
+ RdfSerializer rdfSerializer = RdfXmlSerializer.DEFAULT;
// This will show the final output from the bean
System.out.println(rdfSerializer.serialize(pojo));
}
diff --git a/juneau-examples/juneau-examples-rest/src/test/java/org/apache/juneau/examples/rest/ContentComboTestBase.java b/juneau-examples/juneau-examples-rest/src/test/java/org/apache/juneau/examples/rest/ContentComboTestBase.java
index 6d2f43d..6cecc2a 100644
--- a/juneau-examples/juneau-examples-rest/src/test/java/org/apache/juneau/examples/rest/ContentComboTestBase.java
+++ b/juneau-examples/juneau-examples-rest/src/test/java/org/apache/juneau/examples/rest/ContentComboTestBase.java
@@ -47,10 +47,10 @@ public class ContentComboTestBase extends RestTestcase {
case "text/uon": return getClient(mt, UonSerializer.DEFAULT, UonParser.DEFAULT);
case "application/x-www-form-urlencoded": return getClient(mt, UrlEncodingSerializer.DEFAULT, UrlEncodingParser.DEFAULT);
case "text/xml": return getClient(mt, XmlSerializer.DEFAULT, XmlParser.DEFAULT);
- case "text/xml+rdf": return getClient(mt, RdfSerializer.DEFAULT_XML, RdfParser.DEFAULT_XML);
- case "text/n-triple": return getClient(mt, RdfSerializer.DEFAULT_NTRIPLE, RdfParser.DEFAULT_NTRIPLE);
- case "text/turtle": return getClient(mt, RdfSerializer.DEFAULT_TURTLE, RdfParser.DEFAULT_TURTLE);
- case "text/n3": return getClient(mt, RdfSerializer.DEFAULT_N3, RdfParser.DEFAULT_N3);
+ case "text/xml+rdf": return getClient(mt, RdfXmlSerializer.DEFAULT, RdfXmlParser.DEFAULT);
+ case "text/n-triple": return getClient(mt, NTripleSerializer.DEFAULT, NTripleParser.DEFAULT);
+ case "text/turtle": return getClient(mt, TurtleSerializer.DEFAULT, TurtleParser.DEFAULT);
+ case "text/n3": return getClient(mt, N3Serializer.DEFAULT, N3Parser.DEFAULT);
default: throw new FormattedRuntimeException("Client for mediaType ''{0}'' not found", mt);
}
}
diff --git a/juneau-examples/juneau-examples-rest/src/test/java/org/apache/juneau/examples/rest/TestUtils.java b/juneau-examples/juneau-examples-rest/src/test/java/org/apache/juneau/examples/rest/TestUtils.java
index 6bb6282..002bad5 100644
--- a/juneau-examples/juneau-examples-rest/src/test/java/org/apache/juneau/examples/rest/TestUtils.java
+++ b/juneau-examples/juneau-examples-rest/src/test/java/org/apache/juneau/examples/rest/TestUtils.java
@@ -271,7 +271,7 @@ public class TestUtils {
public static void debugOut(Object o) {
try {
- System.err.println(decodeHex(JsonSerializer.DEFAULT_LAX.serialize(o)));
+ System.err.println(decodeHex(SimpleJsonSerializer.DEFAULT.serialize(o)));
} catch (SerializeException e) {
e.printStackTrace();
}
@@ -337,14 +337,14 @@ public class TestUtils {
}
/**
- * Assert that the object equals the specified string after running it through JsonSerializer.DEFAULT_LAX.toString().
+ * Assert that the object equals the specified string after running it through SimpleJsonSerializer.DEFAULT.toString().
*/
public static void assertObjectEquals(String s, Object o) {
assertObjectEquals(s, o, js2);
}
/**
- * Assert that the object equals the specified string after running it through JsonSerializer.DEFAULT_LAX.toString()
+ * Assert that the object equals the specified string after running it through SimpleJsonSerializer.DEFAULT.toString()
* with BEAN_sortProperties set to true.
*/
public static void assertSortedObjectEquals(String s, Object o) {
diff --git a/juneau-microservice/juneau-microservice-server/src/main/java/org/apache/juneau/microservice/BasicRestServletJena.java b/juneau-microservice/juneau-microservice-server/src/main/java/org/apache/juneau/microservice/BasicRestServletJena.java
index 2732bfc..a53d1c5 100755
--- a/juneau-microservice/juneau-microservice-server/src/main/java/org/apache/juneau/microservice/BasicRestServletJena.java
+++ b/juneau-microservice/juneau-microservice-server/src/main/java/org/apache/juneau/microservice/BasicRestServletJena.java
@@ -23,18 +23,18 @@ import org.apache.juneau.rest.annotation.*;
@RestResource(
serializers={
Inherit.class,
- RdfSerializer.Xml.class,
- RdfSerializer.XmlAbbrev.class,
- RdfSerializer.Turtle.class,
- RdfSerializer.NTriple.class,
- RdfSerializer.N3.class
+ RdfXmlSerializer.class,
+ RdfXmlAbbrevSerializer.class,
+ TurtleSerializer.class,
+ NTripleSerializer.class,
+ N3Serializer.class
},
parsers={
Inherit.class,
- RdfParser.Xml.class,
- RdfParser.Turtle.class,
- RdfParser.NTriple.class,
- RdfParser.N3.class
+ RdfXmlParser.class,
+ TurtleParser.class,
+ NTripleParser.class,
+ N3Parser.class
}
)
public abstract class BasicRestServletJena extends BasicRestServlet {}
diff --git a/juneau-microservice/juneau-microservice-server/src/main/java/org/apache/juneau/microservice/BasicRestServletJenaGroup.java b/juneau-microservice/juneau-microservice-server/src/main/java/org/apache/juneau/microservice/BasicRestServletJenaGroup.java
index ae5ba04..5a9ebbb 100644
--- a/juneau-microservice/juneau-microservice-server/src/main/java/org/apache/juneau/microservice/BasicRestServletJenaGroup.java
+++ b/juneau-microservice/juneau-microservice-server/src/main/java/org/apache/juneau/microservice/BasicRestServletJenaGroup.java
@@ -23,18 +23,18 @@ import org.apache.juneau.rest.annotation.*;
@RestResource(
serializers={
Inherit.class,
- RdfSerializer.Xml.class,
- RdfSerializer.XmlAbbrev.class,
- RdfSerializer.Turtle.class,
- RdfSerializer.NTriple.class,
- RdfSerializer.N3.class
+ RdfXmlSerializer.class,
+ RdfXmlAbbrevSerializer.class,
+ TurtleSerializer.class,
+ NTripleSerializer.class,
+ N3Serializer.class
},
parsers={
Inherit.class,
- RdfParser.Xml.class,
- RdfParser.Turtle.class,
- RdfParser.NTriple.class,
- RdfParser.N3.class
+ RdfXmlParser.class,
+ TurtleParser.class,
+ NTripleParser.class,
+ N3Parser.class
}
)
public abstract class BasicRestServletJenaGroup extends BasicRestServletGroup {}
diff --git a/juneau-microservice/juneau-microservice-test/src/test/java/org/apache/juneau/rest/test/client/InterfaceProxyTest.java b/juneau-microservice/juneau-microservice-test/src/test/java/org/apache/juneau/rest/test/client/InterfaceProxyTest.java
index 730597d..485f5ab 100644
--- a/juneau-microservice/juneau-microservice-test/src/test/java/org/apache/juneau/rest/test/client/InterfaceProxyTest.java
+++ b/juneau-microservice/juneau-microservice-test/src/test/java/org/apache/juneau/rest/test/client/InterfaceProxyTest.java
@@ -56,7 +56,7 @@ public class InterfaceProxyTest {
{ /* 4 */ "MessagePack", MsgPackSerializer.DEFAULT.builder().addBeanTypes().addRootType().build(), MsgPackParser.DEFAULT },
{ /* 5 */ "UrlEncoding", UrlEncodingSerializer.DEFAULT.builder().addBeanTypes().addRootType().build(), UrlEncodingParser.DEFAULT },
{ /* 6 */ "Uon", UonSerializer.DEFAULT.builder().addBeanTypes().addRootType().build(), UonParser.DEFAULT },
- { /* 7 */ "RdfXml", RdfSerializer.DEFAULT_XMLABBREV.builder().addBeanTypes().addRootType().build(), RdfParser.DEFAULT_XML },
+ { /* 7 */ "RdfXml", RdfXmlAbbrevSerializer.DEFAULT.builder().addBeanTypes().addRootType().build(), RdfXmlParser.DEFAULT },
});
}
diff --git a/juneau-microservice/juneau-microservice-test/src/test/java/org/apache/juneau/rest/test/client/ThirdPartyProxyTest.java b/juneau-microservice/juneau-microservice-test/src/test/java/org/apache/juneau/rest/test/client/ThirdPartyProxyTest.java
index 216f5b7..cf1d5f8 100644
--- a/juneau-microservice/juneau-microservice-test/src/test/java/org/apache/juneau/rest/test/client/ThirdPartyProxyTest.java
+++ b/juneau-microservice/juneau-microservice-test/src/test/java/org/apache/juneau/rest/test/client/ThirdPartyProxyTest.java
@@ -56,7 +56,7 @@ public class ThirdPartyProxyTest extends RestTestcase {
{ /* 4 */ "MessagePack", MsgPackSerializer.DEFAULT.builder().addBeanTypes().addRootType().build(), MsgPackParser.DEFAULT },
{ /* 5 */ "UrlEncoding", UrlEncodingSerializer.DEFAULT.builder().addBeanTypes().addRootType().build(), UrlEncodingParser.DEFAULT },
{ /* 6 */ "Uon", UonSerializer.DEFAULT.builder().addBeanTypes().addRootType().build(), UonParser.DEFAULT },
- { /* 7 */ "RdfXml", RdfSerializer.DEFAULT_XMLABBREV.builder().addBeanTypes().addRootType().build(), RdfParser.DEFAULT_XML },
+ { /* 7 */ "RdfXml", RdfXmlAbbrevSerializer.DEFAULT.builder().addBeanTypes().addRootType().build(), RdfXmlParser.DEFAULT },
});
}
diff --git a/juneau-rest/juneau-rest-server-jaxrs/src/main/java/org/apache/juneau/rest/jaxrs/BasicProvider.java b/juneau-rest/juneau-rest-server-jaxrs/src/main/java/org/apache/juneau/rest/jaxrs/BasicProvider.java
index 0017c07..e2107e6 100644
--- a/juneau-rest/juneau-rest-server-jaxrs/src/main/java/org/apache/juneau/rest/jaxrs/BasicProvider.java
+++ b/juneau-rest/juneau-rest-server-jaxrs/src/main/java/org/apache/juneau/rest/jaxrs/BasicProvider.java
@@ -56,7 +56,7 @@ import org.apache.juneau.xmlschema.*;
@JuneauProvider(
serializers={
JsonSerializer.class,
- JsonSerializer.Simple.class,
+ SimpleJsonSerializer.class,
JsonSchemaSerializer.class,
XmlDocSerializer.Ns.class,
XmlDocSerializer.class,
diff --git a/juneau-rest/juneau-rest-server/src/main/java/org/apache/juneau/rest/BasicRestConfig.java b/juneau-rest/juneau-rest-server/src/main/java/org/apache/juneau/rest/BasicRestConfig.java
index f563136..b02c226 100644
--- a/juneau-rest/juneau-rest-server/src/main/java/org/apache/juneau/rest/BasicRestConfig.java
+++ b/juneau-rest/juneau-rest-server/src/main/java/org/apache/juneau/rest/BasicRestConfig.java
@@ -35,12 +35,14 @@ import org.apache.juneau.xmlschema.*;
* be configured with the same serializers/parsers/etc... as {@link BasicRestServlet}.
*/
@RestResource(
+
+ // Default serializers for all Java methods in the class.
serializers={
HtmlDocSerializer.class, // HTML must be listed first because Internet Explore does not include text/html in their Accept header.
HtmlStrippedDocSerializer.class,
HtmlSchemaDocSerializer.class,
JsonSerializer.class,
- JsonSerializer.Simple.class,
+ SimpleJsonSerializer.class,
JsonSchemaSerializer.class,
XmlDocSerializer.class,
XmlSchemaDocSerializer.class,
@@ -50,6 +52,8 @@ import org.apache.juneau.xmlschema.*;
SoapXmlSerializer.class,
PlainTextSerializer.class
},
+
+ // Default parsers for all Java methods in the class.
parsers={
JsonParser.class,
JsonParser.Simple.class,
@@ -60,24 +64,44 @@ import org.apache.juneau.xmlschema.*;
MsgPackParser.class,
PlainTextParser.class
},
+
+ // Properties to apply to all serializers/parsers and REST-specific API objects.
properties={
- // URI-resolution is disabled by default. Need to enable it.
+ // Enable automatic resolution of URI objects to root-relative values.
@Property(name=SERIALIZER_uriResolution, value="ROOT_RELATIVE")
},
+
+ // HTML-page specific settings
htmldoc=@HtmlDoc(
+
+ // Default page header contents.
header={
- "<h1>$R{resourceTitle}</h1>",
- "<h2>$R{methodSummary,resourceDescription}</h2>",
- "$C{REST/header}"
+ "<h1>$R{resourceTitle}</h1>", // Use @RestResource(title)
+ "<h2>$R{methodSummary,resourceDescription}</h2>", // Use either @RestMethod(summary) or @RestResource(description)
+ "$C{REST/header}" // Extra header HTML defined in external config file.
},
+
+ // Basic page navigation links.
navlinks={
"up: request:/.."
},
+
+ // Default stylesheet to use for the page.
+ // Can be overridden from external config file.
+ // Default is DevOps look-and-feel (aka Depression look-and-feel).
stylesheet="$C{REST/theme,servlet:/htdocs/themes/devops.css}",
+
+ // Default contents to add to the <head> section of the HTML page.
+ // Use it to add a favicon link to the page.
head={
"<link rel='icon' href='$U{$C{REST/favicon}}'/>"
},
+
+ // No default page footer contents.
+ // Can be overridden from external config file.
footer="$C{REST/footer}",
+
+ // By default, table cell contents should not wrap.
nowrap="true"
),
@@ -86,6 +110,7 @@ import org.apache.juneau.xmlschema.*;
// These are static files that are served up by the servlet under the specified sub-paths.
// For example, "/servletPath/htdocs/javadoc.css" resolves to the file "[servlet-package]/htdocs/javadoc.css"
- staticFiles={"$C{REST/staticFiles}"}
+ // By default, we define static files through the external configuration file.
+ staticFiles="$C{REST/staticFiles}"
)
public interface BasicRestConfig {}
diff --git a/juneau-rest/juneau-rest-server/src/main/java/org/apache/juneau/rest/BasicRestInfoProvider.java b/juneau-rest/juneau-rest-server/src/main/java/org/apache/juneau/rest/BasicRestInfoProvider.java
index 8be3926..b38fe3a 100644
--- a/juneau-rest/juneau-rest-server/src/main/java/org/apache/juneau/rest/BasicRestInfoProvider.java
+++ b/juneau-rest/juneau-rest-server/src/main/java/org/apache/juneau/rest/BasicRestInfoProvider.java
@@ -600,12 +600,12 @@ public class BasicRestInfoProvider implements RestInfoProvider {
// if (! omSwagger.isEmpty())
// assertNoEmpties(omSwagger);
// } catch (SwaggerException e1) {
-// System.err.println(omSwagger.toString(JsonSerializer.DEFAULT_LAX_READABLE));
+// System.err.println(omSwagger.toString(SimpleJsonSerializer.DEFAULT_LAX_READABLE));
// throw e1;
// }
try {
- String swaggerJson = omSwagger.toString(JsonSerializer.DEFAULT_LAX_READABLE);
+ String swaggerJson = omSwagger.toString(SimpleJsonSerializer.DEFAULT_READABLE);
swagger = jp.parse(swaggerJson, Swagger.class);
} catch (Exception e) {
throw new RestServletException("Error detected in swagger.").initCause(e);
diff --git a/juneau-rest/juneau-rest-server/src/main/java/org/apache/juneau/rest/BasicRestLogger.java b/juneau-rest/juneau-rest-server/src/main/java/org/apache/juneau/rest/BasicRestLogger.java
index db3671f..c76d33a 100644
--- a/juneau-rest/juneau-rest-server/src/main/java/org/apache/juneau/rest/BasicRestLogger.java
+++ b/juneau-rest/juneau-rest-server/src/main/java/org/apache/juneau/rest/BasicRestLogger.java
@@ -86,7 +86,7 @@ public class BasicRestLogger implements RestLogger {
}
/**
- * Same as {@link #log(Level, String, Object...)} excepts runs the arguments through {@link JsonSerializer#DEFAULT_LAX_READABLE}.
+ * Same as {@link #log(Level, String, Object...)} excepts runs the arguments through {@link JsonSerializer#DEFAULT_READABLE}.
*
* <p>
* Serialization of arguments do not occur if message is not logged, so it's safe to use this method from within
@@ -104,7 +104,7 @@ public class BasicRestLogger implements RestLogger {
@Override /* RestLogger */
public void logObjects(Level level, String msg, Object...args) {
for (int i = 0; i < args.length; i++)
- args[i] = JsonSerializer.DEFAULT_LAX_READABLE.toStringObject(args[i]);
+ args[i] = SimpleJsonSerializer.DEFAULT_READABLE.toStringObject(args[i]);
log(level, null, msg, args);
}
diff --git a/juneau-rest/juneau-rest-server/src/main/java/org/apache/juneau/rest/BasicRestServlet.java b/juneau-rest/juneau-rest-server/src/main/java/org/apache/juneau/rest/BasicRestServlet.java
index 027bb28..0148660 100644
--- a/juneau-rest/juneau-rest-server/src/main/java/org/apache/juneau/rest/BasicRestServlet.java
+++ b/juneau-rest/juneau-rest-server/src/main/java/org/apache/juneau/rest/BasicRestServlet.java
@@ -49,7 +49,7 @@ import org.apache.juneau.xmlschema.*;
* <tr>
* <td class='code'>application/json+simple<br>text/json+simple</td>
* <td class='code'>application/json</td>
- * <td>{@link org.apache.juneau.json.JsonSerializer.Simple}</td>
+ * <td>{@link org.apache.juneau.json.SimpleJsonSerializer}</td>
* </tr>
* <tr>
* <td class='code'>application/json+schema<br>text/json+schema</td>
@@ -167,16 +167,26 @@ import org.apache.juneau.xmlschema.*;
* </ul>
*/
@RestResource(
+
+ // Allow OPTIONS requests to be simulated using ?method=OPTIONS query parameter.
allowedMethodParams="OPTIONS",
+
+ // HTML-page specific settings.
htmldoc=@HtmlDoc(
+ // Basic page navigation links.
navlinks={
"up: request:/..",
"options: servlet:/?method=OPTIONS"
}
),
+
+ // POJO swaps to apply to all serializers/parsers.
pojoSwaps={
+ // Use the SwaggerUI swap when rendering Swagger beans.
SwaggerUI.class
},
+
+ // Properties to apply to all serializers/parsers and REST-specific API objects.
properties={
// Add descriptions to the following types when not specified:
@Property(name=JSONSCHEMA_addDescriptionsTo, value="bean,collection,array,map,enum"),
@@ -184,10 +194,13 @@ import org.apache.juneau.xmlschema.*;
// Add x-example to the following types:
@Property(name=JSONSCHEMA_addExamplesTo, value="bean,collection,array,map"),
- // Don't generate schema information on the Swagger bean itself.
+ // Don't generate schema information on the Swagger bean itself or HTML beans.
@Property(name=INFOPROVIDER_ignoreTypes, value="Swagger,org.apache.juneau.dto.html5.*")
},
+
+ // Shortcut for boolean properties.
flags={
+ // Use $ref references for bean definitions to reduce duplication in Swagger.
JSONSCHEMA_useBeanDefs
}
)
@@ -204,14 +217,17 @@ public abstract class BasicRestServlet extends RestServlet implements BasicRestC
summary="Swagger documentation",
description="Swagger documentation for this resource.",
htmldoc=@HtmlDoc(
+ // Override the nav links for the swagger page.
navlinks={
"back: servlet:/",
"json: servlet:/?method=OPTIONS&Accept=text/json&plainText=true"
},
+ // Never show aside contents of page inherited from class.
aside="NONE"
)
)
public Swagger getOptions(RestRequest req) {
+ // Localized Swagger for this resource is available through the RestRequest object.
return req.getSwagger();
}
}
diff --git a/juneau-rest/juneau-rest-server/src/main/java/org/apache/juneau/rest/Inherit.java b/juneau-rest/juneau-rest-server/src/main/java/org/apache/juneau/rest/Inherit.java
index 79acd12..71b95ef 100644
--- a/juneau-rest/juneau-rest-server/src/main/java/org/apache/juneau/rest/Inherit.java
+++ b/juneau-rest/juneau-rest-server/src/main/java/org/apache/juneau/rest/Inherit.java
@@ -19,22 +19,22 @@ package org.apache.juneau.rest;
* <p class='bcode'>
* <ja>@RestMethod</ja>(
*
- * // Override the serializers for this method, but also inherit the serializers from the class.
- * // Class-level serializers will be inserted in the location in the array.
+ * <jc>// Override the serializers for this method, but also inherit the serializers from the class.
+ * // Class-level serializers will be inserted in the location in the array.</jc>
* serializers={JsonSerializer.<jk>class</jk>, Inherit.<jk>class</jk>},
*
- * // Override the parsers for this method, but also inherit the parsers from the class.
- * // Class-level parsers will be inserted in the location in the array.
+ * <jc>// Override the parsers for this method, but also inherit the parsers from the class.
+ * // Class-level parsers will be inserted in the location in the array.</jc>
* parsers={JsonParser.<jk>class</jk>, Inherit.<jk>class</jk>},
*
- * // Override the bean filters for this method, but also inherit the bean filters from the class.
+ * <jc>// Override the bean filters for this method, but also inherit the bean filters from the class.
* // Overridden bean filters only apply to NEW serializers and parsers defined on the method
- * // (not those inherited from the class).
+ * // (not those inherited from the class).</jc>
* beanFilters={MyFilter.<jk>class</jk>, Inherit.<jk>class</jk>},
*
- * // Override the POJO swaps for this method, but also inherit the POJO swaps from the class.
+ * <jc>// Override the POJO swaps for this method, but also inherit the POJO swaps from the class.
* // Overridden POJO swaps only apply to NEW serializers and parsers defined on the method
- * // (not those inherited from the class).
+ * // (not those inherited from the class).</jc>
* pojoSwaps={MySwap.<jk>class</jk>, Inherit.<jk>class</jk>}
* )
* </p>
diff --git a/juneau-rest/juneau-rest-server/src/main/java/org/apache/juneau/rest/None.java b/juneau-rest/juneau-rest-server/src/main/java/org/apache/juneau/rest/None.java
index b51c3f4..3b94c6c 100644
--- a/juneau-rest/juneau-rest-server/src/main/java/org/apache/juneau/rest/None.java
+++ b/juneau-rest/juneau-rest-server/src/main/java/org/apache/juneau/rest/None.java
@@ -19,16 +19,16 @@ package org.apache.juneau.rest;
* <p class='bcode'>
* <ja>@RestMethod</ja>(
*
- * // No serializers are defined method or inherited from the class.
+ * <jc>// No serializers are defined method or inherited from the class.</jc>
* serializers=None.<jk>class</jk>,
*
- * // No parsers are defined method or inherited from the class.
+ * <jc>// No parsers are defined method or inherited from the class.</jc>
* parsers=None.<jk>class</jk>,
*
- * // No bean filters are defined method or inherited from the class.
+ * <jc>// No bean filters are defined method or inherited from the class.</jc>
* beanFilters=None.<jk>class</jk>,
*
- * // No POJO swaps are defined method or inherited from the class.
+ * <jc>// No POJO swaps are defined method or inherited from the class.</jc>
* pojoSwaps=None.<jk>class</jk>
* )
* </p>
diff --git a/juneau-rest/juneau-rest-server/src/main/java/org/apache/juneau/rest/RequestFormData.java b/juneau-rest/juneau-rest-server/src/main/java/org/apache/juneau/rest/RequestFormData.java
index 3de30d8..8238ae1 100644
--- a/juneau-rest/juneau-rest-server/src/main/java/org/apache/juneau/rest/RequestFormData.java
+++ b/juneau-rest/juneau-rest-server/src/main/java/org/apache/juneau/rest/RequestFormData.java
@@ -587,7 +587,7 @@ public class RequestFormData extends LinkedHashMap<String,String[]> {
if (v != null)
m.put(e.getKey(), v.length == 1 ? v[0] : v);
}
- return JsonSerializer.DEFAULT_LAX.toString(m);
+ return SimpleJsonSerializer.DEFAULT.toString(m);
}
@Override /* Object */
diff --git a/juneau-rest/juneau-rest-server/src/main/java/org/apache/juneau/rest/RequestHeaders.java b/juneau-rest/juneau-rest-server/src/main/java/org/apache/juneau/rest/RequestHeaders.java
index d4fa6b9..e3d4e51 100644
--- a/juneau-rest/juneau-rest-server/src/main/java/org/apache/juneau/rest/RequestHeaders.java
+++ b/juneau-rest/juneau-rest-server/src/main/java/org/apache/juneau/rest/RequestHeaders.java
@@ -941,7 +941,7 @@ public class RequestHeaders extends TreeMap<String,String[]> {
String[] v = e.getValue();
m.put(e.getKey(), v.length == 1 ? v[0] : v);
}
- return JsonSerializer.DEFAULT_LAX.toString(m);
+ return SimpleJsonSerializer.DEFAULT.toString(m);
}
@Override /* Object */
diff --git a/juneau-rest/juneau-rest-server/src/main/java/org/apache/juneau/rest/RequestQuery.java b/juneau-rest/juneau-rest-server/src/main/java/org/apache/juneau/rest/RequestQuery.java
index cbad175..38aec16 100644
--- a/juneau-rest/juneau-rest-server/src/main/java/org/apache/juneau/rest/RequestQuery.java
+++ b/juneau-rest/juneau-rest-server/src/main/java/org/apache/juneau/rest/RequestQuery.java
@@ -648,7 +648,7 @@ public final class RequestQuery extends LinkedHashMap<String,String[]> {
String[] v = e.getValue();
m.put(e.getKey(), v.length == 1 ? v[0] : v);
}
- return JsonSerializer.DEFAULT_LAX.toString(m);
+ return SimpleJsonSerializer.DEFAULT.toString(m);
}
/**
diff --git a/juneau-rest/juneau-rest-server/src/main/java/org/apache/juneau/rest/RestContext.java b/juneau-rest/juneau-rest-server/src/main/java/org/apache/juneau/rest/RestContext.java
index be2e7a9..eb74228 100644
--- a/juneau-rest/juneau-rest-server/src/main/java/org/apache/juneau/rest/RestContext.java
+++ b/juneau-rest/juneau-rest-server/src/main/java/org/apache/juneau/rest/RestContext.java
@@ -2303,7 +2303,7 @@ public final class RestContext extends BeanContext {
* <li class='jc'>{@link HtmlStrippedDocSerializer}
* <li class='jc'>{@link HtmlSchemaDocSerializer}
* <li class='jc'>{@link JsonSerializer}
- * <li class='jc'>{@link org.apache.juneau.json.JsonSerializer.Simple}
+ * <li class='jc'>{@link SimpleJsonSerializer}
* <li class='jc'>{@link JsonSchemaSerializer}
* <li class='jc'>{@link XmlDocSerializer}
* <li class='jc'>{@link XmlSchemaDocSerializer}
@@ -3091,7 +3091,7 @@ public final class RestContext extends BeanContext {
addToRouter(routers, httpMethod, sm);
}
} catch (RestServletException e) {
- throw new RestServletException("Problem occurred trying to serialize methods on class {0}, methods={1}", resourceClass.getName(), JsonSerializer.DEFAULT_LAX.serialize(methodsFound)).initCause(e);
+ throw new RestServletException("Problem occurred trying to serialize methods on class {0}, methods={1}", resourceClass.getName(), SimpleJsonSerializer.DEFAULT.serialize(methodsFound)).initCause(e);
}
}
}
diff --git a/juneau-rest/juneau-rest-server/src/main/java/org/apache/juneau/rest/RestLogger.java b/juneau-rest/juneau-rest-server/src/main/java/org/apache/juneau/rest/RestLogger.java
index 6209c3e..ad2a4c9 100644
--- a/juneau-rest/juneau-rest-server/src/main/java/org/apache/juneau/rest/RestLogger.java
+++ b/juneau-rest/juneau-rest-server/src/main/java/org/apache/juneau/rest/RestLogger.java
@@ -59,7 +59,7 @@ public interface RestLogger {
public void log(Level level, String msg, Object...args);
/**
- * Same as {@link #log(Level, String, Object...)} excepts runs the arguments through {@link JsonSerializer#DEFAULT_LAX_READABLE}.
+ * Same as {@link #log(Level, String, Object...)} excepts runs the arguments through {@link SimpleJsonSerializer#DEFAULT_READABLE}.
*
* <p>
* Serialization of arguments do not occur if message is not logged, so it's safe to use this method from within
diff --git a/juneau-rest/juneau-rest-server/src/main/java/org/apache/juneau/rest/RestServlet.java b/juneau-rest/juneau-rest-server/src/main/java/org/apache/juneau/rest/RestServlet.java
index d65956a..e68398d 100644
--- a/juneau-rest/juneau-rest-server/src/main/java/org/apache/juneau/rest/RestServlet.java
+++ b/juneau-rest/juneau-rest-server/src/main/java/org/apache/juneau/rest/RestServlet.java
@@ -212,14 +212,4 @@ public abstract class RestServlet extends HttpServlet {
context.destroy();
super.destroy();
}
-
- /**
- * Convenience method for calling <code>getContext().getProperties();</code>
- *
- * @return The resource properties as an {@link RestContextProperties}.
- * @see RestContext#getProperties()
- */
- public RestContextProperties getProperties() {
- return getContext().getProperties();
- }
}
diff --git a/juneau-rest/juneau-rest-server/src/main/java/org/apache/juneau/rest/annotation/MethodSwagger.java b/juneau-rest/juneau-rest-server/src/main/java/org/apache/juneau/rest/annotation/MethodSwagger.java
index 8c69d40..1238046 100644
--- a/juneau-rest/juneau-rest-server/src/main/java/org/apache/juneau/rest/annotation/MethodSwagger.java
+++ b/juneau-rest/juneau-rest-server/src/main/java/org/apache/juneau/rest/annotation/MethodSwagger.java
@@ -13,7 +13,6 @@
package org.apache.juneau.rest.annotation;
import org.apache.juneau.http.annotation.*;
-import org.apache.juneau.json.*;
/**
* Extended annotation for {@link RestMethod#swagger() RestMethod.swagger()}.
@@ -87,7 +86,7 @@ public @interface MethodSwagger {
* <h5 class='section'>Notes:</h5>
* <ul class='spaced-list'>
* <li>
- * The format is either a comma-delimited list of simple strings or a {@link JsonSerializer#DEFAULT_LAX Simple-JSON} array.
+ * The format is either a comma-delimited list of simple strings or a <a class='doclink' href='../../../../../overview-summary.html#juneau-marshall.JsonDetails.SimplifiedJson'>Simplified JSON</a> array.
* <li>
* Supports <a class="doclink" href="../../../../../overview-summary.html#DefaultRestSvlVariables">initialization-time and request-time variables</a>
* (e.g. <js>"$L{my.localized.variable}"</js>).
@@ -133,7 +132,7 @@ public @interface MethodSwagger {
* <h5 class='section'>Notes:</h5>
* <ul class='spaced-list'>
* <li>
- * The format is either a comma-delimited list of simple strings or a {@link JsonSerializer#DEFAULT_LAX Simple-JSON} array.
+ * The format is either a comma-delimited list of simple strings or a <a class='doclink' href='../../../../../overview-summary.html#juneau-marshall.JsonDetails.SimplifiedJson'>Simplified JSON</a> array.
* <li>
* Supports <a class="doclink" href="../../../../../overview-summary.html#DefaultRestSvlVariables">initialization-time and request-time variables</a>
* (e.g. <js>"$L{my.localized.variable}"</js>).
@@ -152,7 +151,7 @@ public @interface MethodSwagger {
* <h5 class='section'>Notes:</h5>
* <ul class='spaced-list'>
* <li>
- * The format is either a comma-delimited list of simple strings or a {@link JsonSerializer#DEFAULT_LAX Simple-JSON} array.
+ * The format is either a comma-delimited list of simple strings or a <a class='doclink' href='../../../../../overview-summary.html#juneau-marshall.JsonDetails.SimplifiedJson'>Simplified JSON</a> array.
* <li>
* Supports <a class="doclink" href="../../../../../overview-summary.html#DefaultRestSvlVariables">initialization-time and request-time variables</a>
* (e.g. <js>"$L{my.localized.variable}"</js>).
@@ -320,7 +319,7 @@ public @interface MethodSwagger {
* Free-form value for the swagger of a resource method.
*
* <p>
- * This is a {@link JsonSerializer#DEFAULT_LAX Simple-JSON} object that makes up the swagger information for this resource method.
+ * This is a <a class='doclink' href='../../../../../overview-summary.html#juneau-marshall.JsonDetails.SimplifiedJson'>Simplified JSON</a> object that makes up the swagger information for this resource method.
*
* <p>
* The following are completely equivalent ways of defining the swagger description of a resource method:
@@ -379,7 +378,7 @@ public @interface MethodSwagger {
* <h5 class='section'>Notes:</h5>
* <ul class='spaced-list'>
* <li>
- * The format is a {@link JsonSerializer#DEFAULT_LAX Simple-JSON} object.
+ * The format is a <a class='doclink' href='../../../../../overview-summary.html#juneau-marshall.JsonDetails.SimplifiedJson'>Simplified JSON</a> object.
* <li>
* The leading/trailing <code>{ }</code> characters are optional.
* <br>The following two example are considered equivalent:
diff --git a/juneau-rest/juneau-rest-server/src/main/java/org/apache/juneau/rest/annotation/ResourceSwagger.java b/juneau-rest/juneau-rest-server/src/main/java/org/apache/juneau/rest/annotation/ResourceSwagger.java
index 461f6a3..41a2210 100644
--- a/juneau-rest/juneau-rest-server/src/main/java/org/apache/juneau/rest/annotation/ResourceSwagger.java
+++ b/juneau-rest/juneau-rest-server/src/main/java/org/apache/juneau/rest/annotation/ResourceSwagger.java
@@ -13,7 +13,6 @@
package org.apache.juneau.rest.annotation;
import org.apache.juneau.http.annotation.*;
-import org.apache.juneau.json.*;
/**
* Extended annotation for {@link RestResource#swagger() @RestResource.swagger()}.
@@ -99,7 +98,7 @@ public @interface ResourceSwagger {
* Defines the swagger field <code>/info/contact</code>.
*
* <p>
- * A {@link JsonSerializer#DEFAULT_LAX Simple-JSON} string with the following fields:
+ * A <a class='doclink' href='../../../../../overview-summary.html#juneau-marshall.JsonDetails.SimplifiedJson'>Simplified JSON</a> string with the following fields:
* <p class='bcode'>
* {
* name: string,
@@ -142,7 +141,7 @@ public @interface ResourceSwagger {
* <h5 class='section'>Notes:</h5>
* <ul class='spaced-list'>
* <li>
- * The format is a {@link JsonSerializer#DEFAULT_LAX Simple-JSON} object.
+ * The format is a <a class='doclink' href='../../../../../overview-summary.html#juneau-marshall.JsonDetails.SimplifiedJson'>Simplified JSON</a> object.
* <br>Multiple lines are concatenated with newlines.
* <li>
* Supports <a class="doclink" href="../../../../../overview-summary.html#DefaultRestSvlVariables">initialization-time and request-time variables</a>
@@ -180,7 +179,7 @@ public @interface ResourceSwagger {
* It is used to populate the Swagger license field and to display on HTML pages.
*
* <p>
- * A {@link JsonSerializer#DEFAULT_LAX Simple-JSON} string with the following fields:
+ * A <a class='doclink' href='../../../../../overview-summary.html#juneau-marshall.JsonDetails.SimplifiedJson'>Simplified JSON</a> string with the following fields:
* <p class='bcode'>
* {
* name: string,
@@ -205,7 +204,7 @@ public @interface ResourceSwagger {
* <h5 class='section'>Notes:</h5>
* <ul class='spaced-list'>
* <li>
- * The format is a {@link JsonSerializer#DEFAULT_LAX Simple-JSON} object.
+ * The format is a <a class='doclink' href='../../../../../overview-summary.html#juneau-marshall.JsonDetails.SimplifiedJson'>Simplified JSON</a> object.
* <br>Multiple lines are concatenated with newlines.
* <li>
* Supports <a class="doclink" href="../../../../../overview-summary.html#DefaultRestSvlVariables">initialization-time and request-time variables</a>
@@ -224,7 +223,7 @@ public @interface ResourceSwagger {
* It is used to populate the Swagger tags field and to display on HTML pages.
*
* <p>
- * A {@link JsonSerializer#DEFAULT_LAX Simple-JSON} string with the following fields:
+ * A <a class='doclink' href='../../../../../overview-summary.html#juneau-marshall.JsonDetails.SimplifiedJson'>Simplified JSON</a> string with the following fields:
* <p class='bcode'>
* [
* {
@@ -255,7 +254,7 @@ public @interface ResourceSwagger {
* <h5 class='section'>Notes:</h5>
* <ul class='spaced-list'>
* <li>
- * The format is a {@link JsonSerializer#DEFAULT_LAX Simple-JSON} array.
+ * The format is a <a class='doclink' href='../../../../../overview-summary.html#juneau-marshall.JsonDetails.SimplifiedJson'>Simplified JSON</a> array.
* <br>Multiple lines are concatenated with newlines.
* <li>
* Supports <a class="doclink" href="../../../../../overview-summary.html#DefaultRestSvlVariables">initialization-time and request-time variables</a>
@@ -318,7 +317,7 @@ public @interface ResourceSwagger {
* Free-form value for the swagger of a resource.
*
* <p>
- * This is a {@link JsonSerializer#DEFAULT_LAX Simple-JSON} object that makes up the swagger information for this resource.
+ * This is a <a class='doclink' href='../../../../../overview-summary.html#juneau-marshall.JsonDetails.SimplifiedJson'>Simplified JSON</a> object that makes up the swagger information for this resource.
*
* <p>
* The following are completely equivalent ways of defining the swagger description of a resource:
@@ -408,7 +407,7 @@ public @interface ResourceSwagger {
* <h5 class='section'>Notes:</h5>
* <ul class='spaced-list'>
* <li>
- * The format is a {@link JsonSerializer#DEFAULT_LAX Simple-JSON} object.
+ * The format is a <a class='doclink' href='../../../../../overview-summary.html#juneau-marshall.JsonDetails.SimplifiedJson'>Simplified JSON</a> object.
* <li>
* The leading/trailing <code>{ }</code> characters are optional.
* <br>The following two example are considered equivalent:
diff --git a/juneau-rest/juneau-rest-server/src/main/java/org/apache/juneau/rest/annotation/RestMethod.java b/juneau-rest/juneau-rest-server/src/main/java/org/apache/juneau/rest/annotation/RestMethod.java
index 0ec0922..066fc8e 100644
--- a/juneau-rest/juneau-rest-server/src/main/java/org/apache/juneau/rest/annotation/RestMethod.java
+++ b/juneau-rest/juneau-rest-server/src/main/java/org/apache/juneau/rest/annotation/RestMethod.java
@@ -18,7 +18,6 @@ import static java.lang.annotation.RetentionPolicy.*;
import java.lang.annotation.*;
import org.apache.juneau.*;
-import org.apache.juneau.json.*;
import org.apache.juneau.remoteable.*;
import org.apache.juneau.rest.*;
import org.apache.juneau.http.annotation.*;
@@ -760,7 +759,7 @@ public @interface RestMethod {
* <h5 class='section'>Notes:</h5>
* <ul class='spaced-list'>
* <li>
- * The format is {@link JsonSerializer#DEFAULT_LAX Simple-JSON}.
+ * The format is <a class='doclink' href='../../../../../overview-summary.html#juneau-marshall.JsonDetails.SimplifiedJson'>Simplified JSON</a>.
* <br>Multiple lines are concatenated with newlines.
* <li>
* The starting and ending <js>'{'</js>/<js>'}'</js> characters around the entire value are optional.
diff --git a/juneau-rest/juneau-rest-server/src/main/java/org/apache/juneau/rest/remoteable/RemoteableServlet.java b/juneau-rest/juneau-rest-server/src/main/java/org/apache/juneau/rest/remoteable/RemoteableServlet.java
index 9ee4373..b44364a 100644
--- a/juneau-rest/juneau-rest-server/src/main/java/org/apache/juneau/rest/remoteable/RemoteableServlet.java
+++ b/juneau-rest/juneau-rest-server/src/main/java/org/apache/juneau/rest/remoteable/RemoteableServlet.java
@@ -218,7 +218,7 @@ public abstract class RemoteableServlet extends BasicRestServlet {
//--------------------------------------------------------------------------------
private boolean useOnlyAnnotated() {
- return getProperties().getBoolean(RemoteableServiceProperties.REMOTEABLE_includeOnlyRemotableMethods, false);
+ return getContext().getProperties().getBoolean(RemoteableServiceProperties.REMOTEABLE_includeOnlyRemotableMethods, false);
}
private Map<String,java.lang.reflect.Method> getMethods(String javaInterface) throws Exception {
diff --git a/juneau-rest/juneau-rest-server/src/main/java/org/apache/juneau/rest/vars/RestInfoVar.java b/juneau-rest/juneau-rest-server/src/main/java/org/apache/juneau/rest/vars/RestInfoVar.java
index 6f0c4c3..98b9226 100644
--- a/juneau-rest/juneau-rest-server/src/main/java/org/apache/juneau/rest/vars/RestInfoVar.java
+++ b/juneau-rest/juneau-rest-server/src/main/java/org/apache/juneau/rest/vars/RestInfoVar.java
@@ -103,7 +103,7 @@ public class RestInfoVar extends MultipartResolvingVar {
RestRequest req = session.getSessionObject(RestRequest.class, SESSION_req, true);
Swagger swagger = req.getSwagger();
RestInfoProvider rip = req.getInfoProvider();
- WriterSerializer s = JsonSerializer.DEFAULT_LAX;
+ WriterSerializer s = SimpleJsonSerializer.DEFAULT;
char c = StringUtils.charAt(key, 0);
if (c == 'c') {
if ("contact".equals(key)) {
diff --git a/juneau-rest/juneau-rest-server/src/test/java/org/apache/juneau/rest/annotation/BodyAnnotationTest.java b/juneau-rest/juneau-rest-server/src/test/java/org/apache/juneau/rest/annotation/BodyAnnotationTest.java
index 5a13fb8..2c82908 100644
--- a/juneau-rest/juneau-rest-server/src/test/java/org/apache/juneau/rest/annotation/BodyAnnotationTest.java
+++ b/juneau-rest/juneau-rest-server/src/test/java/org/apache/juneau/rest/annotation/BodyAnnotationTest.java
@@ -54,7 +54,7 @@ public class BodyAnnotationTest {
// @Body on parameter
//=================================================================================================================
- @RestResource(serializers=JsonSerializer.Simple.class, parsers=JsonParser.class)
+ @RestResource(serializers=SimpleJsonSerializer.class, parsers=JsonParser.class)
public static class A {
@RestMethod(name=PUT, path="/String")
public String a01(@Body String b) {
@@ -276,7 +276,7 @@ public class BodyAnnotationTest {
// @Body on POJO
//=================================================================================================================
- @RestResource(serializers=JsonSerializer.Simple.class, parsers=JsonParser.class)
+ @RestResource(serializers=SimpleJsonSerializer.class, parsers=JsonParser.class)
public static class B {
@RestMethod(name=PUT, path="/StringTransform")
public B01 b01(B01 b) {
@@ -621,7 +621,7 @@ public class BodyAnnotationTest {
// Complex POJOs
//=================================================================================================================
- @RestResource(serializers=JsonSerializer.Simple.class, parsers=JsonParser.class)
+ @RestResource(serializers=SimpleJsonSerializer.class, parsers=JsonParser.class)
public static class E {
@RestMethod(name=PUT, path="/B")
public DTOs.B testPojo1(@Body DTOs.B b) {
@@ -637,7 +637,7 @@ public class BodyAnnotationTest {
@Test
public void e01_complexPojos_B_body() throws Exception {
String expected = "{f01:['a','b'],f02:['c','d'],f03:[1,2],f04:[3,4],f05:[['e','f'],['g','h']],f06:[['i','j'],['k','l']],f07:[{a:'a',b:1,c:true},{a:'a',b:1,c:true}],f08:[{a:'a',b:1,c:true},{a:'a',b:1,c:true}],f09:[[{a:'a',b:1,c:true}],[{a:'a',b:1,c:true}]],f10:[[{a:'a',b:1,c:true}],[{a:'a',b:1,c:true}]],f11:['a','b'],f12:['c','d'],f13:[1,2],f14:[3,4],f15:[['e','f'],['g','h']],f16:[['i','j'],['k','l']],f17:[{a:'a',b:1,c:true},{a:'a',b:1,c:true}],f18:[{a:'a',b:1,c:true},{a:'a',b:1,c:true} [...]
- e.put("/B", JsonSerializer.DEFAULT_LAX.toString(DTOs.B.INSTANCE)).json().execute().assertBody(expected);
+ e.put("/B", SimpleJsonSerializer.DEFAULT.toString(DTOs.B.INSTANCE)).json().execute().assertBody(expected);
}
@Test
public void e02_complexPojos_B_bodyParam() throws Exception {
@@ -647,7 +647,7 @@ public class BodyAnnotationTest {
@Test
public void e03_complexPojos_C_body() throws Exception {
String expected = "{f01:['a','b'],f02:['c','d'],f03:[1,2],f04:[3,4],f05:[['e','f'],['g','h']],f06:[['i','j'],['k','l']],f07:[{a:'a',b:1,c:true},{a:'a',b:1,c:true}],f08:[{a:'a',b:1,c:true},{a:'a',b:1,c:true}],f09:[[{a:'a',b:1,c:true}],[{a:'a',b:1,c:true}]],f10:[[{a:'a',b:1,c:true}],[{a:'a',b:1,c:true}]],f11:['a','b'],f12:['c','d'],f13:[1,2],f14:[3,4],f15:[['e','f'],['g','h']],f16:[['i','j'],['k','l']],f17:[{a:'a',b:1,c:true},{a:'a',b:1,c:true}],f18:[{a:'a',b:1,c:true},{a:'a',b:1,c:true} [...]
- e.put("/C", JsonSerializer.DEFAULT_LAX.toString(DTOs.B.INSTANCE)).json().execute().assertBody(expected);
+ e.put("/C", SimpleJsonSerializer.DEFAULT.toString(DTOs.B.INSTANCE)).json().execute().assertBody(expected);
}
@Test
public void e04_complexPojos_C_bodyParam() throws Exception {
@@ -666,7 +666,7 @@ public class BodyAnnotationTest {
@Body F01 bean,
@HasQuery("p1") boolean hqp1, @HasQuery("p2") boolean hqp2,
@Query("p1") String qp1, @Query("p2") int qp2) throws Exception {
- return new StringReader("bean=["+JsonSerializer.DEFAULT_LAX.toString(bean)+"],qp1=["+qp1+"],qp2=["+qp2+"],hqp1=["+hqp1+"],hqp2=["+hqp2+"]");
+ return new StringReader("bean=["+SimpleJsonSerializer.DEFAULT.toString(bean)+"],qp1=["+qp1+"],qp2=["+qp2+"],hqp1=["+hqp1+"],hqp2=["+hqp2+"]");
}
public static class F01 {
public String p1;
diff --git a/juneau-rest/juneau-rest-server/src/test/java/org/apache/juneau/rest/annotation/QueryAnnotationTest.java b/juneau-rest/juneau-rest-server/src/test/java/org/apache/juneau/rest/annotation/QueryAnnotationTest.java
index bedecca..0106b41 100644
--- a/juneau-rest/juneau-rest-server/src/test/java/org/apache/juneau/rest/annotation/QueryAnnotationTest.java
+++ b/juneau-rest/juneau-rest-server/src/test/java/org/apache/juneau/rest/annotation/QueryAnnotationTest.java
@@ -150,7 +150,7 @@ public class QueryAnnotationTest {
// Multipart parameters (e.g. &key=val1,&key=val2).
//=================================================================================================================
- @RestResource(serializers=JsonSerializer.Simple.class)
+ @RestResource(serializers=SimpleJsonSerializer.class)
public static class C {
public static class C01 {
public String a;
diff --git a/juneau-rest/juneau-rest-server/src/test/java/org/apache/juneau/rest/annotation/RestMethodInheritTest.java b/juneau-rest/juneau-rest-server/src/test/java/org/apache/juneau/rest/annotation/RestMethodInheritTest.java
index 74af9dc..58c06e0 100644
--- a/juneau-rest/juneau-rest-server/src/test/java/org/apache/juneau/rest/annotation/RestMethodInheritTest.java
+++ b/juneau-rest/juneau-rest-server/src/test/java/org/apache/juneau/rest/annotation/RestMethodInheritTest.java
@@ -221,7 +221,7 @@ public class RestMethodInheritTest {
@RestResource(pojoSwaps={F2Swap.class,Inherit.class})
public static class D01 extends D {}
- @RestResource(serializers=JsonSerializer.Simple.class)
+ @RestResource(serializers=SimpleJsonSerializer.class)
public static class D02 extends D01 {
@RestMethod(name=GET, path="/default")
public Object[] d01() {
@@ -233,13 +233,13 @@ public class RestMethodInheritTest {
// Should show ['F1','F2','F3']
return new Object[]{new Foo1(), new Foo2(), new Foo3()};
}
- @RestMethod(name=GET, path="/overrideSerializer", serializers=JsonSerializer.Simple.class, pojoSwaps=F3Swap.class)
+ @RestMethod(name=GET, path="/overrideSerializer", serializers=SimpleJsonSerializer.class, pojoSwaps=F3Swap.class)
public Object[] d03() {
// Should show ['Foo1','Foo2','F3']"
// Overriding serializer does not have parent filters applied.
return new Object[]{new Foo1(), new Foo2(), new Foo3()};
}
- @RestMethod(name=GET, path="/overrideSerializerInheritTransforms", serializers=JsonSerializer.Simple.class, pojoSwaps={F3Swap.class,Inherit.class})
+ @RestMethod(name=GET, path="/overrideSerializerInheritTransforms", serializers=SimpleJsonSerializer.class, pojoSwaps={F3Swap.class,Inherit.class})
public Object[] d04() {
// Should show ['F1','F2','F3']
return new Object[]{new Foo1(), new Foo2(), new Foo3()};
diff --git a/juneau-rest/juneau-rest-server/src/test/java/org/apache/juneau/rest/annotation/RestResourcePojoSwapsTest.java b/juneau-rest/juneau-rest-server/src/test/java/org/apache/juneau/rest/annotation/RestResourcePojoSwapsTest.java
index a79b144..059b107 100644
--- a/juneau-rest/juneau-rest-server/src/test/java/org/apache/juneau/rest/annotation/RestResourcePojoSwapsTest.java
+++ b/juneau-rest/juneau-rest-server/src/test/java/org/apache/juneau/rest/annotation/RestResourcePojoSwapsTest.java
@@ -84,7 +84,7 @@ public class RestResourcePojoSwapsTest {
}
}
- @RestResource(pojoSwaps={SwapA1.class}, serializers=JsonSerializer.Simple.class, parsers=JsonParser.class)
+ @RestResource(pojoSwaps={SwapA1.class}, serializers=SimpleJsonSerializer.class, parsers=JsonParser.class)
public static class A01_Parent {}
@RestResource(pojoSwaps={SwapA2.class})
diff --git a/juneau-rest/juneau-rest-server/src/test/java/org/apache/juneau/rest/util/UrlPathPatternTest.java b/juneau-rest/juneau-rest-server/src/test/java/org/apache/juneau/rest/util/UrlPathPatternTest.java
index 8f7dcde..93f240d 100644
--- a/juneau-rest/juneau-rest-server/src/test/java/org/apache/juneau/rest/util/UrlPathPatternTest.java
+++ b/juneau-rest/juneau-rest-server/src/test/java/org/apache/juneau/rest/util/UrlPathPatternTest.java
@@ -40,6 +40,6 @@ public class UrlPathPatternTest {
l.add(new UrlPathPattern("/foo/{id}/bar/*"));
Collections.sort(l);
- assertEquals("[{patternString:'/foo/bar',vars:[]},{patternString:'/foo/bar/*',vars:[]},{patternString:'/foo/{id}/bar',vars:['id']},{patternString:'/foo/{id}/bar/*',vars:['id']},{patternString:'/foo/{id}',vars:['id']},{patternString:'/foo/{id}/*',vars:['id']},{patternString:'/foo',vars:[]},{patternString:'/foo/*',vars:[]}]", JsonSerializer.DEFAULT_LAX.builder().sortProperties().build().serialize(l));
+ assertEquals("[{patternString:'/foo/bar',vars:[]},{patternString:'/foo/bar/*',vars:[]},{patternString:'/foo/{id}/bar',vars:['id']},{patternString:'/foo/{id}/bar/*',vars:['id']},{patternString:'/foo/{id}',vars:['id']},{patternString:'/foo/{id}/*',vars:['id']},{patternString:'/foo',vars:[]},{patternString:'/foo/*',vars:[]}]", SimpleJsonSerializer.DEFAULT.builder().sortProperties().build().serialize(l));
}
}