com.sun.xml.internal.ws.model.ParameterImpl Java Examples

The following examples show how to use com.sun.xml.internal.ws.model.ParameterImpl. You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example #1
Source File: ResponseBuilder.java    From openjdk-8 with GNU General Public License v2.0 6 votes vote down vote up
/**
 * Creates an AttachmentBuilder based on the parameter type
 *
 * @param param
 *      runtime Parameter that abstracts the annotated java parameter
 * @param setter
 *      specifies how the obtained value is set into the argument. Takes
 *      care of Holder arguments.
 */
public static ResponseBuilder createAttachmentBuilder(ParameterImpl param, ValueSetter setter) {
    Class type = (Class)param.getTypeInfo().type;
    if (DataHandler.class.isAssignableFrom(type)) {
        return new DataHandlerBuilder(param, setter);
    } else if (byte[].class==type) {
        return new ByteArrayBuilder(param, setter);
    } else if(Source.class.isAssignableFrom(type)) {
        return new SourceBuilder(param, setter);
    } else if(Image.class.isAssignableFrom(type)) {
        return new ImageBuilder(param, setter);
    } else if(InputStream.class==type) {
        return new InputStreamBuilder(param, setter);
    } else if(isXMLMimeType(param.getBinding().getMimeType())) {
        return new JAXBBuilder(param, setter);
    } else if(String.class.isAssignableFrom(type)) {
        return new StringBuilder(param, setter);
    } else {
        throw new UnsupportedOperationException("Unexpected Attachment type ="+type);
    }
}
 
Example #2
Source File: WSDLGenerator.java    From openjdk-8-source with GNU General Public License v2.0 6 votes vote down vote up
/**
 * Generates the parameterOrder for a PortType operation
 * @param operation the operation to generate the parameterOrder for
 * @param method the {@link JavaMethod} to generate the parameterOrder from
 */
protected void generateRpcParameterOrder(Operation operation, JavaMethodImpl method) {
    String partName;
    StringBuilder paramOrder = new StringBuilder();
    Set<String> partNames = new HashSet<String>();
    List<ParameterImpl> sortedParams = sortMethodParameters(method);
    int i = 0;
    for (ParameterImpl parameter : sortedParams) {
        if (parameter.getIndex() >= 0) {
            partName = parameter.getPartName();
            if (!partNames.contains(partName)) {
                if (i++ > 0)
                    paramOrder.append(' ');
                paramOrder.append(partName);
                partNames.add(partName);
            }
        }
    }
    if (i > 1) {
        operation.parameterOrder(paramOrder.toString());
    }
}
 
Example #3
Source File: WSDLGenerator.java    From hottub with GNU General Public License v2.0 6 votes vote down vote up
/**
 * Generates the parameterOrder for a PortType operation
 * @param operation the operation to generate the parameterOrder for
 * @param method the {@link JavaMethod} to generate the parameterOrder from
 */
protected void generateRpcParameterOrder(Operation operation, JavaMethodImpl method) {
    String partName;
    StringBuilder paramOrder = new StringBuilder();
    Set<String> partNames = new HashSet<String>();
    List<ParameterImpl> sortedParams = sortMethodParameters(method);
    int i = 0;
    for (ParameterImpl parameter : sortedParams) {
        if (parameter.getIndex() >= 0) {
            partName = parameter.getPartName();
            if (!partNames.contains(partName)) {
                if (i++ > 0)
                    paramOrder.append(' ');
                paramOrder.append(partName);
                partNames.add(partName);
            }
        }
    }
    if (i > 1) {
        operation.parameterOrder(paramOrder.toString());
    }
}
 
Example #4
Source File: EndpointArgumentsBuilder.java    From openjdk-jdk9 with GNU General Public License v2.0 6 votes vote down vote up
/**
 * Creates an AttachmentBuilder based on the parameter type
 *
 * @param param
 *      runtime Parameter that abstracts the annotated java parameter
 * @param setter
 *      specifies how the obtained value is set into the argument. Takes
 *      care of Holder arguments.
 */
