Java源码示例:com.sun.xml.internal.ws.encoding.xml.XMLMessage.UnknownContent

示例1
@Override
public void decode(InputStream in, String contentType, Packet packet) throws IOException {
    /**
     * Reset the encoding state when on the server side for each
     * decode/encode step.
     */
    if (packet.contentNegotiation == null)
        useFastInfosetForEncoding = false;

    if (contentType == null) {
        xmlCodec.decode(in, contentType, packet);
    } else if (isMultipartRelated(contentType)) {
        packet.setMessage(new XMLMultiPart(contentType, in, features));
    } else if(isFastInfoset(contentType)) {
        if (fiCodec == null) {
            throw new RuntimeException(StreamingMessages.FASTINFOSET_NO_IMPLEMENTATION());
        }

        useFastInfosetForEncoding = true;
        fiCodec.decode(in, contentType, packet);
    } else if (isXml(contentType)) {
        xmlCodec.decode(in, contentType, packet);
    } else {
        packet.setMessage(new UnknownContent(contentType, in));
    }

    if (!useFastInfosetForEncoding) {
        useFastInfosetForEncoding = isFastInfosetAcceptable(packet.acceptableMimeTypes);
    }
}
 
示例2
@Override
public void decode(InputStream in, String contentType, Packet packet) throws IOException {
    /**
     * Reset the encoding state when on the server side for each
     * decode/encode step.
     */
    if (packet.contentNegotiation == null)
        useFastInfosetForEncoding = false;

    if (contentType == null) {
        xmlCodec.decode(in, contentType, packet);
    } else if (isMultipartRelated(contentType)) {
        packet.setMessage(new XMLMultiPart(contentType, in, features));
    } else if(isFastInfoset(contentType)) {
        if (fiCodec == null) {
            throw new RuntimeException(StreamingMessages.FASTINFOSET_NO_IMPLEMENTATION());
        }

        useFastInfosetForEncoding = true;
        fiCodec.decode(in, contentType, packet);
    } else if (isXml(contentType)) {
        xmlCodec.decode(in, contentType, packet);
    } else {
        packet.setMessage(new UnknownContent(contentType, in));
    }

    if (!useFastInfosetForEncoding) {
        useFastInfosetForEncoding = isFastInfosetAcceptable(packet.acceptableMimeTypes);
    }
}
 
示例3
@Override
public void decode(InputStream in, String contentType, Packet packet) throws IOException {
    /**
     * Reset the encoding state when on the server side for each
     * decode/encode step.
     */
    if (packet.contentNegotiation == null)
        useFastInfosetForEncoding = false;

    if (contentType == null) {
        xmlCodec.decode(in, contentType, packet);
    } else if (isMultipartRelated(contentType)) {
        packet.setMessage(new XMLMultiPart(contentType, in, features));
    } else if(isFastInfoset(contentType)) {
        if (fiCodec == null) {
            throw new RuntimeException(StreamingMessages.FASTINFOSET_NO_IMPLEMENTATION());
        }

        useFastInfosetForEncoding = true;
        fiCodec.decode(in, contentType, packet);
    } else if (isXml(contentType)) {
        xmlCodec.decode(in, contentType, packet);
    } else {
        packet.setMessage(new UnknownContent(contentType, in));
    }

    if (!useFastInfosetForEncoding) {
        useFastInfosetForEncoding = isFastInfosetAcceptable(packet.acceptableMimeTypes);
    }
}
 
示例4
@Override
public void decode(InputStream in, String contentType, Packet packet) throws IOException {
    /**
     * Reset the encoding state when on the server side for each
     * decode/encode step.
     */
    if (packet.contentNegotiation == null)
        useFastInfosetForEncoding = false;

    if (contentType == null) {
        xmlCodec.decode(in, contentType, packet);
    } else if (isMultipartRelated(contentType)) {
        packet.setMessage(new XMLMultiPart(contentType, in, features));
    } else if(isFastInfoset(contentType)) {
        if (fiCodec == null) {
            throw new RuntimeException(StreamingMessages.FASTINFOSET_NO_IMPLEMENTATION());
        }

        useFastInfosetForEncoding = true;
        fiCodec.decode(in, contentType, packet);
    } else if (isXml(contentType)) {
        xmlCodec.decode(in, contentType, packet);
    } else {
        packet.setMessage(new UnknownContent(contentType, in));
    }

    if (!useFastInfosetForEncoding) {
        useFastInfosetForEncoding = isFastInfosetAcceptable(packet.acceptableMimeTypes);
    }
}
 
