+2002-11-11 Michael Koch <konqueror@gmx.de>
+
+ * java/nio/charset/CharacterCodingException.java:
+ This class must be public.
+ * java/nio/charset/CoderMalfunctionError.java:
+ This class must be public.
+ * java/nio/charset/CodingErrorAction.java:
+ This class must be public.
+ * java/nio/charset/IllegalCharsetNameException.java:
+ This class must be public, better implementation.
+ * java/nio/charset/MalformedInputException.java:
+ This class must be public, better implementation.
+ * java/nio/charset/UnmappableCharacterException.java:
+ This class must be public, better implementation.
+ * java/nio/charset/UnsupportedCharsetException.java:
+ This class must be public, better implementation.
+
2002-11-11 Michael Koch <konqueror@gmx.de>
* java/nio/BufferOverflowException.java,
import java.io.IOException;
-class CharacterCodingException extends IOException
+/**
+ * @since 1.4
+ */
+public class CharacterCodingException extends IOException
{
/**
* Creates the exception
/**
* @since 1.4
*/
-class CoderMalfunctionError extends Error
+public class CoderMalfunctionError extends Error
{
/**
* Creates the error
package java.nio.charset;
-
-class CodingErrorAction
+public class CodingErrorAction
{
- public static final CodingErrorAction IGNORE;
- public static final CodingErrorAction REPLACE;
- public static final CodingErrorAction REPORT;
+ public static final CodingErrorAction IGNORE
+ = new CodingErrorAction("ignore");
+ public static final CodingErrorAction REPLACE
+ = new CodingErrorAction("replace");
+ public static final CodingErrorAction REPORT
+ = new CodingErrorAction("report");
+
+ private final String name;
+
+ /**
+ * Private constructor only used to create the constant CodingErrorActions.
+ */
+ private CodingErrorAction(String name)
+ {
+ this.name = name;
+ }
/**
- * FIXME
+ * Returns the name of the CodingErrorAction.
*/
public String toString ()
{
- return "";
+ return name;
}
}
package java.nio.charset;
-class IllegalCharsetNameException extends IllegalArgumentException
+/**
+ * @since 1.4
+ */
+public class IllegalCharsetNameException extends IllegalArgumentException
{
- private String charsetName;
-
/**
* Creates the exception
*/
public IllegalCharsetNameException (String charsetName)
{
- super ();
- this.charsetName = charsetName;
+ super (charsetName);
}
/**
*/
public String getCharsetName ()
{
- return charsetName;
+ return getMessage ();
}
}
package java.nio.charset;
-class MalformedInputException extends CharacterCodingException
+/**
+ * @since 1.4
+ */
+public class MalformedInputException extends CharacterCodingException
{
private int inputLength;
*/
public String getMessage ()
{
- // FIXME: I think this is not correct
- return "";
+ return "Input length = " + inputLength;
}
}
package java.nio.charset;
-class UnmappableCharacterException extends CharacterCodingException
+/**
+ * @since 1.4
+ */
+public class UnmappableCharacterException extends CharacterCodingException
{
private int inputLength;
*/
public String getMessage ()
{
- // FIXME: I think this is not correct
- return "";
+ return "Input length = " + inputLength;
}
}
package java.nio.charset;
-class UnsupportedCharsetException extends IllegalArgumentException
+/**
+ * @since 1.4
+ */
+public class UnsupportedCharsetException extends IllegalArgumentException
{
- private String charsetName;
-
/**
* Creates the exception
*/
public UnsupportedCharsetException (String charsetName)
{
- super ();
- this.charsetName = charsetName;
+ super (charsetName);
}
/**
*/
public String getCharsetName ()
{
- return charsetName;
+ return getMessage ();
}
}