public static EndpointArgumentsBuilder createAttachmentBuilder(ParameterImpl param, EndpointValueSetter setter) {
    Class type = (Class)param.getTypeInfo().type;
    if (DataHandler.class.isAssignableFrom(type)) {
        return new DataHandlerBuilder(param, setter);
    } else if (byte[].class==type) {
        return new ByteArrayBuilder(param, setter);
    } else if(Source.class.isAssignableFrom(type)) {
        return new SourceBuilder(param, setter);
    } else if(Image.class.isAssignableFrom(type)) {
        return new ImageBuilder(param, setter);
    } else if(InputStream.class==type) {
        return new InputStreamBuilder(param, setter);
    } else if(isXMLMimeType(param.getBinding().getMimeType())) {
        return new JAXBBuilder(param, setter);
    } else if(String.class.isAssignableFrom(type)) {
        return new StringBuilder(param, setter);
    } else {
        throw new UnsupportedOperationException("Unknown Type="+type+" Attachment is not mapped.");
    }
}
 
Example #5
Source File: EndpointArgumentsBuilder.java    From hottub with GNU General Public License v2.0 6 votes vote down vote up
/**
 * Creates an AttachmentBuilder based on the parameter type
 *
 * @param param
 *      runtime Parameter that abstracts the annotated java parameter
 * @param setter
 *      specifies how the obtained value is set into the argument. Takes
 *      care of Holder arguments.
 */
public static EndpointArgumentsBuilder createAttachmentBuilder(ParameterImpl param, EndpointValueSetter setter) {
    Class type = (Class)param.getTypeInfo().type;
    if (DataHandler.class.isAssignableFrom(type)) {
        return new DataHandlerBuilder(param, setter);
    } else if (byte[].class==type) {
        return new ByteArrayBuilder(param, setter);
    } else if(Source.class.isAssignableFrom(type)) {
        return new SourceBuilder(param, setter);
    } else if(Image.class.isAssignableFrom(type)) {
        return new ImageBuilder(param, setter);
    } else if(InputStream.class==type) {
        return new InputStreamBuilder(param, setter);
    } else if(isXMLMimeType(param.getBinding().getMimeType())) {
        return new JAXBBuilder(param, setter);
    } else if(String.class.isAssignableFrom(type)) {
        return new StringBuilder(param, setter);
    } else {
        throw new UnsupportedOperationException("Unknown Type="+type+" Attachment is not mapped.");
    }
}
 
Example #6
Source File: EndpointArgumentsBuilder.java    From openjdk-jdk8u with GNU General Public License v2.0 5 votes vote down vote up
public Header(SOAPVersion soapVersion, ParameterImpl param, EndpointValueSetter setter) {
    this(
        soapVersion,
        param.getTypeInfo().tagName,
        param.getXMLBridge(),
        setter);
    assert param.getOutBinding()== ParameterBinding.HEADER;
}
 
Example #7
Source File: ResponseBuilder.java    From TencentKona-8 with GNU General Public License v2.0 5 votes vote down vote up
public Header(SOAPVersion soapVersion, ParameterImpl param, ValueSetter setter) {
    this(soapVersion,
        param.getTypeInfo().tagName,
        param.getXMLBridge(),
        setter);
    assert param.getOutBinding()== ParameterBinding.HEADER;
}
 
Example #8
Source File: EndpointResponseMessageBuilder.java    From TencentKona-8 with GNU General Public License v2.0 5 votes vote down vote up
/**
 * Creates a {@link EndpointResponseMessageBuilder} from a {@link WrapperParameter}.
 */
public DocLit(WrapperParameter wp, SOAPVersion soapVersion) {
    super(wp, soapVersion);
    bindingContext = wp.getOwner().getBindingContext();
    wrapper = (Class)wp.getXMLBridge().getTypeInfo().type;
    dynamicWrapper = WrapperComposite.class.equals(wrapper);
    children = wp.getWrapperChildren();
    parameterBridges = new XMLBridge[children.size()];
    accessors = new PropertyAccessor[children.size()];
    for( int i=0; i<accessors.length; i++ ) {
        ParameterImpl p = children.get(i);
        QName name = p.getName();
        if (dynamicWrapper) {
            parameterBridges[i] = children.get(i).getInlinedRepeatedElementBridge();
            if (parameterBridges[i] == null) parameterBridges[i] = children.get(i).getXMLBridge();
        } else {
            try {
                accessors[i] = (dynamicWrapper) ? null :
                    p.getOwner().getBindingContext().getElementPropertyAccessor(
                    wrapper, name.getNamespaceURI(), name.getLocalPart() );
            } catch (JAXBException e) {
                throw new WebServiceException(  // TODO: i18n
                    wrapper+" do not have a property of the name "+name,e);
            }
        }
    }

}
 
