Class JaxbUtils


  • public abstract class JaxbUtils
    extends Object
    • Method Detail

      • getClassForElement

        public static Class<?> getClassForElement​(String elementName)
      • getNamespacesForClass

        public static <T> List<String> getNamespacesForClass​(Class<T> clazz)
      • marshal

        public static void marshal​(Object obj,
                                   Writer writer)
      • unmarshal

        public static <T> T unmarshal​(Class<T> clazz,
                                      File file)
      • unmarshal

        public static <T> T unmarshal​(Class<T> clazz,
                                      File file,
                                      boolean validate)
      • unmarshal

        public static <T> T unmarshal​(Class<T> clazz,
                                      Reader reader)
      • unmarshal

        public static <T> T unmarshal​(Class<T> clazz,
                                      Reader reader,
                                      boolean validate)
      • unmarshal

        public static <T> T unmarshal​(Class<T> clazz,
                                      InputStream stream)
      • unmarshal

        public static <T> T unmarshal​(Class<T> clazz,
                                      InputStream stream,
                                      boolean validate)
      • unmarshal

        public static <T> T unmarshal​(Class<T> clazz,
                                      String xml)
      • unmarshal

        public static <T> T unmarshal​(Class<T> clazz,
                                      String xml,
                                      boolean validate)
      • unmarshal

        public static <T> T unmarshal​(Class<T> clazz,
                                      org.springframework.core.io.Resource resource)
      • unmarshal

        public static <T> T unmarshal​(Class<T> clazz,
                                      org.springframework.core.io.Resource resource,
                                      boolean validate)
      • unmarshal

        public static <T> T unmarshal​(Class<T> clazz,
                                      InputSource inputSource)
      • unmarshal

        public static <T> T unmarshal​(Class<T> clazz,
                                      InputSource inputSource,
                                      boolean validate)
      • unmarshal

        public static <T> T unmarshal​(Class<T> clazz,
                                      InputSource inputSource,
                                      JAXBContext jaxbContext,
                                      boolean validate)
      • getNamespaceForClass

        public static <T> String getNamespaceForClass​(Class<T> clazz)
      • getUnmarshallerFor

        public static Unmarshaller getUnmarshallerFor​(Object obj,
                                                      JAXBContext jaxbContext,
                                                      boolean validate)
        Get a JAXB unmarshaller for the given object. If no JAXBContext is provided, JAXBUtils will create and cache a context for the given object.
        Parameters:
        obj - The object type to be unmarshalled.
        jaxbContext - An optional JAXB context to create the unmarshaller from.
        validate - TODO
        Returns:
        an Unmarshaller
      • duplicateObject

        public static <T> T duplicateObject​(T obj,
                                            Class<T> clazz)