Skip to content

Commit 52c9559

Browse files
committed
metafacture-mangling/ (main): Fix Checkstyle violations.
1 parent d23f165 commit 52c9559

21 files changed

+62
-20
lines changed

metafacture-mangling/src/main/java/org/metafacture/mangling/DuplicateObjectFilter.java

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,7 @@
1313
* See the License for the specific language governing permissions and
1414
* limitations under the License.
1515
*/
16+
1617
package org.metafacture.mangling;
1718

1819
import org.metafacture.framework.FluxCommand;
@@ -34,11 +35,13 @@
3435
@In(Object.class)
3536
@Out(Object.class)
3637
@FluxCommand("filter-duplicate-objects")
37-
public final class DuplicateObjectFilter<T> extends
38-
DefaultObjectPipe<T, ObjectReceiver<T>> {
38+
public final class DuplicateObjectFilter<T> extends DefaultObjectPipe<T, ObjectReceiver<T>> {
3939

4040
private T lastObj;
4141

42+
public DuplicateObjectFilter() {
43+
}
44+
4245
@Override
4346
public void process(final T obj) {
4447
if (!obj.equals(lastObj)) {

metafacture-mangling/src/main/java/org/metafacture/mangling/EntityPathTracker.java

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -13,13 +13,14 @@
1313
* See the License for the specific language governing permissions and
1414
* limitations under the License.
1515
*/
16+
1617
package org.metafacture.mangling;
1718

19+
import org.metafacture.framework.helpers.DefaultStreamReceiver;
20+
1821
import java.util.ArrayDeque;
1922
import java.util.Deque;
2023

21-
import org.metafacture.framework.helpers.DefaultStreamReceiver;
22-
2324
/**
2425
* Tracks the <i>path</i> of the current entity. The entity path consists of the
2526
* names of all parent entities of the current entity separated by a separator
@@ -46,6 +47,9 @@ public class EntityPathTracker extends DefaultStreamReceiver {
4647

4748
private String entitySeparator = DEFAULT_ENTITY_SEPARATOR;
4849

50+
public EntityPathTracker() {
51+
}
52+
4953
/**
5054
* Returns the current entity path.
5155
*

metafacture-mangling/src/main/java/org/metafacture/mangling/LiteralToObject.java

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -13,10 +13,8 @@
1313
* See the License for the specific language governing permissions and
1414
* limitations under the License.
1515
*/
16-
package org.metafacture.mangling;
1716

18-
import java.util.regex.Matcher;
19-
import java.util.regex.Pattern;
17+
package org.metafacture.mangling;
2018

2119
import org.metafacture.framework.FluxCommand;
2220
import org.metafacture.framework.ObjectReceiver;
@@ -26,6 +24,9 @@
2624
import org.metafacture.framework.annotations.Out;
2725
import org.metafacture.framework.helpers.DefaultStreamPipe;
2826

27+
import java.util.regex.Matcher;
28+
import java.util.regex.Pattern;
29+
2930
/**
3031
* Emits the values of literals matching {@literal #setPattern(String)}
3132
* as objects.
@@ -49,6 +50,9 @@ public final class LiteralToObject extends DefaultStreamPipe<ObjectReceiver<Stri
4950

5051
private Matcher matcher = Pattern.compile(DEFAULT_PATTERN).matcher("");
5152

53+
public LiteralToObject() {
54+
}
55+
5256
/**
5357
* Sets the pattern against which literal names are matched. Only the
5458
* values of matching literals are converted into objects.

metafacture-mangling/src/main/java/org/metafacture/mangling/NullFilter.java

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,7 @@
1313
* See the License for the specific language governing permissions and
1414
* limitations under the License.
1515
*/
16+
1617
package org.metafacture.mangling;
1718

1819
import org.metafacture.framework.FluxCommand;
@@ -35,7 +36,10 @@
3536
@FluxCommand("filter-null-values")
3637
public final class NullFilter extends ForwardingStreamPipe {
3738

38-
private String replacement = null;
39+
private String replacement;
40+
41+
public NullFilter() {
42+
}
3943

4044
public void setReplacement(final String replacement) {
4145
this.replacement = replacement;
@@ -49,7 +53,8 @@ public String getReplacement() {
4953
public void literal(final String name, final String value) {
5054
if (value != null) {
5155
getReceiver().literal(name, value);
52-
} else if (replacement != null) {
56+
}
57+
else if (replacement != null) {
5358
getReceiver().literal(name, replacement);
5459
}
5560
}

metafacture-mangling/src/main/java/org/metafacture/mangling/ObjectToLiteral.java

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,7 @@
1313
* See the License for the specific language governing permissions and
1414
* limitations under the License.
1515
*/
16+
1617
package org.metafacture.mangling;
1718

1819
import org.metafacture.framework.FluxCommand;
@@ -41,10 +42,9 @@ public final class ObjectToLiteral<T> extends
4142
private int recordCount;
4243

4344
public ObjectToLiteral() {
44-
super();
4545
setLiteralName(DEFAULT_LITERAL_NAME);
4646
setRecordId(DEFAULT_RECORD_ID);
47-
recordCount=0;
47+
recordCount = 0;
4848
}
4949

5050
public void setLiteralName(final String literalName) {
@@ -65,7 +65,7 @@ public String getRecordId() {
6565

6666
@Override
6767
public void process(final T obj) {
68-
assert obj!=null;
68+
assert obj != null;
6969
assert !isClosed();
7070
getReceiver().startRecord(String.format(recordId, ++recordCount));
7171
getReceiver().literal(literalName, obj.toString());

metafacture-mangling/src/main/java/org/metafacture/mangling/RecordIdChanger.java

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,7 @@
1313
* See the License for the specific language governing permissions and
1414
* limitations under the License.
1515
*/
16+
1617
package org.metafacture.mangling;
1718

1819
import org.metafacture.flowcontrol.StreamBuffer;
@@ -78,6 +79,9 @@ public final class RecordIdChanger extends DefaultStreamPipe<StreamReceiver> {
7879
private boolean keepRecordsWithoutIdLiteral = true;
7980
private boolean keepIdLiteral;
8081

82+
public RecordIdChanger() {
83+
}
84+
8185
/**
8286
* Sets the name of the literal that contains the new record id. This must be
8387
* a qualified literal name including the entities in which the literal is
@@ -158,7 +162,8 @@ public void endRecord() {
158162
if (currentIdentifier != null || keepRecordsWithoutIdLiteral) {
159163
if (currentIdentifier == null) {
160164
getReceiver().startRecord(originalIdentifier);
161-
} else {
165+
}
166+
else {
162167
getReceiver().startRecord(currentIdentifier);
163168
}
164169
streamBuffer.replay();

metafacture-mangling/src/main/java/org/metafacture/mangling/RecordPathFilter.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,7 @@
1313
* See the License for the specific language governing permissions and
1414
* limitations under the License.
1515
*/
16+
1617
package org.metafacture.mangling;
1718

1819
import org.metafacture.framework.FluxCommand;
@@ -49,7 +50,6 @@ public RecordPathFilter() {
4950
}
5051

5152
public RecordPathFilter(final String path) {
52-
super();
5353
resetRecord();
5454
setPath(path);
5555
setRecordIdFormat(DEFAULT_RECORD_ID_FORMAT);

metafacture-mangling/src/main/java/org/metafacture/mangling/RecordToEntity.java

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,7 @@
1313
* See the License for the specific language governing permissions and
1414
* limitations under the License.
1515
*/
16+
1617
package org.metafacture.mangling;
1718

1819
import org.metafacture.framework.FluxCommand;
@@ -47,6 +48,9 @@ public class RecordToEntity extends ForwardingStreamPipe {
4748
private String entityName = DEFAULT_ENTITY_NAME;
4849
private String idLiteralName;
4950

51+
public RecordToEntity() {
52+
}
53+
5054
public String getEntityName() {
5155
return entityName;
5256
}

metafacture-mangling/src/main/java/org/metafacture/mangling/StreamEventDiscarder.java

Lines changed: 11 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -13,16 +13,17 @@
1313
* See the License for the specific language governing permissions and
1414
* limitations under the License.
1515
*/
16-
package org.metafacture.mangling;
1716

18-
import java.util.EnumSet;
17+
package org.metafacture.mangling;
1918

2019
import org.metafacture.framework.FluxCommand;
2120
import org.metafacture.framework.StreamPipe;
2221
import org.metafacture.framework.StreamReceiver;
2322
import org.metafacture.framework.annotations.In;
2423
import org.metafacture.framework.annotations.Out;
2524

25+
import java.util.EnumSet;
26+
2627
/**
2728
* Discards stream events by type. The type of a stream event is either
2829
* {@linkplain EventType#RECORD record}, {@linkplain EventType#ENTITY entity},
@@ -48,10 +49,13 @@ public class StreamEventDiscarder implements StreamPipe<StreamReceiver> {
4849

4950
private EnumSet<EventType> discardedEvents = EnumSet.noneOf(EventType.class);
5051

52+
public StreamEventDiscarder() {
53+
}
54+
5155
@Override
52-
public <R extends StreamReceiver> R setReceiver(final R receiver) {
53-
this.receiver = receiver;
54-
return receiver;
56+
public <R extends StreamReceiver> R setReceiver(final R newReceiver) {
57+
receiver = newReceiver;
58+
return newReceiver;
5559
}
5660

5761
/**
@@ -122,7 +126,8 @@ private void setDiscardEventsByType(final EventType type,
122126
final boolean discard) {
123127
if (discard) {
124128
discardedEvents.add(type);
125-
} else {
129+
}
130+
else {
126131
discardedEvents.remove(type);
127132
}
128133
}

metafacture-mangling/src/main/java/org/metafacture/mangling/StreamFlattener.java

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,7 @@
1313
* See the License for the specific language governing permissions and
1414
* limitations under the License.
1515
*/
16+
1617
package org.metafacture.mangling;
1718

1819
import org.metafacture.framework.FluxCommand;

0 commit comments

Comments
 (0)