Class W3CEndpointReferenceHelper

java.lang.Object
com.helger.smpclient.peppol.utils.W3CEndpointReferenceHelper

@Immutable public final class W3CEndpointReferenceHelper extends Object
As the default WS-Addressing binding since JAXB 2.1 uses the W3CEndpointReference class, we must also use this class, otherwise JAXB would complain, that there are 2 contexts for the same namespace+element combination.
The issue with W3CEndpointReference is that it can easily be created using the W3CEndpointReferenceBuilder class, but it's not possible to extract information from it (get....). This class offers a workaround by using DOM serialization to access the content of a W3CEndpointReference. In case the serialization tag names of W3CEndpointReference change, this implementation has to be adopted!
The JIRA issue JAX_WS-1132 was filed to help dealing with this issue.
Author:
Philip Helger
  • Method Summary

    Modifier and Type
    Method
    Description
    static jakarta.xml.ws.wsaddressing.W3CEndpointReference
    Create a new endpoint reference for the given address without reference parameters.
    static jakarta.xml.ws.wsaddressing.W3CEndpointReference
    createEndpointReference(String sAddress, Iterable<Element> aReferenceParameters)
    Create a new endpoint reference for the given address, using the specified reference parameters.
    static String
    getAddress(jakarta.xml.ws.wsaddressing.W3CEndpointReference aEndpointReference)
    Get the address contained in the passed endpoint reference.
    See https://github.com/jakartaee/jax-ws-api/issues/167 why this is done so stupidly
    static Element
    getReferenceParameter(jakarta.xml.ws.wsaddressing.W3CEndpointReference aEndpointReference, int nIndex)
    Get the reference parameter at the given index
    static com.helger.commons.collection.impl.ICommonsList<Element>
    getReferenceParameters(jakarta.xml.ws.wsaddressing.W3CEndpointReference aEndpointReference)
    Get a list of all reference parameters contained in the passed endpoint reference.

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • Method Details

    • createEndpointReference

      @Nonnull public static jakarta.xml.ws.wsaddressing.W3CEndpointReference createEndpointReference(@Nonnull String sAddress)
      Create a new endpoint reference for the given address without reference parameters.
      Parameters:
      sAddress - The address to use. May not be null but may be empty to .
      Returns:
      The non-null endpoint reference for the given address
    • createEndpointReference

      @Nonnull public static jakarta.xml.ws.wsaddressing.W3CEndpointReference createEndpointReference(@Nonnull String sAddress, @Nonnull Iterable<Element> aReferenceParameters)
      Create a new endpoint reference for the given address, using the specified reference parameters.
      Parameters:
      sAddress - The address to use. May not be null but may be empty.
      aReferenceParameters - The non-null list of reference parameters. May not be null.
      Returns:
      The non-null endpoint reference for the given address
    • getAddress

      @Nullable public static String getAddress(@Nonnull jakarta.xml.ws.wsaddressing.W3CEndpointReference aEndpointReference)
      Get the address contained in the passed endpoint reference.
      See https://github.com/jakartaee/jax-ws-api/issues/167 why this is done so stupidly
      Parameters:
      aEndpointReference - The endpoint reference to retrieve the address from. May not be null.
      Returns:
      The contained address.
    • getReferenceParameters

      @Nullable public static com.helger.commons.collection.impl.ICommonsList<Element> getReferenceParameters(@Nonnull jakarta.xml.ws.wsaddressing.W3CEndpointReference aEndpointReference)
      Get a list of all reference parameters contained in the passed endpoint reference.
      Parameters:
      aEndpointReference - The endpoint reference to retrieve the reference parameters. May not be null.
      Returns:
      A mutable element list
    • getReferenceParameter

      @Nullable public static Element getReferenceParameter(@Nonnull jakarta.xml.ws.wsaddressing.W3CEndpointReference aEndpointReference, @Nonnegative int nIndex)
      Get the reference parameter at the given index
      Parameters:
      aEndpointReference - The object to retrieve the reference parameter from. May not be null.
      nIndex - The index to retrieve. Must be ≥ 0.
      Returns:
      null if the index is invalid