Example #9
Source File: ValueSetter.java    From hottub with GNU General Public License v2.0 5 votes vote down vote up
/**
 * Returns a {@link ValueSetter} suitable for the given {@link Parameter}.
 */
static ValueSetter getSync(ParameterImpl p) {
    int idx = p.getIndex();

    if(idx==-1)
        return RETURN_VALUE;
    if(idx<POOL.length)
        return POOL[idx];
    else
        return new Param(idx);
}
 
Example #10
Source File: BodyBuilder.java    From jdk8u60 with GNU General Public License v2.0 5 votes vote down vote up
protected Wrapped(WrapperParameter wp, SOAPVersion soapVersion, ValueGetterFactory getter) {
    super(wp.getXMLBridge(), soapVersion);
    children = wp.getWrapperChildren();
    indices = new int[children.size()];
    getters = new ValueGetter[children.size()];
    for( int i=0; i<indices.length; i++ ) {
        ParameterImpl p = children.get(i);
        indices[i] = p.getIndex();
        getters[i] = getter.get(p);
    }
}
 
Example #11
Source File: MessageFiller.java    From openjdk-jdk9 with GNU General Public License v2.0 5 votes vote down vote up
/**
 * Creates an MessageFiller based on the parameter type
 *
 * @param param
 *      runtime Parameter that abstracts the annotated java parameter
 * @param getter
 *      Gets a value from an object that represents a parameter passed
 *      as a method argument.
 */
public static MessageFiller createAttachmentFiller(ParameterImpl param, ValueGetter getter) {
    Class type = (Class)param.getTypeInfo().type;
    if (DataHandler.class.isAssignableFrom(type) || Source.class.isAssignableFrom(type)) {
        return new DataHandlerFiller(param, getter);
    } else if (byte[].class==type) {
        return new ByteArrayFiller(param, getter);
    } else if(isXMLMimeType(param.getBinding().getMimeType())) {
        return new JAXBFiller(param, getter);
    } else {
        return new DataHandlerFiller(param, getter);
    }
}
 
Example #12
Source File: ValueSetter.java    From openjdk-8 with GNU General Public License v2.0 5 votes vote down vote up
/**
 * Returns a {@link ValueSetter} suitable for the given {@link Parameter}.
 */
static ValueSetter getSync(ParameterImpl p) {
    int idx = p.getIndex();

    if(idx==-1)
        return RETURN_VALUE;
    if(idx<POOL.length)
        return POOL[idx];
    else
        return new Param(idx);
}
 
Example #13
Source File: MessageFiller.java    From openjdk-jdk8u-backup with GNU General Public License v2.0 5 votes vote down vote up
protected AttachmentFiller(ParameterImpl param, ValueGetter getter) {
    super(param.getIndex());
    this.param = param;
    this.getter = getter;
    mimeType = param.getBinding().getMimeType();
    try {
        contentIdPart = URLEncoder.encode(param.getPartName(), "UTF-8")+'=';
    } catch (UnsupportedEncodingException e) {
        throw new WebServiceException(e);
    }
}
 
Example #14
Source File: WSDLGenerator.java    From openjdk-jdk9 with GNU General Public License v2.0 5 votes vote down vote up
protected void splitParameters(List<ParameterImpl> bodyParams, List<ParameterImpl> headerParams, List<ParameterImpl> params) {
    for (ParameterImpl parameter : params) {
        if (isBodyParameter(parameter)) {
            bodyParams.add(parameter);
        } else {
            headerParams.add(parameter);
        }
    }
}
 
Example #15
Source File: WSDLGenerator.java    From openjdk-jdk8u with GNU General Public License v2.0 5 votes vote down vote up
/**
 * Determines if the <CODE>method</CODE> is wrapper style
 * @param method The {@link JavaMethod} to check if it is wrapper style
 * @return true if the method is wrapper style, otherwise, false.
 */
protected boolean isWrapperStyle(JavaMethodImpl method) {
    if (method.getRequestParameters().size() > 0) {
        ParameterImpl param = method.getRequestParameters().iterator().next();
        return param.isWrapperStyle();
    }
    return false;
}
 
