Return-Path: X-Original-To: archive-asf-public-internal@cust-asf2.ponee.io Delivered-To: archive-asf-public-internal@cust-asf2.ponee.io Received: from cust-asf.ponee.io (cust-asf.ponee.io [163.172.22.183]) by cust-asf2.ponee.io (Postfix) with ESMTP id 158C5200C23 for ; Wed, 8 Feb 2017 02:20:49 +0100 (CET) Received: by cust-asf.ponee.io (Postfix) id 1416D160B3E; Wed, 8 Feb 2017 01:20:49 +0000 (UTC) Delivered-To: archive-asf-public@cust-asf.ponee.io Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by cust-asf.ponee.io (Postfix) with SMTP id C812A160B68 for ; Wed, 8 Feb 2017 02:20:46 +0100 (CET) Received: (qmail 49218 invoked by uid 500); 8 Feb 2017 01:20:45 -0000 Mailing-List: contact commits-help@juneau.incubator.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: dev@juneau.incubator.apache.org Delivered-To: mailing list commits@juneau.incubator.apache.org Received: (qmail 49209 invoked by uid 99); 8 Feb 2017 01:20:45 -0000 Received: from pnap-us-west-generic-nat.apache.org (HELO spamd1-us-west.apache.org) (209.188.14.142) by apache.org (qpsmtpd/0.29) with ESMTP; Wed, 08 Feb 2017 01:20:45 +0000 Received: from localhost (localhost [127.0.0.1]) by spamd1-us-west.apache.org (ASF Mail Server at spamd1-us-west.apache.org) with ESMTP id 57720C0908 for ; Wed, 8 Feb 2017 01:20:45 +0000 (UTC) X-Virus-Scanned: Debian amavisd-new at spamd1-us-west.apache.org X-Spam-Flag: NO X-Spam-Score: -6.219 X-Spam-Level: X-Spam-Status: No, score=-6.219 tagged_above=-999 required=6.31 tests=[KAM_ASCII_DIVIDERS=0.8, KAM_LAZY_DOMAIN_SECURITY=1, RCVD_IN_DNSWL_HI=-5, RCVD_IN_MSPIKE_H3=-0.01, RCVD_IN_MSPIKE_WL=-0.01, RP_MATCHES_RCVD=-2.999] autolearn=disabled Received: from mx1-lw-eu.apache.org ([10.40.0.8]) by localhost (spamd1-us-west.apache.org [10.40.0.7]) (amavisd-new, port 10024) with ESMTP id qHPksJpt6Nz8 for ; Wed, 8 Feb 2017 01:20:39 +0000 (UTC) Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by mx1-lw-eu.apache.org (ASF Mail Server at mx1-lw-eu.apache.org) with SMTP id 1F23560D42 for ; Wed, 8 Feb 2017 01:20:21 +0000 (UTC) Received: (qmail 48520 invoked by uid 99); 8 Feb 2017 01:20:21 -0000 Received: from git1-us-west.apache.org (HELO git1-us-west.apache.org) (140.211.11.23) by apache.org (qpsmtpd/0.29) with ESMTP; Wed, 08 Feb 2017 01:20:21 +0000 Received: by git1-us-west.apache.org (ASF Mail Server at git1-us-west.apache.org, from userid 33) id 40A14DFB0E; Wed, 8 Feb 2017 01:20:21 +0000 (UTC) Content-Type: text/plain; charset="us-ascii" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit From: jamesbognar@apache.org To: commits@juneau.incubator.apache.org Date: Wed, 08 Feb 2017 01:20:45 -0000 Message-Id: <2f26256672544c628bd4cf3cb35ada9f@git.apache.org> In-Reply-To: References: X-Mailer: ASF-Git Admin Mailer Subject: [26/51] [partial] incubator-juneau-website git commit: Update docs for 6.0.1 archived-at: Wed, 08 Feb 2017 01:20:49 -0000 http://git-wip-us.apache.org/repos/asf/incubator-juneau-website/blob/afa6a1d0/content/site/apidocs/org/apache/juneau/parser/InputStreamParser.html ---------------------------------------------------------------------- diff --git a/content/site/apidocs/org/apache/juneau/parser/InputStreamParser.html b/content/site/apidocs/org/apache/juneau/parser/InputStreamParser.html index 7c25fdb..94b95e3 100644 --- a/content/site/apidocs/org/apache/juneau/parser/InputStreamParser.html +++ b/content/site/apidocs/org/apache/juneau/parser/InputStreamParser.html @@ -135,7 +135,7 @@ var activeTableTab = "activeTableTab"; extends Parser
Subclass of Parser for byte-based parsers. -
Description
+
Description:

