From notifications-return-13985-archive-asf-public=cust-asf.ponee.io@groovy.apache.org Sun Sep 16 03:41:05 2018 Return-Path: X-Original-To: archive-asf-public@cust-asf.ponee.io Delivered-To: archive-asf-public@cust-asf.ponee.io Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by mx-eu-01.ponee.io (Postfix) with SMTP id 9D88018067A for ; Sun, 16 Sep 2018 03:41:04 +0200 (CEST) Received: (qmail 36503 invoked by uid 500); 16 Sep 2018 01:41:03 -0000 Mailing-List: contact notifications-help@groovy.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: dev@groovy.apache.org Delivered-To: mailing list notifications@groovy.apache.org Received: (qmail 36494 invoked by uid 99); 16 Sep 2018 01:41:03 -0000 Received: from pnap-us-west-generic-nat.apache.org (HELO spamd4-us-west.apache.org) (209.188.14.142) by apache.org (qpsmtpd/0.29) with ESMTP; Sun, 16 Sep 2018 01:41:03 +0000 Received: from localhost (localhost [127.0.0.1]) by spamd4-us-west.apache.org (ASF Mail Server at spamd4-us-west.apache.org) with ESMTP id 2A313C018C for ; Sun, 16 Sep 2018 01:41:03 +0000 (UTC) X-Virus-Scanned: Debian amavisd-new at spamd4-us-west.apache.org X-Spam-Flag: NO X-Spam-Score: -109.501 X-Spam-Level: X-Spam-Status: No, score=-109.501 tagged_above=-999 required=6.31 tests=[ENV_AND_HDR_SPF_MATCH=-0.5, KAM_ASCII_DIVIDERS=0.8, RCVD_IN_DNSWL_MED=-2.3, SPF_PASS=-0.001, USER_IN_DEF_SPF_WL=-7.5, USER_IN_WHITELIST=-100] autolearn=disabled Received: from mx1-lw-us.apache.org ([10.40.0.8]) by localhost (spamd4-us-west.apache.org [10.40.0.11]) (amavisd-new, port 10024) with ESMTP id XQsB0r5nspM6 for ; Sun, 16 Sep 2018 01:41:02 +0000 (UTC) Received: from mailrelay1-us-west.apache.org (mailrelay1-us-west.apache.org [209.188.14.139]) by mx1-lw-us.apache.org (ASF Mail Server at mx1-lw-us.apache.org) with ESMTP id 9D6D45F1A1 for ; Sun, 16 Sep 2018 01:41:01 +0000 (UTC) Received: from jira-lw-us.apache.org (unknown [207.244.88.139]) by mailrelay1-us-west.apache.org (ASF Mail Server at mailrelay1-us-west.apache.org) with ESMTP id 08EBCE006D for ; Sun, 16 Sep 2018 01:41:00 +0000 (UTC) Received: from jira-lw-us.apache.org (localhost [127.0.0.1]) by jira-lw-us.apache.org (ASF Mail Server at jira-lw-us.apache.org) with ESMTP id 1AA3323F99 for ; Sun, 16 Sep 2018 01:41:00 +0000 (UTC) Date: Sun, 16 Sep 2018 01:41:00 +0000 (UTC) From: "ASF GitHub Bot (JIRA)" To: notifications@groovy.apache.org Message-ID: In-Reply-To: References: Subject: [jira] [Commented] (GROOVY-8794) Add groovy-yaml subproject to support parsing and building yaml MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit X-JIRA-FingerPrint: 30527f35849b9dde25b450d4833f0394 [ https://issues.apache.org/jira/browse/GROOVY-8794?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16616556#comment-16616556 ] ASF GitHub Bot commented on GROOVY-8794: ---------------------------------------- Github user paulk-asert commented on a diff in the pull request: https://github.com/apache/groovy/pull/797#discussion_r217899699 --- Diff: subprojects/groovy-yaml/src/spec/doc/yaml-userguide.adoc --- @@ -0,0 +1,112 @@ +////////////////////////////////////////// + + 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. + +////////////////////////////////////////// + += Processing YAML + +Groovy comes with integrated support for converting between Groovy objects and YAML. The classes dedicated to +YAML serialisation and parsing are found in the `groovy.yaml` package. + +[[yaml_yamlslurper]] +== YamlSlurper + +`YamlSlurper` is a class that parses YAML text or reader content into Groovy data structures (objects) such as maps, lists and +primitive types like `Integer`, `Double`, `Boolean` and `String`. + +The class comes with a bunch of overloaded `parse` methods plus some special methods such as `parseText` +and others. For the next example we will use the `parseText` method. It parses a YAML `String` and recursively converts it to a +list or map of objects. The other `parse*` methods are similar in that they return a YAML `String` but for different parameter +types. + +[source,groovy] +---- +include::{rootProjectDir}/subprojects/groovy-yaml/src/spec/test/groovy/yaml/YamlParserTest.groovy --- End diff -- I'd just bring in lines 24-47 > Add groovy-yaml subproject to support parsing and building yaml > --------------------------------------------------------------- > > Key: GROOVY-8794 > URL: https://issues.apache.org/jira/browse/GROOVY-8794 > Project: Groovy > Issue Type: New Feature > Reporter: Daniel Sun > Assignee: Daniel Sun > Priority: Major > Fix For: 2.5.3 > > -- This message was sent by Atlassian JIRA (v7.6.3#76005)