Giter Site home page Giter Site logo

apex-xml-serializer's Introduction

Deploy to Salesforce

Apex-XML-Serializer

Serializes and Deserializes an Apex object to XML and vice versa. It also has functionality to convert between XML and Json.

Usage

Use the methods in the XMLSerializer class to perform round-trip XML serialization and deserialization of Apex objects.

XMLSerializer Methods

Following are the XMLSerializer methods.

-serialize(objectToSerialize )
Serializes Apex objects into XML content.

-serialize(objectToSerialize , suppressApexObjectNulls, addRootElementName)
Suppresses null values when serializing Apex objects into XML content and wraps entire content with 'addRootElementName' when supplied and ignores empty objects from serializing.

-deSerialize(xmlString, apexType)
Deserializes the specified XML string into an Apex object of the specified type.

-deSerialize(xmlString,apexType, deSerializeNodesAsArray)
Deserializes the specified XML string into an Apex object of the specified type and deserializes all elements specified in 'deSerializeNodesAsArray' as array.

-deSerializeUnTyped(xmlString)
Deserializes the specified XML string into collection of primitive data types.

-deSerializeUnTyped(xmlString, deSerializeNodesAsArray)
Deserializes the XML string into collection of primitive data types. All node names specified in 'deSerializeNodesAsArray' will be deserialized as arrays.

-XMLToJSON(xmlString)
Converts specified XML string into JSON string.

-XMLToJSON(xmlString, deSerializeNodesAsArray)
Converts specified XML string into JSON string and converts nodes specified in 'deSerializeNodesAsArray' as arrays.

-JSONToXML(jsonString)
Converts specified JSON string to XML.

-JSONToXML(jsonString, suppressNulls)
Converts specified JSON string to XML and ignores all empty tags if 'suppressNulls' is true.

Limitations

  • XML attributes are not supported.

Areas of interest/Future work

  • Ability to replace XML tag names : Often times we need xml tag names in a format that apex would not allow as variable names like one with special characters or reserved words. It would be useful to be able to replace them in the serialization or deserialization process.

apex-xml-serializer's People

Contributors

skolakan avatar

Watchers

James Cloos avatar psweatte avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.