You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@groovy.apache.org by alien11689 <gi...@git.apache.org> on 2016/02/08 15:03:49 UTC

[GitHub] groovy pull request: Add jaxb marshalling support

GitHub user alien11689 opened a pull request:

    https://github.com/apache/groovy/pull/255

    Add jaxb marshalling support

    

You can merge this pull request into a Git repository by running:

    $ git pull https://github.com/alien11689/incubator-groovy add-jaxb-marshalling-support

Alternatively you can review and apply these changes as the patch at:

    https://github.com/apache/groovy/pull/255.patch

To close this pull request, make a commit to your master/trunk branch
with (at least) the following in the commit message:

    This closes #255
    
----
commit 1df0aa4541876371e2a2bf2917f22978ae354753
Author: Dominik Przybysz <dp...@touk.pl>
Date:   2016-02-08T14:02:49Z

    Add jaxb marshalling support

----


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

[GitHub] groovy pull request: Add jaxb marshalling support

Posted by PascalSchumacher <gi...@git.apache.org>.
Github user PascalSchumacher commented on a diff in the pull request:

    https://github.com/apache/groovy/pull/255#discussion_r55146104
  
    --- Diff: subprojects/groovy-xml/src/main/groovy/groovy/xml/jaxb/JaxbGroovyMethods.groovy ---
    @@ -0,0 +1,54 @@
    +/*
    + *  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 groovy.xml.jaxb
    +
    +import groovy.transform.CompileStatic
    +
    +import javax.xml.bind.JAXBContext
    +import javax.xml.bind.Marshaller
    +import javax.xml.bind.Unmarshaller
    +
    +/**
    + * This class defines methods which simplifies marshalling object to
    + * {@link String} containing xml and unmarshalling xml in {@link String} to object.
    + *
    + * @author Dominik Przybysz
    + */
    +@CompileStatic
    +class JaxbGroovyMethods {
    --- End diff --
    
    Hi Dominik,
    
    can you please add some javadoc to the methods?
    
    Thanks!


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

[GitHub] groovy pull request: Add jaxb marshalling support

Posted by asfgit <gi...@git.apache.org>.
Github user asfgit closed the pull request at:

    https://github.com/apache/groovy/pull/255


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

[GitHub] groovy pull request: Add jaxb marshalling support

Posted by PascalSchumacher <gi...@git.apache.org>.
Github user PascalSchumacher commented on a diff in the pull request:

    https://github.com/apache/groovy/pull/255#discussion_r55146131
  
    --- Diff: subprojects/groovy-xml/src/test/groovy/groovy/xml/jaxb/JaxbGroovyMethodsTest.groovy ---
    @@ -0,0 +1,41 @@
    +/*
    + *  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 groovy.xml.jaxb
    +
    +import javax.xml.bind.JAXBContext
    +
    +/**
    + * Test cases for {@link JaxbGroovyMethods}
    + *
    + * @author Dominik Przybysz
    + */
    +class JaxbGroovyMethodsTest extends GroovyTestCase {
    +    JAXBContext jaxbContext = JAXBContext.newInstance(Person)
    +    Person p = new Person(name: 'JT', age: 20)
    +
    +    void testMarshallAndUnmarshallObjectUsingCategoryOnMarshallerAndUnmarshaller() {
    +        String xml = jaxbContext.createMarshaller().marshal(p)
    +        assert jaxbContext.createUnmarshaller().unmarshal(xml, Person) == p
    +    }
    +
    +    void testMarshallAndUnmarshallObjectUsingCategoryOnJaxbContext() {
    --- End diff --
    
    These test should be renamed, because there is no `Category` anymore. Thanks!


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---