Package: groovy.xml.jaxb

## [Groovy] Class JaxbGroovyMethods

- groovy.xml.jaxb.JaxbGroovyMethods

- This class defines new groovy methods which appear on Jaxb-related JDK classes (`JAXBContext`, `Marshaller`) inside the Groovy environment. Static methods are used with the first parameter being the destination class.

  deprecated:
    use org.apache.groovy.jaxb.extensions.JaxbExtensions

- - ### Methods Summary

    Methods
    Type Params | Return Type | Name and description
    --- | --- | ---
    `<T>` | `static String` | `marshal(Marshaller self, T jaxbElement)` Marshall an object to a xml `String`.
    `<T>` | `static String` | `marshal(JAXBContext self, T jaxbElement)` Marshall an object to a xml `String`.
    `<T>` | `static T` | `unmarshal(Unmarshaller self, String xml, Class<T> declaredType)` Unmarshal xml data from the given `String` to object of the given type.
    `<T>` | `static T` | `unmarshal(JAXBContext self, String xml, Class<T> declaredType)` Unmarshal xml data from the given `String` to object of the given type.

  - ### Inherited Methods Summary

    Inherited Methods
    Methods inherited from class | Name
    --- | ---
    `class Object` | `wait, wait, wait, equals, toString, hashCode, getClass, notify, notifyAll`

- - ### Method Detail

    - #### <T> @Deprecated static String marshal(Marshaller self, T jaxbElement)

      Marshall an object to a xml `String`.

      Parameters:
        `self` - a Marshaller which can marshall the type of the given object
        `jaxbElement` - object to marshall to a `String`
      Returns:
        `String` representing the object as xml

    - #### <T> @Deprecated static String marshal(JAXBContext self, T jaxbElement)

      Marshall an object to a xml `String`.

      Parameters:
        `self` - a JaxbContext, which recognizes the type of the given object
        `jaxbElement` - object to marshall to a `String`
      Returns:
        String representing the object as xml

    - #### <T> @Deprecated static T unmarshal(Unmarshaller self, String xml, Class<T> declaredType)

      Unmarshal xml data from the given `String` to object of the given type.

      Parameters:
        `self` - Unmarshaller, a Unmarshaller which can unmarshall the type of the given object
        `xml` - xml data as a String
        `declaredType` - appropriate JAXB mapped class to hold node's xml data
      Returns:
        instance of destination class unmarshalled from xml

    - #### <T> @Deprecated static T unmarshal(JAXBContext self, String xml, Class<T> declaredType)

      Unmarshal xml data from the given `String` to object of the given type.

      Parameters:
        `self` - a JaxbContext, which recognizes the type of the given object
        `xml` - xml data as a String
        `declaredType` - appropriate JAXB mapped class to hold node's xml data
      Returns:
        instance of destination class unmarshalled from xml