com.sun.xml.ws.tx.coord.v11.XmlTypeAdapter Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of webservices-osgi Show documentation
Show all versions of webservices-osgi Show documentation
Metro Web Services Runtime OSGi Bundle
/*
* Copyright (c) 1997, 2020 Oracle and/or its affiliates. All rights reserved.
*
* This program and the accompanying materials are made available under the
* terms of the Eclipse Distribution License v. 1.0, which is available at
* http://www.eclipse.org/org/documents/edl-v10.php.
*
* SPDX-License-Identifier: BSD-3-Clause
*/
package com.sun.xml.ws.tx.coord.v11;
import org.glassfish.jaxb.runtime.api.JAXBRIContext;
import com.sun.xml.ws.tx.coord.common.types.*;
import com.sun.xml.ws.tx.coord.v11.types.*;
import com.sun.xml.ws.tx.coord.v11.types.RegisterResponseType;
import com.sun.xml.ws.tx.at.WSATConstants;
import javax.xml.namespace.QName;
import jakarta.xml.ws.wsaddressing.W3CEndpointReference;
import jakarta.xml.ws.WebServiceException;
import jakarta.xml.bind.JAXBException;
import java.util.List;
import java.util.Map;
public class XmlTypeAdapter {
public static BaseExpires adapt(final Expires delegate) {
if (delegate == null) return null;
else return new ExpiresImpl(delegate);
}
public static BaseIdentifier adapt(final CoordinationContextType.Identifier delegate) {
if (delegate == null) return null;
else return new IdentifierImpl(delegate);
}
/*
public CoordinationContextTypeIF adapt(final CoordinationContextType delegate) {
if (delegate == null) return null;
else return new CoordinationContextTypeImpl(delegate, this);
}
*/
public static CoordinationContextIF adapt(final CoordinationContext delegate) {
if (delegate == null) return null;
else return new CoordinationContextImpl(delegate);
}
public static BaseRegisterType adapt(final RegisterType delegate) {
if (delegate == null) return null;
else return new RegisterTypeImpl(delegate);
}
public static BaseRegisterType newRegisterType() {
return new RegisterTypeImpl(new RegisterType());
}
public static BaseRegisterResponseType adapt(final RegisterResponseType delegate) {
if (delegate == null) return null;
else return new RegisterResponseTypeImpl(delegate);
}
public static BaseRegisterResponseType newRegisterResponseType() {
return new RegisterResponseTypeImpl(new RegisterResponseType());
}
static class ExpiresImpl extends BaseExpires {
protected ExpiresImpl(Expires delegate) {
super(delegate);
}
public long getValue() {
return delegate.getValue();
}
public void setValue(long value) {
delegate.setValue(value);
}
public Map getOtherAttributes() {
return delegate.getOtherAttributes();
}
}
static class IdentifierImpl extends BaseIdentifier {
protected IdentifierImpl(CoordinationContextType.Identifier delegate) {
super(delegate);
}
public String getValue() {
return delegate.getValue();
}
public void setValue(String value) {
delegate.setValue(value);
}
public Map getOtherAttributes() {
return delegate.getOtherAttributes();
}
public QName getQName() {
return new QName(WSATConstants.WSCOOR11_NS_URI,WSATConstants.IDENTIFIER);
}
}
public static class CoordinationContextTypeImpl implements CoordinationContextTypeIF {
private CoordinationContextType delegate;
public CoordinationContextTypeImpl(CoordinationContextType delegate) {
this.delegate = delegate;
}
public BaseIdentifier getIdentifier() {
return XmlTypeAdapter.adapt(delegate.getIdentifier());
}
public void setIdentifier(BaseIdentifier value) {
delegate.setIdentifier(value.getDelegate());
}
public BaseExpires getExpires() {
return XmlTypeAdapter.adapt(delegate.getExpires());
}
public void setExpires(BaseExpires value) {
delegate.setExpires(value.getDelegate());
}
public String getCoordinationType() {
return delegate.getCoordinationType();
}
public void setCoordinationType(String value) {
delegate.setCoordinationType(value);
}
public W3CEndpointReference getRegistrationService() {
return delegate.getRegistrationService();
}
public void setRegistrationService(W3CEndpointReference value) {
delegate.setRegistrationService(value);
}
public Map getOtherAttributes() {
return delegate.getOtherAttributes();
}
public CoordinationContextType getDelegate() {
return delegate;
}
}
public static class CoordinationContextImpl extends CoordinationContextTypeImpl implements CoordinationContextIF {
final static JAXBRIContext jaxbContext = getCoordinationContextJaxbContext();
private static JAXBRIContext getCoordinationContextJaxbContext() {
try {
return (JAXBRIContext)JAXBRIContext.newInstance(CoordinationContext.class);
} catch (JAXBException e) {
throw new WebServiceException("Error creating JAXBContext for CoordinationContext. ", e);
}
}
public CoordinationContextImpl(CoordinationContext delegate) {
super(delegate);
}
public List