Skip to content

Commit 6741fe8

Browse files
fixed some javadoc errors
1 parent 55ca9fe commit 6741fe8

File tree

3 files changed

+39
-38
lines changed

3 files changed

+39
-38
lines changed

vlog4j-graal/src/main/java/org/semanticweb/vlog4j/graal/GraalToVLog4JModelConverter.java

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -93,8 +93,8 @@ public static Fact convertAtomToFact(final fr.lirmm.graphik.graal.api.core.Atom
9393
* Atoms} into a {@link List} of {@link PositiveLiteral VLog4J
9494
* PositiveLiterals}.
9595
*
96-
* @param literals A {@link List} of {@link fr.lirmm.graphik.graal.api.core.Atom
97-
* Graal Atoms}.
96+
* @param literals list of {@link fr.lirmm.graphik.graal.api.core.Atom Graal
97+
* Atoms}.
9898
* @return A {@link List} of {@link PositiveLiteral VLog4J PositiveLiterals}.
9999
*/
100100
public static List<PositiveLiteral> convertAtoms(final List<fr.lirmm.graphik.graal.api.core.Atom> atoms) {
@@ -109,8 +109,8 @@ public static List<PositiveLiteral> convertAtoms(final List<fr.lirmm.graphik.gra
109109
* Converts a {@link List} of {@link fr.lirmm.graphik.graal.api.core.Atom Graal
110110
* Atoms} into a {@link List} of {@link Fact VLog4j facts}.
111111
*
112-
* @param literals A {@link List} of {@link fr.lirmm.graphik.graal.api.core.Atom
113-
* Graal Atoms}.
112+
* @param literals list of {@link fr.lirmm.graphik.graal.api.core.Atom Graal
113+
* Atoms}.
114114
* @return A {@link List} of {@link Fact VLog4j facts}.
115115
*/
116116
public static List<Fact> convertAtomsToFacts(final List<fr.lirmm.graphik.graal.api.core.Atom> atoms) {

vlog4j-parser/src/main/java/org/semanticweb/vlog4j/parser/ParserConfiguration.java

Lines changed: 18 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,7 @@
2626
import org.apache.commons.lang3.Validate;
2727
import org.semanticweb.vlog4j.core.model.api.Constant;
2828
import org.semanticweb.vlog4j.core.model.api.DataSource;
29+
import org.semanticweb.vlog4j.core.model.api.DataSourceDeclaration;
2930
import org.semanticweb.vlog4j.core.model.api.PrefixDeclarations;
3031
import org.semanticweb.vlog4j.core.model.implementation.Expressions;
3132
import org.semanticweb.vlog4j.parser.javacc.SubParserFactory;
@@ -39,12 +40,12 @@ public class ParserConfiguration {
3940
/**
4041
* The registered data sources.
4142
*/
42-
private HashMap<String, DataSourceDeclarationHandler> dataSources = new HashMap<>();
43+
private final HashMap<String, DataSourceDeclarationHandler> dataSources = new HashMap<>();
4344

4445
/**
4546
* The registered datatypes.
4647
*/
47-
private HashMap<String, DatatypeConstantHandler> datatypes = new HashMap<>();
48+
private final HashMap<String, DatatypeConstantHandler> datatypes = new HashMap<>();
4849

4950
/**
5051
* Register a new (type of) Data Source.
@@ -53,8 +54,8 @@ public class ParserConfiguration {
5354
* production of the rules grammar, corresponding to some {@link DataSource}
5455
* type.
5556
*
56-
* @see <"https://github.com/knowsys/vlog4j/wiki/Rule-syntax-grammar"> for the
57-
* grammar.
57+
* @see <a href="https://github.com/knowsys/vlog4j/wiki/Rule-syntax-grammar">
58+
* the grammar</a>.
5859
*
5960
* @param name Name of the data source, as it appears in the declaring
6061
* directive.
@@ -63,9 +64,9 @@ public class ParserConfiguration {
6364
* @throws IllegalArgumentException if the provided name is already registered.
6465
* @return this
6566
*/
66-
public ParserConfiguration registerDataSource(String name, DataSourceDeclarationHandler handler)
67+
public ParserConfiguration registerDataSource(final String name, final DataSourceDeclarationHandler handler)
6768
throws IllegalArgumentException {
68-
Validate.isTrue(!dataSources.containsKey(name), "The Data Source \"%s\" is already registered.", name);
69+
Validate.isTrue(!this.dataSources.containsKey(name), "The Data Source \"%s\" is already registered.", name);
6970

7071
this.dataSources.put(name, handler);
7172
return this;
@@ -87,9 +88,9 @@ public ParserConfiguration registerDataSource(String name, DataSourceDeclaration
8788
*
8889
* @return the Data Source instance.
8990
*/
90-
public DataSource parseDataSourceSpecificPartOfDataSourceDeclaration(String name, List<String> args,
91+
public DataSource parseDataSourceSpecificPartOfDataSourceDeclaration(final String name, final List<String> args,
9192
final SubParserFactory subParserFactory) throws ParsingException {
92-
DataSourceDeclarationHandler handler = dataSources.get(name);
93+
final DataSourceDeclarationHandler handler = this.dataSources.get(name);
9394

9495
if (handler == null) {
9596
throw new ParsingException("Data source \"" + name + "\" is not known.");
@@ -104,30 +105,29 @@ public DataSource parseDataSourceSpecificPartOfDataSourceDeclaration(String name
104105
* @param lexicalForm the (unescaped) lexical form of the constant.
105106
* @param languageTag the language tag, or null if not present.
106107
* @param the datatype, or null if not present.
107-
* @note At most one of {@code languageTag} and {@code datatype} may be
108-
* non-null.
108+
* @pre At most one of {@code languageTag} and {@code datatype} may be non-null.
109109
*
110110
* @throws ParsingException when the lexical form is invalid for the
111111
* given data type.
112112
* @throws IllegalArgumentException when both {@code languageTag} and
113113
* {@code datatype} are non-null.
114114
* @return the {@link Constant} corresponding to the given arguments.
115115
*/
116-
public Constant parseConstant(String lexicalForm, String languageTag, String datatype)
116+
public Constant parseConstant(final String lexicalForm, final String languageTag, final String datatype)
117117
throws ParsingException, IllegalArgumentException {
118-
Validate.isTrue(languageTag == null || datatype == null,
118+
Validate.isTrue((languageTag == null) || (datatype == null),
119119
"A constant with a language tag may not explicitly specify a data type.");
120120

121121
if (languageTag != null) {
122122
return Expressions.makeLanguageStringConstant(lexicalForm, languageTag);
123123
} else {
124-
return parseDatatypeConstant(lexicalForm, datatype);
124+
return this.parseDatatypeConstant(lexicalForm, datatype);
125125
}
126126
}
127127

128-
private Constant parseDatatypeConstant(String lexicalForm, String datatype) throws ParsingException {
129-
String type = ((datatype != null) ? datatype : PrefixDeclarations.XSD_STRING);
130-
DatatypeConstantHandler handler = datatypes.get(type);
128+
private Constant parseDatatypeConstant(final String lexicalForm, final String datatype) throws ParsingException {
129+
final String type = ((datatype != null) ? datatype : PrefixDeclarations.XSD_STRING);
130+
final DatatypeConstantHandler handler = this.datatypes.get(type);
131131

132132
if (handler != null) {
133133
return handler.createConstant(lexicalForm);
@@ -148,9 +148,9 @@ private Constant parseDatatypeConstant(String lexicalForm, String datatype) thro
148148
*
149149
* @return this
150150
*/
151-
public ParserConfiguration registerDatatype(String name, DatatypeConstantHandler handler)
151+
public ParserConfiguration registerDatatype(final String name, final DatatypeConstantHandler handler)
152152
throws IllegalArgumentException {
153-
Validate.isTrue(!datatypes.containsKey(name), "The Data type \"%s\" is already registered.", name);
153+
Validate.isTrue(!this.datatypes.containsKey(name), "The Data type \"%s\" is already registered.", name);
154154

155155
this.datatypes.put(name, handler);
156156
return this;
Lines changed: 17 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,7 @@
11
package org.semanticweb.vlog4j.parser.javacc;
22

3+
import java.io.ByteArrayInputStream;
4+
35
/*-
46
* #%L
57
* vlog4j-parser
@@ -21,31 +23,30 @@
2123
*/
2224

2325
import java.io.InputStream;
24-
import java.io.ByteArrayInputStream;
2526

2627
import org.semanticweb.vlog4j.core.model.api.PrefixDeclarations;
2728
import org.semanticweb.vlog4j.core.reasoner.KnowledgeBase;
2829
import org.semanticweb.vlog4j.parser.ParserConfiguration;
2930
import org.semanticweb.vlog4j.parser.RuleParser;
3031

3132
/**
32-
* Factory for creating a SubParser sharing configuration, state, and
33-
* prefixes, but with an independent input stream, to be used, e.g.,
34-
* for parsing arguments in data source declarations.
33+
* Factory for creating a SubParser sharing configuration, state, and prefixes,
34+
* but with an independent input stream, to be used, e.g., for parsing arguments
35+
* in data source declarations.
3536
*
3637
* @author Maximilian Marx
3738
*/
3839
public class SubParserFactory {
39-
private KnowledgeBase knowledgeBase;
40-
private ParserConfiguration parserConfiguration;
41-
private PrefixDeclarations prefixDeclarations;
40+
private final KnowledgeBase knowledgeBase;
41+
private final ParserConfiguration parserConfiguration;
42+
private final PrefixDeclarations prefixDeclarations;
4243

4344
/**
4445
* Construct a SubParserFactory.
4546
*
46-
* @argument parser the parser instance to get the state from.
47+
* @param parser the parser instance to get the state from.
4748
*/
48-
SubParserFactory(JavaCCParser parser) {
49+
SubParserFactory(final JavaCCParser parser) {
4950
this.knowledgeBase = parser.getKnowledgeBase();
5051
this.prefixDeclarations = parser.getPrefixDeclarations();
5152
this.parserConfiguration = parser.getParserConfiguration();
@@ -54,14 +55,14 @@ public class SubParserFactory {
5455
/**
5556
* Create a new parser with the specified state and given input.
5657
*
57-
* @argument inputStream the input stream to parse.
58-
* @argument encoding encoding of the input stream.
58+
* @param inputStream the input stream to parse.
59+
* @param encoding encoding of the input stream.
5960
*
60-
* @return A new {@link JavaCCParser} bound to inputStream and
61-
* with the specified parser state.
61+
* @return A new {@link JavaCCParser} bound to inputStream and with the
62+
* specified parser state.
6263
*/
6364
public JavaCCParser makeSubParser(final InputStream inputStream, final String encoding) {
64-
JavaCCParser subParser = new JavaCCParser(inputStream, encoding);
65+
final JavaCCParser subParser = new JavaCCParser(inputStream, encoding);
6566
subParser.setKnowledgeBase(this.knowledgeBase);
6667
subParser.setPrefixDeclarations(this.prefixDeclarations);
6768
subParser.setParserConfiguration(this.parserConfiguration);
@@ -70,10 +71,10 @@ public JavaCCParser makeSubParser(final InputStream inputStream, final String en
7071
}
7172

7273
public JavaCCParser makeSubParser(final InputStream inputStream) {
73-
return makeSubParser(inputStream, RuleParser.DEFAULT_STRING_ENCODING);
74+
return this.makeSubParser(inputStream, RuleParser.DEFAULT_STRING_ENCODING);
7475
}
7576

7677
public JavaCCParser makeSubParser(final String string) {
77-
return makeSubParser(new ByteArrayInputStream(string.getBytes()));
78+
return this.makeSubParser(new ByteArrayInputStream(string.getBytes()));
7879
}
7980
}

0 commit comments

Comments
 (0)