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 2017/02/08 01:16:02 UTC
[4/7] incubator-juneau git commit: Eliminate ClassMeta dependencies
from Parser. Clean up docs.
http://git-wip-us.apache.org/repos/asf/incubator-juneau/blob/30dd3b93/juneau-core/src/main/java/org/apache/juneau/urlencoding/UrlEncodingParser.java
----------------------------------------------------------------------
diff --git a/juneau-core/src/main/java/org/apache/juneau/urlencoding/UrlEncodingParser.java b/juneau-core/src/main/java/org/apache/juneau/urlencoding/UrlEncodingParser.java
index a3a6722..2c68e09 100644
--- a/juneau-core/src/main/java/org/apache/juneau/urlencoding/UrlEncodingParser.java
+++ b/juneau-core/src/main/java/org/apache/juneau/urlencoding/UrlEncodingParser.java
@@ -18,7 +18,6 @@ import java.lang.reflect.*;
import java.util.*;
import org.apache.juneau.*;
-import org.apache.juneau.MediaType;
import org.apache.juneau.annotation.*;
import org.apache.juneau.internal.*;
import org.apache.juneau.parser.*;
@@ -27,11 +26,11 @@ import org.apache.juneau.transform.*;
/**
* Parses URL-encoded text into POJO models.
*
- * <h6 class='topic'>Media types</h6>
+ * <h5 class='section'>Media types:</h5>
* <p>
* Handles <code>Content-Type</code> types: <code>application/x-www-form-urlencoded</code>
*
- * <h6 class='topic'>Description</h6>
+ * <h5 class='section'>Description:</h5>
* <p>
* Parses URL-Encoded text (e.g. <js>"foo=bar&baz=bing"</js>) into POJOs.
* <p>
@@ -39,7 +38,7 @@ import org.apache.juneau.transform.*;
* <p>
* This parser uses a state machine, which makes it very fast and efficient.
*
- * <h6 class='topic'>Configurable properties</h6>
+ * <h5 class='section'>Configurable properties:</h5>
* <p>
* This class has the following properties associated with it:
* <ul>
@@ -429,17 +428,21 @@ public class UrlEncodingParser extends UonParser {
* Parses a single query parameter value into the specified class type.
*
* @param in The input query string value.
- * @param type The class type of the object to create.
+ * @param type The object type to create.
+ * <br>Can be any of the following: {@link ClassMeta}, {@link Class}, {@link ParameterizedType}, {@link GenericArrayType}
+ * @param args The type arguments of the class if it's a collection or map.
+ * <br>Can be any of the following: {@link ClassMeta}, {@link Class}, {@link ParameterizedType}, {@link GenericArrayType}
+ * <br>Ignored if the main type is not a map or collection.
* @return A new instance of the specified type.
* @throws ParseException
*/
- public <T> T parseParameter(CharSequence in, ClassMeta<T> type) throws ParseException {
+ public <T> T parseParameter(CharSequence in, Type type, Type...args) throws ParseException {
if (in == null)
return null;
UonParserSession session = createParameterSession(in);
try {
UonReader r = session.getReader();
- return super.parseAnything(session, type, r, null, true, null);
+ return (T)super.parseAnything(session, session.getClassMeta(type, args), r, null, true, null);
} catch (ParseException e) {
throw e;
} catch (Exception e) {
@@ -473,6 +476,31 @@ public class UrlEncodingParser extends UonParser {
}
}
+ /**
+ * Same as {@link #parseParameter(CharSequence, Type, Type...)} except the type has already
+ * been converted to a {@link ClassMeta} object.
+ *
+ * @param in The input query string value.
+ * @param type The class type of the object to create.
+ * @return A new instance of the specified type.
+ * @throws ParseException
+ */
+ public <T> T parseParameter(CharSequence in, ClassMeta<T> type) throws ParseException {
+ if (in == null)
+ return null;
+ UonParserSession session = createParameterSession(in);
+ try {
+ UonReader r = session.getReader();
+ return super.parseAnything(session, type, r, null, true, null);
+ } catch (ParseException e) {
+ throw e;
+ } catch (Exception e) {
+ throw new ParseException(session, e);
+ } finally {
+ session.close();
+ }
+ }
+
//--------------------------------------------------------------------------------
// Overridden methods
//--------------------------------------------------------------------------------
@@ -485,7 +513,6 @@ public class UrlEncodingParser extends UonParser {
@Override /* Parser */
protected <T> T doParse(ParserSession session, ClassMeta<T> type) throws Exception {
UrlEncodingParserSession s = (UrlEncodingParserSession)session;
- type = session.normalizeClassMeta(type);
UonReader r = s.getReader();
T o = parseAnything(s, type, r, s.getOuter());
return o;
@@ -505,7 +532,7 @@ public class UrlEncodingParser extends UonParser {
UonReader r = s.getReader();
if (r.peek() == '?')
r.read();
- m = parseIntoMap(s, r, m, session.getClassMeta(keyType), session.getClassMeta(valueType));
+ m = parseIntoMap(s, r, m, (ClassMeta<K>)session.getClassMeta(keyType), (ClassMeta<V>)session.getClassMeta(valueType));
return m;
}
http://git-wip-us.apache.org/repos/asf/incubator-juneau/blob/30dd3b93/juneau-core/src/main/java/org/apache/juneau/urlencoding/UrlEncodingParserContext.java
----------------------------------------------------------------------
diff --git a/juneau-core/src/main/java/org/apache/juneau/urlencoding/UrlEncodingParserContext.java b/juneau-core/src/main/java/org/apache/juneau/urlencoding/UrlEncodingParserContext.java
index 5df8849..fa13729 100644
--- a/juneau-core/src/main/java/org/apache/juneau/urlencoding/UrlEncodingParserContext.java
+++ b/juneau-core/src/main/java/org/apache/juneau/urlencoding/UrlEncodingParserContext.java
@@ -60,7 +60,7 @@ public class UrlEncodingParserContext extends UonParserContext {
* If <jk>false</jk>, serializing the array <code>[1,2,3]</code> results in <code>?key=$a(1,2,3)</code>.
* If <jk>true</jk>, serializing the same array results in <code>?key=1&key=2&key=3</code>.
*
- * <h6 class='topic'>Example:</h6>
+ * <h5 class='section'>Example:</h5>
* <p class='bcode'>
* <jk>public class</jk> A {
* <jk>public</jk> String[] f1 = {<js>"a"</js>,<js>"b"</js>};
@@ -74,11 +74,14 @@ public class UrlEncodingParserContext extends UonParserContext {
* String s2 = p2.serialize(<jk>new</jk> A()); <jc>// Produces "f1=a&f1=b&f2=c&f2=d"</jc>
* </p>
* <p>
- * <b>Important note:</b> If parsing multi-part parameters, it's highly recommended to use Collections or Lists
- * as bean property types instead of arrays since arrays have to be recreated from scratch every time a value
- * is added to it.
- * <p>
* This option only applies to beans.
+ * <p>
+ * <h5 class='section'>Notes:</h5>
+ * <ul>
+ * <li>If parsing multi-part parameters, it's highly recommended to use Collections or Lists
+ * as bean property types instead of arrays since arrays have to be recreated from scratch every time a value
+ * is added to it.
+ * </ul>
*/
public static final String URLENC_expandedParams = "UrlEncoding.expandedParams";
http://git-wip-us.apache.org/repos/asf/incubator-juneau/blob/30dd3b93/juneau-core/src/main/java/org/apache/juneau/urlencoding/UrlEncodingSerializer.java
----------------------------------------------------------------------
diff --git a/juneau-core/src/main/java/org/apache/juneau/urlencoding/UrlEncodingSerializer.java b/juneau-core/src/main/java/org/apache/juneau/urlencoding/UrlEncodingSerializer.java
index e96ef9b..6bb81d5 100644
--- a/juneau-core/src/main/java/org/apache/juneau/urlencoding/UrlEncodingSerializer.java
+++ b/juneau-core/src/main/java/org/apache/juneau/urlencoding/UrlEncodingSerializer.java
@@ -29,18 +29,18 @@ import org.apache.juneau.transform.*;
/**
* Serializes POJO models to URL-encoded notation with UON-encoded values (a notation for URL-encoded query paramter values).
*
- * <h6 class='topic'>Media types</h6>
+ * <h5 class='section'>Media types:</h5>
* <p>
* Handles <code>Accept</code> types: <code>application/x-www-form-urlencoded</code>
* <p>
* Produces <code>Content-Type</code> types: <code>application/x-www-form-urlencoded</code>
*
- * <h6 class='topic'>Description</h6>
+ * <h5 class='section'>Description:</h5>
* <p>
* This serializer provides several serialization options. Typically, one of the predefined DEFAULT serializers will be sufficient.
* However, custom serializers can be constructed to fine-tune behavior.
*
- * <h6 class='topic'>Configurable properties</h6>
+ * <h5 class='section'>Configurable properties:</h5>
* <p>
* This class has the following properties associated with it:
* <ul>
@@ -121,7 +121,7 @@ import org.apache.juneau.transform.*;
* )
* </p>
*
- * <h6 class='topic'>Example:</h6>
+ * <h5 class='section'>Example:</h5>
* <p class='bcode'>
* <jc>// Serialize a Map</jc>
* Map m = <jk>new</jk> ObjectMap(<js>"{a:'b',c:1,d:false,e:['f',1,false],g:{h:'i'}}"</js>);
http://git-wip-us.apache.org/repos/asf/incubator-juneau/blob/30dd3b93/juneau-core/src/main/java/org/apache/juneau/urlencoding/UrlEncodingSerializerContext.java
----------------------------------------------------------------------
diff --git a/juneau-core/src/main/java/org/apache/juneau/urlencoding/UrlEncodingSerializerContext.java b/juneau-core/src/main/java/org/apache/juneau/urlencoding/UrlEncodingSerializerContext.java
index fc5bd2c..0e68416 100644
--- a/juneau-core/src/main/java/org/apache/juneau/urlencoding/UrlEncodingSerializerContext.java
+++ b/juneau-core/src/main/java/org/apache/juneau/urlencoding/UrlEncodingSerializerContext.java
@@ -61,7 +61,7 @@ public class UrlEncodingSerializerContext extends UonSerializerContext {
* If <jk>false</jk>, serializing the array <code>[1,2,3]</code> results in <code>?key=$a(1,2,3)</code>.
* If <jk>true</jk>, serializing the same array results in <code>?key=1&key=2&key=3</code>.
*
- * <h6 class='topic'>Example:</h6>
+ * <h5 class='section'>Example:</h5>
* <p class='bcode'>
* <jk>public class</jk> A {
* <jk>public</jk> String[] f1 = {<js>"a"</js>,<js>"b"</js>};
@@ -75,11 +75,14 @@ public class UrlEncodingSerializerContext extends UonSerializerContext {
* String s2 = p2.serialize(<jk>new</jk> A()); <jc>// Produces "f1=a&f1=b&f2=c&f2=d"</jc>
* </p>
* <p>
- * <b>Important note:</b> If parsing multi-part parameters, it's highly recommended to use Collections or Lists
- * as bean property types instead of arrays since arrays have to be recreated from scratch every time a value
- * is added to it.
- * <p>
* This option only applies to beans.
+ * <p>
+ * <h5 class='section'>Notes:</h5>
+ * <ul>
+ * <li>If parsing multi-part parameters, it's highly recommended to use Collections or Lists
+ * as bean property types instead of arrays since arrays have to be recreated from scratch every time a value
+ * is added to it.
+ * </ul>
*/
public static final String URLENC_expandedParams = "UrlEncoding.expandedParams";
http://git-wip-us.apache.org/repos/asf/incubator-juneau/blob/30dd3b93/juneau-core/src/main/java/org/apache/juneau/utils/Args.java
----------------------------------------------------------------------
diff --git a/juneau-core/src/main/java/org/apache/juneau/utils/Args.java b/juneau-core/src/main/java/org/apache/juneau/utils/Args.java
index 58176db..4d4d01d 100644
--- a/juneau-core/src/main/java/org/apache/juneau/utils/Args.java
+++ b/juneau-core/src/main/java/org/apache/juneau/utils/Args.java
@@ -37,7 +37,7 @@ import org.apache.juneau.internal.*;
* <li><code>java com.sample.MyClass mainArg1 -optArg1 optArg1Val1 -optArg1 optArg1Val2</code>
* </ul>
*
- * <h6 class='topic'>Code examples</h6>
+ * <h5 class='section'>Examples:</h5>
* <p class='bcode'>
*
* <jc>// Main method with arguments</jc>
@@ -193,7 +193,7 @@ public final class Args extends ObjectMap {
* <p>
* If the optional arg has multiple values, returns only the first converted value.
*
- * <h6 class='topic'>Example:</h6>
+ * <h5 class='section'>Example:</h5>
* <p class='bcode'>
* <jc>// Command: java com.sample.MyClass -verbose true -debug 5</jc>
* <jk>boolean</jk> b = args.getArg(<jk>boolean</jk>.<jk>class</jk>, <js>"verbose"</js>);
@@ -215,7 +215,7 @@ public final class Args extends ObjectMap {
/**
* Returns the optional argument values as a list of strings.
*
- * <h6 class='topic'>Example:</h6>
+ * <h5 class='section'>Example:</h5>
* <p class='bcode'>
* <jc>// Command: java com.sample.MyClass -extraArgs foo bar baz</jc>
* List<String> l1 = args.getArgs(<js>"extraArgs"</js>); <jc>// ['foo','bar','baz']</jc>
http://git-wip-us.apache.org/repos/asf/incubator-juneau/blob/30dd3b93/juneau-core/src/main/java/org/apache/juneau/utils/MessageBundle.java
----------------------------------------------------------------------
diff --git a/juneau-core/src/main/java/org/apache/juneau/utils/MessageBundle.java b/juneau-core/src/main/java/org/apache/juneau/utils/MessageBundle.java
index 965a2d9..190e68c 100644
--- a/juneau-core/src/main/java/org/apache/juneau/utils/MessageBundle.java
+++ b/juneau-core/src/main/java/org/apache/juneau/utils/MessageBundle.java
@@ -154,7 +154,7 @@ public class MessageBundle extends ResourceBundle {
* Similar to {@link ResourceBundle#getString(String)} except allows you to pass in {@link MessageFormat} objects.
*
* @param key The resource bundle key.
- * @param args Optional variable replacement arguments.
+ * @param args Optional {@link MessageFormat}-style arguments.
* @return The resolved value. Never <jk>null</jk>. <js>"{!!key}"</js> if the bundle is missing. <js>"{!key}"</js> if the key is missing.
*/
public String getString(String key, Object...args) {
@@ -171,7 +171,7 @@ public class MessageBundle extends ResourceBundle {
*
* @param locale The locale of the resource bundle to retrieve message from.
* @param key The resource bundle key.
- * @param args Optional variable replacement arguments.
+ * @param args Optional {@link MessageFormat}-style arguments.
* @return The resolved value. Never <jk>null</jk>. <js>"{!!key}"</js> if the bundle is missing. <js>"{!key}"</js> if the key is missing.
*/
public String getString(Locale locale, String key, Object...args) {
@@ -184,7 +184,7 @@ public class MessageBundle extends ResourceBundle {
* Same as {@link #getString(String, Object...)} but uses the locale specified on the call to {@link #setClientLocale(Locale)}.
*
* @param key The resource bundle key.
- * @param args Optional variable replacement arguments.
+ * @param args Optional {@link MessageFormat}-style arguments.
* @return The resolved value. Never <jk>null</jk>. <js>"{!!key}"</js> if the bundle is missing. <js>"{!key}"</js> if the key is missing.
*/
public String getClientString(String key, Object...args) {
http://git-wip-us.apache.org/repos/asf/incubator-juneau/blob/30dd3b93/juneau-core/src/main/java/org/apache/juneau/utils/PojoIntrospector.java
----------------------------------------------------------------------
diff --git a/juneau-core/src/main/java/org/apache/juneau/utils/PojoIntrospector.java b/juneau-core/src/main/java/org/apache/juneau/utils/PojoIntrospector.java
index 44d5580..908fc5d 100644
--- a/juneau-core/src/main/java/org/apache/juneau/utils/PojoIntrospector.java
+++ b/juneau-core/src/main/java/org/apache/juneau/utils/PojoIntrospector.java
@@ -23,7 +23,7 @@ import org.apache.juneau.parser.*;
/**
* Used to invoke methods on {@code Objects} using arguments in serialized form.
*
- * <h6 class='topic'>Example:</h6>
+ * <h5 class='section'>Example:</h5>
* <p class='bcode'>
* String s = <js>"foobar"</js>;
* String s2 = (String)<jk>new</jk> PojoIntrospector(s).invoke(<js>"substring(int,int)"</js>, <js>"[3,6]"</js>); <jc>// "bar"</jc>
http://git-wip-us.apache.org/repos/asf/incubator-juneau/blob/30dd3b93/juneau-core/src/main/java/org/apache/juneau/utils/PojoQuery.java
----------------------------------------------------------------------
diff --git a/juneau-core/src/main/java/org/apache/juneau/utils/PojoQuery.java b/juneau-core/src/main/java/org/apache/juneau/utils/PojoQuery.java
index 4e0d2ec..1f2ff64 100644
--- a/juneau-core/src/main/java/org/apache/juneau/utils/PojoQuery.java
+++ b/juneau-core/src/main/java/org/apache/juneau/utils/PojoQuery.java
@@ -66,7 +66,7 @@ import org.apache.juneau.internal.*;
* Search patterns can be either {@code Strings} or {@code Maps}.<br>
* Multiple search patterns are ANDed (i.e. all patterns must match for the row to be returned).
*
- * <h6 class='topic'>Example:</h6>
+ * <h5 class='section'>Example:</h5>
* <ul class='spaced-list'>
* <li><tt>{fi:'123'}</tt> - Return only rows where the <tt>fi</tt> column is 123.
* <li><tt>{fs:'foobar'}</tt> - Return only rows where the <tt>fs</tt> column is 'foobar'.
@@ -95,7 +95,7 @@ import org.apache.juneau.internal.*;
* <li><tt>foo?</tt> - <tt>?</tt> matches exactly one character
* </ul>
*
- * <h6 class='topic'>Notes</h6>
+ * <h5 class='section'>Notes:</h5>
* <ul class='spaced-list'>
* <li>Whitespace is ignored around search patterns.
* <li>Prepend <tt>+</tt> to tokens that must match. (e.g. <tt>+foo* +*bar</tt>)
@@ -118,7 +118,7 @@ import org.apache.juneau.internal.*;
* <li><tt>!123</tt> - Not 123
* </ul>
*
- * <h6 class='topic'>Notes</h6>
+ * <h5 class='section'>Notes:</h5>
* <ul class='spaced-list'>
* <li>Whitespace is ignored in search patterns.
* <li>Negative numbers are supported.
@@ -149,7 +149,7 @@ import org.apache.juneau.internal.*;
* <li><tt>2001 2003 2005</tt> - Multiple date patterns are ORed.
* </ul>
*
- * <h6 class='topic'>Notes</h6>
+ * <h5 class='section'>Notes:</h5>
* <ul>
* <li>Whitespace is ignored in search patterns.
* </ul>
http://git-wip-us.apache.org/repos/asf/incubator-juneau/blob/30dd3b93/juneau-core/src/main/java/org/apache/juneau/utils/PojoRest.java
----------------------------------------------------------------------
diff --git a/juneau-core/src/main/java/org/apache/juneau/utils/PojoRest.java b/juneau-core/src/main/java/org/apache/juneau/utils/PojoRest.java
index 6f690cf..851bc9b 100644
--- a/juneau-core/src/main/java/org/apache/juneau/utils/PojoRest.java
+++ b/juneau-core/src/main/java/org/apache/juneau/utils/PojoRest.java
@@ -42,7 +42,7 @@ import org.apache.juneau.parser.*;
* <p>
* Leading slashes in URLs are ignored. So <js>"/xxx/yyy/zzz"</js> and <js>"xxx/yyy/zzz"</js> are considered identical.
*
- * <h6 class='topic'>Example:</h6>
+ * <h5 class='section'>Example:</h5>
* <p class='bcode'>
* <jc>// Construct an unstructured POJO model</jc>
* ObjectMap m = <jk>new</jk> ObjectMap(<js>""</js>
@@ -106,7 +106,7 @@ import org.apache.juneau.parser.*;
* can be used in lieu of index numbers on GET requests to return a map/bean with a specified attribute value.<br>
* The syntax is {@code @attr=val}, where attr is the attribute name on the child map, and val is the matching value.
*
- * <h6 class='topic'>Example:</h6>
+ * <h5 class='section'>Example:</h5>
* <p class='bcode'>
* <jc>// Get map/bean with name attribute value of 'foo' from a list of items</jc>
* Map m = pojoRest.getMap(<js>"/items/@name=foo"</js>);
@@ -528,21 +528,24 @@ public final class PojoRest {
/**
* Adds a value to a list element in a POJO model.
* <p>
- * The URL is the address of the list being added to.
+ * The URL is the address of the list being added to.
* <p>
- * If the list does not already exist, it will be created.
+ * If the list does not already exist, it will be created.
* <p>
- * This method expands the POJO model as necessary to create the new element.
+ * This method expands the POJO model as necessary to create the new element.
* <p>
- * Note: You can only post to three types of nodes:
- * <ul class='spaced-list'>
- * <li>{@link List Lists}
- * <li>{@link Map Maps} containing integers as keys (i.e sparse arrays)
- * <li>arrays
- * </ul>
+ * <h5 class='section'>Notes:</h5>
+ * <ul>
+ * <li>You can only post to three types of nodes:
+ * <ul class='spaced-list'>
+ * <li>{@link List Lists}
+ * <li>{@link Map Maps} containing integers as keys (i.e sparse arrays)
+ * <li>arrays
+ * </ul>
+ * </ul>
*
* @param url The URL of the element being added to.
- * If null or blank, the root itself (assuming it's one of the types specified above) is added to.
+ * <br>If <jk>null</jk> or blank, the root itself (assuming it's one of the types specified above) is added to.
* @param val The value being added.
* @return The URL of the element that was added.
*/
http://git-wip-us.apache.org/repos/asf/incubator-juneau/blob/30dd3b93/juneau-core/src/main/java/org/apache/juneau/utils/PojoRestException.java
----------------------------------------------------------------------
diff --git a/juneau-core/src/main/java/org/apache/juneau/utils/PojoRestException.java b/juneau-core/src/main/java/org/apache/juneau/utils/PojoRestException.java
index 2dc190c..ad74cef 100644
--- a/juneau-core/src/main/java/org/apache/juneau/utils/PojoRestException.java
+++ b/juneau-core/src/main/java/org/apache/juneau/utils/PojoRestException.java
@@ -38,7 +38,7 @@ public final class PojoRestException extends RuntimeException {
*
* @param status The HTTP-equivalent status code.
* @param message The detailed message.
- * @param args Optional message arguments.
+ * @param args Optional {@link MessageFormat}-style arguments.
*/
public PojoRestException(int status, String message, Object...args) {
super(args.length == 0 ? message : MessageFormat.format(message, args));
http://git-wip-us.apache.org/repos/asf/incubator-juneau/blob/30dd3b93/juneau-core/src/main/java/org/apache/juneau/utils/ProcBuilder.java
----------------------------------------------------------------------
diff --git a/juneau-core/src/main/java/org/apache/juneau/utils/ProcBuilder.java b/juneau-core/src/main/java/org/apache/juneau/utils/ProcBuilder.java
index 6b253e2..376317b 100644
--- a/juneau-core/src/main/java/org/apache/juneau/utils/ProcBuilder.java
+++ b/juneau-core/src/main/java/org/apache/juneau/utils/ProcBuilder.java
@@ -71,7 +71,7 @@ public class ProcBuilder {
* Command arguments if the specified matcher matches.
* Can be used for specifying os-specific commands.
*
- * <h6 class='topic'>Example:</h6>
+ * <h5 class='section'>Example:</h5>
* <p class='bcode'>
* ProcessBuilder pb = ProcessBuilder
* .create()
http://git-wip-us.apache.org/repos/asf/incubator-juneau/blob/30dd3b93/juneau-core/src/main/java/org/apache/juneau/xml/XmlDocSerializer.java
----------------------------------------------------------------------
diff --git a/juneau-core/src/main/java/org/apache/juneau/xml/XmlDocSerializer.java b/juneau-core/src/main/java/org/apache/juneau/xml/XmlDocSerializer.java
index eb58b7c..501de0f 100644
--- a/juneau-core/src/main/java/org/apache/juneau/xml/XmlDocSerializer.java
+++ b/juneau-core/src/main/java/org/apache/juneau/xml/XmlDocSerializer.java
@@ -20,13 +20,13 @@ import org.apache.juneau.serializer.*;
/**
* Serializes POJOs to HTTP responses as XML.
*
- * <h6 class='topic'>Media types</h6>
+ * <h5 class='section'>Media types:</h5>
* <p>
* Handles <code>Accept</code> types: <code>text/xml</code>
* <p>
* Produces <code>Content-Type</code> types: <code>text/xml</code>
*
- * <h6 class='topic'>Description</h6>
+ * <h5 class='section'>Description:</h5>
* <p>
* Same as {@link XmlSerializer}, except prepends <code><xt><?xml</xt> <xa>version</xa>=<xs>'1.0'</xs> <xa>encoding</xa>=<xs>'UTF-8'</xs><xt>?></xt></code> to the response
* to make it a valid XML document.
http://git-wip-us.apache.org/repos/asf/incubator-juneau/blob/30dd3b93/juneau-core/src/main/java/org/apache/juneau/xml/XmlParser.java
----------------------------------------------------------------------
diff --git a/juneau-core/src/main/java/org/apache/juneau/xml/XmlParser.java b/juneau-core/src/main/java/org/apache/juneau/xml/XmlParser.java
index 29dea9f..0e04e3f 100644
--- a/juneau-core/src/main/java/org/apache/juneau/xml/XmlParser.java
+++ b/juneau-core/src/main/java/org/apache/juneau/xml/XmlParser.java
@@ -31,15 +31,15 @@ import org.apache.juneau.xml.annotation.*;
/**
* Parses text generated by the {@link XmlSerializer} class back into a POJO model.
*
- * <h6 class='topic'>Media types</h6>
+ * <h5 class='section'>Media types:</h5>
* <p>
* Handles <code>Content-Type</code> types: <code>text/xml</code>
*
- * <h6 class='topic'>Description</h6>
+ * <h5 class='section'>Description:</h5>
* <p>
* See the {@link XmlSerializer} class for a description of Juneau-generated XML.
*
- * <h6 class='topic'>Configurable properties</h6>
+ * <h5 class='section'>Configurable properties:</h5>
* <p>
* This class has the following properties associated with it:
* <ul>
@@ -510,7 +510,6 @@ public class XmlParser extends ReaderParser {
@Override /* Parser */
protected <T> T doParse(ParserSession session, ClassMeta<T> type) throws Exception {
XmlParserSession s = (XmlParserSession)session;
- type = session.normalizeClassMeta(type);
return parseAnything(s, type, null, s.getXmlStreamReader(), s.getOuter(), true, null);
}
http://git-wip-us.apache.org/repos/asf/incubator-juneau/blob/30dd3b93/juneau-core/src/main/java/org/apache/juneau/xml/XmlParserContext.java
----------------------------------------------------------------------
diff --git a/juneau-core/src/main/java/org/apache/juneau/xml/XmlParserContext.java b/juneau-core/src/main/java/org/apache/juneau/xml/XmlParserContext.java
index 765fbd6..a5b6802 100644
--- a/juneau-core/src/main/java/org/apache/juneau/xml/XmlParserContext.java
+++ b/juneau-core/src/main/java/org/apache/juneau/xml/XmlParserContext.java
@@ -84,11 +84,11 @@ import org.apache.juneau.parser.*;
* </tr>
* </table>
*
- * <h6 class='topic'>Configurable properties inherited from parent classes</h6>
+ * <h5 class='section'>Inherited configurable properties:</h5>
* <ul class='javahierarchy'>
- * <li class='c'><a class='doclink' href='../BeanContext.html#ConfigProperties'>BeanContext</a> - Properties associated with handling beans on serializers and parsers.
+ * <li class='c'><a class="doclink" href="../BeanContext.html#ConfigProperties">BeanContext</a> - Properties associated with handling beans on serializers and parsers.
* <ul>
- * <li class='c'><a class='doclink' href='../parser/ParserContext.html#ConfigProperties'>ParserContext</a> - Configurable properties common to all parsers.
+ * <li class='c'><a class="doclink" href="../parser/ParserContext.html#ConfigProperties">ParserContext</a> - Configurable properties common to all parsers.
* </ul>
* </ul>
*/
@@ -135,7 +135,10 @@ public class XmlParserContext extends ParserContext {
* <p>
* Associates an {@link XMLReporter} with this parser.
* <p>
- * Note: Reporters are not copied to new parsers during a clone.
+ * <h5 class='section'>Notes:</h5>
+ * <ul>
+ * <li>Reporters are not copied to new parsers during a clone.
+ * </ul>
*/
public static final String XML_reporter = "XmlParser.reporter";
http://git-wip-us.apache.org/repos/asf/incubator-juneau/blob/30dd3b93/juneau-core/src/main/java/org/apache/juneau/xml/XmlSchemaDocSerializer.java
----------------------------------------------------------------------
diff --git a/juneau-core/src/main/java/org/apache/juneau/xml/XmlSchemaDocSerializer.java b/juneau-core/src/main/java/org/apache/juneau/xml/XmlSchemaDocSerializer.java
index 95a8024..195abf1 100644
--- a/juneau-core/src/main/java/org/apache/juneau/xml/XmlSchemaDocSerializer.java
+++ b/juneau-core/src/main/java/org/apache/juneau/xml/XmlSchemaDocSerializer.java
@@ -18,13 +18,13 @@ import org.apache.juneau.serializer.*;
/**
* Serializes POJO metadata to HTTP responses as XML.
*
- * <h6 class='topic'>Media types</h6>
+ * <h5 class='section'>Media types:</h5>
* <p>
* Handles <code>Accept</code> types: <code>text/xml+schema</code>
* <p>
* Produces <code>Content-Type</code> types: <code>text/xml</code>
*
- * <h6 class='topic'>Description</h6>
+ * <h5 class='section'>Description:</h5>
* <p>
* Same as {@link XmlSchemaSerializer}, except prepends <code><xt><?xml</xt> <xa>version</xa>=<xs>'1.0'</xs> <xa>encoding</xa>=<xs>'UTF-8'</xs><xt>?></xt></code> to the response
* to make it a valid XML document.
http://git-wip-us.apache.org/repos/asf/incubator-juneau/blob/30dd3b93/juneau-core/src/main/java/org/apache/juneau/xml/XmlSchemaSerializer.java
----------------------------------------------------------------------
diff --git a/juneau-core/src/main/java/org/apache/juneau/xml/XmlSchemaSerializer.java b/juneau-core/src/main/java/org/apache/juneau/xml/XmlSchemaSerializer.java
index 35effd0..01d8138 100644
--- a/juneau-core/src/main/java/org/apache/juneau/xml/XmlSchemaSerializer.java
+++ b/juneau-core/src/main/java/org/apache/juneau/xml/XmlSchemaSerializer.java
@@ -35,17 +35,17 @@ import org.w3c.dom.ls.*;
/**
* Serializes POJO metadata to HTTP responses as XML.
*
- * <h6 class='topic'>Media types</h6>
+ * <h5 class='section'>Media types:</h5>
* <p>
* Handles <code>Accept</code> types: <code>text/xml+schema</code>
* <p>
* Produces <code>Content-Type</code> types: <code>text/xml</code>
*
- * <h6 class='topic'>Description</h6>
+ * <h5 class='section'>Description:</h5>
* <p>
* Produces the XML-schema representation of the XML produced by the {@link XmlSerializer} class with the same properties.
*
- * <h6 class='topic'>Configurable properties</h6>
+ * <h5 class='section'>Configurable properties:</h5>
* <p>
* This class has the following properties associated with it:
* <ul>
http://git-wip-us.apache.org/repos/asf/incubator-juneau/blob/30dd3b93/juneau-core/src/main/java/org/apache/juneau/xml/XmlSerializer.java
----------------------------------------------------------------------
diff --git a/juneau-core/src/main/java/org/apache/juneau/xml/XmlSerializer.java b/juneau-core/src/main/java/org/apache/juneau/xml/XmlSerializer.java
index e8e0bbf..3a86e00 100644
--- a/juneau-core/src/main/java/org/apache/juneau/xml/XmlSerializer.java
+++ b/juneau-core/src/main/java/org/apache/juneau/xml/XmlSerializer.java
@@ -31,13 +31,13 @@ import org.apache.juneau.xml.annotation.*;
/**
* Serializes POJO models to XML.
*
- * <h6 class='topic'>Media types</h6>
+ * <h5 class='section'>Media types:</h5>
* <p>
* Handles <code>Accept</code> types: <code>text/xml</code>
* <p>
* Produces <code>Content-Type</code> types: <code>text/xml</code>
*
- * <h6 class='topic'>Description</h6>
+ * <h5 class='section'>Description:</h5>
* <p>
* See the {@link JsonSerializer} class for details on how Java models map to JSON.
* <p>
@@ -105,7 +105,7 @@ import org.apache.juneau.xml.annotation.*;
* <p>
* If an attribute name contains any non-valid XML element characters, they will be escaped using standard {@code _x####_} notation.
*
- * <h6 class='topic'>Configurable properties</h6>
+ * <h5 class='section'>Configurable properties:</h5>
* <p>
* This class has the following properties associated with it:
* <ul>
http://git-wip-us.apache.org/repos/asf/incubator-juneau/blob/30dd3b93/juneau-core/src/main/java/org/apache/juneau/xml/XmlSerializerContext.java
----------------------------------------------------------------------
diff --git a/juneau-core/src/main/java/org/apache/juneau/xml/XmlSerializerContext.java b/juneau-core/src/main/java/org/apache/juneau/xml/XmlSerializerContext.java
index d1d51df..215a5e1 100644
--- a/juneau-core/src/main/java/org/apache/juneau/xml/XmlSerializerContext.java
+++ b/juneau-core/src/main/java/org/apache/juneau/xml/XmlSerializerContext.java
@@ -81,11 +81,11 @@ import org.apache.juneau.serializer.*;
* </tr>
* </table>
*
- * <h6 class='topic'>Configurable properties inherited from parent classes</h6>
+ * <h5 class='section'>Inherited configurable properties:</h5>
* <ul class='javahierarchy'>
- * <li class='c'><a class='doclink' href='../BeanContext.html#ConfigProperties'>BeanContext</a> - Properties associated with handling beans on serializers and parsers.
+ * <li class='c'><a class="doclink" href="../BeanContext.html#ConfigProperties">BeanContext</a> - Properties associated with handling beans on serializers and parsers.
* <ul>
- * <li class='c'><a class='doclink' href='../serializer/SerializerContext.html#ConfigProperties'>SerializerContext</a> - Configurable properties common to all serializers.
+ * <li class='c'><a class="doclink" href="../serializer/SerializerContext.html#ConfigProperties">SerializerContext</a> - Configurable properties common to all serializers.
* </ul>
* </ul>
*/
@@ -127,10 +127,12 @@ public class XmlSerializerContext extends SerializerContext {
* <p>
* This setting is ignored if {@link #XML_enableNamespaces} is not enabled.
* <p>
- * <b>IMPORTANT NOTE:</b>
- * Auto-detection of namespaces can be costly performance-wise.
- * In high-performance environments, it's recommended that namespace detection be
- * disabled, and that namespaces be manually defined through the {@link #XML_namespaces} property.
+ * <h5 class='section'>Notes:</h5>
+ * <ul>
+ * <li>Auto-detection of namespaces can be costly performance-wise.
+ * In high-performance environments, it's recommended that namespace detection be
+ * disabled, and that namespaces be manually defined through the {@link #XML_namespaces} property.
+ * </ul>
*/
public static final String XML_autoDetectNamespaces = "XmlSerializer.autoDetectNamespaces";
http://git-wip-us.apache.org/repos/asf/incubator-juneau/blob/30dd3b93/juneau-core/src/main/java/org/apache/juneau/xml/XmlWriter.java
----------------------------------------------------------------------
diff --git a/juneau-core/src/main/java/org/apache/juneau/xml/XmlWriter.java b/juneau-core/src/main/java/org/apache/juneau/xml/XmlWriter.java
index 281e664..1140561 100644
--- a/juneau-core/src/main/java/org/apache/juneau/xml/XmlWriter.java
+++ b/juneau-core/src/main/java/org/apache/juneau/xml/XmlWriter.java
@@ -20,7 +20,10 @@ import org.apache.juneau.xml.annotation.*;
/**
* Specialized writer for serializing XML.
* <p>
- * <b>Note: This class is not intended for external use.</b>
+ * <h5 class='section'>Notes:</h5>
+ * <ul>
+ * <li>This class is not intended for external use.
+ * </ul>
*/
public class XmlWriter extends SerializerWriter {
http://git-wip-us.apache.org/repos/asf/incubator-juneau/blob/30dd3b93/juneau-core/src/main/java/org/apache/juneau/xml/annotation/Xml.java
----------------------------------------------------------------------
diff --git a/juneau-core/src/main/java/org/apache/juneau/xml/annotation/Xml.java b/juneau-core/src/main/java/org/apache/juneau/xml/annotation/Xml.java
index e901f58..5d53451 100644
--- a/juneau-core/src/main/java/org/apache/juneau/xml/annotation/Xml.java
+++ b/juneau-core/src/main/java/org/apache/juneau/xml/annotation/Xml.java
@@ -40,7 +40,7 @@ public @interface Xml {
* <p>
* Applies only to collection and array bean properties.
*
- * <h6 class='topic'>Example:</h6>
+ * <h5 class='section'>Example:</h5>
* <p class='bcode'>
* <jk>public class</jk> MyBean {
* <ja>@Xml</ja>(childName=<js>"child"</js>}
@@ -98,7 +98,7 @@ public @interface Xml {
/**
* The {@link XmlFormat} to use for serializing this object type.
*
- * <h6 class='topic'>Example:</h6>
+ * <h5 class='section'>Example:</h5>
* <p class='bcode'>
* <jk>public class</jk> MyBean {
*
http://git-wip-us.apache.org/repos/asf/incubator-juneau/blob/30dd3b93/juneau-core/src/main/java/org/apache/juneau/xml/annotation/XmlSchema.java
----------------------------------------------------------------------
diff --git a/juneau-core/src/main/java/org/apache/juneau/xml/annotation/XmlSchema.java b/juneau-core/src/main/java/org/apache/juneau/xml/annotation/XmlSchema.java
index adf06e5..1bd5945 100644
--- a/juneau-core/src/main/java/org/apache/juneau/xml/annotation/XmlSchema.java
+++ b/juneau-core/src/main/java/org/apache/juneau/xml/annotation/XmlSchema.java
@@ -52,7 +52,7 @@ public @interface XmlSchema {
* <p>
* Inherited by child packages.
*
- * <h6 class='topic'>Example:</h6>
+ * <h5 class='section'>Example:</h5>
* <p>
* Contents of <code>package-info.java</code>...
* </p>
http://git-wip-us.apache.org/repos/asf/incubator-juneau/blob/30dd3b93/juneau-core/src/main/javadoc/javadoc.css
----------------------------------------------------------------------
diff --git a/juneau-core/src/main/javadoc/javadoc.css b/juneau-core/src/main/javadoc/javadoc.css
index 66d7637..dc99fdb 100755
--- a/juneau-core/src/main/javadoc/javadoc.css
+++ b/juneau-core/src/main/javadoc/javadoc.css
@@ -673,3 +673,8 @@ h1.hidden {
font-weight: bold;
}
+h5.section, h6.section {
+ color: #4e4e4e;
+ margin: 10px 0 5px 0;
+}
+
http://git-wip-us.apache.org/repos/asf/incubator-juneau/blob/30dd3b93/juneau-core/src/main/javadoc/overview.html
----------------------------------------------------------------------
diff --git a/juneau-core/src/main/javadoc/overview.html b/juneau-core/src/main/javadoc/overview.html
index f55c6a2..ce52a4e 100644
--- a/juneau-core/src/main/javadoc/overview.html
+++ b/juneau-core/src/main/javadoc/overview.html
@@ -388,12 +388,16 @@
<jc>// Parse a JSON object as a HashMap<String,Person>.</jc>
json = <js>"{a:{name:'John Smith',age:21},b:{name:'Joe Smith',age:42}}"</js>;
- Map<String,Person> m4 = parser.parseMap(json, HashMap.<jk>class</jk>, String.<jk>class</jk>, Person.<jk>class</jk>)
+ Map<String,Person> m4 = parser.parse(json, HashMap.<jk>class</jk>, String.<jk>class</jk>, Person.<jk>class</jk>)
+
+ <jc>// Parse a JSON object as a HashMap<String,LinkedList<Person>>.</jc>
+ json = <js>"{a:[{name:'John Smith',age:21},{name:'Joe Smith',age:42}]}"</js>;
+ Map<String,List<Person>> m5 = parser.parse(json, HashMap.<jk>class</jk>, String.<jk>class</jk>, LinkedList.<jk>class</jk>, Person.<jk>class</jk>)
<jc>// Parse a JSON array of integers as a Collection of Integers or int[] array.</jc>
json = <js>"[1,2,3]"</js>;
- List<Integer> l5 = parser.parseCollection(json, LinkedList.<jk>class</jk>, Integer.<jk>class</jk>);
- <jk>int</jk>[] i6 = parser.parse(json, <jk>int</jk>[].<jk>class</jk>);
+ List<Integer> l6 = parser.parse(json, LinkedList.<jk>class</jk>, Integer.<jk>class</jk>);
+ <jk>int</jk>[] i7 = parser.parse(json, <jk>int</jk>[].<jk>class</jk>);
</p>
<p>
The parsers can also be used to populating existing bean and collection objects:
@@ -5330,7 +5334,7 @@
<h5 class='toc'>What's new in each release</h5>
<ul class='toc'>
- <li><p><a class='doclink' href='#6.0.2'>6.0.2 (TBD)</a></p>
+ <li><p><a class='doclink' href='#6.1.0'>6.1.0 (TBD)</a></p>
<li><p><a class='doclink' href='#6.0.1'>6.0.1 (Jan 3, 2017)</a></p>
<li><p><a class='doclink' href='#6.0.0'>6.0.0 (Oct 3, 2016)</a></p>
<li><p><a class='doclink' href='#5.2.0.1'>5.2.0.1 (Mar 23, 2016)</a></p>
@@ -5397,12 +5401,11 @@
<!-- ======================================================================================================== -->
- <a id="6.0.2"></a>
- <h3 class='topic' onclick='toggle(this)'>6.0.2 (TBD)</h3>
+ <a id="6.1.0"></a>
+ <h3 class='topic' onclick='toggle(this)'>6.1.0 (TBD)</h3>
<div class='topic'>
<p>
- Juneau 6.0.2 is a moderate update that provides localized serialization and parsing.
- For example, dates can now be serialized to and parsed from locale-targeted formats.
+ Juneau 6.1.0 is a major update.
</p>
<p>
In particular, this release cleans up the {@link org.apache.juneau.BeanContext} API to match
@@ -5461,6 +5464,18 @@
<li>{@link org.apache.juneau.BeanContext#BEAN_timeZone} - Specifies a default timezone at the context level.
<li>{@link org.apache.juneau.BeanContext#BEAN_mediaType} - Specifies a default media type at the context level.
</ul>
+ <li>Improvements to Parser class:
+ <ul>
+ <li>Simplified the parse methods (e.g. <code>parseMap()</code>, <code>parseCollection()</code>)
+ by replacing them with two simple methods:
+ <ul>
+ <li>{@link org.apache.juneau.parser.Parser#parse(Object,Class)} - Normal method.
+ <li>{@link org.apache.juneau.parser.Parser#parse(Object,Type,Type...)} - Method for parsing into parameterized maps and collections.
+ </ul>
+ <li>Arbitrarily-complex parameterized maps and collections can now be parsed without the need for creating intermediate <code>ClassMeta</code> objects.
+ <li>No need for casting anymore if you were using the old <code>parseMap()</code> and <code>parseCollection()</code> methods!
+ <li>Changes allow me to eliminate <code>BeanContext.normalizeClassMeta()</code> method.
+ </ul>
<li>Simplified {@link org.apache.juneau.transform.PojoSwap} class. Now just two methods:
<ul>
<li>{@link org.apache.juneau.transform.PojoSwap#swap(BeanSession,Object)}
@@ -5521,7 +5536,7 @@
</ul>
<li>New {@link org.apache.juneau.transform.MapSwap} and {@link org.apache.juneau.transform.StringSwap} classes.
<li>New {@link org.apache.juneau.serializer.WriterSerializer#println(Object)} method. Useful for debugging purposes.
- <li>New {@link org.apache.juneau.BeanContext#getClassMeta(Object[])} and {@link org.apache.juneau.BeanSession#getClassMeta(Object[])}
+ <li>New {@link org.apache.juneau.BeanContext#getClassMeta(Type,Type...)} and {@link org.apache.juneau.BeanSession#getClassMeta(Type,Type...)}
methods for retrieving Map and Collection class metas.
Replaces the various <code>getMapClassMeta()</code>/<code>getCollectionClassMeta()</code> methods.
<li>New section added to this document: <a class='doclink' href='#DTOs'>Juneau Data Transfer Objects (org.apache.juneau.dto)</a>
@@ -5531,6 +5546,28 @@
<ul class='spaced-list'>
<li>{@link org.apache.juneau.rest.RestRequest} now passes locale and timezone to serializers/parsers/transforms.
<li>New {@link org.apache.juneau.rest.RestRequest#getTimeZone()} method.
+ <li>Standardized the following methods in {@link org.apache.juneau.rest.RestRequest} to remove dependency on <code>ClassMeta</code>
+ objects and eliminate the need for casts:
+ <ul>
+ <li>{@link org.apache.juneau.rest.RestRequest#getHeader(String,Class)}
+ <li>{@link org.apache.juneau.rest.RestRequest#getHeader(String,Object,Class)}
+ <li>{@link org.apache.juneau.rest.RestRequest#getHeader(String,Type,Type...)}
+ <li>{@link org.apache.juneau.rest.RestRequest#getQueryParameter(String,Class)}
+ <li>{@link org.apache.juneau.rest.RestRequest#getQueryParameter(String,Object,Class)}
+ <li>{@link org.apache.juneau.rest.RestRequest#getQueryParameter(String,Type,Type...)}
+ <li>{@link org.apache.juneau.rest.RestRequest#getQueryParameter(String,Object,Type,Type...)}
+ <li>{@link org.apache.juneau.rest.RestRequest#getQueryParameters(String,Class)}
+ <li>{@link org.apache.juneau.rest.RestRequest#getQueryParameters(String,Type,Type...)}
+ <li>{@link org.apache.juneau.rest.RestRequest#getFormDataParameter(String,Class)}
+ <li>{@link org.apache.juneau.rest.RestRequest#getFormDataParameter(String,Object,Class)}
+ <li>{@link org.apache.juneau.rest.RestRequest#getFormDataParameters(String,Class)}
+ <li>{@link org.apache.juneau.rest.RestRequest#getFormDataParameter(String,Type,Type...)}
+ <li>{@link org.apache.juneau.rest.RestRequest#getFormDataParameters(String,Type,Type...)}
+ <li>{@link org.apache.juneau.rest.RestRequest#getPathParameter(String,Class)}
+ <li>{@link org.apache.juneau.rest.RestRequest#getPathParameter(String,Type,Type...)}
+ <li>{@link org.apache.juneau.rest.RestRequest#getBody(Class)}
+ <li>{@link org.apache.juneau.rest.RestRequest#getBody(Type,Type...)}
+ </ul>
</ul>
</div>
@@ -6572,10 +6609,26 @@
<h6 class='topic'>Client</h6>
<ul class='spaced-list'>
- <li>New convenience methods in {@link org.apache.juneau.rest.client.RestCall}:
+ <li>New methods in {@link org.apache.juneau.rest.client.RestCall}:
<ol>
- <li>{@link org.apache.juneau.rest.client.RestCall#getResponseMap(Class,Class,Class)}
- <li>{@link org.apache.juneau.rest.client.RestCall#getResponseCollection(Class,Class)}
+<li>{@link org.apache.juneau.rest.RestRequest#getHeader(String,Class)}
+<li>{@link org.apache.juneau.rest.RestRequest#getHeader(String,Object,Class)}
+<li>{@link org.apache.juneau.rest.RestRequest#getHeader(String,Type,Type...)}
+<li>{@link org.apache.juneau.rest.RestRequest#getQueryParameter(String,Class)}
+<li>{@link org.apache.juneau.rest.RestRequest#getQueryParameter(String,Object,Class)}
+<li>{@link org.apache.juneau.rest.RestRequest#getQueryParameter(String,Type,Type...)}
+<li>{@link org.apache.juneau.rest.RestRequest#getQueryParameter(String,Object,Type,Type...)}
+<li>{@link org.apache.juneau.rest.RestRequest#getQueryParameters(String,Class)}
+<li>{@link org.apache.juneau.rest.RestRequest#getQueryParameters(String,Type,Type...)}
+<li>{@link org.apache.juneau.rest.RestRequest#getFormDataParameter(String,Class)}
+<li>{@link org.apache.juneau.rest.RestRequest#getFormDataParameter(String,Object,Class)}
+<li>{@link org.apache.juneau.rest.RestRequest#getFormDataParameters(String,Class)}
+<li>{@link org.apache.juneau.rest.RestRequest#getFormDataParameter(String,Type,Type...)}
+<li>{@link org.apache.juneau.rest.RestRequest#getFormDataParameters(String,Type,Type...)}
+<li>{@link org.apache.juneau.rest.RestRequest#getPathParameter(String,Class)}
+<li>{@link org.apache.juneau.rest.RestRequest#getPathParameter(String,Type,Type...)}
+<li>{@link org.apache.juneau.rest.RestRequest#getBody(Class)}
+<li>{@link org.apache.juneau.rest.RestRequest#getBody(Type,Type...)}
</ol>
</li>
</ul>
http://git-wip-us.apache.org/repos/asf/incubator-juneau/blob/30dd3b93/juneau-examples-rest/juneau-examples-rest.launch
----------------------------------------------------------------------
diff --git a/juneau-examples-rest/juneau-examples-rest.launch b/juneau-examples-rest/juneau-examples-rest.launch
new file mode 100644
index 0000000..129975b
--- /dev/null
+++ b/juneau-examples-rest/juneau-examples-rest.launch
@@ -0,0 +1,30 @@
+<?xml version="1.0" encoding="UTF-8" standalone="no"?>
+<!--
+ ***************************************************************************************************************************
+ * 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. *
+ ***************************************************************************************************************************
+-->
+<launchConfiguration type="org.eclipse.jdt.launching.localJavaApplication">
+<stringAttribute key="bad_container_name" value="/juneau-examples"/>
+<listAttribute key="org.eclipse.debug.core.MAPPED_RESOURCE_PATHS">
+<listEntry value="/juneau-microservice/src/main/java/org/apache/juneau/microservice/RestMicroservice.java"/>
+</listAttribute>
+<listAttribute key="org.eclipse.debug.core.MAPPED_RESOURCE_TYPES">
+<listEntry value="1"/>
+</listAttribute>
+<booleanAttribute key="org.eclipse.jdt.debug.ui.CONSIDER_INHERITED_MAIN" value="true"/>
+<booleanAttribute key="org.eclipse.jdt.debug.ui.INCLUDE_EXTERNAL_JARS" value="true"/>
+<booleanAttribute key="org.eclipse.jdt.launching.ATTR_USE_START_ON_FIRST_THREAD" value="true"/>
+<stringAttribute key="org.eclipse.jdt.launching.MAIN_TYPE" value="org.apache.juneau.microservice.RestMicroservice"/>
+<stringAttribute key="org.eclipse.jdt.launching.PROGRAM_ARGUMENTS" value="examples.cfg"/>
+<stringAttribute key="org.eclipse.jdt.launching.PROJECT_ATTR" value="juneau-examples-rest"/>
+</launchConfiguration>
http://git-wip-us.apache.org/repos/asf/incubator-juneau/blob/30dd3b93/juneau-examples-rest/src/main/java/org/apache/juneau/examples/rest/MethodExampleResource.java
----------------------------------------------------------------------
diff --git a/juneau-examples-rest/src/main/java/org/apache/juneau/examples/rest/MethodExampleResource.java b/juneau-examples-rest/src/main/java/org/apache/juneau/examples/rest/MethodExampleResource.java
index c523cbf..c056a09 100644
--- a/juneau-examples-rest/src/main/java/org/apache/juneau/examples/rest/MethodExampleResource.java
+++ b/juneau-examples-rest/src/main/java/org/apache/juneau/examples/rest/MethodExampleResource.java
@@ -71,7 +71,7 @@ public class MethodExampleResource extends Resource {
UUID a3 = req.getPathParameter("a3", UUID.class);
// Optional GET parameters
- int p1 = req.getQueryParameter("p1", int.class, 0);
+ int p1 = req.getQueryParameter("p1", 0, int.class);
String p2 = req.getQueryParameter("p2", String.class);
UUID p3 = req.getQueryParameter("p3", UUID.class);
http://git-wip-us.apache.org/repos/asf/incubator-juneau/blob/30dd3b93/juneau-microservice/src/main/java/org/apache/juneau/microservice/Microservice.java
----------------------------------------------------------------------
diff --git a/juneau-microservice/src/main/java/org/apache/juneau/microservice/Microservice.java b/juneau-microservice/src/main/java/org/apache/juneau/microservice/Microservice.java
index 6efd127..e604231 100755
--- a/juneau-microservice/src/main/java/org/apache/juneau/microservice/Microservice.java
+++ b/juneau-microservice/src/main/java/org/apache/juneau/microservice/Microservice.java
@@ -220,7 +220,7 @@ public abstract class Microservice {
* <p>
* Subclasses can override this method to provide their own variables.
*
- * <h6 class='topic'>Example:</h6>
+ * <h5 class='section'>Example:</h5>
* <p class='bcode'>
* <jd>/**
* * Augment default var resolver with a custom $B{...} variable that simply wraps strings inside square brackets.
@@ -289,7 +289,7 @@ public abstract class Microservice {
* <p>
* This method can be called from the class constructor.
*
- * <h6 class='topic'>Example:</h6>
+ * <h5 class='section'>Example:</h5>
* <p class='bcode'>
* <cc>#--------------------------</cc>
* <cc># My section</cc>
@@ -367,7 +367,7 @@ public abstract class Microservice {
* <p>
* This method can be called from the class constructor.
*
- * <h6 class='topic'>Example:</h6>
+ * <h5 class='section'>Example:</h5>
* <p class='bcode'>
* <jc>// Get Main-Class from manifest file.</jc>
* String mainClass = Microservice.<jsm>getManifest</jsm>().getString(<js>"Main-Class"</js>, <js>"unknown"</js>);
http://git-wip-us.apache.org/repos/asf/incubator-juneau/blob/30dd3b93/juneau-microservice/src/main/java/org/apache/juneau/microservice/RestMicroservice.java
----------------------------------------------------------------------
diff --git a/juneau-microservice/src/main/java/org/apache/juneau/microservice/RestMicroservice.java b/juneau-microservice/src/main/java/org/apache/juneau/microservice/RestMicroservice.java
index 839f606..a86eb4c 100755
--- a/juneau-microservice/src/main/java/org/apache/juneau/microservice/RestMicroservice.java
+++ b/juneau-microservice/src/main/java/org/apache/juneau/microservice/RestMicroservice.java
@@ -85,7 +85,7 @@ public class RestMicroservice extends Microservice {
/**
* Constructor.
*
- * @param args The command line arguments.
+ * @param args Command line arguments.
* @throws Exception
*/
public RestMicroservice(String...args) throws Exception {
http://git-wip-us.apache.org/repos/asf/incubator-juneau/blob/30dd3b93/juneau-rest-client/src/main/java/org/apache/juneau/rest/client/AllowAllRedirects.java
----------------------------------------------------------------------
diff --git a/juneau-rest-client/src/main/java/org/apache/juneau/rest/client/AllowAllRedirects.java b/juneau-rest-client/src/main/java/org/apache/juneau/rest/client/AllowAllRedirects.java
index 619bfca..044e3b1 100644
--- a/juneau-rest-client/src/main/java/org/apache/juneau/rest/client/AllowAllRedirects.java
+++ b/juneau-rest-client/src/main/java/org/apache/juneau/rest/client/AllowAllRedirects.java
@@ -17,8 +17,11 @@ import org.apache.http.impl.client.*;
/**
* Redirect strategy that allows for redirects on any request type, not just <code>GET</code> or <code>HEAD</code>.
* <p>
- * Note: This class is similar to <code>org.apache.http.impl.client.LaxRedirectStrategy</code>
- * in Apache HttpClient 4.2, but also allows for redirects on <code>PUTs</code> and <code>DELETEs</code>.
+ * <h5 class='section'>Notes:</h5>
+ * <ul>
+ * <li>This class is similar to <code>org.apache.http.impl.client.LaxRedirectStrategy</code>
+ * in Apache HttpClient 4.2, but also allows for redirects on <code>PUTs</code> and <code>DELETEs</code>.
+ * </ul>
*/
public class AllowAllRedirects extends DefaultRedirectStrategy {
http://git-wip-us.apache.org/repos/asf/incubator-juneau/blob/30dd3b93/juneau-rest-client/src/main/java/org/apache/juneau/rest/client/NameValuePairs.java
----------------------------------------------------------------------
diff --git a/juneau-rest-client/src/main/java/org/apache/juneau/rest/client/NameValuePairs.java b/juneau-rest-client/src/main/java/org/apache/juneau/rest/client/NameValuePairs.java
index da6393a..ee97ac1 100644
--- a/juneau-rest-client/src/main/java/org/apache/juneau/rest/client/NameValuePairs.java
+++ b/juneau-rest-client/src/main/java/org/apache/juneau/rest/client/NameValuePairs.java
@@ -21,7 +21,7 @@ import org.apache.http.client.entity.*;
* Convenience class for constructing instances of <code>List<NameValuePair></code>
* for the {@link UrlEncodedFormEntity} class.
*
- * <h6 class='topic'>Example:</h6>
+ * <h5 class='section'>Example:</h5>
* <p class='bcode'>
* NameValuePairs params = <jk>new</jk> NameValuePairs()
* .append(<jk>new</jk> BasicNameValuePair(<js>"j_username"</js>, user))
http://git-wip-us.apache.org/repos/asf/incubator-juneau/blob/30dd3b93/juneau-rest-client/src/main/java/org/apache/juneau/rest/client/ResponsePattern.java
----------------------------------------------------------------------
diff --git a/juneau-rest-client/src/main/java/org/apache/juneau/rest/client/ResponsePattern.java b/juneau-rest-client/src/main/java/org/apache/juneau/rest/client/ResponsePattern.java
index 7398bd1..b56797f 100644
--- a/juneau-rest-client/src/main/java/org/apache/juneau/rest/client/ResponsePattern.java
+++ b/juneau-rest-client/src/main/java/org/apache/juneau/rest/client/ResponsePattern.java
@@ -20,7 +20,7 @@ import java.util.regex.*;
* <p>
* Response patterns are applied to REST calls through the {@link RestCall#addResponsePattern(ResponsePattern)} method.
*
- * <h6 class='topic'>Example:</h6>
+ * <h5 class='section'>Example:</h5>
* This example shows how to use a response pattern finder to find and capture patterns for <js>"x=number"</js> and <js>"y=string"</js>
* from a response body.
* <p>
http://git-wip-us.apache.org/repos/asf/incubator-juneau/blob/30dd3b93/juneau-rest-client/src/main/java/org/apache/juneau/rest/client/RestCall.java
----------------------------------------------------------------------
diff --git a/juneau-rest-client/src/main/java/org/apache/juneau/rest/client/RestCall.java b/juneau-rest-client/src/main/java/org/apache/juneau/rest/client/RestCall.java
index b49c59a..5fbf663 100644
--- a/juneau-rest-client/src/main/java/org/apache/juneau/rest/client/RestCall.java
+++ b/juneau-rest-client/src/main/java/org/apache/juneau/rest/client/RestCall.java
@@ -13,6 +13,7 @@
package org.apache.juneau.rest.client;
import java.io.*;
+import java.lang.reflect.*;
import java.net.*;
import java.util.*;
import java.util.logging.*;
@@ -47,9 +48,9 @@ import org.apache.juneau.utils.*;
* <p>
* The actual connection and request/response transaction occurs when calling one of the <code>getResponseXXX()</code> methods.
*
- * <h6 class='topic'>Additional Information</h6>
+ * <h5 class='section'>Additional information:</h5>
* <ul>
- * <li><a class='doclink' href='package-summary.html#RestClient'>org.apache.juneau.rest.client > REST client API</a> for more information and code examples.
+ * <li><a class="doclink" href="package-summary.html#RestClient">org.apache.juneau.rest.client > REST client API</a> for more information and code examples.
* </ul>
*/
public final class RestCall {
@@ -339,7 +340,7 @@ public final class RestCall {
* This method uses {@link #getCapturedResponse()} to read the response text and so does not affect the other output
* methods such as {@link #getResponseAsString()}.
*
- * <h6 class='topic'>Example:</h6>
+ * <h5 class='section'>Example:</h5>
* <p class='bcode'>
* <jc>// Throw a RestCallException if FAILURE or ERROR is found in the output.</jc>
* restClient.doGet(<jsf>URL</jsf>)
@@ -370,7 +371,7 @@ public final class RestCall {
* This method uses {@link #getCapturedResponse()} to read the response text and so does not affect the other output
* methods such as {@link #getResponseAsString()}.
*
- * <h6 class='topic'>Example:</h6>
+ * <h5 class='section'>Example:</h5>
* <p class='bcode'>
* <jc>// Throw a RestCallException if SUCCESS is not found in the output.</jc>
* restClient.doGet(<jsf>URL</jsf>)
@@ -446,7 +447,7 @@ public final class RestCall {
* The response entity is discarded unless one of the pipe methods have been specified to pipe the
* output to an output stream or writer.
*
- * <h6 class='topic'>Example:</h6>
+ * <h5 class='section'>Example:</h5>
* <p class='bcode'>
* <jk>try</jk> {
* RestClient client = <jk>new</jk> RestClient();
@@ -745,6 +746,38 @@ public final class RestCall {
}
/**
+ * Same as {@link #getResponse(Class)}, but useful for parsing into maps and collections of specific types.
+ *
+ * @param type The class to resolve.
+ * Can be any of the following:
+ * <ul>
+ * <li>{@link ClassMeta}
+ * <li>{@link Class}
+ * <li>{@link ParameterizedType}
+ * <li>{@link GenericArrayType}
+ * </ul>
+ * @param args The type arguments of the class if it's a collection or map.
+ * Can be any of the following:
+ * <ul>
+ * <li>{@link ClassMeta}
+ * <li>{@link Class}
+ * <li>{@link ParameterizedType}
+ * <li>{@link GenericArrayType}
+ * </ul>
+ * @param <T> The class to convert the input to.
+ * @return The parsed output.
+ * @throws IOException If a connection error occurred.
+ * @throws ParseException If the input contains a syntax error or is malformed for the <code>Content-Type</code> header.
+ */
+ @SuppressWarnings("unchecked")
+ public <T> T getResponse(Type type, Type...args) throws IOException, ParseException {
+ BeanContext bc = getParser().getBeanContext();
+ if (bc == null)
+ bc = BeanContext.DEFAULT;
+ return (T)getResponse(bc.getClassMeta(type, args));
+ }
+
+ /**
* Parses the output from the connection into the specified type and then wraps that in a {@link PojoRest}.
* <p>
* Useful if you want to quickly retrieve a single value from inside of a larger JSON document.
@@ -771,61 +804,6 @@ public final class RestCall {
return getResponsePojoRest(ObjectMap.class);
}
- /**
- * Convenience method when you want to parse into a Map<K,V> object.
- *
- * <h6 class='topic'>Example:</h6>
- * <p class='bcode'>
- * Map<String,MyBean> m = client.doGet(url).getResponseMap(LinkedHashMap.<jk>class</jk>, String.<jk>class</jk>, MyBean.<jk>class</jk>);
- * </p>
- * <p>
- * A simpler approach is often to just extend the map class you want and just use the normal {@link #getResponse(Class)} method:
- * </p>
- * <p class='bcode'>
- * <jk>public static class</jk> MyMap <jk>extends</jk> LinkedHashMap<String,MyBean> {}
- *
- * Map<String,MyBean> m = client.doGet(url).getResponse(MyMap.<jk>class</jk>);
- * </p>
- *
- * @param mapClass The map class to use (e.g. <code>TreeMap</code>)
- * @param keyClass The class type of the keys (e.g. <code>String</code>)
- * @param valueClass The class type of the values (e.g. <code>MyBean</code>)
- * @return The response parsed as a map.
- * @throws ParseException
- * @throws IOException
- */
- public final <K,V,T extends Map<K,V>> T getResponseMap(Class<T> mapClass, Class<K> keyClass, Class<V> valueClass) throws ParseException, IOException {
- ClassMeta<T> cm = getBeanContext().getClassMeta(mapClass, keyClass, valueClass);
- return getResponse(cm);
- }
-
- /**
- * Convenience method when you want to parse into a Collection<E> object.
- *
- * <h6 class='topic'>Example:</h6>
- * <p class='bcode'>
- * List<MyBean> l = client.doGet(url).getResponseCollection(LinkedList.<jk>class</jk>, MyBean.<jk>class</jk>);
- * </p>
- * <p>
- * A simpler approach is often to just extend the collection class you want and just use the normal {@link #getResponse(Class)} method:
- * </p>
- * <p class='bcode'>
- * <jk>public static class</jk> MyList <jk>extends</jk> LinkedList<MyBean> {}
- *
- * List<MyBean> l = client.doGet(url).getResponse(MyList.<jk>class</jk>);
- * </p>
- *
- * @param collectionClass The collection class to use (e.g. <code>LinkedList</code>)
- * @param entryClass The class type of the values (e.g. <code>MyBean</code>)
- * @return The response parsed as a collection.
- * @throws ParseException
- * @throws IOException
- */
- public final <E,T extends Collection<E>> T getResponseCollection(Class<T> collectionClass, Class<E> entryClass) throws ParseException, IOException {
- ClassMeta<T> cm = getBeanContext().getClassMeta(collectionClass, entryClass);
- return getResponse(cm);
- }
-
<T> T getResponse(ClassMeta<T> type) throws IOException, ParseException {
try {
Parser p = getParser();
http://git-wip-us.apache.org/repos/asf/incubator-juneau/blob/30dd3b93/juneau-rest-client/src/main/java/org/apache/juneau/rest/client/RestClient.java
----------------------------------------------------------------------
diff --git a/juneau-rest-client/src/main/java/org/apache/juneau/rest/client/RestClient.java b/juneau-rest-client/src/main/java/org/apache/juneau/rest/client/RestClient.java
index a088461..54ee36d 100644
--- a/juneau-rest-client/src/main/java/org/apache/juneau/rest/client/RestClient.java
+++ b/juneau-rest-client/src/main/java/org/apache/juneau/rest/client/RestClient.java
@@ -63,9 +63,9 @@ import org.apache.juneau.urlencoding.*;
* <li>API for interacting with remoteable services.
* </ul>
*
- * <h6 class='topic'>Additional Information</h6>
+ * <h5 class='section'>Additional information:</h5>
* <ul>
- * <li><a class='doclink' href='package-summary.html#RestClient'>org.apache.juneau.rest.client > REST client API</a> for more information and code examples.
+ * <li><a class="doclink" href="package-summary.html#RestClient">org.apache.juneau.rest.client > REST client API</a> for more information and code examples.
* </ul>
*/
public class RestClient extends CoreApi {
http://git-wip-us.apache.org/repos/asf/incubator-juneau/blob/30dd3b93/juneau-rest-client/src/main/java/org/apache/juneau/rest/client/SerializedNameValuePair.java
----------------------------------------------------------------------
diff --git a/juneau-rest-client/src/main/java/org/apache/juneau/rest/client/SerializedNameValuePair.java b/juneau-rest-client/src/main/java/org/apache/juneau/rest/client/SerializedNameValuePair.java
index 51de853..17a7dde 100644
--- a/juneau-rest-client/src/main/java/org/apache/juneau/rest/client/SerializedNameValuePair.java
+++ b/juneau-rest-client/src/main/java/org/apache/juneau/rest/client/SerializedNameValuePair.java
@@ -24,7 +24,7 @@ import org.apache.juneau.urlencoding.*;
* Subclass of {@link NameValuePair} for serializing POJOs as URL-encoded form post entries
* using the {@link UrlEncodingSerializer class}.
*
- * <h6 class='topic'>Example:</h6>
+ * <h5 class='section'>Example:</h5>
* <p class='bcode'>
* NameValuePairs params = <jk>new</jk> NameValuePairs()
* .append(<jk>new</jk> SerializedNameValuePair(<js>"myPojo"</js>, pojo, UrlEncodingSerializer.<jsf>DEFAULT_SIMPLE</jsf>))
http://git-wip-us.apache.org/repos/asf/incubator-juneau/blob/30dd3b93/juneau-rest-jaxrs/src/main/java/org/apache/juneau/rest/jaxrs/BaseProvider.java
----------------------------------------------------------------------
diff --git a/juneau-rest-jaxrs/src/main/java/org/apache/juneau/rest/jaxrs/BaseProvider.java b/juneau-rest-jaxrs/src/main/java/org/apache/juneau/rest/jaxrs/BaseProvider.java
index bc2242f..1a26708 100644
--- a/juneau-rest-jaxrs/src/main/java/org/apache/juneau/rest/jaxrs/BaseProvider.java
+++ b/juneau-rest-jaxrs/src/main/java/org/apache/juneau/rest/jaxrs/BaseProvider.java
@@ -132,8 +132,6 @@ public class BaseProvider implements MessageBodyReader<Object>, MessageBodyWrite
if (pm == null)
throw new WebApplicationException(SC_UNSUPPORTED_MEDIA_TYPE);
Parser p = pm.getParser();
- BeanContext bc = p.getBeanContext();
- ClassMeta<?> cm = bc.getClassMeta(gType);
ObjectMap mp = getMethodProperties(a);
mp.put("mediaType", mediaType.toString());
Locale locale = getLocale(headers);
@@ -142,11 +140,11 @@ public class BaseProvider implements MessageBodyReader<Object>, MessageBodyWrite
ReaderParser p2 = (ReaderParser)p;
InputStreamReader r = new InputStreamReader(in, IOUtils.UTF8);
ParserSession session = p2.createSession(r, mp, null, null, locale, timeZone, pm.getMediaType());
- return p2.parse(session, cm);
+ return p2.parseSession(session, p.getBeanContext().getClassMeta(gType));
}
InputStreamParser p2 = (InputStreamParser)p;
ParserSession session = p2.createSession(in, mp, null, null, locale, timeZone, pm.getMediaType());
- return p2.parse(session, cm);
+ return p2.parseSession(session, p.getBeanContext().getClassMeta(gType));
} catch (ParseException e) {
throw new IOException(e);
}
http://git-wip-us.apache.org/repos/asf/incubator-juneau/blob/30dd3b93/juneau-rest-jaxrs/src/main/java/org/apache/juneau/rest/jaxrs/JuneauProvider.java
----------------------------------------------------------------------
diff --git a/juneau-rest-jaxrs/src/main/java/org/apache/juneau/rest/jaxrs/JuneauProvider.java b/juneau-rest-jaxrs/src/main/java/org/apache/juneau/rest/jaxrs/JuneauProvider.java
index b0e54c0..bbca603 100644
--- a/juneau-rest-jaxrs/src/main/java/org/apache/juneau/rest/jaxrs/JuneauProvider.java
+++ b/juneau-rest-jaxrs/src/main/java/org/apache/juneau/rest/jaxrs/JuneauProvider.java
@@ -29,7 +29,7 @@ import org.apache.juneau.xml.*;
/**
* Annotations applicable to subclasses of {@link BaseProvider}.
*
- * <h6 class='topic'>Description</h6>
+ * <h5 class='section'>Description:</h5>
* <p>
* Used to associate serializers, parsers, filters, and properties with instances of {@link BaseProvider}.
*/
http://git-wip-us.apache.org/repos/asf/incubator-juneau/blob/30dd3b93/juneau-rest/src/main/java/org/apache/juneau/rest/Redirect.java
----------------------------------------------------------------------
diff --git a/juneau-rest/src/main/java/org/apache/juneau/rest/Redirect.java b/juneau-rest/src/main/java/org/apache/juneau/rest/Redirect.java
index ab3923f..962e432 100644
--- a/juneau-rest/src/main/java/org/apache/juneau/rest/Redirect.java
+++ b/juneau-rest/src/main/java/org/apache/juneau/rest/Redirect.java
@@ -75,7 +75,7 @@ public final class Redirect {
* Relative paths are interpreted as relative to the servlet path.
*
* @param url The URL to redirect to.
- * @param args Optional {@link MessageFormat} arguments to replace in the URL string.
+ * @param args Optional {@link MessageFormat}-style arguments.
*/
public Redirect(CharSequence url, Object...args) {
this.url = (url == null ? null : url.toString());
@@ -98,7 +98,7 @@ public final class Redirect {
*
* @param httpResponseCode The HTTP response code.
* @param url The URL to redirect to.
- * @param args Optional {@link MessageFormat} arguments to replace in the URL string.
+ * @param args Optional {@link MessageFormat}-style arguments.
*/
public Redirect(int httpResponseCode, CharSequence url, Object...args) {
this.httpResponseCode = httpResponseCode;
http://git-wip-us.apache.org/repos/asf/incubator-juneau/blob/30dd3b93/juneau-rest/src/main/java/org/apache/juneau/rest/RestConverter.java
----------------------------------------------------------------------
diff --git a/juneau-rest/src/main/java/org/apache/juneau/rest/RestConverter.java b/juneau-rest/src/main/java/org/apache/juneau/rest/RestConverter.java
index 9c3e378..cc401ec 100644
--- a/juneau-rest/src/main/java/org/apache/juneau/rest/RestConverter.java
+++ b/juneau-rest/src/main/java/org/apache/juneau/rest/RestConverter.java
@@ -24,7 +24,7 @@ import org.apache.juneau.serializer.*;
* converted to some other POJO after invocation of the REST method.
* <p>
* Converters are associated with REST methods through the {@link RestMethod#converters()} annotation.
- * <h6 class='topic'>Example:</h6>
+ * <h5 class='section'>Example:</h5>
* <p class='bcode'>
* <jk>public class</jk> RequestEchoResource <jk>extends</jk> RestServlet {
*
http://git-wip-us.apache.org/repos/asf/incubator-juneau/blob/30dd3b93/juneau-rest/src/main/java/org/apache/juneau/rest/RestException.java
----------------------------------------------------------------------
diff --git a/juneau-rest/src/main/java/org/apache/juneau/rest/RestException.java b/juneau-rest/src/main/java/org/apache/juneau/rest/RestException.java
index 2f510bb..4ad7fd1 100644
--- a/juneau-rest/src/main/java/org/apache/juneau/rest/RestException.java
+++ b/juneau-rest/src/main/java/org/apache/juneau/rest/RestException.java
@@ -33,7 +33,7 @@ public class RestException extends RuntimeException {
*
* @param status The HTTP status code.
* @param msg The status message.
- * @param args Optional string format arguments.
+ * @param args Optional {@link MessageFormat}-style arguments.
*/
public RestException(int status, String msg, Object...args) {
super(args.length == 0 ? msg : MessageFormat.format(msg, args));
http://git-wip-us.apache.org/repos/asf/incubator-juneau/blob/30dd3b93/juneau-rest/src/main/java/org/apache/juneau/rest/RestGuard.java
----------------------------------------------------------------------
diff --git a/juneau-rest/src/main/java/org/apache/juneau/rest/RestGuard.java b/juneau-rest/src/main/java/org/apache/juneau/rest/RestGuard.java
index 82db0ca..6b406ca 100644
--- a/juneau-rest/src/main/java/org/apache/juneau/rest/RestGuard.java
+++ b/juneau-rest/src/main/java/org/apache/juneau/rest/RestGuard.java
@@ -19,7 +19,7 @@ import org.apache.juneau.rest.annotation.*;
/**
* REST method guard.
*
- * <h6 class='topic'>Description</h6>
+ * <h5 class='section'>Description:</h5>
* <p>
* Implements a guard mechanism for REST method calls that allows requests to be
* rejected before invocation of the REST method.
http://git-wip-us.apache.org/repos/asf/incubator-juneau/blob/30dd3b93/juneau-rest/src/main/java/org/apache/juneau/rest/RestMatcher.java
----------------------------------------------------------------------
diff --git a/juneau-rest/src/main/java/org/apache/juneau/rest/RestMatcher.java b/juneau-rest/src/main/java/org/apache/juneau/rest/RestMatcher.java
index 84a14f3..236545f 100644
--- a/juneau-rest/src/main/java/org/apache/juneau/rest/RestMatcher.java
+++ b/juneau-rest/src/main/java/org/apache/juneau/rest/RestMatcher.java
@@ -30,7 +30,7 @@ import org.apache.juneau.rest.annotation.*;
* This is opposite from the {@link RestMethod#guards()} annotation, where all guards
* are required to match in order to execute the method.
*
- * <h6 class='topic'>Example:</h6>
+ * <h5 class='section'>Example:</h5>
* <p class='bcode'>
* <jk>public class</jk> MyResource <jk>extends</jk> RestServlet {
*