This class is typically the parent class of all byte-based parsers. It has 1 abstract method to implement... @@ -195,7 +195,7 @@ extends Parser -addBeanFilters, addImplClass, addListener, addNotBeanClasses, addPojoSwaps, addToDictionary, clone, convertAttrToType, createSession, createSession, doParse, doParseArgs, doParseIntoCollection, doParseIntoMap, getListeners, getMediaTypes, getPrimaryMediaType, lock, onUnknownProperty, parse, parse, parse, parseArgs, parseCollection, parseIntoCollection, parseIntoMap, parseMap, setClassLoader, se tName, setParent, setProperty +addBeanFilters, addImplClass, addListener, addNotBeanClasses, addPojoSwaps, addToDictionary, clone, convertAttrToType, createSession, createSession, doParse, doParseArgs, doParseIntoCollection, doParseIntoMap, getListeners, getMediaTypes, getPrimaryMediaType, lock, onUnknownProperty, parse, parse, parse, parseArgs, parseIntoCollection, parseIntoMap, parseSession, setClassLoader, setName, setParent, setProperty

@@ -261,7 +261,7 @@ extends Parameters:
message - The exception message containing MessageFormat-style arguments.
-
args - Message arguments.
+
args - Optional MessageFormat-style arguments.
http://git-wip-us.apache.org/repos/asf/incubator-juneau-website/blob/afa6a1d0/content/site/apidocs/org/apache/juneau/parser/Parser.html ---------------------------------------------------------------------- diff --git a/content/site/apidocs/org/apache/juneau/parser/Parser.html b/content/site/apidocs/org/apache/juneau/parser/Parser.html index 2c4228f..8f1aade 100644 --- a/content/site/apidocs/org/apache/juneau/parser/Parser.html +++ b/content/site/apidocs/org/apache/juneau/parser/Parser.html @@ -18,7 +18,7 @@ catch(err) { } //--> -var methods = {"i0":10,"i1":10,"i2":10,"i3":10,"i4":10,"i5":10,"i6":10,"i7":10,"i8":10,"i9":10,"i10":6,"i11":10,"i12":10,"i13":10,"i14":10,"i15":10,"i16":10,"i17":6,"i18":10,"i19":10,"i20":10,"i21":10,"i22":10,"i23":10,"i24":10,"i25":10,"i26":10,"i27":10,"i28":10,"i29":10,"i30":10,"i31":10}; +var methods = {"i0":10,"i1":10,"i2":10,"i3":10,"i4":10,"i5":10,"i6":10,"i7":10,"i8":10,"i9":10,"i10":6,"i11":10,"i12":10,"i13":10,"i14":10,"i15":10,"i16":10,"i17":6,"i18":10,"i19":10,"i20":10,"i21":10,"i22":10,"i23":10,"i24":10,"i25":10,"i26":10,"i27":10,"i28":10,"i29":10,"i30":10}; var tabs = {65535:["t0","All Methods"],2:["t2","Instance Methods"],4:["t3","Abstract Methods"],8:["t4","Concrete Methods"]}; var altColor = "altColor"; var rowColor = "rowColor"; @@ -126,7 +126,7 @@ var activeTableTab = "activeTableTab";

-
public abstract class Parser
+
public abstract class Parser
 extends CoreApi
Parent class for all Juneau parsers. @@ -137,7 +137,7 @@ extends getMediaTypes() method.
Valid data conversions
- Parsers can parse any parsable POJO types, as specified in the POJO Categories. + Parsers can parse any parsable POJO types, as specified in the POJO Categories.

Some examples of conversions are shown below...

