Skip to content

Commit

Permalink
Fix grammar in comments and rename Field to SeqItem
Browse files Browse the repository at this point in the history
  • Loading branch information
Mingun committed Jan 13, 2020
1 parent b556ee6 commit c92781f
Show file tree
Hide file tree
Showing 4 changed files with 37 additions and 38 deletions.
33 changes: 16 additions & 17 deletions src/main/java/io/kaitai/struct/annotations/Generated.java
Original file line number Diff line number Diff line change
Expand Up @@ -32,8 +32,6 @@
* Annotation, that applied to Kaitai-generated classes. Visualizers can use that
* annotation to find classes, that contains generated stuff, that should be showed
* in visualization.
*
* @author Mingun
*/
@Documented
@Retention(RetentionPolicy.RUNTIME)
Expand All @@ -58,24 +56,24 @@
* <table>
* <tr><th>Type</th><th>Field</th><th>Description</th></tr>
* <tr><td>{@code Map<String, Integer>}</td><td>{@code _attrStart}</td>
* <td>Start offset in root stream, where {@link Field field} or
* {@link Instance instance} with specified name begins.
* Used only for fields/instances, that is not repeated</td>
* <td>Start offset in the root stream, where {@link SeqItem an attribute} or
* {@link Instance an instance} with specified name begins.
* Used only for attributes/instances, that is not repeated</td>
* </tr>
* <tr><td>{@code Map<String, Integer>}</td><td>{@code _attrEnd}</td>
* <td>Start offset in root stream, where {@link Field field} or
* {@link Instance instance} with specified name ends (exclusive).
* Used only for fields/instances, that is not repeated</td>
* <td>Start offset in the root stream, where {@link SeqItem an attribute} or
* {@link Instance an instance} with specified name ends (exclusive).
* Used only for attributes/instances, that is not repeated</td>
* </tr>
* <tr><td>{@code Map<String, ? extends List<Integer>>}</td><td>{@code _arrStart}</td>
* <td>List with start offset in root stream, where each array element of repeated
* {@link Field field} or {@link Instance instance} with specified name begins.
* Used only for fields/instances, that is repeated</td>
* <td>List with start offset in the root stream, where each array element of
* repeated {@link SeqItem attribute} or {@link Instance instance} with
* specified name begins. Used only for attributes/instances, that is repeated</td>
* </tr>
* <tr><td>{@code Map<String, ? extends List<Integer>>}</td><td>{@code _arrEnd}</td>
* <td>List with end offset (exclusive) in root stream, where each array element of repeated
* {@link Field field} or {@link Instance instance} with specified name ends.
* Used only for fields/instances, that is repeated</td>
* <td>List with end offset (exclusive) in the root stream, where each array
* element of repeated {@link SeqItem attribute} or {@link Instance instance}
* with specified name ends. Used only for attributes/instances, that is repeated</td>
* </tr>
* </table>
*
Expand All @@ -84,7 +82,7 @@
boolean posInfo();
/**
* Determines, if instantiation of user classes (related to user-types, defined
* in {@code ksy} file) automatically read its content from stream, or that must
* in {@code ksy} file) automatically read its content from the stream, or that must
* be performed manually by calling generated {@code _read()}, {@code _readBE()}
* or {@code _readLE()} method.
*
Expand All @@ -93,9 +91,10 @@
*/
boolean autoRead();
/**
* Documentation string, that attached to the type in {@code doc} language element.
* Documentation string attached to the type definition, specified in {@code doc}
* KSY element.
*
* @return Documentation string for type. If documentation is missed, returns empty string
* @return Documentation string for a type. If documentation is missed, returns empty string
*/
String doc();
}
10 changes: 5 additions & 5 deletions src/main/java/io/kaitai/struct/annotations/Instance.java
Original file line number Diff line number Diff line change
Expand Up @@ -30,9 +30,7 @@

/**
* Annotation, that applied to fields, getters or setters that represents instance
* field from {@code instances} language element.
*
* @author Mingun
* field from {@code instances} KSY element.
*/
@Documented
@Retention(RetentionPolicy.RUNTIME)
Expand All @@ -46,9 +44,11 @@
*/
String id();
/**
* Documentation string, that attached to the field in {@code doc} language element.
* Documentation string attached to the instance definition, specified in {@code doc}
* KSY element.
*
* @return Documentation string for field. If documentation is missed, returns empty string
* @return Documentation string for an instance. If documentation is missed,
* returns empty string
*/
String doc();
}
14 changes: 7 additions & 7 deletions src/main/java/io/kaitai/struct/annotations/Parameter.java
Original file line number Diff line number Diff line change
Expand Up @@ -30,9 +30,7 @@

/**
* Annotation, that applied to fields, getters or setters that represents parameter
* from {@code params} language element.
*
* @author Mingun
* from {@code params} KSY element.
*/
@Documented
@Retention(RetentionPolicy.RUNTIME)
Expand All @@ -46,15 +44,17 @@
*/
String id();
/**
* Index of parameter in sequence of parameters of the type
* Index of a parameter in sequence of parameters in the type.
*
* @return 0-based index of parameter in {@code params} language element
* @return 0-based index of a parameter in {@code params} KSY element
*/
int index();
/**
* Documentation string, that attached to the parameter in {@code doc} language element.
* Documentation string attached to the parameter, specified in {@code doc}
* KSY element.
*
* @return Documentation string for parameter. If documentation is missed, returns empty string
* @return Documentation string for parameter. If documentation is missed,
* returns empty string
*/
String doc();
}
Original file line number Diff line number Diff line change
Expand Up @@ -29,15 +29,13 @@
import java.lang.annotation.Target;

/**
* Annotation, that applied to fields, getters or setters that represents field
* from {@code seq} language element.
*
* @author Mingun
* Annotation, that applied to fields, getters or setters that represents an attribute
* from {@code seq} KSY element.
*/
@Documented
@Retention(RetentionPolicy.RUNTIME)
@Target({ElementType.FIELD, ElementType.METHOD})
public @interface Field {
public @interface SeqItem {
/**
* Original identifier ({@code id} key) from {@code ksy} file.
*
Expand All @@ -46,15 +44,17 @@
*/
String id();
/**
* Index of field in sequence of fields in the type
* Index of an attribute in sequence of attributes in the type.
*
* @return 0-based index of field in {@code seq} language element
* @return 0-based index of an attribute in {@code seq} KSY element
*/
int index();
/**
* Documentation string, that attached to the field in {@code doc} language element.
* Documentation string attached to the attribute, specified in {@code doc}
* KSY element.
*
* @return Documentation string for field. If documentation is missed, returns empty string
* @return Documentation string for and attribute. If documentation is missed,
* returns empty string
*/
String doc();
}

0 comments on commit c92781f

Please sign in to comment.