public static <T extends EndpointReference> T transform(Class<T> clazz, EndpointReference epr) { assert epr != null; if (clazz.isAssignableFrom(W3CEndpointReference.class)) { if (epr instanceof W3CEndpointReference) { return (T)epr; } else if (epr instanceof NativeEndpointReference) { return (T)W3CEndpointReference.readFrom(getSourceFromEndpointReference(epr)); } else { throw new WebServiceException("Unsupported EndpointReference: " + epr); } } else if (clazz.isAssignableFrom(NativeEndpointReference.class)) { return (T)NativeEndpointReference.readFrom(getSourceFromEndpointReference(epr)); } //transformations from different types of EndpointReference could be supported in future... throw new WebServiceException("EndpointReference of type " + clazz + " not supported."); }
public static <T extends EndpointReference> T transform(Class<T> clazz, EndpointReference epr) { assert epr != null; if (clazz.isAssignableFrom(W3CEndpointReference.class)) { if (epr instanceof W3CEndpointReference) { return (T)epr; } else if (epr instanceof NativeEndpointReference) { return (T)W3CEndpointReference.readFrom(getSourceFromEndpointReference(epr)); } else { throw new WebServiceException("Unsupported EndpointReference: " + epr); } } else if (clazz.isAssignableFrom(NativeEndpointReference.class)) { return (T)NativeEndpointReference.readFrom(getSourceFromEndpointReference(epr)); } //transformations from different types of EndpointReference could be supported in future... throw new WebServiceException("EndpointReference of type " + clazz + " not supported."); }
public static <T extends EndpointReference> T transform(Class<T> clazz, EndpointReference epr) { assert epr != null; if (clazz.isAssignableFrom(W3CEndpointReference.class)) { if (epr instanceof W3CEndpointReference) { return (T)epr; } else if (epr instanceof NativeEndpointReference) { return (T)W3CEndpointReference.readFrom(getSourceFromEndpointReference(epr)); } else { throw new WebServiceException("Unsupported EndpointReference: " + epr); } } else if (clazz.isAssignableFrom(NativeEndpointReference.class)) { return (T)NativeEndpointReference.readFrom(getSourceFromEndpointReference(epr)); } //transformations from different types of EndpointReference could be supported in future... throw new WebServiceException("EndpointReference of type " + clazz + " not supported."); }
public static <T extends EndpointReference> T transform(Class<T> clazz, EndpointReference epr) { assert epr != null; if (clazz.isAssignableFrom(W3CEndpointReference.class)) { if (epr instanceof W3CEndpointReference) { return (T)epr; } else if (epr instanceof NativeEndpointReference) { return (T)W3CEndpointReference.readFrom(getSourceFromEndpointReference(epr)); } else { throw new WebServiceException("Unsupported EndpointReference: " + epr); } } else if (clazz.isAssignableFrom(NativeEndpointReference.class)) { return (T)NativeEndpointReference.readFrom(getSourceFromEndpointReference(epr)); } //transformations from different types of EndpointReference could be supported in future... throw new WebServiceException("EndpointReference of type " + clazz + " not supported."); }