mirror of
https://github.com/collinsmith/riiablo.git
synced 2025-02-11 11:27:16 +07:00
Added annotation field to allow bin generator to ignore certain columns
This commit is contained in:
parent
d9b701901d
commit
814925d76c
@ -67,15 +67,17 @@ public abstract class Excel<T extends Excel.Entry> implements Iterable<T> {
|
||||
@Retention(RetentionPolicy.RUNTIME)
|
||||
public @interface Column {
|
||||
/** Used to index format */
|
||||
int startIndex() default 0;
|
||||
int startIndex() default 0;
|
||||
/** Used to index format */
|
||||
int endIndex() default 0;
|
||||
int endIndex() default 0;
|
||||
/** Format of column name, if not set, then field name is used */
|
||||
String format() default "";
|
||||
String format() default "";
|
||||
/** Used to index format not non-numerical indexes */
|
||||
String values()[] default {};
|
||||
String values()[] default {};
|
||||
/** Sets index of column of value (used for cases like weapons.txt where one column has no name) */
|
||||
int columnIndex() default -1;
|
||||
int columnIndex() default -1;
|
||||
/** Whether or not to read/write value in bin codec */
|
||||
boolean bin() default true;
|
||||
}
|
||||
|
||||
@Target(ElementType.FIELD)
|
||||
|
@ -15,6 +15,8 @@ public class ExcelGenerationTool {
|
||||
Field[] fields = clazz.getFields();
|
||||
for (int i = 0; i < fields.length; i++) {
|
||||
Field field = fields[i];
|
||||
Excel.Entry.Column column = field.getAnnotation(Excel.Entry.Column.class);
|
||||
if (!column.bin()) continue;
|
||||
Class type = field.getType();
|
||||
if (type.isArray()) {
|
||||
type = type.getComponentType();
|
||||
@ -29,6 +31,7 @@ public class ExcelGenerationTool {
|
||||
for (int i = 0; i < fields.length; i++) {
|
||||
Field field = fields[i];
|
||||
Excel.Entry.Column column = field.getAnnotation(Excel.Entry.Column.class);
|
||||
if (!column.bin()) continue;
|
||||
Class type = field.getType();
|
||||
if (type.isArray()) {
|
||||
type = type.getComponentType();
|
||||
|
Loading…
Reference in New Issue
Block a user