some cosmetic changes

This commit is contained in:
Jörg Prante 2018-02-08 11:06:27 +01:00
parent 1037f9308a
commit 89aeaf90b1
4 changed files with 17 additions and 9 deletions

View file

@ -5,7 +5,7 @@ plugins {
id "org.xbib.gradle.plugin.asciidoctor" version "1.5.6.0.1" id "org.xbib.gradle.plugin.asciidoctor" version "1.5.6.0.1"
} }
printf "Host: %s\nOS: %s %s %s\nJVM: %s %s %s %s\nGroovy: %s\nGradle: %s\n" + printf "Host: %s\nOS: %s %s %s\nJVM: %s %s %s %s\n\nGradle: %s Groovy: %s Java: %s\n" +
"Build: group: ${project.group} name: ${project.name} version: ${project.version}\n", "Build: group: ${project.group} name: ${project.name} version: ${project.version}\n",
InetAddress.getLocalHost(), InetAddress.getLocalHost(),
System.getProperty("os.name"), System.getProperty("os.name"),
@ -15,8 +15,9 @@ printf "Host: %s\nOS: %s %s %s\nJVM: %s %s %s %s\nGroovy: %s\nGradle: %s\n" +
System.getProperty("java.vm.version"), System.getProperty("java.vm.version"),
System.getProperty("java.vm.vendor"), System.getProperty("java.vm.vendor"),
System.getProperty("java.vm.name"), System.getProperty("java.vm.name"),
gradle.gradleVersion,
GroovySystem.getVersion(), GroovySystem.getVersion(),
gradle.gradleVersion JavaVersion.current()
apply plugin: 'build-dashboard' apply plugin: 'build-dashboard'
apply plugin: "io.codearte.nexus-staging" apply plugin: "io.codearte.nexus-staging"

View file

@ -28,12 +28,12 @@ public class RdfXContent implements RdfContent<RdfXContentParams> {
} }
@Override @Override
public RdfContentGenerator<RdfXContentParams> createGenerator(OutputStream out) throws IOException { public RdfContentGenerator<RdfXContentParams> createGenerator(OutputStream out) {
return new RdfXContentGenerator<>(out); return new RdfXContentGenerator<>(out);
} }
@Override @Override
public RdfContentParser<RdfXContentParams> createParser(InputStream in) throws IOException { public RdfContentParser<RdfXContentParams> createParser(InputStream in) {
throw new UnsupportedOperationException(); throw new UnsupportedOperationException();
} }
} }

View file

@ -19,12 +19,16 @@ import java.util.List;
public class RdfXContentGenerator<P extends RdfXContentParams> implements RdfContentGenerator<P> { public class RdfXContentGenerator<P extends RdfXContentParams> implements RdfContentGenerator<P> {
protected final OutputStream out; protected final OutputStream out;
protected Resource resource; protected Resource resource;
protected XContentBuilder builder; protected XContentBuilder builder;
private P params; private P params;
private boolean flushed; private boolean flushed;
RdfXContentGenerator(OutputStream out) throws IOException { RdfXContentGenerator(OutputStream out) {
this.out = out; this.out = out;
} }
@ -112,14 +116,14 @@ public class RdfXContentGenerator<P extends RdfXContentParams> implements RdfCon
return this; return this;
} }
public String string() throws IOException { public String string() {
if (builder != null) { if (builder != null) {
return builder.string(); return builder.string();
} }
return null; return null;
} }
public String get() throws IOException { public String get() {
return string(); return string();
} }

View file

@ -29,17 +29,20 @@ import javax.xml.stream.util.XMLEventConsumer;
public class XmlContentGenerator implements RdfContentGenerator<XmlContentParams>, Flushable, XmlConstants { public class XmlContentGenerator implements RdfContentGenerator<XmlContentParams>, Flushable, XmlConstants {
private static final XMLOutputFactory outputFactory = XMLOutputFactory.newInstance(); private static final XMLOutputFactory outputFactory = XMLOutputFactory.newInstance();
private static final XMLEventFactory eventFactory = XMLEventFactory.newInstance(); private static final XMLEventFactory eventFactory = XMLEventFactory.newInstance();
private final Writer writer; private final Writer writer;
private Resource resource; private Resource resource;
private XmlContentParams params = XmlContentParams.XML_CONTENT_PARAMS; private XmlContentParams params = XmlContentParams.XML_CONTENT_PARAMS;
public XmlContentGenerator(OutputStream out) throws IOException { public XmlContentGenerator(OutputStream out) {
this(new OutputStreamWriter(out, StandardCharsets.UTF_8)); this(new OutputStreamWriter(out, StandardCharsets.UTF_8));
} }
public XmlContentGenerator(Writer writer) throws IOException { public XmlContentGenerator(Writer writer) {
this.writer = writer; this.writer = writer;
} }