Skip to content

Commit

Permalink
fix javadoc, set up GH actions,
Browse files Browse the repository at this point in the history
drop travis, update plugins and depndencies

Signed-off-by: Lukas Jungmann <lukas.jungmann@oracle.com>
  • Loading branch information
lukasj committed Jul 19, 2021
1 parent 124b9fd commit 911523a
Show file tree
Hide file tree
Showing 25 changed files with 665 additions and 528 deletions.
37 changes: 37 additions & 0 deletions .github/workflows/maven.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
#
# Copyright (c) 2021 Contributors to the Eclipse Foundation
#
# This program and the accompanying materials are made available under the
# terms of the Eclipse Public License v. 2.0 which is available at
# http://www.eclipse.org/legal/epl-2.0,
# or the Eclipse Distribution License v. 1.0 which is available at
# http://www.eclipse.org/org/documents/edl-v10.php.
#
# SPDX-License-Identifier: EPL-2.0 OR BSD-3-Clause
#

name: JAXB stax-ex

on:
pull_request:
push:

jobs:
build:
name: Test on JDK ${{ matrix.java_version }}
runs-on: ubuntu-latest

strategy:
matrix:
java_version: [ 11, 17-ea ]

steps:
- name: Checkout for build
uses: actions/checkout@v2.3.4
- name: Set up JDK
uses: actions/setup-java@v2
with:
distribution: 'zulu'
java-version: ${{ matrix.java_version }}
- name: Verify
run: mvn -B -V -U -C -Poss-release clean verify org.glassfish.copyright:glassfish-copyright-maven-plugin:check -Dgpg.skip=true
24 changes: 0 additions & 24 deletions .travis.yml

This file was deleted.