Example #16
Source File: MessageFiller.java    From openjdk-8-source with GNU General Public License v2.0 5 votes vote down vote up
protected AttachmentFiller(ParameterImpl param, ValueGetter getter) {
    super(param.getIndex());
    this.param = param;
    this.getter = getter;
    mimeType = param.getBinding().getMimeType();
    try {
        contentIdPart = URLEncoder.encode(param.getPartName(), "UTF-8")+'=';
    } catch (UnsupportedEncodingException e) {
        throw new WebServiceException(e);
    }
}
 
Example #17
Source File: MessageFiller.java    From openjdk-jdk9 with GNU General Public License v2.0 5 votes vote down vote up
/**
 * Creates an MessageFiller based on the parameter type
 *
 * @param param
 *      runtime Parameter that abstracts the annotated java parameter
 * @param getter
 *      Gets a value from an object that represents a parameter passed
 *      as a method argument.
 */
public static MessageFiller createAttachmentFiller(ParameterImpl param, ValueGetter getter) {
    Class type = (Class)param.getTypeInfo().type;
    if (DataHandler.class.isAssignableFrom(type) || Source.class.isAssignableFrom(type)) {
        return new DataHandlerFiller(param, getter);
    } else if (byte[].class==type) {
        return new ByteArrayFiller(param, getter);
    } else if(isXMLMimeType(param.getBinding().getMimeType())) {
        return new JAXBFiller(param, getter);
    } else {
        return new DataHandlerFiller(param, getter);
    }
}
 
Example #18
Source File: MessageFiller.java    From openjdk-jdk8u-backup with GNU General Public License v2.0 5 votes vote down vote up
/**
 * Creates an MessageFiller based on the parameter type
 *
 * @param param
 *      runtime Parameter that abstracts the annotated java parameter
 * @param getter
 *      Gets a value from an object that represents a parameter passed
 *      as a method argument.
 */
public static MessageFiller createAttachmentFiller(ParameterImpl param, ValueGetter getter) {
    Class type = (Class)param.getTypeInfo().type;
    if (DataHandler.class.isAssignableFrom(type) || Source.class.isAssignableFrom(type)) {
        return new DataHandlerFiller(param, getter);
    } else if (byte[].class==type) {
        return new ByteArrayFiller(param, getter);
    } else if(isXMLMimeType(param.getBinding().getMimeType())) {
        return new JAXBFiller(param, getter);
    } else {
        return new DataHandlerFiller(param, getter);
    }
}
 
Example #19
Source File: WSDLGenerator.java    From openjdk-8 with GNU General Public License v2.0 5 votes vote down vote up
protected void generateSOAPHeaders(TypedXmlWriter writer, List<ParameterImpl> parameters, QName message) {

        for (ParameterImpl headerParam : parameters) {
            Header header = writer._element(Header.class);
            header.message(message);
            header.part(headerParam.getPartName());
            header.use(LITERAL);
        }
    }
 
Example #20
Source File: MessageFiller.java    From TencentKona-8 with GNU General Public License v2.0 5 votes vote down vote up
/**
 * Creates an MessageFiller based on the parameter type
 *
 * @param param
 *      runtime Parameter that abstracts the annotated java parameter
 * @param getter
 *      Gets a value from an object that represents a parameter passed
 *      as a method argument.
 */
public static MessageFiller createAttachmentFiller(ParameterImpl param, ValueGetter getter) {
    Class type = (Class)param.getTypeInfo().type;
    if (DataHandler.class.isAssignableFrom(type) || Source.class.isAssignableFrom(type)) {
        return new DataHandlerFiller(param, getter);
    } else if (byte[].class==type) {
        return new ByteArrayFiller(param, getter);
    } else if(isXMLMimeType(param.getBinding().getMimeType())) {
        return new JAXBFiller(param, getter);
    } else {
        return new DataHandlerFiller(param, getter);
    }
}
 
Example #21
Source File: WSDLGenerator.java    From openjdk-jdk8u with GNU General Public License v2.0 5 votes vote down vote up
protected void splitParameters(List<ParameterImpl> bodyParams, List<ParameterImpl> headerParams, List<ParameterImpl> params) {
    for (ParameterImpl parameter : params) {
        if (isBodyParameter(parameter)) {
            bodyParams.add(parameter);
        } else {
            headerParams.add(parameter);
        }
    }
}
 
