http://git-wip-us.apache.org/repos/asf/isis/blob/e4735c72/framework/core/commons/src/main/java/org/apache/isis/core/commons/encoding/DataInputExtendedDecorator.java ---------------------------------------------------------------------- diff --git a/framework/core/commons/src/main/java/org/apache/isis/core/commons/encoding/DataInputExtendedDecorator.java b/framework/core/commons/src/main/java/org/apache/isis/core/commons/encoding/DataInputExtendedDecorator.java deleted file mode 100644 index d7f9fa3..0000000 --- a/framework/core/commons/src/main/java/org/apache/isis/core/commons/encoding/DataInputExtendedDecorator.java +++ /dev/null @@ -1,213 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ - -package org.apache.isis.core.commons.encoding; - -import java.io.DataInputStream; -import java.io.IOException; - -public class DataInputExtendedDecorator implements DataInputExtended { - - private final DataInputExtended underlying; - - public DataInputExtendedDecorator(final DataInputExtended underlying) { - this.underlying = underlying; - } - - @Override - public DataInputStream getDataInputStream() { - return underlying.getDataInputStream(); - } - - // //////////////////////////////////////// - // Boolean, Char - // //////////////////////////////////////// - - @Override - public boolean readBoolean() throws IOException { - return underlying.readBoolean(); - } - - @Override - public boolean[] readBooleans() throws IOException { - return underlying.readBooleans(); - } - - @Override - public char readChar() throws IOException { - return underlying.readChar(); - } - - @Override - public char[] readChars() throws IOException { - return underlying.readChars(); - } - - // //////////////////////////////////////// - // Integral Numbers - // //////////////////////////////////////// - - @Override - public byte readByte() throws IOException { - return underlying.readByte(); - } - - @Override - public int readUnsignedByte() throws IOException { - return underlying.readUnsignedByte(); - } - - @Override - public byte[] readBytes() throws IOException { - return underlying.readBytes(); - } - - @Override - public short readShort() throws IOException { - return underlying.readShort(); - } - - @Override - public int readUnsignedShort() throws IOException { - return underlying.readUnsignedShort(); - } - - @Override - public short[] readShorts() throws IOException { - return underlying.readShorts(); - } - - @Override - public int readInt() throws IOException { - return underlying.readInt(); - } - - @Override - public int[] readInts() throws IOException { - return underlying.readInts(); - } - - @Override - public long[] readLongs() throws IOException { - return underlying.readLongs(); - } - - @Override - public long readLong() throws IOException { - return underlying.readLong(); - } - - // //////////////////////////////////////// - // Floating Point Numbers - // //////////////////////////////////////// - - @Override - public float readFloat() throws IOException { - return underlying.readFloat(); - } - - @Override - public float[] readFloats() throws IOException { - return underlying.readFloats(); - } - - @Override - public double readDouble() throws IOException { - return underlying.readDouble(); - } - - @Override - public double[] readDoubles() throws IOException { - return underlying.readDoubles(); - } - - // //////////////////////////////////////// - // Strings - // //////////////////////////////////////// - - @Override - public String readUTF() throws IOException { - return underlying.readUTF(); - } - - @Override - public String[] readUTFs() throws IOException { - return underlying.readUTFs(); - } - - // //////////////////////////////////////// - // Encodable and Serializable - // //////////////////////////////////////// - - @Override - public <T> T readEncodable(final Class<T> encodableType) throws IOException { - return underlying.readEncodable(encodableType); - } - - @Override - public <T> T[] readEncodables(final Class<T> encodableType) throws IOException { - return underlying.readEncodables(encodableType); - } - - @Override - public <T> T readSerializable(final Class<T> serializableType) throws IOException { - return underlying.readSerializable(serializableType); - } - - @Override - public <T> T[] readSerializables(final Class<T> serializableType) throws IOException { - return underlying.readSerializables(serializableType); - } - - // //////////////////////////////////////// - // Other - // //////////////////////////////////////// - - @Override - public void readFully(final byte[] b) throws IOException { - underlying.readFully(b); - } - - @Override - public void readFully(final byte[] b, final int off, final int len) throws IOException { - underlying.readFully(b, off, len); - } - - @Override - public String readLine() throws IOException { - return underlying.readLine(); - } - - @Override - public int skipBytes(final int n) throws IOException { - return underlying.skipBytes(n); - } - - // ////////////////////////////////////////// - // // Closeable - // ////////////////////////////////////////// - // - // public void close() throws IOException { - // if (underlying instanceof Closeable) { - // Closeable closeable = (Closeable) underlying; - // closeable.close(); - // } - // } - -}
http://git-wip-us.apache.org/repos/asf/isis/blob/e4735c72/framework/core/commons/src/main/java/org/apache/isis/core/commons/encoding/DataInputStreamExtended.java ---------------------------------------------------------------------- diff --git a/framework/core/commons/src/main/java/org/apache/isis/core/commons/encoding/DataInputStreamExtended.java b/framework/core/commons/src/main/java/org/apache/isis/core/commons/encoding/DataInputStreamExtended.java deleted file mode 100644 index cdad1b3..0000000 --- a/framework/core/commons/src/main/java/org/apache/isis/core/commons/encoding/DataInputStreamExtended.java +++ /dev/null @@ -1,206 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ - -package org.apache.isis.core.commons.encoding; - -import java.io.DataInputStream; -import java.io.IOException; -import java.io.InputStream; - -public class DataInputStreamExtended implements DataInputExtended { - - private final DataInputStream dataInputStream; - - public DataInputStreamExtended(final InputStream inputStream) { - this.dataInputStream = new DataInputStream(inputStream); - } - - @Override - public DataInputStream getDataInputStream() { - return dataInputStream; - } - - // //////////////////////////////////////// - // Boolean, Char - // //////////////////////////////////////// - - @Override - public boolean readBoolean() throws IOException { - return FieldType.BOOLEAN.read(this); - } - - @Override - public boolean[] readBooleans() throws IOException { - return FieldType.BOOLEAN_ARRAY.read(this); - } - - @Override - public char readChar() throws IOException { - return FieldType.CHAR.read(this); - } - - @Override - public char[] readChars() throws IOException { - return FieldType.CHAR_ARRAY.read(this); - } - - // //////////////////////////////////////// - // Integral Numbers - // //////////////////////////////////////// - - @Override - public byte readByte() throws IOException { - return FieldType.BYTE.read(this); - } - - @Override - public byte[] readBytes() throws IOException { - return FieldType.BYTE_ARRAY.read(this); - } - - @Override - public short readShort() throws IOException { - return FieldType.SHORT.read(this); - } - - @Override - public short[] readShorts() throws IOException { - return FieldType.SHORT_ARRAY.read(this); - } - - @Override - public int readInt() throws IOException { - return FieldType.INTEGER.read(this); - } - - @Override - public int readUnsignedByte() throws IOException { - return FieldType.UNSIGNED_BYTE.read(this); - } - - @Override - public int readUnsignedShort() throws IOException { - return FieldType.UNSIGNED_SHORT.read(this); - } - - @Override - public int[] readInts() throws IOException { - return FieldType.INTEGER_ARRAY.read(this); - } - - @Override - public long readLong() throws IOException { - return FieldType.LONG.read(this); - } - - @Override - public long[] readLongs() throws IOException { - return FieldType.LONG_ARRAY.read(this); - } - - // //////////////////////////////////////// - // Floating Point Numbers - // //////////////////////////////////////// - - @Override - public float readFloat() throws IOException { - return FieldType.FLOAT.read(this); - } - - @Override - public float[] readFloats() throws IOException { - return FieldType.FLOAT_ARRAY.read(this); - } - - @Override - public double readDouble() throws IOException { - return FieldType.DOUBLE.read(this); - } - - @Override - public double[] readDoubles() throws IOException { - return FieldType.DOUBLE_ARRAY.read(this); - } - - // //////////////////////////////////////// - // Strings - // //////////////////////////////////////// - - @Override - public String readUTF() throws IOException { - return FieldType.STRING.read(this); - } - - @Override - public String[] readUTFs() throws IOException { - return FieldType.STRING_ARRAY.read(this); - } - - // //////////////////////////////////////// - // Encodable and Serializable - // //////////////////////////////////////// - - @Override - @SuppressWarnings("unchecked") - public <T> T readEncodable(final Class<T> encodableType) throws IOException { - return (T) FieldType.ENCODABLE.read(this); - } - - @Override - public <T> T[] readEncodables(final Class<T> elementType) throws IOException { - return FieldType.ENCODABLE_ARRAY.readArray(this, elementType); - } - - @Override - @SuppressWarnings("unchecked") - public <T> T readSerializable(final Class<T> serializableType) throws IOException { - return (T) FieldType.SERIALIZABLE.read(this); - } - - @Override - public <T> T[] readSerializables(final Class<T> elementType) throws IOException { - return FieldType.SERIALIZABLE_ARRAY.readArray(this, elementType); - } - - // //////////////////////////////////////// - // Other - // //////////////////////////////////////// - - @Override - public void readFully(final byte[] b) throws IOException { - dataInputStream.readFully(b); - } - - @Override - public void readFully(final byte[] b, final int off, final int len) throws IOException { - dataInputStream.readFully(b, off, len); - } - - @Override - @SuppressWarnings("deprecation") - public String readLine() throws IOException { - return dataInputStream.readLine(); - } - - @Override - public int skipBytes(final int n) throws IOException { - return dataInputStream.skipBytes(n); - } - -} http://git-wip-us.apache.org/repos/asf/isis/blob/e4735c72/framework/core/commons/src/main/java/org/apache/isis/core/commons/encoding/DataOutputExtended.java ---------------------------------------------------------------------- diff --git a/framework/core/commons/src/main/java/org/apache/isis/core/commons/encoding/DataOutputExtended.java b/framework/core/commons/src/main/java/org/apache/isis/core/commons/encoding/DataOutputExtended.java deleted file mode 100644 index 861b28a..0000000 --- a/framework/core/commons/src/main/java/org/apache/isis/core/commons/encoding/DataOutputExtended.java +++ /dev/null @@ -1,68 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ - -package org.apache.isis.core.commons.encoding; - -import java.io.DataOutput; -import java.io.DataOutputStream; -import java.io.Flushable; -import java.io.IOException; - -public interface DataOutputExtended extends DataOutput, Flushable { - - public void writeBooleans(boolean[] booleans) throws IOException; - - public void writeChars(char[] chars) throws IOException; - - /** - * NB: only writes out <tt>byte</tt>. - */ - @Override - public void write(int b) throws IOException; - - /** - * Same as {@link #write(int)}. - */ - @Override - public void writeByte(int v) throws IOException; - - public void writeBytes(byte[] bytes) throws IOException; - - public void writeShorts(short[] shorts) throws IOException; - - public void writeInts(int[] ints) throws IOException; - - public void writeLongs(long[] longs) throws IOException; - - public void writeDoubles(double[] doubles) throws IOException; - - public void writeFloats(float[] floats) throws IOException; - - public void writeUTFs(String[] strings) throws IOException; - - public void writeEncodable(Object encodable) throws IOException; - - public void writeEncodables(Object[] encodables) throws IOException; - - public void writeSerializable(Object serializable) throws IOException; - - public void writeSerializables(Object[] serializables) throws IOException; - - DataOutputStream getDataOutputStream(); -} http://git-wip-us.apache.org/repos/asf/isis/blob/e4735c72/framework/core/commons/src/main/java/org/apache/isis/core/commons/encoding/DataOutputExtendedDecorator.java ---------------------------------------------------------------------- diff --git a/framework/core/commons/src/main/java/org/apache/isis/core/commons/encoding/DataOutputExtendedDecorator.java b/framework/core/commons/src/main/java/org/apache/isis/core/commons/encoding/DataOutputExtendedDecorator.java deleted file mode 100644 index a32fd5e..0000000 --- a/framework/core/commons/src/main/java/org/apache/isis/core/commons/encoding/DataOutputExtendedDecorator.java +++ /dev/null @@ -1,206 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ - -package org.apache.isis.core.commons.encoding; - -import java.io.DataOutputStream; -import java.io.IOException; - -public class DataOutputExtendedDecorator implements DataOutputExtended { - - private final DataOutputExtended underlying; - - public DataOutputExtendedDecorator(final DataOutputExtended underlying) { - this.underlying = underlying; - } - - @Override - public DataOutputStream getDataOutputStream() { - return underlying.getDataOutputStream(); - } - - // //////////////////////////////////////// - // Boolean, Char - // //////////////////////////////////////// - - @Override - public void writeBoolean(final boolean v) throws IOException { - underlying.writeBoolean(v); - } - - @Override - public void writeBooleans(final boolean[] booleans) throws IOException { - underlying.writeBooleans(booleans); - } - - @Override - public void writeChar(final int v) throws IOException { - underlying.writeChar(v); - } - - @Override - public void writeChars(final char[] chars) throws IOException { - underlying.writeChars(chars); - } - - // //////////////////////////////////////// - // Integral Numbers - // //////////////////////////////////////// - - @Override - public void write(final int b) throws IOException { - underlying.write(b); - } - - @Override - public void writeByte(final int v) throws IOException { - underlying.writeByte(v); - } - - @Override - public void write(final byte[] b) throws IOException { - underlying.write(b); - } - - @Override - public void writeBytes(final byte[] bytes) throws IOException { - underlying.writeBytes(bytes); - } - - @Override - public void writeShort(final int v) throws IOException { - underlying.writeShort(v); - } - - @Override - public void writeShorts(final short[] shorts) throws IOException { - underlying.writeShorts(shorts); - } - - @Override - public void writeInt(final int v) throws IOException { - underlying.writeInt(v); - } - - @Override - public void writeInts(final int[] ints) throws IOException { - underlying.writeInts(ints); - } - - @Override - public void writeLong(final long v) throws IOException { - underlying.writeLong(v); - } - - @Override - public void writeLongs(final long[] longs) throws IOException { - underlying.writeLongs(longs); - } - - // //////////////////////////////////////// - // Floating Point Numbers - // //////////////////////////////////////// - - @Override - public void writeFloat(final float v) throws IOException { - underlying.writeFloat(v); - } - - @Override - public void writeFloats(final float[] floats) throws IOException { - underlying.writeFloats(floats); - } - - @Override - public void writeDouble(final double v) throws IOException { - underlying.writeDouble(v); - } - - @Override - public void writeDoubles(final double[] doubles) throws IOException { - underlying.writeDoubles(doubles); - } - - // //////////////////////////////////////// - // Strings - // //////////////////////////////////////// - - @Override - public void writeUTF(final String str) throws IOException { - underlying.writeUTF(str); - } - - @Override - public void writeUTFs(final String[] strings) throws IOException { - underlying.writeUTFs(strings); - } - - // //////////////////////////////////////// - // Encodable and Serializable - // //////////////////////////////////////// - - @Override - public void writeEncodable(final Object encodable) throws IOException { - underlying.writeEncodable(encodable); - } - - @Override - public void writeEncodables(final Object[] encodables) throws IOException { - underlying.writeEncodables(encodables); - } - - @Override - public void writeSerializable(final Object serializable) throws IOException { - underlying.writeSerializable(serializable); - } - - @Override - public void writeSerializables(final Object[] serializables) throws IOException { - underlying.writeSerializables(serializables); - } - - // //////////////////////////////////////// - // Other - // //////////////////////////////////////// - - @Override - public void write(final byte[] b, final int off, final int len) throws IOException { - underlying.write(b, off, len); - } - - @Override - public void writeBytes(final String s) throws IOException { - underlying.writeBytes(s); - } - - @Override - public void writeChars(final String s) throws IOException { - underlying.writeChars(s); - } - - // //////////////////////////////////////// - // Flush - // //////////////////////////////////////// - - @Override - public void flush() throws IOException { - underlying.flush(); - } - -} http://git-wip-us.apache.org/repos/asf/isis/blob/e4735c72/framework/core/commons/src/main/java/org/apache/isis/core/commons/encoding/DataOutputStreamExtended.java ---------------------------------------------------------------------- diff --git a/framework/core/commons/src/main/java/org/apache/isis/core/commons/encoding/DataOutputStreamExtended.java b/framework/core/commons/src/main/java/org/apache/isis/core/commons/encoding/DataOutputStreamExtended.java deleted file mode 100644 index 27c0404..0000000 --- a/framework/core/commons/src/main/java/org/apache/isis/core/commons/encoding/DataOutputStreamExtended.java +++ /dev/null @@ -1,227 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ - -package org.apache.isis.core.commons.encoding; - -import java.io.DataOutputStream; -import java.io.IOException; -import java.io.OutputStream; -import java.io.Serializable; - -public class DataOutputStreamExtended implements DataOutputExtended { - - private final DataOutputStream dataOutputStream; - - public DataOutputStreamExtended(final OutputStream output) { - dataOutputStream = new DataOutputStream(output); - } - - @Override - public DataOutputStream getDataOutputStream() { - return dataOutputStream; - } - - // //////////////////////////////////////// - // Boolean, Char - // //////////////////////////////////////// - - @Override - public void writeBoolean(final boolean value) throws IOException { - FieldType.BOOLEAN.write(this, value); - } - - @Override - public void writeBooleans(final boolean[] value) throws IOException { - FieldType.BOOLEAN_ARRAY.write(this, value); - } - - @Override - public void writeChar(final int value) throws IOException { - FieldType.CHAR.write(this, (char) value); - } - - @Override - public void writeChars(final char[] value) throws IOException { - FieldType.CHAR_ARRAY.write(this, value); - } - - - // //////////////////////////////////////// - // Integral Numbers - // //////////////////////////////////////// - - @Override - public void write(final int value) throws IOException { - writeByte((byte) value); - } - - @Override - public void writeByte(final int value) throws IOException { - FieldType.BYTE.write(this, (byte) value); - } - - @Override - public void write(final byte[] value) throws IOException { - writeBytes(value); - } - - @Override - public void writeBytes(final byte[] value) throws IOException { - FieldType.BYTE_ARRAY.write(this, value); - } - - @Override - public void writeShort(final int value) throws IOException { - FieldType.SHORT.write(this, (short) value); - } - - @Override - public void writeShorts(final short[] value) throws IOException { - FieldType.SHORT_ARRAY.write(this, value); - } - - @Override - public void writeInt(final int value) throws IOException { - FieldType.INTEGER.write(this, value); - } - - @Override - public void writeInts(final int[] value) throws IOException { - FieldType.INTEGER_ARRAY.write(this, value); - } - - @Override - public void writeLong(final long value) throws IOException { - FieldType.LONG.write(this, value); - } - - @Override - public void writeLongs(final long[] value) throws IOException { - FieldType.LONG_ARRAY.write(this, value); - } - - // //////////////////////////////////////// - // Floating Point Numbers - // //////////////////////////////////////// - - @Override - public void writeFloat(final float value) throws IOException { - FieldType.FLOAT.write(this, value); - } - - @Override - public void writeFloats(final float[] value) throws IOException { - FieldType.FLOAT_ARRAY.write(this, value); - } - - @Override - public void writeDouble(final double value) throws IOException { - FieldType.DOUBLE.write(this, value); - } - - @Override - public void writeDoubles(final double[] value) throws IOException { - FieldType.DOUBLE_ARRAY.write(this, value); - } - - // //////////////////////////////////////// - // Strings - // //////////////////////////////////////// - - @Override - public void writeUTF(final String value) throws IOException { - FieldType.STRING.write(this, value); - } - - @Override - public void writeUTFs(final String[] value) throws IOException { - FieldType.STRING_ARRAY.write(this, value); - } - - // //////////////////////////////////////// - // Encodable and Serializable - // //////////////////////////////////////// - - @Override - public void writeEncodable(final Object encodable) throws IOException { - FieldType.ENCODABLE.write(this, (Encodable) encodable); - } - - @Override - public void writeEncodables(final Object[] objects) throws IOException { - Encodable[] encodables; - if (objects == null) { - encodables = null; - } else { - encodables = new Encodable[objects.length]; - for (int i = 0; i < encodables.length; i++) { - encodables[i] = (Encodable) objects[i]; - } - } - FieldType.ENCODABLE_ARRAY.write(this, encodables); - } - - @Override - public void writeSerializable(final Object serializable) throws IOException { - FieldType.SERIALIZABLE.write(this, (Serializable) serializable); - } - - @Override - public void writeSerializables(final Object[] objects) throws IOException { - Serializable[] serializeables; - if (objects == null) { - serializeables = null; - } else { - serializeables = new Serializable[objects.length]; - for (int i = 0; i < serializeables.length; i++) { - serializeables[i] = (Serializable) objects[i]; - } - } - FieldType.SERIALIZABLE_ARRAY.write(this, serializeables); - } - - // //////////////////////////////////////// - // Other - // //////////////////////////////////////// - - @Override - public void write(final byte[] b, final int off, final int len) throws IOException { - dataOutputStream.write(b, off, len); - } - - @Override - public void writeBytes(final String str) throws IOException { - dataOutputStream.writeBytes(str); - } - - @Override - public void writeChars(final String str) throws IOException { - dataOutputStream.writeChars(str); - } - - // //////////////////////////////////////// - // Flushable - // //////////////////////////////////////// - - @Override - public void flush() throws IOException { - dataOutputStream.flush(); - } - -} http://git-wip-us.apache.org/repos/asf/isis/blob/e4735c72/framework/core/commons/src/main/java/org/apache/isis/core/commons/encoding/DebugDataInputExtended.java ---------------------------------------------------------------------- diff --git a/framework/core/commons/src/main/java/org/apache/isis/core/commons/encoding/DebugDataInputExtended.java b/framework/core/commons/src/main/java/org/apache/isis/core/commons/encoding/DebugDataInputExtended.java deleted file mode 100644 index a682627..0000000 --- a/framework/core/commons/src/main/java/org/apache/isis/core/commons/encoding/DebugDataInputExtended.java +++ /dev/null @@ -1,116 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ - -package org.apache.isis.core.commons.encoding; - -import java.io.IOException; -import java.util.Arrays; - -import org.apache.log4j.Logger; - -public class DebugDataInputExtended extends DataInputExtendedDecorator { - - private static final Logger LOG = Logger.getLogger(DebugDataInputExtended.class); - - public DebugDataInputExtended(final DataInputExtended input) { - super(input); - } - - @Override - public boolean readBoolean() throws IOException { - final boolean b = super.readBoolean(); - if (LOG.isDebugEnabled()) { - LOG.debug("boolean: " + b); - } - return b; - } - - @Override - public byte readByte() throws IOException { - final byte b = super.readByte(); - if (LOG.isDebugEnabled()) { - LOG.debug("byte: " + b); - } - return b; - } - - @Override - public byte[] readBytes() throws IOException { - final byte[] bs = super.readBytes(); - if (LOG.isDebugEnabled()) { - LOG.debug("bytes: " + new String(bs)); - } - return bs; - } - - @Override - public int readInt() throws IOException { - final int i = super.readInt(); - if (LOG.isDebugEnabled()) { - LOG.debug("int: " + i); - } - return i; - } - - @Override - public long readLong() throws IOException { - final long l = super.readLong(); - if (LOG.isDebugEnabled()) { - LOG.debug("long: " + l); - } - return l; - } - - @Override - public String readUTF() throws IOException { - final String string = super.readUTF(); - if (LOG.isDebugEnabled()) { - LOG.debug("string: " + string); - } - return string; - } - - @Override - public String[] readUTFs() throws IOException { - final String[] strings = super.readUTFs(); - if (LOG.isDebugEnabled()) { - LOG.debug("list: " + Arrays.toString(strings)); - } - return strings; - } - - @Override - public <T> T readEncodable(final Class<T> encodableType) throws IOException { - final T object = super.readEncodable(encodableType); - if (LOG.isDebugEnabled()) { - LOG.debug(">>> object"); - } - return object; - } - - @Override - public <T> T[] readEncodables(final Class<T> encodableType) throws IOException { - final T[] objects = super.readEncodables(encodableType); - if (LOG.isDebugEnabled()) { - LOG.debug(">>> objects x" + objects.length); - } - return objects; - } - -} http://git-wip-us.apache.org/repos/asf/isis/blob/e4735c72/framework/core/commons/src/main/java/org/apache/isis/core/commons/encoding/DebugDataOutputExtended.java ---------------------------------------------------------------------- diff --git a/framework/core/commons/src/main/java/org/apache/isis/core/commons/encoding/DebugDataOutputExtended.java b/framework/core/commons/src/main/java/org/apache/isis/core/commons/encoding/DebugDataOutputExtended.java deleted file mode 100644 index bbc37b0..0000000 --- a/framework/core/commons/src/main/java/org/apache/isis/core/commons/encoding/DebugDataOutputExtended.java +++ /dev/null @@ -1,113 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ - -package org.apache.isis.core.commons.encoding; - -import java.io.IOException; - -import org.apache.log4j.Logger; - -public class DebugDataOutputExtended extends DataOutputExtendedDecorator { - - private static final Logger LOG = Logger.getLogger(DebugDataOutputExtended.class); - - public DebugDataOutputExtended(final DataOutputExtended underlying) { - super(underlying); - } - - @Override - public void writeBoolean(final boolean flag) throws IOException { - if (LOG.isDebugEnabled()) { - LOG.debug("boolean: " + flag); - } - super.writeBoolean(flag); - } - - @Override - public void writeBytes(final byte[] value) throws IOException { - if (LOG.isDebugEnabled()) { - LOG.debug("bytes: (" + value.length + ") " + new String(value)); - } - super.writeBytes(value); - } - - @Override - public void writeByte(final int value) throws IOException { - if (LOG.isDebugEnabled()) { - LOG.debug("byte: " + value); - } - super.writeByte(value); - } - - @Override - public void writeInt(final int value) throws IOException { - if (LOG.isDebugEnabled()) { - LOG.debug("int: " + value); - } - super.writeInt(value); - } - - @Override - public void writeLong(final long value) throws IOException { - if (LOG.isDebugEnabled()) { - LOG.debug("long: " + value); - } - super.writeLong(value); - } - - @Override - public void writeEncodable(final Object object) throws IOException { - if (LOG.isDebugEnabled()) { - LOG.debug(">>> object: (" + object + ")"); - } - super.writeEncodable(object); - } - - @Override - public void writeEncodables(final Object[] objects) throws IOException { - if (LOG.isDebugEnabled()) { - LOG.debug(">>> objects x" + objects.length); - } - super.writeEncodables(objects); - } - - @Override - public void writeUTF(final String str) throws IOException { - if (LOG.isDebugEnabled()) { - LOG.debug("string: " + str); - } - super.writeUTF(str); - } - - @Override - public void writeUTFs(final String[] strings) throws IOException { - if (LOG.isDebugEnabled()) { - final StringBuffer l = new StringBuffer(); - for (int i = 0; i < strings.length; i++) { - if (i > 0) { - l.append(", "); - } - l.append(strings[i]); - } - LOG.debug("list: " + l); - } - super.writeUTFs(strings); - } - -} http://git-wip-us.apache.org/repos/asf/isis/blob/e4735c72/framework/core/commons/src/main/java/org/apache/isis/core/commons/encoding/Encodable.java ---------------------------------------------------------------------- diff --git a/framework/core/commons/src/main/java/org/apache/isis/core/commons/encoding/Encodable.java b/framework/core/commons/src/main/java/org/apache/isis/core/commons/encoding/Encodable.java deleted file mode 100644 index 03d6bf6..0000000 --- a/framework/core/commons/src/main/java/org/apache/isis/core/commons/encoding/Encodable.java +++ /dev/null @@ -1,40 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ - -package org.apache.isis.core.commons.encoding; - -import java.io.IOException; - -/** - * This interface indicates that an object can be encoded into into a byte array - * so it can be streamed. - * - * <p> - * By implementing this interface you are agreeing to provide a constructor with - * a single argument of type {@link DataInputExtended}, which create an instance - * from the stream. - */ -public interface Encodable { - - /** - * Returns the domain object's value as an encoded byte array via the - * encoder. - */ - void encode(DataOutputExtended outputStream) throws IOException; -} http://git-wip-us.apache.org/repos/asf/isis/blob/e4735c72/framework/core/commons/src/main/java/org/apache/isis/core/commons/encoding/EncodingConstants.java ---------------------------------------------------------------------- diff --git a/framework/core/commons/src/main/java/org/apache/isis/core/commons/encoding/EncodingConstants.java b/framework/core/commons/src/main/java/org/apache/isis/core/commons/encoding/EncodingConstants.java deleted file mode 100644 index c6b87db..0000000 --- a/framework/core/commons/src/main/java/org/apache/isis/core/commons/encoding/EncodingConstants.java +++ /dev/null @@ -1,29 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ - -package org.apache.isis.core.commons.encoding; - -public class EncodingConstants { - - static final String ENCODED_NULL_ARRAY = "$$.$null-array$.$$"; - static final String ENCODED_BOOLEAN_FALSE = "$$.$false$.$$"; - static final String ENCODED_BOOLEAN_TRUE = "$$.$true$.$$"; - static final String ENCODED_NULL_OBJECT = "$$.$null$.$$"; - -} http://git-wip-us.apache.org/repos/asf/isis/blob/e4735c72/framework/core/commons/src/main/java/org/apache/isis/core/commons/encoding/FailedToDecodeException.java ---------------------------------------------------------------------- diff --git a/framework/core/commons/src/main/java/org/apache/isis/core/commons/encoding/FailedToDecodeException.java b/framework/core/commons/src/main/java/org/apache/isis/core/commons/encoding/FailedToDecodeException.java deleted file mode 100644 index d2d3315..0000000 --- a/framework/core/commons/src/main/java/org/apache/isis/core/commons/encoding/FailedToDecodeException.java +++ /dev/null @@ -1,42 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ - -/** - * - */ -package org.apache.isis.core.commons.encoding; - -import java.io.IOException; - -public class FailedToDecodeException extends IOException { - - private static final long serialVersionUID = 1L; - - private final Throwable cause; - - public FailedToDecodeException(final Throwable cause) { - this.cause = cause; - } - - @Override - public Throwable getCause() { - return cause; - } - -} \ No newline at end of file http://git-wip-us.apache.org/repos/asf/isis/blob/e4735c72/framework/core/commons/src/main/java/org/apache/isis/core/commons/encoding/FailedToDeserializeException.java ---------------------------------------------------------------------- diff --git a/framework/core/commons/src/main/java/org/apache/isis/core/commons/encoding/FailedToDeserializeException.java b/framework/core/commons/src/main/java/org/apache/isis/core/commons/encoding/FailedToDeserializeException.java deleted file mode 100644 index 6419897..0000000 --- a/framework/core/commons/src/main/java/org/apache/isis/core/commons/encoding/FailedToDeserializeException.java +++ /dev/null @@ -1,42 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ - -/** - * - */ -package org.apache.isis.core.commons.encoding; - -import java.io.IOException; - -public class FailedToDeserializeException extends IOException { - - private static final long serialVersionUID = 1L; - - private final Throwable cause; - - public FailedToDeserializeException(final ClassNotFoundException cause) { - this.cause = cause; - } - - @Override - public Throwable getCause() { - return cause; - } - -} \ No newline at end of file