diff --git a/src/javax/persistence/Cacheable.java b/src/javax/persistence/Cacheable.java
index 431fdca05..9cbd2a749 100644
--- a/src/javax/persistence/Cacheable.java
+++ b/src/javax/persistence/Cacheable.java
@@ -39,6 +39,7 @@ public @interface Cacheable {
/**
* (Optional) Whether or not the entity should be cached.
+ * @return boolean
*/
boolean value() default true;
}
diff --git a/src/javax/persistence/Column.java b/src/javax/persistence/Column.java
index adc030b17..a4f6e1dc3 100644
--- a/src/javax/persistence/Column.java
+++ b/src/javax/persistence/Column.java
@@ -1,4 +1,4 @@
-/*******************************************************************************
+/** *****************************************************************************
* Copyright (c) 2008 - 2013 Oracle Corporation. All rights reserved.
*
* This program and the accompanying materials are made available under the
@@ -12,7 +12,7 @@
* Linda DeMichiel - Java Persistence 2.1
* Linda DeMichiel - Java Persistence 2.0
*
- ******************************************************************************/
+ ***************************************************************************** */
package javax.persistence;
import java.lang.annotation.Target;
@@ -48,75 +48,96 @@ import static java.lang.annotation.RetentionPolicy.RUNTIME;
*
*
* @since Java Persistence 1.0
- */
-@Target({METHOD, FIELD})
+ */
+@Target({METHOD, FIELD})
@Retention(RUNTIME)
public @interface Column {
/**
- * (Optional) The name of the column. Defaults to
+ * (Optional) The name of the column. Defaults to
* the property or field name.
+ *
+ * @return String
*/
String name() default "";
/**
- * (Optional) Whether the column is a unique key. This is a
- * shortcut for the UniqueConstraint annotation at the table
- * level and is useful for when the unique key constraint
- * corresponds to only a single column. This constraint applies
- * in addition to any constraint entailed by primary key mapping and
+ * (Optional) Whether the column is a unique key. This is a
+ * shortcut for the UniqueConstraint annotation at the table
+ * level and is useful for when the unique key constraint
+ * corresponds to only a single column. This constraint applies
+ * in addition to any constraint entailed by primary key mapping and
* to constraints specified at the table level.
+ *
+ * @return boolean
*/
boolean unique() default false;
/**
* (Optional) Whether the database column is nullable.
+ *
+ * @return boolean
*/
boolean nullable() default true;
/**
- * (Optional) Whether the column is included in SQL INSERT
+ * (Optional) Whether the column is included in SQL INSERT
* statements generated by the persistence provider.
+ *
+ * @return boolean
*/
boolean insertable() default true;
/**
- * (Optional) Whether the column is included in SQL UPDATE
+ * (Optional) Whether the column is included in SQL UPDATE
* statements generated by the persistence provider.
+ *
+ * @return boolean
*/
boolean updatable() default true;
/**
- * (Optional) The SQL fragment that is used when
+ * (Optional) The SQL fragment that is used when
* generating the DDL for the column.
- *
Defaults to the generated SQL to create a + *
+ * Defaults to the generated SQL to create a * column of the inferred type. + * + * @return String */ String columnDefinition() default ""; /** - * (Optional) The name of the table that contains the column. + * (Optional) The name of the table that contains the column. * If absent the column is assumed to be in the primary table. + * + * @return String */ String table() default ""; /** * (Optional) The column length. (Applies only if a * string-valued column is used.) + * + * @return int */ int length() default 255; /** - * (Optional) The precision for a decimal (exact numeric) + * (Optional) The precision for a decimal (exact numeric) * column. (Applies only if a decimal column is used.) - * Value must be set by developer if used when generating + * Value must be set by developer if used when generating * the DDL for the column. + * + * @return int */ int precision() default 0; /** - * (Optional) The scale for a decimal (exact numeric) column. + * (Optional) The scale for a decimal (exact numeric) column. * (Applies only if a decimal column is used.) + * + * @return int */ int scale() default 0; } diff --git a/src/javax/persistence/Entity.java b/src/javax/persistence/Entity.java index 1dda0a3ab..024df1bb5 100644 --- a/src/javax/persistence/Entity.java +++ b/src/javax/persistence/Entity.java @@ -37,6 +37,7 @@ public @interface Entity { * name of the entity class. This name is used to refer to the * entity in queries. The name must not be a reserved literal * in the Java Persistence query language. + * @return String */ String name() default ""; } diff --git a/src/javax/persistence/GeneratedValue.java b/src/javax/persistence/GeneratedValue.java index 8ec4ce611..0d66f074a 100644 --- a/src/javax/persistence/GeneratedValue.java +++ b/src/javax/persistence/GeneratedValue.java @@ -51,8 +51,6 @@ import static java.lang.annotation.RetentionPolicy.RUNTIME; * * * @see Id - * @see TableGenerator - * @see SequenceGenerator * * @since Java Persistence 1.0 */ @@ -64,15 +62,17 @@ public @interface GeneratedValue { * (Optional) The primary key generation strategy * that the persistence provider must use to * generate the annotated entity primary key. + * @return GenerationType */ @Deprecated GenerationType strategy() default GenerationType.AUTO; /** * (Optional) The name of the primary key generator - * to use as specified in the {@link SequenceGenerator} - * or {@link TableGenerator} annotation. + * to use as specified in the SequenceGenerator + * or TableGenerator annotation. *
Defaults to the id generator supplied by persistence provider. + * @return String */ @Deprecated String generator() default ""; diff --git a/src/javax/persistence/Table.java b/src/javax/persistence/Table.java index 6f523b1e1..dd39e3784 100644 --- a/src/javax/persistence/Table.java +++ b/src/javax/persistence/Table.java @@ -22,8 +22,7 @@ import static java.lang.annotation.RetentionPolicy.RUNTIME; /** * Specifies the primary table for the annotated entity. Additional - * tables may be specified using {@link SecondaryTable} or {@link - * SecondaryTables} annotation. + * tables may be specified using SecondaryTable or SecondaryTables annotation. * *
If no Table annotation is specified for an entity
* class, the default values apply.
@@ -45,16 +44,19 @@ public @interface Table {
/**
* (Optional) The name of the table.
*
Defaults to the entity name. + * @return String */ String name() default ""; /** (Optional) The catalog of the table. *
Defaults to the default catalog. + * @return String */ String catalog() default ""; /** (Optional) The schema of the table. *
Defaults to the default schema for user. + * @return String */ String schema() default ""; diff --git a/src/org/redkale/boot/ClassFilter.java b/src/org/redkale/boot/ClassFilter.java index 231332c65..d9524b0bd 100644 --- a/src/org/redkale/boot/ClassFilter.java +++ b/src/org/redkale/boot/ClassFilter.java @@ -22,7 +22,9 @@ import java.util.regex.*; /** * class过滤器, 符合条件的class会保留下来存入FilterEntry。 * - *
详情见: http://www.redkale.org + *
+ * 详情见: http://www.redkale.org
+ *
* @author zhangjx
* @param
- * @return
+ *
+ * @return Set<FilterEntry<T>>
*/
public final Set
- * @param property
- * @param clazzname
+ *
+ * @param property AnyValue
+ * @param clazzname String
*/
@SuppressWarnings("unchecked")
public final void filter(AnyValue property, String clazzname) {
@@ -90,7 +92,7 @@ public final class ClassFilter
+ *
* @param property application.xml中对应class节点下的property属性项
* @param clazzname class名称
* @param autoscan 为true表示自动扫描的, false表示显著调用filter, AutoLoad的注解将被忽略
@@ -149,10 +151,10 @@ public final class ClassFilter
- * @param property
- * @param classname
- * @return
+ *
+ * @param property AnyValue
+ * @param classname String
+ * @return boolean
*/
public boolean accept(AnyValue property, String classname) {
boolean r = accept0(property, classname);
@@ -187,11 +189,11 @@ public final class ClassFilter
- * @param property
- * @param clazz
- * @param autoscan
- * @return
+ *
+ * @param property AnyValue
+ * @param clazz Class
+ * @param autoscan boolean
+ * @return boolean
*/
@SuppressWarnings("unchecked")
public boolean accept(AnyValue property, Class clazz, boolean autoscan) {
@@ -247,8 +249,8 @@ public final class ClassFilter
- * @param
+ *
* @param exclude 不需要扫描的文件夹, 可以为null
- * @param filters
- * @throws IOException
+ * @param filters 过滤器
+ * @throws IOException 异常
*/
public static void load(final File exclude, final ClassFilter... filters) throws IOException {
URLClassLoader loader = (URLClassLoader) Thread.currentThread().getContextClassLoader();
diff --git a/src/org/redkale/convert/AnyEncoder.java b/src/org/redkale/convert/AnyEncoder.java
index b2ec82943..b4f4ccced 100644
--- a/src/org/redkale/convert/AnyEncoder.java
+++ b/src/org/redkale/convert/AnyEncoder.java
@@ -12,7 +12,7 @@ import java.lang.reflect.Type;
*
* 详情见: http://www.redkale.org
* @author zhangjx
- * @param 详情见: http://www.redkale.org
+ *
+ *
+ * 详情见: http://www.redkale.org
+ *
* @author zhangjx
- * @param 详情见: http://www.redkale.org
+ *
+ * 详情见: http://www.redkale.org
+ *
* @author zhangjx
- * @param 详情见: http://www.redkale.org
+ *
+ * 详情见: http://www.redkale.org
+ *
* @author zhangjx
- * @param 详情见: http://www.redkale.org
* @author zhangjx
- * @param 详情见: http://www.redkale.org
+ *
+ * 详情见: http://www.redkale.org
+ *
* @author zhangjx
- * @param 详情见: http://www.redkale.org
+ *
+ * 详情见: http://www.redkale.org
+ *
* @author zhangjx
*/
@Inherited
@@ -25,21 +27,21 @@ public @interface ConvertColumn {
/**
* 给字段取个别名, 只对JSON有效
*
- * @return
+ * @return 字段别名
*/
String name() default "";
/**
* 解析/序列化时是否屏蔽该字段
*
- * @return
+ * @return 是否屏蔽该字段
*/
boolean ignore() default false;
/**
* 解析/序列化定制化的TYPE
*
- * @return
+ * @return JSON or BSON or ALL
*/
ConvertType type() default ConvertType.ALL;
}
diff --git a/src/org/redkale/convert/DeMember.java b/src/org/redkale/convert/DeMember.java
index 6f83ea81d..673527a57 100644
--- a/src/org/redkale/convert/DeMember.java
+++ b/src/org/redkale/convert/DeMember.java
@@ -9,11 +9,13 @@ import org.redkale.util.Attribute;
/**
*
- * 详情见: http://www.redkale.org
+ *
+ * 详情见: http://www.redkale.org
+ *
* @author zhangjx
- * @param 详情见: http://www.redkale.org
+ *
+ * 详情见: http://www.redkale.org
+ *
* @author zhangjx
- * @param 详情见: http://www.redkale.org
+ *
+ * 详情见: http://www.redkale.org
+ *
* @author zhangjx
- * @param 详情见: http://www.redkale.org
+ *
+ * 详情见: http://www.redkale.org
+ *
* @author zhangjx
- * @param 详情见: http://www.redkale.org
+ *
+ * 详情见: http://www.redkale.org
+ *
* @author zhangjx
- * @param
- * @param skipIgnore
+ *
+ * @param skipIgnore 是否忽略Ignore注解
*/
public final void registerSkipAllIgnore(final boolean skipIgnore) {
this.skipAllIgnore = skipIgnore;
@@ -177,8 +179,8 @@ public abstract class Factory
- * @param type
+ *
+ * @param type 指定的类
*/
public final void registerSkipIgnore(final Class type) {
skipIgnores.add(type);
diff --git a/src/org/redkale/convert/MapDecoder.java b/src/org/redkale/convert/MapDecoder.java
index 41182bb75..7b2385084 100644
--- a/src/org/redkale/convert/MapDecoder.java
+++ b/src/org/redkale/convert/MapDecoder.java
@@ -14,8 +14,8 @@ import java.util.Map;
*
* 详情见: http://www.redkale.org
* @author zhangjx
- * @param 详情见: http://www.redkale.org
+ *
+ * 详情见: http://www.redkale.org
+ *
* @author zhangjx
- * @param 详情见: http://www.redkale.org
* @author zhangjx
- * @param 详情见: http://www.redkale.org
+ *
+ * 详情见: http://www.redkale.org
+ *
* @author zhangjx
*/
public interface Reader {
@@ -21,7 +23,7 @@ public interface Reader {
/**
* 是否还存在下个元素或字段
*
- * @return
+ * @return 是否还存在下个元素或字段
*/
public boolean hasNext();
@@ -38,7 +40,7 @@ public interface Reader {
/**
* 读取对象的开头 返回字段数
*
- * @return
+ * @return 返回字段数
*/
public int readObjectB();
@@ -51,7 +53,7 @@ public interface Reader {
/**
* 读取数组的开头并返回数组的长度
*
- * @return
+ * @return 返回数组的长度
*/
public int readArrayB();
@@ -64,7 +66,7 @@ public interface Reader {
/**
* 读取map的开头并返回map的size
*
- * @return
+ * @return 返回map的size
*/
public int readMapB();
@@ -77,37 +79,87 @@ public interface Reader {
/**
* 根据字段读取字段对应的DeMember
*
- * @param index
- * @param members
- * @return
+ * @param index 当前members的游标位置
+ * @param members DeMember的全量集合
+ * @return 匹配的DeMember
*/
public DeMember readField(final AtomicInteger index, final DeMember[] members);
+ /**
+ * 读取一个boolean值
+ *
+ * @return boolean值
+ */
public boolean readBoolean();
+ /**
+ * 读取一个byte值
+ *
+ * @return byte值
+ */
public byte readByte();
+ /**
+ * 读取一个char值
+ *
+ * @return char值
+ */
public char readChar();
+ /**
+ * 读取一个short值
+ *
+ * @return short值
+ */
public short readShort();
+ /**
+ * 读取一个int值
+ *
+ * @return int值
+ */
public int readInt();
+ /**
+ * 读取一个long值
+ *
+ * @return long值
+ */
public long readLong();
+ /**
+ * 读取一个float值
+ *
+ * @return float值
+ */
public float readFloat();
+ /**
+ * 读取一个double值
+ *
+ * @return double值
+ */
public double readDouble();
/**
* 读取无转义字符长度不超过255的字符串, 例如枚举值、字段名、类名字符串等
*
- * @return
+ * @return String值
*/
public String readSmallString();
+ /**
+ * 读取反解析对象的类名
+ *
+ * @return 类名
+ */
public String readClassName();
+ /**
+ * 读取一个String值
+ *
+ * @return String值
+ */
public String readString();
}
diff --git a/src/org/redkale/convert/SimpledCoder.java b/src/org/redkale/convert/SimpledCoder.java
index e916e8be6..35ae99813 100644
--- a/src/org/redkale/convert/SimpledCoder.java
+++ b/src/org/redkale/convert/SimpledCoder.java
@@ -10,11 +10,13 @@ import java.lang.reflect.Type;
/**
*
- * 详情见: http://www.redkale.org
+ *
+ * 详情见: http://www.redkale.org
+ *
* @author zhangjx
- * @param 详情见: http://www.redkale.org
+ *
+ * 详情见: http://www.redkale.org
+ *
* @author zhangjx
*/
public interface Writer {
/**
* 当tiny=true时, 字符串为空、boolean为false的字段值都会被跳过, 不会输出。
- *
- * @return
+ *
+ * @return 是否简化
*/
public boolean isTiny();
@@ -27,8 +29,9 @@ public interface Writer {
public void writeNull();
/**
+ * 写入类名
*
- * @param clazz
+ * @param clazz 类名
*/
public void wirteClassName(String clazz);
@@ -37,14 +40,14 @@ public interface Writer {
*
* @param fieldCount 字段个数
*
- * @param obj
+ * @param obj 写入的对象
*/
public void writeObjectB(int fieldCount, Object obj);
/**
* 输出一个对象后的操作
*
- * @param obj
+ * @param obj 写入的对象
*/
public void writeObjectE(Object obj);
@@ -90,32 +93,77 @@ public interface Writer {
* 输出一个字段
*
* @param comma 是否非第一个字段
- * @param attribute
+ * @param attribute 字段的Attribute对象
*/
public void writeField(boolean comma, Attribute attribute);
+ /**
+ * 写入一个boolean值
+ *
+ * @param value boolean值
+ */
public void writeBoolean(boolean value);
+ /**
+ * 写入一个byte值
+ *
+ * @param value byte值
+ */
public void writeByte(byte value);
+ /**
+ * 写入一个char值
+ *
+ * @param value char值
+ */
public void writeChar(char value);
+ /**
+ * 写入一个short值
+ *
+ * @param value short值
+ */
public void writeShort(short value);
+ /**
+ * 写入一个int值
+ *
+ * @param value int值
+ */
public void writeInt(int value);
+ /**
+ * 写入一个long值
+ *
+ * @param value long值
+ */
public void writeLong(long value);
+ /**
+ * 写入一个float值
+ *
+ * @param value float值
+ */
public void writeFloat(float value);
+ /**
+ * 写入一个double值
+ *
+ * @param value double值
+ */
public void writeDouble(double value);
/**
* 写入无转义字符长度不超过255的字符串, 例如枚举值、字段名、类名字符串等 *
*
- * @param value
+ * @param value 非空且不含需要转义的字符的String值
*/
public void writeSmallString(String value);
+ /**
+ * 写入一个String值
+ *
+ * @param value String值
+ */
public void writeString(String value);
}
diff --git a/src/org/redkale/convert/bson/BsonByteBufferReader.java b/src/org/redkale/convert/bson/BsonByteBufferReader.java
index 5bfd623be..97dafc419 100644
--- a/src/org/redkale/convert/bson/BsonByteBufferReader.java
+++ b/src/org/redkale/convert/bson/BsonByteBufferReader.java
@@ -44,7 +44,7 @@ public final class BsonByteBufferReader extends BsonReader {
/**
* 判断下一个非空白字节是否为[
*
- * @return
+ * @return 数组长度或 SIGN_NULL
*/
@Override
public int readArrayB() {
diff --git a/src/org/redkale/convert/bson/BsonConvert.java b/src/org/redkale/convert/bson/BsonConvert.java
index e2fe55dfe..5157e7b77 100644
--- a/src/org/redkale/convert/bson/BsonConvert.java
+++ b/src/org/redkale/convert/bson/BsonConvert.java
@@ -12,6 +12,7 @@ import org.redkale.convert.*;
import org.redkale.util.*;
/**
+ * 详情见: http://www.redkale.org
+ *
+ * 详情见: http://www.redkale.org
+ *
* @author zhangjx
*/
public final class BsonConvert extends Convert 详情见: http://www.redkale.org
+ *
+ * 详情见: http://www.redkale.org
+ *
* @author zhangjx
*/
public class BsonReader implements Reader {
@@ -193,7 +195,7 @@ public class BsonReader implements Reader {
/**
* 判断下一个非空白字节是否为[
*
- * @return
+ * @return 数组长度或SIGN_NULL
*/
@Override
public int readArrayB() {
@@ -216,7 +218,7 @@ public class BsonReader implements Reader {
/**
* 判断对象是否存在下一个属性或者数组是否存在下一个元素
*
- * @return
+ * @return 是否存在
*/
@Override
public final boolean hasNext() {
diff --git a/src/org/redkale/convert/bson/BsonSimpledCoder.java b/src/org/redkale/convert/bson/BsonSimpledCoder.java
index d8d16fc17..d5b497d51 100644
--- a/src/org/redkale/convert/bson/BsonSimpledCoder.java
+++ b/src/org/redkale/convert/bson/BsonSimpledCoder.java
@@ -9,9 +9,11 @@ import org.redkale.convert.SimpledCoder;
/**
*
- * 详情见: http://www.redkale.org
+ *
+ * 详情见: http://www.redkale.org
+ *
* @author zhangjx
- * @param 详情见: http://www.redkale.org
+ *
+ * 详情见: http://www.redkale.org
+ *
* @author zhangjx
*/
public class JsonReader implements Reader {
@@ -83,7 +85,7 @@ public class JsonReader implements Reader {
/**
* 找到指定的属性值 例如: {id : 1, data : { name : 'a', items : [1,2,3]}} seek('data.items') 直接跳转到 [1,2,3];
*
- * @param key
+ * @param key 指定的属性名
*/
public final void seek(String key) {
if (key == null || key.length() < 1) return;
@@ -135,7 +137,7 @@ public class JsonReader implements Reader {
/**
* 读取下一个字符, 不跳过空白字符
*
- * @return
+ * @return 空白字符或有效字符
*/
protected char nextChar() {
return this.text[++this.position];
@@ -144,7 +146,7 @@ public class JsonReader implements Reader {
/**
* 跳过空白字符, 返回一个非空白字符
*
- * @return
+ * @return 有效字符
*/
protected char nextGoodChar() {
char c = nextChar();
@@ -158,7 +160,7 @@ public class JsonReader implements Reader {
/**
* 回退最后读取的字符
*
- * @param ch
+ * @param ch 后退的字符
*/
protected void backChar(char ch) {
this.position--;
@@ -167,6 +169,7 @@ public class JsonReader implements Reader {
/**
* 判断下一个非空白字符是否为{
*
+ * @return SIGN_NOLENGTH 或 SIGN_NULL
*/
@Override
public int readObjectB() {
@@ -191,6 +194,7 @@ public class JsonReader implements Reader {
/**
* 判断下一个非空白字符是否为{
*
+ * @return SIGN_NOLENGTH 或 SIGN_NULL
*/
@Override
public final int readMapB() {
@@ -204,7 +208,7 @@ public class JsonReader implements Reader {
/**
* 判断下一个非空白字符是否为[
*
- * @return
+ * @return SIGN_NOLENGTH 或 SIGN_NULL
*/
@Override
public int readArrayB() {
@@ -248,7 +252,7 @@ public class JsonReader implements Reader {
/**
* 判断对象是否存在下一个属性或者数组是否存在下一个元素
*
- * @return
+ * @return 是否存在
*/
@Override
public boolean hasNext() {
@@ -320,9 +324,9 @@ public class JsonReader implements Reader {
}
/**
- * 读取一个int
+ * 读取一个int值
*
- * @return
+ * @return int值
*/
@Override
public int readInt() {
@@ -366,9 +370,9 @@ public class JsonReader implements Reader {
}
/**
- * 读取一个long
+ * 读取一个long值
*
- * @return
+ * @return long值
*/
@Override
public long readLong() {
@@ -474,7 +478,7 @@ public class JsonReader implements Reader {
/**
* 读取字符串, 必须是"或者'包围的字符串值
*
- * @return
+ * @return String值
*/
@Override
public String readString() {
diff --git a/src/org/redkale/convert/json/JsonSimpledCoder.java b/src/org/redkale/convert/json/JsonSimpledCoder.java
index b91e22f7e..d8d4f6006 100644
--- a/src/org/redkale/convert/json/JsonSimpledCoder.java
+++ b/src/org/redkale/convert/json/JsonSimpledCoder.java
@@ -9,9 +9,11 @@ import org.redkale.convert.SimpledCoder;
/**
*
- * 详情见: http://www.redkale.org
+ *
+ * 详情见: http://www.redkale.org
+ *
* @author zhangjx
- * @param 详情见: http://www.redkale.org
+ *
+ * 详情见: http://www.redkale.org
+ *
* @author zhangjx
*/
public class JsonWriter implements Writer {
@@ -96,8 +98,8 @@ public class JsonWriter implements Writer {
/**
* 注意: 该String值不能为null且不会进行转义, 只用于不含需要转义字符的字符串,例如enum、double、BigInteger转换的String
*
- * @param quote
- * @param value
+ * @param quote 是否加双引号
+ * @param value 非null且不含需要转义的字符的String值
*/
public void writeTo(final boolean quote, final String value) {
int len = value.length();
diff --git a/src/org/redkale/net/AsyncConnection.java b/src/org/redkale/net/AsyncConnection.java
index 9ae9eb223..4c3bc1d16 100644
--- a/src/org/redkale/net/AsyncConnection.java
+++ b/src/org/redkale/net/AsyncConnection.java
@@ -14,7 +14,9 @@ import java.util.concurrent.*;
/**
*
- * 详情见: http://www.redkale.org
+ *
+ * 详情见: http://www.redkale.org
+ *
* @author zhangjx
*/
public abstract class AsyncConnection implements AsynchronousByteChannel, AutoCloseable {
@@ -89,13 +91,13 @@ public abstract class AsyncConnection implements AsynchronousByteChannel, AutoCl
/**
* 创建客户端连接
*
- * @param protocol
- * @param address
- * @param group
- * @param readTimeoutSecond0
- * @param writeTimeoutSecond0
- * @return
- * @throws java.io.IOException
+ * @param protocol 连接类型 只能是TCP或UDP
+ * @param address 连接点子
+ * @param group 连接AsynchronousChannelGroup
+ * @param readTimeoutSecond0 读取超时秒数
+ * @param writeTimeoutSecond0 写入超时秒数
+ * @return 连接
+ * @throws java.io.IOException 异常
*/
public static AsyncConnection create(final String protocol, final AsynchronousChannelGroup group, final SocketAddress address,
final int readTimeoutSecond0, final int writeTimeoutSecond0) throws IOException {
@@ -428,8 +430,8 @@ public abstract class AsyncConnection implements AsynchronousByteChannel, AutoCl
/**
* 通常用于 ssl socket
*
- * @param socket
- * @return
+ * @param socket Socket对象
+ * @return 连接对象
*/
public static AsyncConnection create(final Socket socket) {
return create(socket, null, 0, 0);
diff --git a/src/org/redkale/net/PrepareServlet.java b/src/org/redkale/net/PrepareServlet.java
index aa3a45264..2734a6a5c 100644
--- a/src/org/redkale/net/PrepareServlet.java
+++ b/src/org/redkale/net/PrepareServlet.java
@@ -15,8 +15,8 @@ import java.util.logging.*;
*
* 详情见: http://www.redkale.org
* @author zhangjx
- * @param
+ * @param Response的子类型
*/
public abstract class PrepareServlet 详情见: http://www.redkale.org
+ *
+ * 详情见: http://www.redkale.org
+ *
* @author zhangjx
*/
public abstract class Request {
@@ -44,18 +46,18 @@ public abstract class Request {
}
/**
- * 返回值:Integer.MIN_VALUE: 帧数据; -1:数据不合法; 0:解析完毕; >0: 需再读取的字节数。
+ * 返回值:Integer.MIN_VALUE: 帧数据; -1:数据不合法; 0:解析完毕; >0: 需再读取的字节数。
*
- * @param buffer
- * @return
+ * @param buffer ByteBuffer对象
+ * @return 缺少的字节数
*/
protected abstract int readHeader(ByteBuffer buffer);
/**
* 读取buffer,并返回读取的有效数据长度
*
- * @param buffer
- * @return
+ * @param buffer ByteBuffer对象
+ * @return 有效数据长度
*/
protected abstract int readBody(ByteBuffer buffer);
diff --git a/src/org/redkale/net/Response.java b/src/org/redkale/net/Response.java
index 2fc77d9cf..5b0667709 100644
--- a/src/org/redkale/net/Response.java
+++ b/src/org/redkale/net/Response.java
@@ -10,9 +10,11 @@ import java.nio.channels.*;
/**
*
- * 详情见: http://www.redkale.org
+ *
+ * 详情见: http://www.redkale.org
+ *
* @author zhangjx
- * @param 详情见: http://www.redkale.org
+ *
+ * 详情见: http://www.redkale.org
+ *
* @author zhangjx
- * @param
+ * @param Response的子类型
*/
public abstract class Servlet 详情见: http://www.redkale.org
+ *
+ * 详情见: http://www.redkale.org
+ *
* @author zhangjx
*/
public abstract class BasedHttpServlet extends HttpServlet {
/**
* 配合 BasedHttpServlet 使用。
- * 当标记为 @AuthIgnore 的方法不会再调用之前调用authenticate 方法。
+ * 当标记为 @AuthIgnore 的方法不会再调用之前调用authenticate 方法。
+ *
+ *
+ * 详情见: http://www.redkale.org
*
- * 详情见: http://www.redkale.org
* @author zhangjx
*/
@Inherited
@@ -44,9 +48,11 @@ public abstract class BasedHttpServlet extends HttpServlet {
/**
* 配合 BasedHttpServlet 使用。
- * 用于对@WebServlet对应的url进行细分。 其 url
+ * 用于对@WebServlet对应的url进行细分。 其 url
+ *
+ *
+ * 详情见: http://www.redkale.org
*
- * 详情见: http://www.redkale.org
* @author zhangjx
*/
@Target({ElementType.METHOD})
@@ -61,10 +67,12 @@ public abstract class BasedHttpServlet extends HttpServlet {
/**
* 配合 BasedHttpServlet 使用。
- * 当标记为 @HttpCacheable 的方法使用response.finish的参数将被缓存一定时间(默认值timeout=15秒)。
- * 通常情况下 @HttpCacheable 需要与 @AuthIgnore 一起使用,因为没有标记@AuthIgnore的方法一般输出的结果与当前用户信息有关。
+ * 当标记为 @HttpCacheable 的方法使用response.finish的参数将被缓存一定时间(默认值timeout=15秒)。
+ * 通常情况下 @HttpCacheable 需要与 @AuthIgnore 一起使用,因为没有标记@AuthIgnore的方法一般输出的结果与当前用户信息有关。
+ *
+ *
+ * 详情见: http://www.redkale.org
*
- * 详情见: http://www.redkale.org
* @author zhangjx
*/
@Target({ElementType.METHOD})
@@ -75,7 +83,7 @@ public abstract class BasedHttpServlet extends HttpServlet {
/**
* 超时的秒数
*
- * @return
+ * @return 超时秒数
*/
int timeout() default 15;
}
diff --git a/src/org/redkale/net/http/HttpRequest.java b/src/org/redkale/net/http/HttpRequest.java
index a1f161d26..02ecdca39 100644
--- a/src/org/redkale/net/http/HttpRequest.java
+++ b/src/org/redkale/net/http/HttpRequest.java
@@ -379,7 +379,7 @@ public class HttpRequest extends Request {
/**
* 截取getRequestURI最后的一个/后面的部分
*
- * @return
+ * @return String
*/
public String getRequstURILastPath() {
if (requestURI == null) return "";
@@ -390,8 +390,8 @@ public class HttpRequest extends Request {
*
* 从prefix之后截取getRequestURI再对"/"进行分隔
*
- * @param prefix
- * @return
+ * @param prefix 前缀
+ * @return String[]
*/
public String[] getRequstURIPaths(String prefix) {
if (requestURI == null || prefix == null) return new String[0];
diff --git a/src/org/redkale/net/http/HttpResponse.java b/src/org/redkale/net/http/HttpResponse.java
index 246175d38..acc628034 100644
--- a/src/org/redkale/net/http/HttpResponse.java
+++ b/src/org/redkale/net/http/HttpResponse.java
@@ -24,10 +24,12 @@ import org.redkale.util.*;
* 同时提供发送json的系列接口: public void finishJson(Type type, Object obj)
* RedKale提倡http+json的接口风格, 所以主要输出的数据格式为json, 同时提供异步接口。
*
- * 详情见: http://www.redkale.org
+ *
+ * 详情见: http://www.redkale.org
+ *
* @author zhangjx
*
- * @param
+ * 详情见: http://www.redkale.org
*
- *
- * 详情见: http://www.redkale.org
* @author zhangjx
*/
public abstract class WebSocket {
@@ -84,9 +83,9 @@ public abstract class WebSocket {
//----------------------------------------------------------------
/**
* 发送消息体, 包含二进制/文本
- *
- * @param packet
- * @return
+ *
+ * @param packet WebSocketPacket
+ * @return 0表示成功, 非0表示错误码
*/
public final int send(WebSocketPacket packet) {
int rs = RETCODE_WSOCKET_CLOSED;
@@ -104,9 +103,9 @@ public abstract class WebSocket {
/**
* 发送单一的文本消息
- *
+ *
* @param text 不可为空
- * @return
+ * @return 0表示成功, 非0表示错误码
*/
public final int send(String text) {
return send(text, true);
@@ -114,10 +113,10 @@ public abstract class WebSocket {
/**
* 发送文本消息
- *
+ *
* @param text 不可为空
* @param last 是否最后一条
- * @return
+ * @return 0表示成功, 非0表示错误码
*/
public final int send(String text, boolean last) {
return send(new WebSocketPacket(text, last));
@@ -125,9 +124,9 @@ public abstract class WebSocket {
/**
* 发送单一的二进制消息
- *
- * @param data
- * @return
+ *
+ * @param data byte[]
+ * @return 0表示成功, 非0表示错误码
*/
public final int send(byte[] data) {
return send(data, true);
@@ -152,10 +151,10 @@ public abstract class WebSocket {
/**
* 发送二进制消息
- *
+ *
* @param data 不可为空
* @param last 是否最后一条
- * @return
+ * @return 0表示成功, 非0表示错误码
*/
public final int send(byte[] data, boolean last) {
return send(new WebSocketPacket(data, last));
@@ -163,10 +162,10 @@ public abstract class WebSocket {
/**
* 发送消息, 消息类型是String或byte[]
- *
+ *
* @param message 不可为空, 只能是String或者byte[]
* @param last 是否最后一条
- * @return
+ * @return 0表示成功, 非0表示错误码
*/
public final int send(Serializable message, boolean last) {
return send(new WebSocketPacket(message, last));
@@ -175,8 +174,8 @@ public abstract class WebSocket {
//----------------------------------------------------------------
/**
* 给指定groupid的WebSocketGroup下所有WebSocket节点发送文本消息
- *
- * @param groupid
+ *
+ * @param groupid groupid
* @param text 不可为空
* @return 为0表示成功, 其他值表示异常
*/
@@ -186,8 +185,8 @@ public abstract class WebSocket {
/**
* 给指定groupid的WebSocketGroup下所有WebSocket节点发送二进制消息
- *
- * @param groupid
+ *
+ * @param groupid groupid
* @param data 不可为空
* @return 为0表示成功, 其他值表示异常
*/
@@ -197,10 +196,10 @@ public abstract class WebSocket {
/**
* 给指定groupid的WebSocketGroup下所有WebSocket节点发送文本消息
- *
- * @param groupid
+ *
+ * @param groupid groupid
* @param text 不可为空
- * @param last
+ * @param last 是否最后一条
* @return 为0表示成功, 其他值表示异常
*/
public final int sendEachMessage(Serializable groupid, String text, boolean last) {
@@ -209,8 +208,8 @@ public abstract class WebSocket {
/**
* 给指定groupid的WebSocketGroup下所有WebSocket节点发送二进制消息
- *
- * @param groupid
+ *
+ * @param groupid groupid
* @param data 不可为空
* @param last 是否最后一条
* @return 为0表示成功, 其他值表示异常
@@ -221,8 +220,8 @@ public abstract class WebSocket {
/**
* 给指定groupid的WebSocketGroup下最近活跃的WebSocket节点发送文本消息
- *
- * @param groupid
+ *
+ * @param groupid groupid
* @param text 不可为空
* @return 为0表示成功, 其他值表示异常
*/
@@ -232,8 +231,8 @@ public abstract class WebSocket {
/**
* 给指定groupid的WebSocketGroup下最近活跃的WebSocket节点发送二进制消息
- *
- * @param groupid
+ *
+ * @param groupid groupid
* @param data 不可为空
* @return 为0表示成功, 其他值表示异常
*/
@@ -243,8 +242,8 @@ public abstract class WebSocket {
/**
* 给指定groupid的WebSocketGroup下最近活跃的WebSocket节点发送文本消息
- *
- * @param groupid
+ *
+ * @param groupid groupid
* @param text 不可为空
* @param last 是否最后一条
* @return 为0表示成功, 其他值表示异常
@@ -255,8 +254,8 @@ public abstract class WebSocket {
/**
* 给指定groupid的WebSocketGroup下最近活跃的WebSocket节点发送二进制消息
- *
- * @param groupid
+ *
+ * @param groupid groupid
* @param data 不可为空
* @param last 是否最后一条
* @return 为0表示成功, 其他值表示异常
@@ -282,8 +281,8 @@ public abstract class WebSocket {
/**
* 获取在线用户的节点地址列表
*
- * @param groupid
- * @return
+ * @param groupid groupid
+ * @return 地址列表
*/
protected final Collection
- * @param
- * @param
- * @param name
- * @param value
+ *
+ * @param name 属性值
+ * @param value 属性值
*/
public final void setAttribute(String name, Object value) {
attributes.put(name, value);
@@ -334,8 +333,8 @@ public abstract class WebSocket {
/**
* 获取当前WebSocket所属的groupid
- *
- * @return
+ *
+ * @return groupid
*/
public final Serializable getGroupid() {
return _groupid;
@@ -343,8 +342,8 @@ public abstract class WebSocket {
/**
* 获取当前WebSocket的会话ID, 不会为null
- *
- * @return
+ *
+ * @return sessionid
*/
public final Serializable getSessionid() {
return _sessionid;
@@ -353,7 +352,7 @@ public abstract class WebSocket {
/**
* 获取客户端直接地址, 当WebSocket连接是由代理服务器转发的,则该值固定为代理服务器的IP地址
*
- * @return
+ * @return SocketAddress
*/
public final SocketAddress getRemoteAddress() {
return _remoteAddress;
@@ -362,7 +361,7 @@ public abstract class WebSocket {
/**
* 获取客户端真实地址
*
- * @return
+ * @return String
*/
public final String getRemoteAddr() {
return _remoteAddr;
@@ -371,8 +370,8 @@ public abstract class WebSocket {
//-------------------------------------------------------------------
/**
* 获取当前WebSocket所属的WebSocketGroup, 不会为null
- *
- * @return
+ *
+ * @return WebSocketGroup
*/
protected final WebSocketGroup getWebSocketGroup() {
return _group;
@@ -380,9 +379,9 @@ public abstract class WebSocket {
/**
* 获取指定groupid的WebSocketGroup, 没有返回null
- *
- * @param groupid
- * @return
+ *
+ * @param groupid groupid
+ * @return WebSocketGroup
*/
protected final WebSocketGroup getWebSocketGroup(Serializable groupid) {
return _engine.getWebSocketGroup(groupid);
@@ -396,8 +395,8 @@ public abstract class WebSocket {
/**
* 返回sessionid, null表示连接不合法或异常
*
- * @param request
- * @return
+ * @param request HttpRequest
+ * @return sessionid
*/
public Serializable onOpen(final HttpRequest request) {
return request.getSessionid(false);
@@ -406,13 +405,13 @@ public abstract class WebSocket {
/**
* 创建groupid, null表示异常
*
- * @return
+ * @return groupid
*/
protected abstract Serializable createGroupid();
/**
*
- * @param channel
+ * @param channel 请求连接
*/
public void onRead(AsyncConnection channel) {
}
diff --git a/src/org/redkale/net/http/WebSocketGroup.java b/src/org/redkale/net/http/WebSocketGroup.java
index 5b4e87fd3..74cafc85a 100644
--- a/src/org/redkale/net/http/WebSocketGroup.java
+++ b/src/org/redkale/net/http/WebSocketGroup.java
@@ -12,7 +12,9 @@ import java.util.stream.Stream;
/**
*
- * 详情见: http://www.redkale.org
+ *
+ * 详情见: http://www.redkale.org
+ *
* @author zhangjx
*/
public final class WebSocketGroup {
@@ -61,8 +63,8 @@ public final class WebSocketGroup {
/**
* 最近发送消息的WebSocket
- *
- * @return
+ *
+ * @return WebSocket
*/
public final WebSocket getRecentWebSocket() {
return recentWebSocket;
diff --git a/src/org/redkale/net/http/WebSocketNode.java b/src/org/redkale/net/http/WebSocketNode.java
index ec27fdff5..d9b67dfb3 100644
--- a/src/org/redkale/net/http/WebSocketNode.java
+++ b/src/org/redkale/net/http/WebSocketNode.java
@@ -18,7 +18,9 @@ import org.redkale.util.*;
/**
*
- * 详情见: http://www.redkale.org
+ *
+ * 详情见: http://www.redkale.org
+ *
* @author zhangjx
*/
public abstract class WebSocketNode {
@@ -77,8 +79,8 @@ public abstract class WebSocketNode {
/**
* 获取在线用户的节点地址列表
*
- * @param groupid
- * @return
+ * @param groupid groupid
+ * @return 地址列表
*/
public Collection
+ * 该类实现动态映射一个JavaBean类中成员对应的getter、setter方法; 代替低效的反射实现方式。
* 详情见: http://www.redkale.org
+ *
+ * 详情见: http://www.redkale.org
+ *
* @author zhangjx
- * @param
- * 实现一个类的构造方法。 代替低效的反射实现方式。 不支持数组类。 详情见: http://www.redkale.org
+ *
+ *
+ * 详情见: http://www.redkale.org
+ *
* @author zhangjx
- * @param 详情见: http://www.redkale.org
+ *
+ * 详情见: http://www.redkale.org
+ *
* @author zhangjx
- * @param 详情见: http://www.redkale.org
+ *
+ * 详情见: http://www.redkale.org
+ *
* @author zhangjx
*/
public class SelectColumn implements Predicate
+ *
* BSON协议格式:
* 1). 基本数据类型: 直接转换成byte[]
* 2). SmallString(无特殊字符且长度小于256的字符串): length(1 byte) + byte[](utf8); 通常用于类名、字段名、枚举。
@@ -23,13 +24,16 @@ import org.redkale.util.*;
* 3. SIGN_OBJECTB 标记位,值固定为0xBB (short)
* 4. 循环字段值:
* 4.1 SIGN_HASNEXT 标记位,值固定为1 (byte)
- * 4.2 字段类型; 1-9为基本类型&字符串; 101-109为基本类型&字符串的数组; 127为Object
+ * 4.2 字段类型; 1-9为基本类型和字符串; 101-109为基本类型和字符串的数组; 127为Object
* 4.3 字段名 (SmallString)
* 4.4 字段的值Object
* 5. SIGN_NONEXT 标记位,值固定为0 (byte)
* 6. SIGN_OBJECTE 标记位,值固定为0xEE (short)
*
- *
- *
* public class Record {
*
@@ -66,31 +65,33 @@ import jdk.internal.org.objectweb.asm.*;
* 当不存在getter方法时,get操作固定返回null
* 当不存在setter方法时,set操作为空方法
*
- *
+ * 根据一个getter和setter方法生成 Attribute 对象。
* tgetter、setter不能同时为null
*
* @param
+ * 根据Class、getter和setter方法生成 Attribute 对象。
* tgetter、setter不能同时为null
*
* @param
+ * 根据Class、字段别名、getter和setter方法生成 Attribute 对象。
* tgetter、setter不能同时为null
*
* @param
+ * 根据Class、字段别名、Field、getter和setter方法生成 Attribute 对象。
* Field、tgetter、setter不能同时为null
*
* @param
- * 常见的无参数的构造函数类都可以自动生成Creator, 对应自定义的类可以提供一个静态构建Creator方法。
- * 例如:
+ * 实现一个类的构造方法。 代替低效的反射实现方式。 不支持数组类。
+ * 常见的无参数的构造函数类都可以自动生成Creator, 对应自定义的类可以提供一个静态构建Creator方法。
+ * 例如:
*
- *
- * 或者:
+ *
+ * 或者:
*
* public class Record {
- *
+ *
* private final int id;
- *
+ *
* private String name;
- *
+ *
* Record(int id, String name) {
* this.id = id;
* this.name = name;
* }
- *
+ *
* private static Creator createCreator() {
* return new Creator<Record>() {
* @Override
@@ -43,15 +43,15 @@ import static jdk.internal.org.objectweb.asm.Opcodes.*;
* }
* }
*
- *
- *
* public class Record {
- *
+ *
* private final int id;
- *
+ *
* private String name;
- *
+ *
* @java.beans.ConstructorProperties({"id", "name"})
* public Record(int id, String name) {
* this.id = id;
@@ -59,15 +59,18 @@ import static jdk.internal.org.objectweb.asm.Opcodes.*;
* }
* }
*
+ * @param 源对象的数据类型
*/
public interface Reproduce