Defaults to {@code true}, leading to an exception being thrown 28 | * if the parameter is missing in the request. Switch this to 29 | * {@code false} if you prefer a {@code null} value if the parameter is 30 | * not present in the request. 31 | *
Alternatively, provide a {@link #defaultValue}, which implicitly 32 | * sets this flag to {@code false}. 33 | */ 34 | boolean required() default true; 35 | 36 | /** 37 | * The default value to use as a fallback when the request parameter is 38 | * not provided or has an empty value. 39 | *
Supplying a default value implicitly sets {@link #required} to
40 | * {@code false}.
41 | */
42 | String defaultValue() default "\n\t\t\n\t\t\n\uE000\uE001\uE002\n\t\t\t\t\n";
43 |
44 | }
45 |
--------------------------------------------------------------------------------
/src/main/java/org/pyj/yeauty/annotation/ServerPath.java:
--------------------------------------------------------------------------------
1 | package org.pyj.yeauty.annotation;
2 |
3 | import java.lang.annotation.ElementType;
4 | import java.lang.annotation.Retention;
5 | import java.lang.annotation.RetentionPolicy;
6 | import java.lang.annotation.Target;
7 | import org.springframework.core.annotation.AliasFor;
8 | import org.springframework.stereotype.Component;
9 |
10 | /**
11 | * @author Yeauty
12 | * @version 1.0
13 | */
14 | @Component
15 | @Retention(RetentionPolicy.RUNTIME)
16 | @Target(ElementType.TYPE)
17 | public @interface ServerPath {
18 |
19 | @AliasFor("path")
20 | String value() default "/";
21 |
22 | @AliasFor("value")
23 | String path() default "/";
24 |
25 | }
26 |
--------------------------------------------------------------------------------
/src/main/java/org/pyj/yeauty/pojo/PojoEndpointServer.java:
--------------------------------------------------------------------------------
1 | package org.pyj.yeauty.pojo;
2 |
3 | import io.netty.channel.Channel;
4 | import io.netty.handler.codec.http.FullHttpRequest;
5 | import io.netty.handler.codec.http.websocketx.BinaryWebSocketFrame;
6 | import io.netty.handler.codec.http.websocketx.TextWebSocketFrame;
7 | import io.netty.handler.codec.http.websocketx.WebSocketFrame;
8 | import io.netty.util.Attribute;
9 | import io.netty.util.AttributeKey;
10 | import io.netty.util.internal.logging.InternalLogger;
11 | import io.netty.util.internal.logging.InternalLoggerFactory;
12 | import java.lang.reflect.Method;
13 | import java.util.HashMap;
14 | import java.util.HashSet;
15 | import java.util.List;
16 | import java.util.Map;
17 | import java.util.Set;
18 | import org.pyj.config.ServerEndpointConfig;
19 | import org.pyj.yeauty.support.AntPathMatcherWrapper;
20 | import org.pyj.yeauty.support.DefaultPathMatcher;
21 | import org.pyj.yeauty.support.MethodArgumentResolver;
22 | import org.pyj.yeauty.support.PathVariableMethodArgumentResolver;
23 | import org.pyj.yeauty.support.WsPathMatcher;
24 | import org.springframework.beans.TypeMismatchException;
25 |
26 | /**
27 | * @author Yeauty
28 | * @version 1.0
29 | */
30 | public class PojoEndpointServer {
31 |
32 | public static final AttributeKey