Skip to content

Commit d9297d0

Browse files
committed
fix(javadoc): phase 5 — BlockingQueue, BSH classes, TLV packagers, SMAdapter, QBean, etc.
- BlockingQueue: add class/constructor/all method docs - BSHAction: add class/field/constructor comments - BSHFilter, BinaryTagValue: add class-level descriptions - BinaryEMVTag: add getValue/getTag/getFormattedValue comments - BcdPrefixer, BinaryPrefixer: add INSTANCE field comments - XmlConfigurable: add description to setConfiguration - ISOFilter, RawIncomingFilter: add descriptions and fix bare @throws - BCDChannel: add @exception descriptions - GenericPackager: add missing @throws ISOException - QBean: add getServer/getName descriptions - QBeanSupport: add logger/realm field comments - BSH: add class/field javadoc - GroupSelector, BSHGroupSelector, BSHMethod: add descriptions - UIAware, UIFactory, BorderLayoutFactory: add method/class javadocs - LogListener: add log() method description - BSHLogListener: add field/method/inner class comments - TLV packagers (BinaryHexTaggedSequencePackager, TaggedSequencePackager, BERTLVPackager, BERTLVAsciiHexPackager, BERTLVBinaryPackager, BERTLVEbcdicHexPackager, BERTLVFormatMapper, DefaultICCBERTLVFormatMapper): add constructor/method/field comments - BaseSMAdapter: add field/constructor comments; fix getName/setName descriptions; fix @throws - SMAdapter: fix remaining @param descriptions - ISOMsg: fix getSource description - ISOFieldPackager: expand all remaining inline javadocs
1 parent c815099 commit d9297d0

20 files changed

+117
-8
lines changed

jpos/src/main/java/org/jpos/bsh/BSHAction.java

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -26,9 +26,12 @@
2626
import java.awt.event.ActionEvent;
2727
import java.awt.event.ActionListener;
2828

