Skip to content

Commit

Permalink
Adds very first version of the JSON shredder
Browse files Browse the repository at this point in the history
  • Loading branch information
JohannesLichtenberger committed Feb 4, 2019
1 parent f084147 commit 549a0ea
Show file tree
Hide file tree
Showing 7 changed files with 446 additions and 8 deletions.
Expand Up @@ -19,8 +19,9 @@
* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/

package org.sirix.service.xml.shredder;
package org.sirix.service;

import org.sirix.api.NodeCursor;
import org.sirix.api.NodeTrx;
import org.sirix.exception.SirixException;

Expand All @@ -34,14 +35,14 @@ public enum ShredderCommit {
/** Auto commit afterwards. */
COMMIT {
@Override
void commit(final NodeTrx wtx) throws SirixException {
public <T extends NodeTrx & NodeCursor> void commit(final T wtx) throws SirixException {
wtx.commit();
}
},
/** Do not commit after subtree has been shreddered. */
NOCOMMIT {
@Override
void commit(final NodeTrx wtx) throws SirixException {
public <T extends NodeTrx & NodeCursor> void commit(final T wtx) throws SirixException {
// Do nothing.
}
};
Expand All @@ -52,5 +53,5 @@ void commit(final NodeTrx wtx) throws SirixException {
* @param wtx {@link NodeTrx} reference
* @throws SirixException if commiting changes fails
*/
abstract void commit(final NodeTrx wtx) throws SirixException;
public abstract <T extends NodeTrx & NodeCursor> void commit(final T wtx) throws SirixException;
}

0 comments on commit 549a0ea

Please sign in to comment.