Skip to content

Commit def3c60

Browse files
committed
Merge branch 'master' into 339-metamorphVerifyNoMoreInteractionsPart2
2 parents eda7269 + 73bedb1 commit def3c60

File tree

284 files changed

+4346
-446
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

284 files changed

+4346
-446
lines changed

README.md

Lines changed: 15 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -4,63 +4,63 @@
44

55
Metafacture is a toolkit for processing semi-structured data with a focus on library metadata. It provides a versatile set of tools for reading, writing and transforming data. Metafacture can be used as a stand-alone application or as a Java library in other applications. The name Metafacture is a portmanteau of the words *meta*data and manu*facture*.
66

7-
Metafacture includes a [large number of modules](https://github.com/metafacture/metafacture-documentation/blob/master/flux-commands.md) for operating on semi-structured data. These modules can be combined to build pipelines to perform complex metadata processing tasks. The pipelines can be constructed either in Java code or with the domain-specific language **Flux**. One of the core features of Metafacture is the **Metamorph** module. Metamorph is an xml-based language for specifying transformations of semi-structured data. It can be seamlessly integrated into Java code.
7+
Metafacture includes a [large number of modules](https://github.com/metafacture/metafacture-documentation/blob/master/flux-commands.md) for operating on semi-structured data. These modules can be combined to build pipelines to perform complex metadata processing tasks. The pipelines can be constructed either in Java code or with the domain-specific language **Flux**. One of the core features of Metafacture is the **Metamorph** module. Metamorph is an XML-based language for specifying transformations of semi-structured data. It can be seamlessly integrated into Java code.
88

99
At its heart Metafacture is a framework for implementing modules for metadata processing. This makes Metafacture easily extendable with additional modules. The [plugins and tools page](https://github.com/metafacture/metafacture-core/wiki/Plugins-and-Tools) on the wiki shows supplementary packages and projects which extend Metafacture.
1010

11-
Originally, Metafacture was developed as part of the [Culturegraph](http://culturegraph.org) platform but it is developed independently now and used by others, too: [see who uses Metafacture](https://github.com/metafacture/metafacture-core/wiki/Who-uses-Metafacture).
11+
Originally, Metafacture was developed as part of the [Culturegraph](http://www.culturegraph.org) platform but it is developed independently now and used by others, too: [see who uses Metafacture](https://github.com/metafacture/metafacture-core/wiki/Who-uses-Metafacture).
1212

1313
# Getting started
1414

1515
You can either use Metafacture as a stand-alone application or include it as a Java library in your own projects.
1616

1717
## Metafacture as a stand-alone application
1818

19-
If you are only interested in running Flux scripts without doing any Java programming this is the way to go. The instructions assume that you are using a *nix-like shell.
19+
If you are only interested in running Flux scripts without doing any Java programming this is the way to go. The instructions assume that you are using a \*nix-like shell. [See more information in the wiki page about Flux](https://github.com/metafacture/metafacture-core/wiki/Flux-user-guide).
2020

21-
1. Download the latest distribution package from the [metafacture-core/releases](https://github.com/metafacture/metafacture-core/releases) page. Make sure that you do download a distribution package and _not_ a source code package (the file name should include *-dist*).
21+
1. Download the latest distribution package from the [release page](https://github.com/metafacture/metafacture-core/releases). Make sure that you do download a distribution package and *not* a source code package (the file name should include `*-dist*`).
2222

2323
2. Extract the downloaded archive:
2424
```bash
25-
$ tar xzf metafacture-core-VERSION-dist.tar.gz
25+
$ tar xzf metafacture-core-$VERSION-dist.tar.gz
2626
```
27-
This will create a new directory containing a ready-to-use metafacture distribution.
27+
This will create a new directory containing a ready-to-use Metafacture distribution.
2828
3. Change into the newly created directory:
2929
```bash
30-
$ cd metafacture-core-VERSION
30+
$ cd metafacture-core-$VERSION
3131
```
3232
4. Run one of the example scripts:
3333
```bash
3434
$ ./flux.sh examples/read/marc21/read-marc21.flux
3535
```
36-
This example will print a number of marc21 records on standard out.
36+
This example will print a number of MARC 21 records on standard output.
3737

38-
The _examples_ folder contains many more examples which provide a good starting point for learning metafacture. If you have any questions please join our [mailing list](http://lists.dnb.de/mailman/listinfo/metafacture) or use our issue-based discussion forum over at [metafacture-documentation](https://github.com/metafacture/metafacture-documentation).
38+
The `examples` folder contains many more examples which provide a good starting point for learning Metafacture. If you have any questions please join our [mailing list](http://lists.dnb.de/mailman/listinfo/metafacture) or use our issue-based discussion forum over at [metafacture-documentation](https://github.com/metafacture/metafacture-documentation).
3939

4040

41-
## Using Metafacture as a Java libary
41+
## Using Metafacture as a Java library
4242

43-
If you want use Metafacture in your own Java projects all you need to add some dependencies to your project. As of Metafacture 5 the single metafacture-core package has been replaced with a number of domain-specific packages. You can find the list of packages on [Maven Central](https://search.maven.org/#search%7Cga%7C1%7Cg%3A%22org.metafacture%22).
43+
If you want to use Metafacture in your own Java projects all you need is to add some dependencies to your project. As of Metafacture 5, the single metafacture-core package has been replaced with a number of domain-specific packages. You can find the list of packages on [Maven Central](https://search.maven.org/search?q=g:org.metafacture).
4444

4545
Alternatively, you can simply guess the package names from the top-level folders in the source code repository -- they are the same. For instance, if you want to use Metamorph in your project, simply add the following dependency to your `pom.xml`:
4646

4747
```xml
4848
<dependency>
4949
<groupId>org.metafacture</groupId>
5050
<artifactId>metamorph</artifactId>
51-
<version>VERSION</version>
51+
<version>$VERSION</version>
5252
</dependency>
5353
```
5454

5555
or if Gradle is your build tool of choice use:
5656

5757
```groovy
5858
dependencies {
59-
implementation 'org.metafacture:metamorph:VERSION'
59+
implementation 'org.metafacture:metamorph:$VERSION'
6060
}
6161
```
6262

63-
Our integration server automatically publishes successful builds of all branches as snapshot versions on [Sonatype OSS Repository](https://oss.sonatype.org/index.html#nexus-search;quick~metafacture). The version number is derived from the branch name. Snapshot builds from the master branch always have the version "master-SNAPSHOT".
63+
Occasionally, we publish snapshot builds on [Sonatype OSS Repository](https://oss.sonatype.org/index.html#nexus-search;gav~org.metafacture~~~~). The version number is derived from the branch name. Snapshot builds from the master branch always have the version `master-SNAPSHOT`.
6464

6565
<!--
6666
TODO: Link to getting started tutorial
@@ -77,7 +77,7 @@ $ git clone https://github.com/metafacture/metafacture-core.git
7777
$ cd metafacture-core
7878
```
7979

80-
2. Invoke the gradle-wrapper to download Gradle and build metafacture-core (on Windows call `gradlew.bat install`):
80+
2. Invoke the Gradle wrapper to download Gradle and build metafacture-core (on Windows call `gradlew.bat install` instead):
8181

8282
```bash
8383
$ ./gradlew install

build.gradle

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -58,13 +58,20 @@ subprojects {
5858
apply plugin: 'checkstyle'
5959

6060
check.dependsOn(editorconfigCheck)
61+
check.dependsOn(javadoc)
6162

6263
sourceCompatibility = 1.8
6364
targetCompatibility = 1.8
6465

6566
tasks.withType(JavaCompile) {
67+
'all -processing -rawtypes -serial'.split().each {
68+
options.compilerArgs << "-Xlint:${it}"
69+
}
70+
71+
options.compilerArgs << '-Werror'
6672
options.encoding = 'UTF-8'
6773
}
74+
6875
task sourceJar(type: Jar) {
6976
dependsOn tasks.classes
7077
from sourceSets.main.allJava
@@ -81,6 +88,12 @@ subprojects {
8188
group 'build'
8289
}
8390

91+
javadoc {
92+
options {
93+
addBooleanOption 'Xwerror', true
94+
}
95+
}
96+
8497
artifacts {
8598
archives sourceJar
8699
archives javadocJar
@@ -91,6 +104,15 @@ subprojects {
91104
checkstyleTest.enabled = false
92105
}
93106

107+
test {
108+
systemProperties['org.slf4j.simpleLogger.defaultLogLevel'] = 'warn'
109+
110+
testLogging {
111+
showStandardStreams = true
112+
exceptionFormat = 'full'
113+
}
114+
}
115+
94116
signing {
95117
required {
96118
scmInfo.isRelease() && gradle.taskGraph.hasTask(tasks.uploadArchives)

config/checkstyle/checkstyle.xml

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,7 @@
2929
<module name="CustomImportOrder">
3030
<property name="customImportOrderRules" value="SAME_PACKAGE(2)###THIRD_PARTY_PACKAGE###STANDARD_JAVA_PACKAGE###SPECIAL_IMPORTS###STATIC"/>
3131
<property name="separateLineBetweenGroups" value="true"/>
32+
<property name="sortImportsInGroupAlphabetically" value="true"/>
3233
</module>
3334
<module name="CyclomaticComplexity"/>
3435
<module name="DeclarationOrder"/>
@@ -68,6 +69,7 @@
6869
<module name="InterfaceIsType"/>
6970
<module name="InterfaceTypeParameterName"/>
7071
<module name="JavaNCSS"/>
72+
<module name="JavadocMethod"/>
7173
<module name="JavadocType"/>
7274
<module name="LambdaParameterName"/>
7375
<module name="LeftCurly"/>
@@ -81,6 +83,7 @@
8183
<module name="MethodTypeParameterName"/>
8284
<module name="MissingCtor"/>
8385
<module name="MissingDeprecated"/>
86+
<module name="MissingJavadocMethod"/>
8487
<module name="MissingOverride"/>
8588
<module name="MissingSwitchDefault"/>
8689
<module name="ModifiedControlVariable"/>
@@ -97,6 +100,7 @@
97100
<module name="NoClone"/>
98101
<module name="NoEnumTrailingComma"/>
99102
<module name="NoFinalizer"/>
103+
<module name="NonEmptyAtclauseDescription"/>
100104
<module name="NoWhitespaceAfter"/>
101105
<module name="NoWhitespaceBefore"/>
102106
<module name="OneStatementPerLine">

metafacture-biblio/build.gradle

Lines changed: 0 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -31,10 +31,3 @@ dependencies {
3131
testImplementation 'junit:junit:4.12'
3232
testImplementation 'org.mockito:mockito-core:2.5.5'
3333
}
34-
35-
test {
36-
testLogging {
37-
showStandardStreams = true
38-
exceptionFormat = 'full'
39-
}
40-
}

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: 4 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

@@ -86,6 +89,7 @@ else if (RECORD.equals(localName) && NAMESPACE.equals(uri)) {
8689
}
8790

8891
@Override
92+
@SuppressWarnings("fallthrough")
8993
public void endElement(final String uri, final String localName,
9094
final String qName) throws SAXException {
9195
if (SUBFIELD.equals(localName)) {

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/Label.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@
1717
package org.metafacture.biblio.iso2709;
1818

1919
/**
20-
* Provides read access to the record label of a ISO 2709:2008 formatted
20+
* Provides read access to the record label of an ISO 2709:2008 formatted
2121
* record. The record label consists of the first 24 octets of the record.
2222
* <p>
2323
* Use {@link LabelBuilder} if write access to the label is required.

0 commit comments

Comments
 (0)