我有一个非常广泛的关键字,然后我想将其分为两行或更多行。
我尝试使用省略号(...),但没有用。
我所拥有的:
@Component
@ChannelHandler.Sharable
public class CustomHandler extends ChannelDuplexHandler {
private static final AttributeKey<StringBuilder> BUF_KEY = AttributeKey.newInstance("BUF_KEY");
private static final AttributeKey<String> FOO_KEY = AttributeKey.newInstance("FOO_KEY");
private static final AttributeKey<String> VAL_KEY = AttributeKey.newInstance("VAL_KEY");
@Override
public void channelRead(ChannelHandlerContext ctx, Object msg) {
Channel ch = ctx.channel();
final StringBuilder buf = ch.attr(BUF_KEY).get();
String foo = ch.attr(FOO_KEY).get();
String val = ch.attr(VAL_KEY).get();
// Parse the request and set the variables
if (foo != null) {
foo = request.getUri()
}
if (val != null) {
val = getQueryParamsOf("key");
}
buf.append(val);
ch.attr(FOO_KEY).set(foo);
ch.attr(VAL_KEY).set(val);
}
}
我尝试过的事情:
This is my very extensive keyword and I would like to split it
和(2个空格)
This is my very extensive
... keyword and I would like to split it
答案 0 :(得分:2)
你不能做你想做的。您不能将关键字名称分成多行。