Class JAXBDSContext

java.lang.Object
org.apache.axis2.datasource.jaxb.JAXBDSContext
Direct Known Subclasses:
JAXBBlockContext

public class JAXBDSContext extends Object
  • Field Details

    • DEBUG_ENABLED

      public static final boolean DEBUG_ENABLED
  • Constructor Details

    • JAXBDSContext

      public JAXBDSContext(TreeSet<String> packages, String packagesKey)
      Full Constructor JAXBDSContext (most performant)
      Parameters:
      packages - Set of packages needed by the JAXBContext.
    • JAXBDSContext

      public JAXBDSContext(TreeSet<String> packages)
      Slightly slower constructor
      Parameters:
      packages -
    • JAXBDSContext

      public JAXBDSContext(String contextPackage)
      Deprecated.
      Normal Constructor JAXBBlockContext
      Parameters:
      contextPackage -
    • JAXBDSContext

      public JAXBDSContext(jakarta.xml.bind.JAXBContext jaxbContext)
      "Dispatch" Constructor Use this full constructor when the JAXBContent is provided by the customer.
      Parameters:
      jaxbContext -
  • Method Details

    • getContextPackages

      public TreeSet<String> getContextPackages()
      Returns:
      Class representing type of the element
    • getJAXBContext

      public jakarta.xml.bind.JAXBContext getJAXBContext() throws jakarta.xml.bind.JAXBException
      Throws:
      jakarta.xml.bind.JAXBException
    • getJAXBContext

      public jakarta.xml.bind.JAXBContext getJAXBContext(ClassLoader cl) throws jakarta.xml.bind.JAXBException
      Returns:
      get the JAXBContext
      Throws:
      jakarta.xml.bind.JAXBException
    • getJAXBContext

      public jakarta.xml.bind.JAXBContext getJAXBContext(ClassLoader cl, boolean forceArrays) throws jakarta.xml.bind.JAXBException
      Parameters:
      ClassLoader -
      forceArrays - boolean (if true, then JAXBContext will automatically contain arrays)
      Returns:
      get the JAXBContext
      Throws:
      jakarta.xml.bind.JAXBException
    • setWebServiceNamespace

      public void setWebServiceNamespace(String namespace)
    • getProcessType

      public Class<?> getProcessType()
      Returns:
      RPC Declared Type
    • setProcessType

      public void setProcessType(Class<?> type)
      The procesess type to indicate the class of the target of the unmarshaling. This method should only be used in the cases where the element being unmarshaled is not known to the JAXBContext (examples include RPC/Literal processing and Doc/Literal Wrapped processing with a non-element wrapper class)
      Parameters:
      type -
    • getConstructionType

      public JAXBUtils.CONSTRUCTION_TYPE getConstructionType()
    • isxmlList

      public boolean isxmlList()
    • setIsxmlList

      public void setIsxmlList(boolean isxmlList)
    • getMessageContext

      public org.apache.axis2.context.MessageContext getMessageContext()
    • setMessageContext

      public void setMessageContext(org.apache.axis2.context.MessageContext messageContext)
    • getClassLoader

      public ClassLoader getClassLoader()
    • createAttachmentContext

      protected AttachmentContext createAttachmentContext()
    • unmarshal

      public Object unmarshal(org.apache.axiom.om.OMElement element) throws jakarta.xml.bind.JAXBException
      Unmarshal the xml into a JAXB object
      Parameters:
      element -
      Returns:
      Throws:
      jakarta.xml.bind.JAXBException
    • marshal

      public void marshal(Object obj, XMLStreamWriter writer) throws jakarta.xml.bind.JAXBException
      Marshal the jaxb object
      Parameters:
      obj -
      writer -
      am - AttachmentMarshaller, optional Attachment
      Throws:
      jakarta.xml.bind.JAXBException
    • unmarshalByType

      public static Object unmarshalByType(jakarta.xml.bind.Unmarshaller u, XMLStreamReader reader, Class<?> type, boolean isList, JAXBUtils.CONSTRUCTION_TYPE ctype) throws jakarta.xml.ws.WebServiceException
      The root element being read is defined by schema/JAXB; however its contents are known by schema/JAXB. Therefore we use unmarshal by the declared type (This method is used to unmarshal rpc elements)
      Parameters:
      u - Unmarshaller
      reader - XMLStreamReader
      type - Class
      Returns:
      Object
      Throws:
      jakarta.xml.ws.WebServiceException
    • unmarshalAsListOrArray

      public static Object unmarshalAsListOrArray(XMLStreamReader reader, jakarta.xml.bind.Unmarshaller u, Class<?> type) throws IllegalAccessException, ParseException, NoSuchMethodException, InstantiationException, DatatypeConfigurationException, InvocationTargetException, jakarta.xml.bind.JAXBException
      convert the String into a list or array
      Type Parameters:
      T -
      Parameters:
      jaxb -
      type -
      Returns:
      Throws:
      IllegalAccessException
      ParseException
      NoSuchMethodException
      InstantiationException
      DatatypeConfigurationException
      InvocationTargetException
      jakarta.xml.bind.JAXBException
    • unmarshalByElement

      public static Object unmarshalByElement(jakarta.xml.bind.Unmarshaller u, XMLStreamReader reader) throws jakarta.xml.ws.WebServiceException
      Preferred way to unmarshal objects
      Parameters:
      u - Unmarshaller
      reader - XMLStreamReader
      Returns:
      Object that represents an element
      Throws:
      jakarta.xml.ws.WebServiceException