Example #22
Source File: MessageFiller.java    From openjdk-8-source with GNU General Public License v2.0 5 votes vote down vote up
/**
 * Creates an MessageFiller based on the parameter type
 *
 * @param param
 *      runtime Parameter that abstracts the annotated java parameter
 * @param getter
 *      Gets a value from an object that represents a parameter passed
 *      as a method argument.
 */
public static MessageFiller createAttachmentFiller(ParameterImpl param, ValueGetter getter) {
    Class type = (Class)param.getTypeInfo().type;
    if (DataHandler.class.isAssignableFrom(type) || Source.class.isAssignableFrom(type)) {
        return new DataHandlerFiller(param, getter);
    } else if (byte[].class==type) {
        return new ByteArrayFiller(param, getter);
    } else if(isXMLMimeType(param.getBinding().getMimeType())) {
        return new JAXBFiller(param, getter);
    } else {
        return new DataHandlerFiller(param, getter);
    }
}
 
Example #23
Source File: ResponseBuilder.java    From hottub with GNU General Public License v2.0 5 votes vote down vote up
public Header(SOAPVersion soapVersion, ParameterImpl param, ValueSetter setter) {
    this(soapVersion,
        param.getTypeInfo().tagName,
        param.getXMLBridge(),
        setter);
    assert param.getOutBinding()== ParameterBinding.HEADER;
}
 
Example #24
Source File: WSDLGenerator.java    From openjdk-8-source with GNU General Public License v2.0 5 votes vote down vote up
/**
 * Determines if the <CODE>method</CODE> is wrapper style
 * @param method The {@link JavaMethod} to check if it is wrapper style
 * @return true if the method is wrapper style, otherwise, false.
 */
protected boolean isWrapperStyle(JavaMethodImpl method) {
    if (method.getRequestParameters().size() > 0) {
        ParameterImpl param = method.getRequestParameters().iterator().next();
        return param.isWrapperStyle();
    }
    return false;
}
 
Example #25
Source File: WSDLGenerator.java    From openjdk-jdk8u-backup with GNU General Public License v2.0 5 votes vote down vote up
/**
 * Determines if the <CODE>method</CODE> is wrapper style
 * @param method The {@link JavaMethod} to check if it is wrapper style
 * @return true if the method is wrapper style, otherwise, false.
 */
protected boolean isWrapperStyle(JavaMethodImpl method) {
    if (method.getRequestParameters().size() > 0) {
        ParameterImpl param = method.getRequestParameters().iterator().next();
        return param.isWrapperStyle();
    }
    return false;
}
 
Example #26
Source File: WSDLGenerator.java    From openjdk-jdk8u-backup with GNU General Public License v2.0 5 votes vote down vote up
protected void generateSOAPHeaders(TypedXmlWriter writer, List<ParameterImpl> parameters, QName message) {

        for (ParameterImpl headerParam : parameters) {
            Header header = writer._element(Header.class);
            header.message(message);
            header.part(headerParam.getPartName());
            header.use(LITERAL);
        }
    }
 
Example #27
Source File: ValueSetter.java    From openjdk-jdk8u with GNU General Public License v2.0 5 votes vote down vote up
AsyncBeanValueSetter(ParameterImpl p, Class wrapper) {
    QName name = p.getName();
    try {
        accessor = p.getOwner().getBindingContext().getElementPropertyAccessor(
                    wrapper, name.getNamespaceURI(), name.getLocalPart() );
    } catch (JAXBException e) {
            throw new WebServiceException(  // TODO: i18n
                wrapper+" do not have a property of the name "+name,e);
    }
}
 
Example #28
Source File: MessageFiller.java    From openjdk-jdk8u with GNU General Public License v2.0 4 votes vote down vote up
protected JAXBFiller(ParameterImpl param, ValueGetter getter) {
    super(param, getter);
}
 
Example #29
Source File: MessageFiller.java    From jdk8u60 with GNU General Public License v2.0 4 votes vote down vote up
protected JAXBFiller(ParameterImpl param, ValueGetter getter) {
    super(param, getter);
}
 
Example #30
Source File: ResponseBuilder.java    From openjdk-8-source with GNU General Public License v2.0 4 votes vote down vote up
DataHandlerBuilder(ParameterImpl param, ValueSetter setter) {
    super(param, setter);
}