Skip to content

Commit e568830

Browse files
committed
Fix javadoc for module "biblio" (#396)
Result of 0630ffa.
1 parent 0630ffa commit e568830

16 files changed

+277
-31
lines changed

metafacture-biblio/src/main/java/org/metafacture/biblio/AlephMabXmlHandler.java

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -50,6 +50,9 @@ public final class AlephMabXmlHandler extends DefaultXmlPipe<StreamReceiver> {
5050
private String currentTag = "";
5151
private StringBuilder builder = new StringBuilder();
5252

53+
/**
54+
* Creates instance of {@link AlephMabXmlHandler}.
55+
*/
5356
public AlephMabXmlHandler() {
5457
}
5558

metafacture-biblio/src/main/java/org/metafacture/biblio/AseqDecoder.java

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -42,6 +42,9 @@ public final class AseqDecoder extends DefaultObjectPipe<String, StreamReceiver>
4242
private static final int RECORD_IDENTIFIER_BEGIN = 0;
4343
private static final int RECORD_IDENTIFIER_END = 9;
4444

45+
/**
46+
* Creates an instance of {@link AseqDecoder}.
47+
*/
4548
public AseqDecoder() {
4649
}
4750

metafacture-biblio/src/main/java/org/metafacture/biblio/ComarcXmlHandler.java

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -63,6 +63,9 @@ public class ComarcXmlHandler extends DefaultXmlPipe<StreamReceiver> {
6363
private String currentTag = "";
6464
private StringBuilder builder = new StringBuilder();
6565

66+
/**
67+
* Creates an instance of {@link ComarcXmlHandler}.
68+
*/
6669
public ComarcXmlHandler() {
6770
}
6871

metafacture-biblio/src/main/java/org/metafacture/biblio/MabDecoder.java

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -57,6 +57,9 @@ public final class MabDecoder extends DefaultObjectPipe<String, StreamReceiver>
5757
private static final String ID_TAG = "001 ";
5858
private static final int TAG_LENGTH = 4;
5959

60+
/**
61+
* Creates an instance of {@link MabDecoder}.
62+
*/
6063
public MabDecoder() {
6164
}
6265

metafacture-biblio/src/main/java/org/metafacture/biblio/iso2709/FieldHandler.java

Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -24,14 +24,42 @@
2424
*/
2525
public interface FieldHandler {
2626

27+
/**
28+
* Reference a field.
29+
*
30+
* @param tag the tag
31+
* @param implDefinedPart the impl defined part
32+
* @param value the value
33+
*/
2734
void referenceField(char[] tag, char[] implDefinedPart, String value);
2835

36+
/**
37+
* Starts a data field.
38+
*
39+
* @param tag the tag
40+
* @param implDefinedPart the impl defined part
41+
* @param indicators the indicators
42+
*/
2943
void startDataField(char[] tag, char[] implDefinedPart, char[] indicators);
3044

45+
/**
46+
* Ends the data field.
47+
*/
3148
void endDataField();
3249

50+
/**
51+
* Sets the impl defined part.
52+
*
53+
* @param implDefinedPart he impl defined part
54+
*/
3355
void additionalImplDefinedPart(char[] implDefinedPart);
3456

57+
/**
58+
* Sets the identifier to a value.
59+
*
60+
* @param identifier the identifier
61+
* @param value the value
62+
*/
3563
void data(char[] identifier, String value);
3664

3765
}

metafacture-biblio/src/main/java/org/metafacture/biblio/iso2709/Record.java

Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -91,22 +91,47 @@ private int findRecordIdFieldStart() {
9191
return RECORD_ID_MISSING;
9292
}
9393

94+
/**
95+
* Gets the record format of the Label.
96+
*
97+
* @return the record format of the Label
98+
*/
9499
public RecordFormat getRecordFormat() {
95100
return label.getRecordFormat();
96101
}
97102

103+
/**
104+
* Gets the record status of the Label.
105+
*
106+
* @return the record status of the Label
107+
*/
98108
public char getRecordStatus() {
99109
return label.getRecordStatus();
100110
}
101111

112+
/**
113+
* Gets the impl codes.
114+
*
115+
* @return the impl codes
116+
*/
102117
public char[] getImplCodes() {
103118
return label.getImplCodes();
104119
}
105120

121+
/**
122+
* Gets the systems chars of the Label.
123+
*
124+
* @return the system chars
125+
*/
106126
public char[] getSystemChars() {
107127
return label.getSystemChars();
108128
}
109129

130+
/**
131+
* Gets the reserved char of the Label.
132+
*
133+
* @return the reserved char
134+
*/
110135
public char getReservedChar() {
111136
return label.getReservedChar();
112137
}

metafacture-biblio/src/main/java/org/metafacture/biblio/iso2709/RecordBuilder.java

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -99,6 +99,11 @@ public void setCharset(final Charset charset) {
9999
fields.setCharset(Require.notNull(charset));
100100
}
101101

102+
/**
103+
* Gets the Charset of the FieldsBuilder.
104+
*
105+
* @return the Charset
106+
*/
102107
public Charset getCharset() {
103108
return fields.getCharset();
104109
}
@@ -208,6 +213,13 @@ public void appendIdentifierField(final char[] currentImplDefinedPart, final Str
208213
appendReferenceField(ID_FIELD_TAG, currentImplDefinedPart, value);
209214
}
210215

216+
/**
217+
* Appends a reference field in dependency of the current tag and of the default
218+
* impl defined part.
219+
*
220+
* @param currentTag char array of the current tag
221+
* @param value String that is appended as a reference field
222+
*/
211223
public void appendReferenceField(final char[] currentTag, final String value) {
212224
appendReferenceField(currentTag, defaultImplDefinedPart, value);
213225
}
@@ -249,10 +261,22 @@ private void checkValidReferenceFieldTag(final char[] currentTag) {
249261
}
250262
}
251263

264+
/**
265+
* Starts a data field in dependency of the current tag and default indicators.
266+
*
267+
* @param currentTag char array of the current tag
268+
*/
252269
public void startDataField(final char[] currentTag) {
253270
startDataField(currentTag, defaultIndicators);
254271
}
255272

273+
/**
274+
* Starts a data field in dependency of the current tag, indicators and of the
275+
* default impl defined part.
276+
*
277+
* @param currentTag char array of the current tag
278+
* @param indicators char array of the current indicators
279+
*/
256280
public void startDataField(final char[] currentTag, final char[] indicators) {
257281
startDataField(currentTag, indicators, defaultImplDefinedPart);
258282
}

metafacture-biblio/src/main/java/org/metafacture/biblio/iso2709/RecordFormat.java

Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -109,22 +109,47 @@ public static Builder createFrom(final RecordFormat source) {
109109
.withImplDefinedPartLength(source.implDefinedPartLength);
110110
}
111111

112+
/**
113+
* Gets the length of the indicator.
114+
*
115+
* @return the length of the indicator
116+
*/
112117
public int getIndicatorLength() {
113118
return indicatorLength;
114119
}
115120

121+
/**
122+
* Gets the length of the identifier.
123+
*
124+
* @return the length of the identifier
125+
*/
116126
public int getIdentifierLength() {
117127
return identifierLength;
118128
}
119129

130+
/**
131+
* Gets the length of the field length.
132+
*
133+
* @return the length of the field length
134+
*/
120135
public int getFieldLengthLength() {
121136
return fieldLengthLength;
122137
}
123138

139+
/**
140+
* Gets the length of the field start.
141+
*
142+
* @return length of the field start
143+
*/
124144
public int getFieldStartLength() {
125145
return fieldStartLength;
126146
}
127147

148+
/**
149+
* Gets the the length of the defined part.
150+
*
151+
* @return the length of the defined part
152+
*/
128153
public int getImplDefinedPartLength() {
129154
return implDefinedPartLength;
130155
}

metafacture-biblio/src/main/java/org/metafacture/biblio/marc21/Marc21Decoder.java

Lines changed: 32 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -139,33 +139,45 @@
139139
@FluxCommand("decode-marc21")
140140
public final class Marc21Decoder extends DefaultObjectPipe<String, StreamReceiver> {
141141

142+
public static final boolean EMIT_LEADER_AS_WHOLE = false;
143+
public static final boolean IGNORE_MISSING_ID = false;
144+
142145
private final FieldHandler fieldHandler = new Marc21Handler();
143146

144-
private boolean ignoreMissingId;
145-
private boolean emitLeaderAsWhole;
147+
private boolean ignoreMissingId = IGNORE_MISSING_ID;
148+
private boolean emitLeaderAsWhole = EMIT_LEADER_AS_WHOLE;
146149

150+
/**
151+
* Creates an instance of {@link Marc21Decoder}.
152+
*/
147153
public Marc21Decoder() {
148154
}
149155

150156
/**
151-
* Controls whether the decoder aborts processing if a record has no
152-
* identifier. A {@link MissingIdException} is thrown in these cases.
153-
* If this parameter is set to true then the identifier emitted with the
154-
* <i>start-record</i> event of records without field &quot;001&quot; will
155-
* be an empty string.
157+
* Controls whether the decoder aborts processing if a record has no identifier.
158+
* A {@link MissingIdException} is thrown in these cases. If this parameter is
159+
* set to true then the identifier emitted with the <i>start-record</i> event of
160+
* records without field &quot;001&quot; will be an empty string.
156161
* <p>
157-
* The default value of {@code ignoreMissingId} is false.
162+
* <strong>Default value: {@value #IGNORE_MISSING_ID}</strong>
158163
* <p>
159164
* This parameter can be changed anytime during processing. The new value
160165
* becomes effective with the next record being processed.
161166
*
162-
* @param ignoreMissingId
163-
* true if missing identifiers should be silently ignored.
167+
* @param ignoreMissingId true if missing identifiers should be silently
168+
* ignored.
164169
*/
165170
public void setIgnoreMissingId(final boolean ignoreMissingId) {
166171
this.ignoreMissingId = ignoreMissingId;
167172
}
168173

174+
/**
175+
* Gets the flag to decide whether to abort the processing of a record if it has
176+
* no identifier.
177+
*
178+
* @return true if a missing identifier shouldn't abort processing, otherwise
179+
* false
180+
*/
169181
public boolean getIgnoreMissingId() {
170182
return ignoreMissingId;
171183
}
@@ -174,16 +186,22 @@ public boolean getIgnoreMissingId() {
174186
* Controls whether the Record Leader should be emitted as a whole instead of
175187
* extracting the bibliographic information in the record leader.
176188
*
177-
* @see <a href="http://www.loc.gov/marc/bibliographic/bdleader.html">MARC 21
178-
* Standard: Record Leader</a>
189+
* <strong>Default value: {@value #EMIT_LEADER_AS_WHOLE}</strong>
179190
*
180-
* @param emitLeaderAsWhole
181-
* true if the leader should be emitted as a whole.
191+
* @see <a href="http://www.loc.gov/marc/bibliographic/bdleader.html">MARC 21
192+
* Standard: Record Leader</a>
193+
* @param emitLeaderAsWhole true if the leader should be emitted as a whole.
182194
*/
183195
public void setEmitLeaderAsWhole(final boolean emitLeaderAsWhole) {
184196
this.emitLeaderAsWhole = emitLeaderAsWhole;
185197
}
186198

199+
/**
200+
* Gets the flag to decide whether the Record Leader is emitted as whole instead
201+
* of extracting the bibliographic information in the record leader.
202+
*
203+
* @return true if the Record Leader is emitted as whole, otherwise false
204+
*/
187205
public boolean getEmitLeaderAsWhole() {
188206
return emitLeaderAsWhole;
189207
}

metafacture-biblio/src/main/java/org/metafacture/biblio/marc21/Marc21Encoder.java

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -106,6 +106,11 @@ public void setGenerateIdField(final boolean generateIdField) {
106106
this.generateIdField = generateIdField;
107107
}
108108

109+
/**
110+
* Gets the flag to decide whether the ID field is generated.
111+
*
112+
* @return true if the record ID is generated, otherwise false
113+
*/
109114
public boolean getGenerateIdField() {
110115
return generateIdField;
111116
}

0 commit comments

Comments
 (0)