All Downloads are FREE. Search and download functionalities are using the official Maven repository.

public.javadoc.org.spincast.core.xml.XmlManager.html Maven / Gradle / Ivy

There is a newer version: 2.2.0
Show newest version






XmlManager (org.spincast:spincast-framework 1.0.0 API)












org.spincast.core.xml

Interface XmlManager

  • All Known Implementing Classes:
    SpincastXmlManager


    public interface XmlManager
    Provides methods to work with XML strings and objects.
    • Method Detail

      • toXml

        String toXml(Object obj)
        Converts an object to XML. If the object to convert is a JsonObject, its elements of type "JsonArray" will have a "isArray='true'" attribute added. This way, the XML can be deserialized back to a JsonObject correctly.
      • toXml

        String toXml(Object obj,
                     boolean pretty)
        Converts an object to XML.
        Parameters:
        pretty - If true, the generated XML will be formatted.
      • fromXml

        JsonObject fromXml(String xml)
        Deserializes a XML to an JsonObject. This will correctly manage the XML generated by toXml(), arrays included.
      • fromXmlToJsonArray

        JsonArray fromXmlToJsonArray(String xml)
        Deserializes a XML to an JsonArray. This will correctly manage the XML generated by toXml(), arrays included.
      • fromXml

        <T> T fromXml(String xml,
                      Class<T> clazz)
        Deserializes a XML to the given Class. Be aware that if you use a default Type like Map<String, Object>, the arrays will probably won't be deserialized correctly. Use the version returning a JsonObject to get the arrays to work out of the box!
      • fromXmlToType

        <T> T fromXmlToType(String xml,
                            Type type)
        Deserializes a XML to the given Type. Be aware that if you use a default Type like Map<String, Object>, the arrays will probably won't be deserialized correctly. Use the version returning a JsonObject to get the arrays to work out of the box!
      • fromXmlInputStream

        <T> T fromXmlInputStream(InputStream inputStream,
                                 Class<T> clazz)
        Deserializes a XML inputstream to the given Type. Be aware that if you use a default Type like Map<String, Object>, the arrays will probably won't be deserialized correctly. Use the version returning a JsonObject to get the arrays to work out of the box!

Copyright © 2019. All rights reserved.





© 2015 - 2024 Weber Informatics LLC | Privacy Policy