@@ -393,21 +393,22 @@ extends <T> T parse(Object input, Class<T> type) -
Parses input into the specified object type.
+
Same as parse(Object, Type, Type...) except optimized for a non-parameterized class.
<T> T parse(Object input, ClassMeta<T> type) -
Parses the content of the reader and creates an object of the specified type.
+
Same as parse(Object, Type, Type...) except the type has already been converted into a ClassMeta object.
<T> T -parse(ParserSession session, - ClassMeta<T> type) -
Parses the content of the reader and creates an object of the specified type.
+parse(Object input, + Type type, + Type... args) +
Parses input into the specified object type.
@@ -419,14 +420,6 @@ extends -<E,T extends Collection<E>>
T
-parseCollection(Object input, - Class<T> collectionClass, - Class<E> entryClass) -
Parses input into a collection with a specified element type.
- - - <E> Collection<E> parseIntoCollection(Object input, Collection<E> c, @@ -434,7 +427,7 @@ extends Parses the contents of the specified reader and loads the results into the specified collection.
- + <K,V> Map<K,V> parseIntoMap(Object input, Map<K,V> m, @@ -443,22 +436,20 @@ extends Parses the contents of the specified reader and loads the results into the specified map.
- -<K,V,T extends Map<K,V>>
T
-parseMap(Object input, - Class<T> mapClass, - Class<K> keyClass, - Class<V> valueClass) -
Parses input into a map with specified key and value types.
+ +<T> T +parseSession(ParserSession session, + ClassMeta<T> type) +
Entry point for all parsing calls.
- + Parser setClassLoader(ClassLoader classLoader)
Shortcut for calling getContextFactory().setClassLoader(classLoader).
- + protected void setName(ClassMeta<?> cm, Object o, @@ -467,7 +458,7 @@ extends + protected void setParent(ClassMeta<?> cm, Object o, @@ -476,7 +467,7 @@ extends + Parser setProperty(String property, Object value) @@ -525,7 +516,7 @@ extends
  • doParse

    -
    protected abstract <T> T doParse(ParserSession session,
    +
    protected abstract <T> T doParse(ParserSession session,
                                      ClassMeta<T> type)
                               throws Exception
    Workhorse method. Subclasses are expected to implement this method.
    @@ -551,7 +542,7 @@ extends
  • isReaderParser

    -
    public abstract boolean isReaderParser()
    +
    public abstract boolean isReaderParser()
    Returns true if this parser subclasses from ReaderParser.
    Returns:
    @@ -559,24 +550,24 @@ extends +
    • -

      parse

      -
      public final <T> T parse(ParserSession session,
      -                         ClassMeta<T> type)
      -                  throws ParseException
      -
      Parses the content of the reader and creates an object of the specified type.
      +

      parseSession

      +
      public final <T> T parseSession(ParserSession session,
      +                                ClassMeta<T> type)
      +                         throws ParseException
      +
      Entry point for all parsing calls. +

      + Calls the doParse(ParserSession, ClassMeta) implementation class and catches/rewraps any exceptions thrown.

      Type Parameters:
      T - The class type of the object to create.
      Parameters:
      session - The runtime session returned by createSession(Object, ObjectMap, Method, Object, Locale, TimeZone, MediaType).
      -
      type - The class type of the object to create. - If null or Object.class, object type is based on what's being parsed. - For example, when parsing JSON text, it may return a String, Number, ObjectMap, etc...
      +
      type - The class type of the object to create.
      Returns:
      The parsed object.
      Throws:
      @@ -584,18 +575,49 @@ extends +
      • parse

        -
        public final <T> T parse(Object input,
        -                         ClassMeta<T> type)
        +
        public final <T> T parse(Object input,
        +                         Type type,
        +                         Type... args)
                           throws ParseException
        -
        Parses the content of the reader and creates an object of the specified type. +
        Parses input into the specified object type. + The type can be a simple type (e.g. beans, strings, numbers) or parameterized type (collections/maps). + +
        Examples:
        +

        + ReaderParser p = JsonParser.DEFAULT; + + // Parse into a linked-list of strings. + List l = p.parse(json, LinkedList.class, String.class); + + // Parse into a linked-list of beans. + List l = p.parse(json, LinkedList.class, MyBean.class); + + // Parse into a linked-list of linked-lists of strings. + List l = p.parse(json, LinkedList.class, LinkedList.class, String.class); + + // Parse into a map of string keys/values. + Map m = p.parse(json, TreeMap.class, String.class, String.class); + + // Parse into a map containing string keys and values of lists containing beans. + Map m = p.parse(json, TreeMap.class, String.class, List.class, MyBean.class); +

        - Equivalent to calling parser.parse(in, type, null);

        + Collection classes are assumed to be followed by zero or one objects indicating the element type. +

        + Map classes are assumed to be followed by zero or two meta objects indicating the key and value types. +

        + The array can be arbitrarily long to indicate arbitrarily complex data structures. +

        +

        Notes:
        +
        Type Parameters:
        T - The class type of the object to create.
        @@ -617,9 +639,11 @@ extends File
      -
      type - The class type of the object to create. - If null or Object.class, object type is based on what's being parsed. - For example, when parsing JSON text, it may return a String, Number, ObjectMap, etc...
      +
      type - The object type to create. +
      Can be any of the following: ClassMeta, Class, ParameterizedType, GenericArrayType
      +
      args - The type arguments of the class if it's a collection or map. +
      Can be any of the following: ClassMeta, Class, ParameterizedType, GenericArrayType +
      Ignored if the main type is not a map or collection.
      Returns:
      The parsed object.
      Throws:
      @@ -633,79 +657,35 @@ extends
    • parse

      -
      public final <T> T parse(Object input,
      +
      public final <T> T parse(Object input,
                                Class<T> type)
                         throws ParseException
      -
      Parses input into the specified object type. - -
      Example:
      +
      Same as parse(Object, Type, Type...) except optimized for a non-parameterized class. +

      + This is the preferred parse method for simple types since you don't need to cast the results. +

      Examples:

      ReaderParser p = JsonParser.DEFAULT; + + // Parse into a string. + MyBean b = p.parse(json, String.class); + + // Parse into a bean. MyBean b = p.parse(json, MyBean.class); -

      -

      - This method equivalent to the following code: -

      - ReaderParser p = JsonParser.DEFAULT; - ClassMeta<MyBean> cm = p.getBeanContext().getClassMeta(MyBean.class); - MyBean b = p.parse(json, cm, null); -

      -
      -
      Type Parameters:
      -
      T - The class type of the object to create.
      -
      Parameters:
      -
      input - The input. See parse(Object, ClassMeta) for supported input types.
      -
      type - The class type of the object to create.
      -
      Returns:
      -
      The parsed object.
      -
      Throws:
      -
      ParseException - If the input contains a syntax error or is malformed, or is not valid for the specified type.
      -
      -
    • -
    - - - -