2 changes: 1 addition & 1 deletion CONTRIBUTING.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
[//]: # " Copyright (c) 2018, 2019 Oracle and/or its affiliates. All rights reserved. "
[//]: # " Copyright (c) 2018, 2021 Oracle and/or its affiliates. All rights reserved. "
[//]: # " "
[//]: # " This program and the accompanying materials are made available under the "
[//]: # " terms of the Eclipse Distribution License v. 1.0, which is available at "
Expand Down
2 changes: 1 addition & 1 deletion NOTICE.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
[//]: # " Copyright (c) 2018, 2019 Oracle and/or its affiliates. All rights reserved. "
[//]: # " Copyright (c) 2018, 2021 Oracle and/or its affiliates. All rights reserved. "
[//]: # " "
[//]: # " This program and the accompanying materials are made available under the "
[//]: # " terms of the Eclipse Distribution License v. 1.0, which is available at "
Expand Down
4 changes: 1 addition & 3 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,13 +1,11 @@
[//]: # " Copyright (c) 2018, 2020 Oracle and/or its affiliates. All rights reserved. "
[//]: # " Copyright (c) 2018, 2021 Oracle and/or its affiliates. All rights reserved. "
[//]: # " "
[//]: # " This program and the accompanying materials are made available under the "
[//]: # " terms of the Eclipse Distribution License v. 1.0, which is available at "
[//]: # " http://www.eclipse.org/org/documents/edl-v10.php. "
[//]: # " "
[//]: # " SPDX-License-Identifier: BSD-3-Clause "

[![Build Status](https://travis-ci.com/eclipse-ee4j/jaxb-stax-ex.svg?branch=master)](https://travis-ci.com/eclipse-ee4j/jaxb-stax-ex)

# Extended StAX API

This project contains a few extensions to complement JSR-173 StAX API in the following areas:
Expand Down
8 changes: 5 additions & 3 deletions pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -80,7 +80,7 @@

<spotbugs.skip>false</spotbugs.skip>
<spotbugs.threshold>Low</spotbugs.threshold>
<spotbugs.version>4.2.0</spotbugs.version>
<spotbugs.version>4.3.0</spotbugs.version>
<activation.version>2.0.1</activation.version>
<xml.bind-api.version>3.0.1</xml.bind-api.version>
<junit.version>4.13.2</junit.version>
Expand Down Expand Up @@ -148,7 +148,7 @@
</plugin>
<plugin>
<artifactId>maven-javadoc-plugin</artifactId>
<version>3.2.0</version>
<version>3.3.0</version>
</plugin>
<plugin>
<artifactId>maven-enforcer-plugin</artifactId>
Expand Down Expand Up @@ -247,6 +247,8 @@
<compilerArgs>
<arg>-Xlint:all</arg>
</compilerArgs>
<showDeprecation>true</showDeprecation>
<showWarnings>true</showWarnings>
</configuration>
<executions>
<execution>
Expand Down Expand Up @@ -379,7 +381,7 @@
<plugin>
<groupId>org.jacoco</groupId>
<artifactId>jacoco-maven-plugin</artifactId>
<version>0.8.6</version>
<version>0.8.7</version>
</plugin>
</plugins>
</pluginManagement>
Expand Down
2 changes: 1 addition & 1 deletion src/main/java/module-info.java
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
* Copyright (c) 2017, 2020 Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 2017, 2021 Oracle and/or its affiliates. All rights reserved.
*
* This program and the accompanying materials are made available under the
* terms of the Eclipse Distribution License v. 1.0, which is available at
Expand Down
14 changes: 12 additions & 2 deletions src/main/java/org/jvnet/staxex/Base64Data.java
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
* Copyright (c) 1997, 2020 Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 1997, 2021 Oracle and/or its affiliates. All rights reserved.
*
* This program and the accompanying materials are made available under the
* terms of the Eclipse Distribution License v. 1.0, which is available at
Expand Down Expand Up @@ -186,10 +186,12 @@ private final class Base64StreamingDataHandler extends StreamingDataHandler {
super(source);
}

@Override
public InputStream readOnce() throws IOException {
return getDataSource().getInputStream();
}

@Override
public void moveTo(File dst) throws IOException {
FileOutputStream fout = new FileOutputStream(dst);
try {
Expand All @@ -199,6 +201,7 @@ public void moveTo(File dst) throws IOException {
}
}

@Override
public void close() throws IOException {
// nothing to do
}
Expand All @@ -210,10 +213,12 @@ private static final class FilterDataHandler extends StreamingDataHandler {
super(dh.getDataSource());
}

@Override
public InputStream readOnce() throws IOException {
return getDataSource().getInputStream();
}

@Override
public void moveTo(File dst) throws IOException {
byte[] buf = new byte[8192];
InputStream in = null;
Expand Down Expand Up @@ -246,6 +251,7 @@ public void moveTo(File dst) throws IOException {
}
}

@Override
public void close() throws IOException {
// nothing to do
}
Expand Down Expand Up @@ -339,6 +345,7 @@ public String getMimeType() {
* Gets the number of characters needed to represent
* this binary data in the base64 encoding.
*/
@Override
public int length() {
// for each 3 bytes you use 4 chars
// if the remainder is 1 or 2 there will be 4 more
Expand All @@ -350,6 +357,7 @@ public int length() {
* Encode this binary data in the base64 encoding
* and returns the character at the specified position.
*/
@Override
public char charAt(int index) {
// we assume that the length() method is called before this method
// (otherwise how would the caller know that the index is valid?)
Expand Down Expand Up @@ -403,6 +411,7 @@ public char charAt(int index) {
* which doesn't happen that much for base64.
* So this method should be smaller than faster.
*/
@Override
public CharSequence subSequence(int start, int end) {
StringBuilder buf = new StringBuilder();
get(); // fill in the buffer if we haven't done so
Expand Down Expand Up @@ -492,7 +501,8 @@ static String getProperty(final String propName) {
return System.getProperty(propName);
} else {
return (String) java.security.AccessController.doPrivileged(
new java.security.PrivilegedAction() {
new java.security.PrivilegedAction<Object>() {
@Override
public java.lang.Object run() {
return System.getProperty(propName);
}
Expand Down
2 changes: 1 addition & 1 deletion src/main/java/org/jvnet/staxex/Base64Encoder.java
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
* Copyright (c) 1997, 2018 Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 1997, 2021 Oracle and/or its affiliates. All rights reserved.
*
* This program and the accompanying materials are made available under the
* terms of the Eclipse Distribution License v. 1.0, which is available at
Expand Down
3 changes: 2 additions & 1 deletion src/main/java/org/jvnet/staxex/Base64EncoderStream.java
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
* Copyright (c) 2011, 2018 Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 2011, 2021 Oracle and/or its affiliates. All rights reserved.
*
* This program and the accompanying materials are made available under the
* terms of the Eclipse Distribution License v. 1.0, which is available at
Expand Down Expand Up @@ -43,6 +43,7 @@ public Base64EncoderStream(OutputStream out) {

/**
* Create a BASE64 encoder that encodes the specified input stream
* @param out
*/
public Base64EncoderStream(XMLStreamWriter outWriter, OutputStream out) {
super(out);
Expand Down
4 changes: 2 additions & 2 deletions src/main/java/org/jvnet/staxex/BinaryText.java
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
* Copyright (c) 2013, 2020 Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 2013, 2021 Oracle and/or its affiliates. All rights reserved.
*
* This program and the accompanying materials are made available under the
* terms of the Eclipse Distribution License v. 1.0, which is available at
Expand All @@ -14,7 +14,7 @@

/**
* BinaryText represents a MTOM attachment.
*
*
* @author shih-chang.chen@oracle.com
*/
public interface BinaryText {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
* Copyright (c) 1997, 2018 Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 1997, 2021 Oracle and/or its affiliates. All rights reserved.
*
* This program and the accompanying materials are made available under the
* terms of the Eclipse Distribution License v. 1.0, which is available at
Expand Down
4 changes: 2 additions & 2 deletions src/main/java/org/jvnet/staxex/MtomEnabled.java
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
* Copyright (c) 2013, 2020 Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 2013, 2021 Oracle and/or its affiliates. All rights reserved.
*
* This program and the accompanying materials are made available under the
* terms of the Eclipse Distribution License v. 1.0, which is available at
Expand All @@ -14,7 +14,7 @@

/**
* A SOAPElement implementation may support this interface to allow MTOM attachments.
*
*
* @author shih-chang.chen@oracle.com
*/
public interface MtomEnabled {
Expand Down
3 changes: 2 additions & 1 deletion src/main/java/org/jvnet/staxex/NamespaceContextEx.java
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
* Copyright (c) 1997, 2018 Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 1997, 2021 Oracle and/or its affiliates. All rights reserved.
*
* This program and the accompanying materials are made available under the
* terms of the Eclipse Distribution License v. 1.0, which is available at
Expand Down Expand Up @@ -47,6 +47,7 @@ public interface NamespaceContextEx extends NamespaceContext, Iterable<Namespace
* @return
* may return an empty iterator, but never null.
*/
@Override
Iterator<Binding> iterator();

/**
Expand Down
70 changes: 36 additions & 34 deletions src/main/java/org/jvnet/staxex/StAxSOAPBody.java
Original file line number Diff line number Diff line change
@@ -1,13 +1,12 @@
/*
* Copyright (c) 2013, 2018 Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 2013, 2021 Oracle and/or its affiliates. All rights reserved.
*
* This program and the accompanying materials are made available under the
* terms of the Eclipse Distribution License v. 1.0, which is available at
* http://www.eclipse.org/org/documents/edl-v10.php.
*
* SPDX-License-Identifier: BSD-3-Clause
*/

package org.jvnet.staxex;

import javax.xml.namespace.QName;
Expand All @@ -16,50 +15,53 @@
import javax.xml.stream.XMLStreamWriter;

/**
* A StAxSOAPBody is a SOAPBody that allows to be loaded from a StAX style payload.
*
* A StAxSOAPBody is a SOAPBody that allows to be loaded from a StAX style
* payload.
*
* @author shih-chang.chen@oracle.com
*/
public interface StAxSOAPBody {

/**
* The StAxSOAPBody represents the StAX source of SOAPBody payload.
*/
public static interface Payload {

/**
* Retrieve payload qname without materializing its contents
* @return
*
* @return qname
*/
public QName getPayloadQName();

public XMLStreamReader readPayload() throws XMLStreamException;

public void writePayloadTo(XMLStreamWriter writer)throws XMLStreamException;
public QName getPayloadQName();

/**
* Retrieve payload attribute value without materializing its contents
* @param localName
* @return
* @throws XMLStreamException
*/
public String getPayloadAttributeValue(String localName) throws XMLStreamException;
public XMLStreamReader readPayload() throws XMLStreamException;

public void writePayloadTo(XMLStreamWriter writer) throws XMLStreamException;

/**
* Retrieve payload attribute value without materializing its contents
*
* @param localName attribute local name
* @return payload attribute value
* @throws XMLStreamException for errors
*/
public String getPayloadAttributeValue(String localName) throws XMLStreamException;

/**
* Retrieve payload attribute value without materializing its contents
* @param qName
* @return
* @throws XMLStreamException
*/
public String getPayloadAttributeValue(QName qName) throws XMLStreamException;

public void materialize() throws XMLStreamException;
/**
* Retrieve payload attribute value without materializing its contents
*
* @param qName attribute QName
* @return payload attribute value
* @throws XMLStreamException for errors
*/
public String getPayloadAttributeValue(QName qName) throws XMLStreamException;

public void materialize() throws XMLStreamException;
}

public void setPayload(Payload src) throws XMLStreamException;

public Payload getPayload()throws XMLStreamException;

public boolean hasStaxPayload();
}

public Payload getPayload() throws XMLStreamException;

public boolean hasStaxPayload();
}
Loading

0 comments on commit 911523a

Please sign in to comment.