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"
}
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",
InetAddress.getLocalHost(),
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.vendor"),
System.getProperty("java.vm.name"),
gradle.gradleVersion,
GroovySystem.getVersion(),
gradle.gradleVersion
JavaVersion.current()
apply plugin: 'build-dashboard'
apply plugin: "io.codearte.nexus-staging"

View file

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

View file

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

View file

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