Skip to content

Commit 3e872d8

Browse files
committedMar 2, 2023
fix javadocs of classes ConsoleEngine, JrtJavaBasePackages and Widgets
1 parent c6a476e commit 3e872d8

File tree

3 files changed

+41
-39
lines changed

3 files changed

+41
-39
lines changed
 

‎console/src/main/java/org/jline/console/ConsoleEngine.java

+4-3
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright (c) 2002-2021, the original author or authors.
2+
* Copyright (c) 2002-2023, the original author or authors.
33
*
44
* This software is distributable under the BSD license. See the terms of the
55
* BSD license in the documentation provided with this software.
@@ -198,6 +198,7 @@ default Object execute(File script) throws Exception {
198198
ExecutionResult postProcess(Object result);
199199

200200
/**
201+
* Print object if trace is enabled
201202
* @param object object to print
202203
*/
203204
void trace(Object object);
@@ -242,8 +243,8 @@ default Object execute(File script) throws Exception {
242243
boolean executeWidget(Object function);
243244

244245
/**
245-
*
246-
* @return true if consoleEngine is executing script
246+
* Checks if consoleEngine is executing script
247+
* @return true when executing script
247248
*/
248249
boolean isExecuting();
249250

‎console/src/main/java/org/jline/widget/Widgets.java

+34-33
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright (c) 2002-2020, the original author or authors.
2+
* Copyright (c) 2002-2023, the original author or authors.
33
*
44
* This software is distributable under the BSD license. See the terms of the
55
* BSD license in the documentation provided with this software.
@@ -105,7 +105,8 @@ public void aliasWidget(String orig, String alias) {
105105
}
106106

107107
/**
108-
*
108+
* Resolve widget name if its alias is given as method parameter.
109+
* i.e. both method calls getWidget("yank") and getWidget(".yank") will return string ".yank"
109110
* @param name widget name or alias
110111
* @return widget name
111112
*/
@@ -114,8 +115,8 @@ public String getWidget(String name) {
114115
}
115116

116117
/**
117-
*
118-
* @param name widget name or alias
118+
* Test if widget exists
119+
* @param name widget name or its alias
119120
* @return true if widget exists
120121
*/
121122
public boolean existsWidget(String name) {
@@ -142,127 +143,127 @@ private Widget widget(String name) {
142143
}
143144

144145
/**
145-
*
146-
* @return The LineRearer Parser
146+
* Get lineReader's parser
147+
* @return The parser
147148
*/
148149
public Parser parser() {
149150
return reader.getParser();
150151
}
151152

152153
/**
153-
*
154-
* @return The LineReader Main KeyMap
154+
* Get lineReader's Main KeyMap
155+
* @return The KeyMap
155156
*/
156157
public KeyMap<Binding> getKeyMap() {
157158
return reader.getKeyMaps().get(LineReader.MAIN);
158159
}
159160

160161
/**
161-
*
162-
* @return The LineReader Buffer
162+
* Get lineReader's buffer
163+
* @return The buffer
163164
*/
164165
public Buffer buffer() {
165166
return reader.getBuffer();
166167
}
167168

168169
/**
169-
*
170+
* Replace lineReader buffer
170171
* @param buffer buffer that will be copied to the LineReader Buffer
171172
*/
172173
public void replaceBuffer(Buffer buffer) {
173174
reader.getBuffer().copyFrom(buffer);
174175
}
175176

176177
/**
177-
*
178+
* Parse lineReader buffer and returns its arguments
178179
* @return command line arguments
179180
*/
180181
public List<String> args() {
181182
return reader.getParser().parse(buffer().toString(), 0, ParseContext.COMPLETE).words();
182183
}
183184

184185
/**
185-
*
186-
* @return Buffer's previous character
186+
* Access lineReader buffer and return its previous character
187+
* @return previous character
187188
*/
188189
public String prevChar() {
189190
return String.valueOf((char)reader.getBuffer().prevChar());
190191
}
191192

192193
/**
193-
*
194-
* @return Buffer's current character
194+
* Access lineReader's buffer and return its current character
195+
* @return current character
195196
*/
196197
public String currChar() {
197198
return String.valueOf((char)reader.getBuffer().currChar());
198199
}
199200

200201
/**
201-
*
202-
* @return LineReader's last binding
202+
* Get lineReader's last binding
203+
* @return last binding
203204
*/
204205
public String lastBinding() {
205206
return reader.getLastBinding();
206207
}
207208

208209
/**
209-
*
210-
* @param string string to be written into LineReader Buffer
210+
* Write the string parameter to the lineReader's buffer
211+
* @param string string to be written
211212
*/
212213
public void putString(String string) {
213214
reader.getBuffer().write(string);
214215
}
215216

216217
/**
217-
*
218-
* @return Command line tail tip.
218+
* Get lineReader's command hint
219+
* @return Command hint.
219220
*/
220221
public String tailTip() {
221222
return reader.getTailTip();
222223
}
223224

224225
/**
225-
*
226-
* @param tailTip tail tip to be added to the command line
226+
* Set lineReader's command hint to be added in the command line
227+
* @param tailTip command hint
227228
*/
228229
public void setTailTip(String tailTip) {
229230
reader.setTailTip(tailTip);
230231
}
231232

232233
/**
233-
*
234-
* @param errorPattern error pattern to be set LineReader Highlighter
234+
* Set errorPattern to the lineReader's highlighter
235+
* @param errorPattern error pattern
235236
*/
236237
public void setErrorPattern(Pattern errorPattern) {
237238
reader.getHighlighter().setErrorPattern(errorPattern);
238239
}
239240

240241
/**
241-
*
242-
* @param errorIndex error index to be set LineReader Highlighter
242+
* Set errorIndex to the lineReader's highlighter
243+
* @param errorIndex error index
243244
*/
244245
public void setErrorIndex(int errorIndex) {
245246
reader.getHighlighter().setErrorIndex(errorIndex);
246247
}
247248

248249
/**
249-
* Clears command line tail tip
250+
* Clears command line command hint
250251
*/
251252
public void clearTailTip() {
252253
reader.setTailTip("");
253254
}
254255

255256
/**
256-
*
257-
* @param type type to be set to the LineReader autosuggestion
257+
* Set lineReader's autosuggestion type
258+
* @param type autosuggestion type
258259
*/
259260
public void setSuggestionType(SuggestionType type) {
260261
reader.setAutosuggestion(type);
261262
}
262263

263264
/**
264-
*
265-
* @param desc Text to be displayed on terminal status bar
265+
* Add description text to the terminal status bar
266+
* @param desc description text
266267
*/
267268
public void addDescription(List<AttributedString> desc) {
268269
Status.getStatus(reader.getTerminal()).update(desc);

‎groovy/src/main/java/org/jline/script/JrtJavaBasePackages.java

+3-3
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright (c) 2002-2021, the original author or authors.
2+
* Copyright (c) 2002-2023, the original author or authors.
33
*
44
* This software is distributable under the BSD license. See the terms of the
55
* BSD license in the documentation provided with this software.
@@ -22,7 +22,7 @@
2222
import static java.nio.file.FileVisitResult.CONTINUE;
2323

2424
/**
25-
*
25+
* Helper class to resolve java.base module classes
2626
* @author <a href="mailto:matti.rintanikkola@gmail.com">Matti Rinta-Nikkola</a>
2727
*/
2828
public class JrtJavaBasePackages {
@@ -92,4 +92,4 @@ private List<Object> getClasses() {
9292
return classes;
9393
}
9494
}
95-
}
95+
}

0 commit comments

Comments
 (0)
Please sign in to comment.