示例5
@Override
public void decode(InputStream in, String contentType, Packet packet) throws IOException {
    /**
     * Reset the encoding state when on the server side for each
     * decode/encode step.
     */
    if (packet.contentNegotiation == null)
        useFastInfosetForEncoding = false;

    if (contentType == null) {
        xmlCodec.decode(in, contentType, packet);
    } else if (isMultipartRelated(contentType)) {
        packet.setMessage(new XMLMultiPart(contentType, in, features));
    } else if(isFastInfoset(contentType)) {
        if (fiCodec == null) {
            throw new RuntimeException(StreamingMessages.FASTINFOSET_NO_IMPLEMENTATION());
        }

        useFastInfosetForEncoding = true;
        fiCodec.decode(in, contentType, packet);
    } else if (isXml(contentType)) {
        xmlCodec.decode(in, contentType, packet);
    } else {
        packet.setMessage(new UnknownContent(contentType, in));
    }

    if (!useFastInfosetForEncoding) {
        useFastInfosetForEncoding = isFastInfosetAcceptable(packet.acceptableMimeTypes);
    }
}
 
示例6
@Override
public void decode(InputStream in, String contentType, Packet packet) throws IOException {
    /**
     * Reset the encoding state when on the server side for each
     * decode/encode step.
     */
    if (packet.contentNegotiation == null)
        useFastInfosetForEncoding = false;

    if (contentType == null) {
        xmlCodec.decode(in, contentType, packet);
    } else if (isMultipartRelated(contentType)) {
        packet.setMessage(new XMLMultiPart(contentType, in, features));
    } else if(isFastInfoset(contentType)) {
        if (fiCodec == null) {
            throw new RuntimeException(StreamingMessages.FASTINFOSET_NO_IMPLEMENTATION());
        }

        useFastInfosetForEncoding = true;
        fiCodec.decode(in, contentType, packet);
    } else if (isXml(contentType)) {
        xmlCodec.decode(in, contentType, packet);
    } else {
        packet.setMessage(new UnknownContent(contentType, in));
    }

    if (!useFastInfosetForEncoding) {
        useFastInfosetForEncoding = isFastInfosetAcceptable(packet.acceptableMimeTypes);
    }
}
 
示例7
@Override
public void decode(InputStream in, String contentType, Packet packet) throws IOException {
    /**
     * Reset the encoding state when on the server side for each
     * decode/encode step.
     */
    if (packet.contentNegotiation == null)
        useFastInfosetForEncoding = false;

    if (contentType == null) {
        xmlCodec.decode(in, contentType, packet);
    } else if (isMultipartRelated(contentType)) {
        packet.setMessage(new XMLMultiPart(contentType, in, features));
    } else if(isFastInfoset(contentType)) {
        if (fiCodec == null) {
            throw new RuntimeException(StreamingMessages.FASTINFOSET_NO_IMPLEMENTATION());
        }

        useFastInfosetForEncoding = true;
        fiCodec.decode(in, contentType, packet);
    } else if (isXml(contentType)) {
        xmlCodec.decode(in, contentType, packet);
    } else {
        packet.setMessage(new UnknownContent(contentType, in));
    }

    if (!useFastInfosetForEncoding) {
        useFastInfosetForEncoding = isFastInfosetAcceptable(packet.acceptableMimeTypes);
    }
}
 
示例8
@Override
public void decode(InputStream in, String contentType, Packet packet) throws IOException {
    /**
     * Reset the encoding state when on the server side for each
     * decode/encode step.
     */
    if (packet.contentNegotiation == null)
        useFastInfosetForEncoding = false;

    if (contentType == null) {
        xmlCodec.decode(in, contentType, packet);
    } else if (isMultipartRelated(contentType)) {
        packet.setMessage(new XMLMultiPart(contentType, in, features));
    } else if(isFastInfoset(contentType)) {
        if (fiCodec == null) {
            throw new RuntimeException(StreamingMessages.FASTINFOSET_NO_IMPLEMENTATION());
        }

        useFastInfosetForEncoding = true;
        fiCodec.decode(in, contentType, packet);
    } else if (isXml(contentType)) {
        xmlCodec.decode(in, contentType, packet);
    } else {
        packet.setMessage(new UnknownContent(contentType, in));
    }

    if (!useFastInfosetForEncoding) {
        useFastInfosetForEncoding = isFastInfosetAcceptable(packet.acceptableMimeTypes);
    }
}