com.vmware.vcloud.sdk
Class JAXBUtil

java.lang.Object
  extended by com.vmware.vcloud.sdk.JAXBUtil

public class JAXBUtil
extends Object

Utility class for marshalling and unmarshalling


Constructor Summary
JAXBUtil()
           
 
Method Summary
static void addPackages(List<String> packageNames)
          Adding more custom extension classes to the SDK's JAXBContext.
static void initialize(ClassLoader classLoader)
          Explicitly passing the classloader for locating the generated jaxb classes from schema(rest-api-schemas-{version}.jar).
static void initialize(List<String> packageNames, ClassLoader classLoader)
          Explicitly passing the package names and classloader for locating the generated jaxb classes from schema(rest-api-schemas-{version}.jar).
static String marshal(JAXBElement<?> element)
          Converts the JAXB Object into an XML
static
<Type> Type
unmarshallResource(InputStream is)
          Converts the response XML stream to the Object
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

JAXBUtil

public JAXBUtil()
Method Detail

initialize

public static void initialize(ClassLoader classLoader)
Explicitly passing the classloader for locating the generated jaxb classes from schema(rest-api-schemas-{version}.jar).

Parameters:
classLoader - This class loader will be used to locate the implementation classes - generated jaxb classes from schema(rest-api-schemas-{version}.jar).
Since:
SDK 5.5

initialize

public static void initialize(List<String> packageNames,
                              ClassLoader classLoader)
Explicitly passing the package names and classloader for locating the generated jaxb classes from schema(rest-api-schemas-{version}.jar).

Parameters:
packageNames - Specify the list of all the package names which needs to be added to the SDK's JAXBContext
classLoader - This class loader will be used to locate the implementation classes - generated jaxb classes from schema(rest-api-schemas-{version}.jar).
Since:
SDK 5.5

addPackages

public static void addPackages(List<String> packageNames)
Adding more custom extension classes to the SDK's JAXBContext.

Parameters:
packageNames - Specify the list of all the package names which needs to be added to the SDK's JAXBContext

unmarshallResource

public static <Type> Type unmarshallResource(InputStream is)
Converts the response XML stream to the Object

Parameters:
is - - response input stream
Returns:
Type

marshal

public static String marshal(JAXBElement<?> element)
Converts the JAXB Object into an XML

Parameters:
element -
Returns:
String


Copyright © 2016. All Rights Reserved.