Java 类javax.websocket.Decoder.TextStream 实例源码

项目:tomcat7    文件:PojoMessageHandlerWholeText.java   
@Override
protected Object decode(String message) throws DecodeException {
    // Handle primitives
    if (primitiveType != null) {
        return Util.coerceToType(primitiveType, message);
    }
    // Handle full decoders
    for (Decoder decoder : decoders) {
        if (decoder instanceof Text) {
            if (((Text<?>) decoder).willDecode(message)) {
                return ((Text<?>) decoder).decode(message);
            }
        } else {
            StringReader r = new StringReader(message);
            try {
                return ((TextStream<?>) decoder).decode(r);
            } catch (IOException ioe) {
                throw new DecodeException(message, sm.getString(
                        "pojoMessageHandlerWhole.decodeIoFail"), ioe);
            }
        }
    }
    return null;
}
项目:apache-tomcat-7.0.73-with-comment    文件:PojoMessageHandlerWholeText.java   
@Override
protected Object decode(String message) throws DecodeException {
    // Handle primitives
    if (primitiveType != null) {
        return Util.coerceToType(primitiveType, message);
    }
    // Handle full decoders
    for (Decoder decoder : decoders) {
        if (decoder instanceof Text) {
            if (((Text<?>) decoder).willDecode(message)) {
                return ((Text<?>) decoder).decode(message);
            }
        } else {
            StringReader r = new StringReader(message);
            try {
                return ((TextStream<?>) decoder).decode(r);
            } catch (IOException ioe) {
                throw new DecodeException(message, sm.getString(
                        "pojoMessageHandlerWhole.decodeIoFail"), ioe);
            }
        }
    }
    return null;
}
项目:lazycat    文件:PojoMessageHandlerWholeText.java   
@Override
protected Object decode(String message) throws DecodeException {
    // Handle primitives
    if (primitiveType != null) {
        return Util.coerceToType(primitiveType, message);
    }
    // Handle full decoders
    for (Decoder decoder : decoders) {
        if (decoder instanceof Text) {
            if (((Text<?>) decoder).willDecode(message)) {
                return ((Text<?>) decoder).decode(message);
            }
        } else {
            StringReader r = new StringReader(message);
            try {
                return ((TextStream<?>) decoder).decode(r);
            } catch (IOException ioe) {
                throw new DecodeException(message, sm.getString("pojoMessageHandlerWhole.decodeIoFail"), ioe);
            }
        }
    }
    return null;
}
项目:class-guard    文件:PojoMessageHandlerWholeText.java   
@Override
protected Object decode(String message) throws DecodeException {
    // Handle primitives
    if (primitiveType != null) {
        return Util.coerceToType(primitiveType, message);
    }
    // Handle full decoders
    for (Decoder decoder : decoders) {
        if (decoder instanceof Text) {
            if (((Text<?>) decoder).willDecode(message)) {
                return ((Text<?>) decoder).decode(message);
            }
        } else {
            StringReader r = new StringReader(message);
            try {
                return ((TextStream<?>) decoder).decode(r);
            } catch (IOException ioe) {
                throw new DecodeException(message, sm.getString(
                        "pojoMessageHandlerWhole.decodeIoFail"), ioe);
            }
        }
    }
    return null;
}
项目:apache-tomcat-7.0.57    文件:PojoMessageHandlerWholeText.java   
@Override
protected Object decode(String message) throws DecodeException {
    // Handle primitives
    if (primitiveType != null) {
        return Util.coerceToType(primitiveType, message);
    }
    // Handle full decoders
    for (Decoder decoder : decoders) {
        if (decoder instanceof Text) {
            if (((Text<?>) decoder).willDecode(message)) {
                return ((Text<?>) decoder).decode(message);
            }
        } else {
            StringReader r = new StringReader(message);
            try {
                return ((TextStream<?>) decoder).decode(r);
            } catch (IOException ioe) {
                throw new DecodeException(message, sm.getString(
                        "pojoMessageHandlerWhole.decodeIoFail"), ioe);
            }
        }
    }
    return null;
}
项目:apache-tomcat-7.0.57    文件:PojoMessageHandlerWholeText.java   
@Override
protected Object decode(String message) throws DecodeException {
    // Handle primitives
    if (primitiveType != null) {
        return Util.coerceToType(primitiveType, message);
    }
    // Handle full decoders
    for (Decoder decoder : decoders) {
        if (decoder instanceof Text) {
            if (((Text<?>) decoder).willDecode(message)) {
                return ((Text<?>) decoder).decode(message);
            }
        } else {
            StringReader r = new StringReader(message);
            try {
                return ((TextStream<?>) decoder).decode(r);
            } catch (IOException ioe) {
                throw new DecodeException(message, sm.getString(
                        "pojoMessageHandlerWhole.decodeIoFail"), ioe);
            }
        }
    }
    return null;
}
项目:tomcat7    文件:Util.java   
public DecoderMatch(Class<?> target, List<DecoderEntry> decoderEntries) {
    this.target = target;
    for (DecoderEntry decoderEntry : decoderEntries) {
        if (decoderEntry.getClazz().isAssignableFrom(target)) {
            if (Binary.class.isAssignableFrom(
                    decoderEntry.getDecoderClazz())) {
                binaryDecoders.add(decoderEntry.getDecoderClazz());
                // willDecode() method means this decoder may or may not
                // decode a message so need to carry on checking for
                // other matches
            } else if (BinaryStream.class.isAssignableFrom(
                    decoderEntry.getDecoderClazz())) {
                binaryDecoders.add(decoderEntry.getDecoderClazz());
                // Stream decoders have to process the message so no
                // more decoders can be matched
                break;
            } else if (Text.class.isAssignableFrom(
                    decoderEntry.getDecoderClazz())) {
                textDecoders.add(decoderEntry.getDecoderClazz());
                // willDecode() method means this decoder may or may not
                // decode a message so need to carry on checking for
                // other matches
            } else if (TextStream.class.isAssignableFrom(
                    decoderEntry.getDecoderClazz())) {
                textDecoders.add(decoderEntry.getDecoderClazz());
                // Stream decoders have to process the message so no
                // more decoders can be matched
                break;
            } else {
                throw new IllegalArgumentException(
                        sm.getString("util.unknownDecoderType"));
            }
        }
    }
}
项目:apache-tomcat-7.0.73-with-comment    文件:Util.java   
public DecoderMatch(Class<?> target, List<DecoderEntry> decoderEntries) {
    this.target = target;
    for (DecoderEntry decoderEntry : decoderEntries) {
        if (decoderEntry.getClazz().isAssignableFrom(target)) {
            if (Binary.class.isAssignableFrom(
                    decoderEntry.getDecoderClazz())) {
                binaryDecoders.add(decoderEntry.getDecoderClazz());
                // willDecode() method means this decoder may or may not
                // decode a message so need to carry on checking for
                // other matches
            } else if (BinaryStream.class.isAssignableFrom(
                    decoderEntry.getDecoderClazz())) {
                binaryDecoders.add(decoderEntry.getDecoderClazz());
                // Stream decoders have to process the message so no
                // more decoders can be matched
                break;
            } else if (Text.class.isAssignableFrom(
                    decoderEntry.getDecoderClazz())) {
                textDecoders.add(decoderEntry.getDecoderClazz());
                // willDecode() method means this decoder may or may not
                // decode a message so need to carry on checking for
                // other matches
            } else if (TextStream.class.isAssignableFrom(
                    decoderEntry.getDecoderClazz())) {
                textDecoders.add(decoderEntry.getDecoderClazz());
                // Stream decoders have to process the message so no
                // more decoders can be matched
                break;
            } else {
                throw new IllegalArgumentException(
                        sm.getString("util.unknownDecoderType"));
            }
        }
    }
}
项目:lazycat    文件:Util.java   
public DecoderMatch(Class<?> target, List<DecoderEntry> decoderEntries) {
    this.target = target;
    for (DecoderEntry decoderEntry : decoderEntries) {
        if (decoderEntry.getClazz().isAssignableFrom(target)) {
            if (Binary.class.isAssignableFrom(decoderEntry.getDecoderClazz())) {
                binaryDecoders.add(decoderEntry.getDecoderClazz());
                // willDecode() method means this decoder may or may not
                // decode a message so need to carry on checking for
                // other matches
            } else if (BinaryStream.class.isAssignableFrom(decoderEntry.getDecoderClazz())) {
                binaryDecoders.add(decoderEntry.getDecoderClazz());
                // Stream decoders have to process the message so no
                // more decoders can be matched
                break;
            } else if (Text.class.isAssignableFrom(decoderEntry.getDecoderClazz())) {
                textDecoders.add(decoderEntry.getDecoderClazz());
                // willDecode() method means this decoder may or may not
                // decode a message so need to carry on checking for
                // other matches
            } else if (TextStream.class.isAssignableFrom(decoderEntry.getDecoderClazz())) {
                textDecoders.add(decoderEntry.getDecoderClazz());
                // Stream decoders have to process the message so no
                // more decoders can be matched
                break;
            } else {
                throw new IllegalArgumentException(sm.getString("util.unknownDecoderType"));
            }
        }
    }
}
项目:class-guard    文件:Util.java   
public DecoderMatch(Class<?> target, List<DecoderEntry> decoderEntries) {
    for (DecoderEntry decoderEntry : decoderEntries) {
        if (decoderEntry.getClazz().isAssignableFrom(target)) {
            if (Binary.class.isAssignableFrom(
                    decoderEntry.getDecoderClazz())) {
                binaryDecoders.add(decoderEntry.getDecoderClazz());
                // willDecode() method means this decoder may or may not
                // decode a message so need to carry on checking for
                // other matches
            } else if (BinaryStream.class.isAssignableFrom(
                    decoderEntry.getDecoderClazz())) {
                binaryDecoders.add(decoderEntry.getDecoderClazz());
                // Stream decoders have to process the message so no
                // more decoders can be matched
                break;
            } else if (Text.class.isAssignableFrom(
                    decoderEntry.getDecoderClazz())) {
                textDecoders.add(decoderEntry.getDecoderClazz());
                // willDecode() method means this decoder may or may not
                // decode a message so need to carry on checking for
                // other matches
            } else if (TextStream.class.isAssignableFrom(
                    decoderEntry.getDecoderClazz())) {
                textDecoders.add(decoderEntry.getDecoderClazz());
                // Stream decoders have to process the message so no
                // more decoders can be matched
                break;
            } else {
                throw new IllegalArgumentException(
                        sm.getString("util.unknownDecoderType"));
            }
        }
    }
}
项目:apache-tomcat-7.0.57    文件:Util.java   
public DecoderMatch(Class<?> target, List<DecoderEntry> decoderEntries) {
    for (DecoderEntry decoderEntry : decoderEntries) {
        if (decoderEntry.getClazz().isAssignableFrom(target)) {
            if (Binary.class.isAssignableFrom(
                    decoderEntry.getDecoderClazz())) {
                binaryDecoders.add(decoderEntry.getDecoderClazz());
                // willDecode() method means this decoder may or may not
                // decode a message so need to carry on checking for
                // other matches
            } else if (BinaryStream.class.isAssignableFrom(
                    decoderEntry.getDecoderClazz())) {
                binaryDecoders.add(decoderEntry.getDecoderClazz());
                // Stream decoders have to process the message so no
                // more decoders can be matched
                break;
            } else if (Text.class.isAssignableFrom(
                    decoderEntry.getDecoderClazz())) {
                textDecoders.add(decoderEntry.getDecoderClazz());
                // willDecode() method means this decoder may or may not
                // decode a message so need to carry on checking for
                // other matches
            } else if (TextStream.class.isAssignableFrom(
                    decoderEntry.getDecoderClazz())) {
                textDecoders.add(decoderEntry.getDecoderClazz());
                // Stream decoders have to process the message so no
                // more decoders can be matched
                break;
            } else {
                throw new IllegalArgumentException(
                        sm.getString("util.unknownDecoderType"));
            }
        }
    }
}
项目:apache-tomcat-7.0.57    文件:Util.java   
public DecoderMatch(Class<?> target, List<DecoderEntry> decoderEntries) {
    for (DecoderEntry decoderEntry : decoderEntries) {
        if (decoderEntry.getClazz().isAssignableFrom(target)) {
            if (Binary.class.isAssignableFrom(
                    decoderEntry.getDecoderClazz())) {
                binaryDecoders.add(decoderEntry.getDecoderClazz());
                // willDecode() method means this decoder may or may not
                // decode a message so need to carry on checking for
                // other matches
            } else if (BinaryStream.class.isAssignableFrom(
                    decoderEntry.getDecoderClazz())) {
                binaryDecoders.add(decoderEntry.getDecoderClazz());
                // Stream decoders have to process the message so no
                // more decoders can be matched
                break;
            } else if (Text.class.isAssignableFrom(
                    decoderEntry.getDecoderClazz())) {
                textDecoders.add(decoderEntry.getDecoderClazz());
                // willDecode() method means this decoder may or may not
                // decode a message so need to carry on checking for
                // other matches
            } else if (TextStream.class.isAssignableFrom(
                    decoderEntry.getDecoderClazz())) {
                textDecoders.add(decoderEntry.getDecoderClazz());
                // Stream decoders have to process the message so no
                // more decoders can be matched
                break;
            } else {
                throw new IllegalArgumentException(
                        sm.getString("util.unknownDecoderType"));
            }
        }
    }
}