29+
/** Swing {@link ActionListener} implemented via a BeanShell script. */
2930
public class BSHAction implements ActionListener, UIAware {
31+
/** The UI context. */
3032
public UI ui;
3133

34+
/** Default constructor. */
3235
public BSHAction () {
3336
super();
3437
}

jpos/src/main/java/org/jpos/bsh/BSHLogListener.java

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -73,7 +73,9 @@
7373
public class BSHLogListener implements org.jpos.util.LogListener, org.jpos.core.Configurable {
7474
/**Holds the configuration for this object*/
7575
protected Configuration cfg;
76+
/** Pattern names used for script filename matching. */
7677
protected static final String[] patterns = {"tag", "realm"};
78+
/** Cache of loaded BeanShell scripts keyed by filename. */
7779
protected Map<String, ScriptInfo> scripts = new HashMap<>();
7880
/** Creates a new instance of BSHLogListener */
7981
public BSHLogListener() {
@@ -83,6 +85,11 @@ public BSHLogListener() {
8385
public void setConfiguration(org.jpos.core.Configuration cfg) {
8486
this.cfg = cfg;
8587
}
88+
/** @param src source strings
89+
* @param patterns patterns to replace
90+
* @param to replacement strings
91+
* @return result array with patterns replaced
92+
*/
8693
protected static String[] replace(String[] src, String[] patterns, String[] to){
8794
String[] ret = new String[src.length];
8895
for(int i=0; i<src.length; i++){
@@ -166,6 +173,10 @@ public LogEvent log(LogEvent ev) {
166173
return ret;
167174
}
168175
}
176+
/** @param f script file to load
177+
* @return file contents as a string
178+
* @throws IOException on read failure
179+
*/
169180
protected String loadCode(File f) throws IOException{
170181
StringBuilder buf = new StringBuilder((int)f.length());
171182
char[] content = new char[(int)f.length()];
@@ -179,27 +190,40 @@ protected String loadCode(File f) throws IOException{
179190
return buf.toString();
180191
}
181192

193+
/** @param filename the script filename key
194+
* @return cached ScriptInfo or null
195+
*/
182196
protected ScriptInfo getScriptInfo(String filename){
183197
Objects.requireNonNull(filename, "The script file name cannot be null");
184198
return scripts.get(filename);
185199
}
186200

201+
/** @param filename the script filename key
202+
* @param code the script source code
203+
* @param lastModified last-modified timestamp
204+
*/
187205
protected void addScriptInfo(String filename, String code, long lastModified){
188206
Objects.requireNonNull(filename, "The script file name cannot be null");
189207
scripts.put(filename, new ScriptInfo(code, lastModified));
190208
}
209+
/** Holds a cached BeanShell script and its namespace. */
191210
protected static class ScriptInfo{
192211
String code;
193212
long lastModified;
194213
long lastCheck;
195214
NameSpace nameSpace;
196215

216+
/** Default constructor creating an empty ScriptInfo. */
197217
public ScriptInfo(){
198218
}
219+
/** @param ns the BeanShell namespace to use */
199220
public ScriptInfo(NameSpace ns){
200221
nameSpace = ns;
201222
}
202223

224+
/** @param code the script source code
225+
* @param lastModified last-modified timestamp of the script file
226+
*/
203227
public ScriptInfo(String code, long lastModified){
204228
setCode(code);
205229
setLastModified(lastModified);

jpos/src/main/java/org/jpos/iso/BcdPrefixer.java

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,7 @@ public class BcdPrefixer implements Prefixer
3030
/**
3131
* A length prefixer for up to 9 chars. The length is encoded with 1 BCD digit.
3232
*/
33+
/** Pre-built BcdPrefixer instances for common lengths. */
3334
public static final BcdPrefixer L = new BcdPrefixer(1);
3435
/**
3536
* A length prefixer for up to 99 chars. The length is encoded with 2 BCD digits.

jpos/src/main/java/org/jpos/iso/BinaryPrefixer.java

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,7 @@ public class BinaryPrefixer implements Prefixer
2929
/**
3030
* A length prefixer for up to 255 chars. The length is encoded with 1 unsigned byte.
3131
*/
32+
/** Pre-built BinaryPrefixer instances for common lengths. */
3233
public static final BinaryPrefixer B = new BinaryPrefixer(1);
3334

3435
/**

jpos/src/main/java/org/jpos/iso/ISOFieldPackager.java

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -88,11 +88,17 @@ public ISOFieldPackager(int len, String description) {
8888
public String getDescription() {
8989
return description;
9090
}
91-
/** Sets the field description. @param description the description */
91+
/**
92+
* Sets the field description.
93+
* @param description the description text
94+
*/
9295
public void setDescription(String description) {
9396
this.description = description;
9497
}
95-
/** Returns the maximum field length. @return max field length */
98+
/**
99+
* Returns the maximum field length.
100+
* @return max field length
101+
*/
96102
public int getLength() {
97103
return len;
98104
}

jpos/src/main/java/org/jpos/iso/ISOFilter.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,7 @@ public VetoException (String detail, Exception nested) {
4949
* @param m ISOMsg to filter
5050
* @param evt LogEvent
5151
* @return an ISOMsg (possibly parameter m)
52-
* @throws VetoException
52+
* @throws VetoException if the message should be suppressed
5353
*/
5454
ISOMsg filter(ISOChannel channel, ISOMsg m, LogEvent evt)
5555
throws VetoException;

jpos/src/main/java/org/jpos/iso/ISOMsg.java

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1259,6 +1259,7 @@ public void setSource (ISOSource source) {
12591259
this.sourceRef = new WeakReference (source);
12601260
}
12611261
/**
1262+
* Returns the associated ISOSource (e.g. the channel that received this message).
12621263
* @return an ISOSource or null
12631264
*/
12641265
public ISOSource getSource () {

jpos/src/main/java/org/jpos/iso/RawIncomingFilter.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@ public interface RawIncomingFilter extends ISOFilter {
3434
* @param image raw image
3535
* @param evt LogEvent
3636
* @return an ISOMsg (possibly parameter m)
37-
* @throws VetoException
37+
* @throws VetoException if the message should be suppressed
3838
*/
3939
ISOMsg filter(ISOChannel channel, ISOMsg m,
4040
byte[] header, byte[] image, LogEvent evt)

jpos/src/main/java/org/jpos/iso/channel/BCDChannel.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -59,7 +59,7 @@ public BCDChannel (String host, int port, ISOPackager p, byte[] TPDU) {
5959
* Construct server ISOChannel
6060
* @param p an ISOPackager
6161
* @param TPDU an optional raw header (i.e. TPDU)
62-
* @exception IOException
62+
* @exception IOException on I/O failure
6363
* @see ISOPackager
6464
*/
6565
public BCDChannel (ISOPackager p, byte[] TPDU) throws IOException {

jpos/src/main/java/org/jpos/iso/packager/Base1_BITMAP126.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -52,7 +52,7 @@ public Base1_BITMAP126(int len, String description)
5252
/**
5353
* @param c - a component
5454
* @return packed component
55-
* @exception ISOException
55+
* @throws ISOException on packing/unpacking error
5656
*/
5757
public byte[] pack (ISOComponent c) throws ISOException
5858
{

0 commit comments

Comments
 (0)