8133115: docs: replace <tt> tags (obsolete in html5) for java.util.logging, java.util.prefs, java.util.zip, java.util.jar

Reviewed-by: lancea
This commit is contained in:
Alexander Stepanov 2015-08-06 19:07:35 +03:00
parent c1ef47c427
commit c78487e756
25 changed files with 694 additions and 694 deletions

View file

@ -526,7 +526,7 @@ public class Attributes implements Map<Object,Object>, Cloneable {
} }
/** /**
* <code>Name</code> object for <code>Manifest-Version</code> * {@code Name} object for {@code Manifest-Version}
* manifest attribute. This attribute indicates the version number * manifest attribute. This attribute indicates the version number
* of the manifest standard to which a JAR file's manifest conforms. * of the manifest standard to which a JAR file's manifest conforms.
* @see <a href="../../../../technotes/guides/jar/jar.html#JAR_Manifest"> * @see <a href="../../../../technotes/guides/jar/jar.html#JAR_Manifest">
@ -535,7 +535,7 @@ public class Attributes implements Map<Object,Object>, Cloneable {
public static final Name MANIFEST_VERSION = new Name("Manifest-Version"); public static final Name MANIFEST_VERSION = new Name("Manifest-Version");
/** /**
* <code>Name</code> object for <code>Signature-Version</code> * {@code Name} object for {@code Signature-Version}
* manifest attribute used when signing JAR files. * manifest attribute used when signing JAR files.
* @see <a href="../../../../technotes/guides/jar/jar.html#JAR_Manifest"> * @see <a href="../../../../technotes/guides/jar/jar.html#JAR_Manifest">
* Manifest and Signature Specification</a> * Manifest and Signature Specification</a>
@ -543,13 +543,13 @@ public class Attributes implements Map<Object,Object>, Cloneable {
public static final Name SIGNATURE_VERSION = new Name("Signature-Version"); public static final Name SIGNATURE_VERSION = new Name("Signature-Version");
/** /**
* <code>Name</code> object for <code>Content-Type</code> * {@code Name} object for {@code Content-Type}
* manifest attribute. * manifest attribute.
*/ */
public static final Name CONTENT_TYPE = new Name("Content-Type"); public static final Name CONTENT_TYPE = new Name("Content-Type");
/** /**
* <code>Name</code> object for <code>Class-Path</code> * {@code Name} object for {@code Class-Path}
* manifest attribute. * manifest attribute.
* @see <a href="../../../../technotes/guides/jar/jar.html#classpath"> * @see <a href="../../../../technotes/guides/jar/jar.html#classpath">
* JAR file specification</a> * JAR file specification</a>
@ -557,16 +557,16 @@ public class Attributes implements Map<Object,Object>, Cloneable {
public static final Name CLASS_PATH = new Name("Class-Path"); public static final Name CLASS_PATH = new Name("Class-Path");
/** /**
* <code>Name</code> object for <code>Main-Class</code> manifest * {@code Name} object for {@code Main-Class} manifest
* attribute used for launching applications packaged in JAR files. * attribute used for launching applications packaged in JAR files.
* The <code>Main-Class</code> attribute is used in conjunction * The {@code Main-Class} attribute is used in conjunction
* with the <code>-jar</code> command-line option of the * with the {@code -jar} command-line option of the
* <tt>java</tt> application launcher. * {@code java} application launcher.
*/ */
public static final Name MAIN_CLASS = new Name("Main-Class"); public static final Name MAIN_CLASS = new Name("Main-Class");
/** /**
* <code>Name</code> object for <code>Sealed</code> manifest attribute * {@code Name} object for {@code Sealed} manifest attribute
* used for sealing. * used for sealing.
* @see <a href="../../../../technotes/guides/jar/jar.html#sealing"> * @see <a href="../../../../technotes/guides/jar/jar.html#sealing">
* Package Sealing</a> * Package Sealing</a>
@ -574,19 +574,19 @@ public class Attributes implements Map<Object,Object>, Cloneable {
public static final Name SEALED = new Name("Sealed"); public static final Name SEALED = new Name("Sealed");
/** /**
* <code>Name</code> object for <code>Extension-List</code> manifest attribute * {@code Name} object for {@code Extension-List} manifest attribute
* used for the extension mechanism that is no longer supported. * used for the extension mechanism that is no longer supported.
*/ */
public static final Name EXTENSION_LIST = new Name("Extension-List"); public static final Name EXTENSION_LIST = new Name("Extension-List");
/** /**
* <code>Name</code> object for <code>Extension-Name</code> manifest attribute. * {@code Name} object for {@code Extension-Name} manifest attribute.
* used for the extension mechanism that is no longer supported. * used for the extension mechanism that is no longer supported.
*/ */
public static final Name EXTENSION_NAME = new Name("Extension-Name"); public static final Name EXTENSION_NAME = new Name("Extension-Name");
/** /**
* <code>Name</code> object for <code>Extension-Installation</code> manifest attribute. * {@code Name} object for {@code Extension-Installation} manifest attribute.
* *
* @deprecated Extension mechanism is no longer supported. * @deprecated Extension mechanism is no longer supported.
*/ */
@ -594,25 +594,25 @@ public class Attributes implements Map<Object,Object>, Cloneable {
public static final Name EXTENSION_INSTALLATION = new Name("Extension-Installation"); public static final Name EXTENSION_INSTALLATION = new Name("Extension-Installation");
/** /**
* <code>Name</code> object for <code>Implementation-Title</code> * {@code Name} object for {@code Implementation-Title}
* manifest attribute used for package versioning. * manifest attribute used for package versioning.
*/ */
public static final Name IMPLEMENTATION_TITLE = new Name("Implementation-Title"); public static final Name IMPLEMENTATION_TITLE = new Name("Implementation-Title");
/** /**
* <code>Name</code> object for <code>Implementation-Version</code> * {@code Name} object for {@code Implementation-Version}
* manifest attribute used for package versioning. * manifest attribute used for package versioning.
*/ */
public static final Name IMPLEMENTATION_VERSION = new Name("Implementation-Version"); public static final Name IMPLEMENTATION_VERSION = new Name("Implementation-Version");
/** /**
* <code>Name</code> object for <code>Implementation-Vendor</code> * {@code Name} object for {@code Implementation-Vendor}
* manifest attribute used for package versioning. * manifest attribute used for package versioning.
*/ */
public static final Name IMPLEMENTATION_VENDOR = new Name("Implementation-Vendor"); public static final Name IMPLEMENTATION_VENDOR = new Name("Implementation-Vendor");
/** /**
* <code>Name</code> object for <code>Implementation-Vendor-Id</code> * {@code Name} object for {@code Implementation-Vendor-Id}
* manifest attribute. * manifest attribute.
* *
* @deprecated Extension mechanism is no longer supported. * @deprecated Extension mechanism is no longer supported.
@ -621,7 +621,7 @@ public class Attributes implements Map<Object,Object>, Cloneable {
public static final Name IMPLEMENTATION_VENDOR_ID = new Name("Implementation-Vendor-Id"); public static final Name IMPLEMENTATION_VENDOR_ID = new Name("Implementation-Vendor-Id");
/** /**
* <code>Name</code> object for <code>Implementation-URL</code> * {@code Name} object for {@code Implementation-URL}
* manifest attribute. * manifest attribute.
* *
* @deprecated Extension mechanism is no longer supported. * @deprecated Extension mechanism is no longer supported.
@ -630,19 +630,19 @@ public class Attributes implements Map<Object,Object>, Cloneable {
public static final Name IMPLEMENTATION_URL = new Name("Implementation-URL"); public static final Name IMPLEMENTATION_URL = new Name("Implementation-URL");
/** /**
* <code>Name</code> object for <code>Specification-Title</code> * {@code Name} object for {@code Specification-Title}
* manifest attribute used for package versioning. * manifest attribute used for package versioning.
*/ */
public static final Name SPECIFICATION_TITLE = new Name("Specification-Title"); public static final Name SPECIFICATION_TITLE = new Name("Specification-Title");
/** /**
* <code>Name</code> object for <code>Specification-Version</code> * {@code Name} object for {@code Specification-Version}
* manifest attribute used for package versioning. * manifest attribute used for package versioning.
*/ */
public static final Name SPECIFICATION_VERSION = new Name("Specification-Version"); public static final Name SPECIFICATION_VERSION = new Name("Specification-Version");
/** /**
* <code>Name</code> object for <code>Specification-Vendor</code> * {@code Name} object for {@code Specification-Vendor}
* manifest attribute used for package versioning. * manifest attribute used for package versioning.
*/ */
public static final Name SPECIFICATION_VENDOR = new Name("Specification-Vendor"); public static final Name SPECIFICATION_VENDOR = new Name("Specification-Vendor");

View file

@ -43,14 +43,14 @@ import sun.misc.SharedSecrets;
import sun.security.util.SignatureFileVerifier; import sun.security.util.SignatureFileVerifier;
/** /**
* The <code>JarFile</code> class is used to read the contents of a jar file * The {@code JarFile} class is used to read the contents of a jar file
* from any file that can be opened with <code>java.io.RandomAccessFile</code>. * from any file that can be opened with {@code java.io.RandomAccessFile}.
* It extends the class <code>java.util.zip.ZipFile</code> with support * It extends the class {@code java.util.zip.ZipFile} with support
* for reading an optional <code>Manifest</code> entry. The * for reading an optional {@code Manifest} entry. The
* <code>Manifest</code> can be used to specify meta-information about the * {@code Manifest} can be used to specify meta-information about the
* jar file and its entries. * jar file and its entries.
* *
* <p> Unless otherwise noted, passing a <tt>null</tt> argument to a constructor * <p> Unless otherwise noted, passing a {@code null} argument to a constructor
* or method in this class will cause a {@link NullPointerException} to be * or method in this class will cause a {@link NullPointerException} to be
* thrown. * thrown.
* *
@ -91,8 +91,8 @@ class JarFile extends ZipFile {
public static final String MANIFEST_NAME = "META-INF/MANIFEST.MF"; public static final String MANIFEST_NAME = "META-INF/MANIFEST.MF";
/** /**
* Creates a new <code>JarFile</code> to read from the specified * Creates a new {@code JarFile} to read from the specified
* file <code>name</code>. The <code>JarFile</code> will be verified if * file {@code name}. The {@code JarFile} will be verified if
* it is signed. * it is signed.
* @param name the name of the jar file to be opened for reading * @param name the name of the jar file to be opened for reading
* @throws IOException if an I/O error has occurred * @throws IOException if an I/O error has occurred
@ -104,8 +104,8 @@ class JarFile extends ZipFile {
} }
/** /**
* Creates a new <code>JarFile</code> to read from the specified * Creates a new {@code JarFile} to read from the specified
* file <code>name</code>. * file {@code name}.
* @param name the name of the jar file to be opened for reading * @param name the name of the jar file to be opened for reading
* @param verify whether or not to verify the jar file if * @param verify whether or not to verify the jar file if
* it is signed. * it is signed.
@ -118,8 +118,8 @@ class JarFile extends ZipFile {
} }
/** /**
* Creates a new <code>JarFile</code> to read from the specified * Creates a new {@code JarFile} to read from the specified
* <code>File</code> object. The <code>JarFile</code> will be verified if * {@code File} object. The {@code JarFile} will be verified if
* it is signed. * it is signed.
* @param file the jar file to be opened for reading * @param file the jar file to be opened for reading
* @throws IOException if an I/O error has occurred * @throws IOException if an I/O error has occurred
@ -132,8 +132,8 @@ class JarFile extends ZipFile {
/** /**
* Creates a new <code>JarFile</code> to read from the specified * Creates a new {@code JarFile} to read from the specified
* <code>File</code> object. * {@code File} object.
* @param file the jar file to be opened for reading * @param file the jar file to be opened for reading
* @param verify whether or not to verify the jar file if * @param verify whether or not to verify the jar file if
* it is signed. * it is signed.
@ -147,9 +147,9 @@ class JarFile extends ZipFile {
/** /**
* Creates a new <code>JarFile</code> to read from the specified * Creates a new {@code JarFile} to read from the specified
* <code>File</code> object in the specified mode. The mode argument * {@code File} object in the specified mode. The mode argument
* must be either <tt>OPEN_READ</tt> or <tt>OPEN_READ | OPEN_DELETE</tt>. * must be either {@code OPEN_READ} or {@code OPEN_READ | OPEN_DELETE}.
* *
* @param file the jar file to be opened for reading * @param file the jar file to be opened for reading
* @param verify whether or not to verify the jar file if * @param verify whether or not to verify the jar file if
@ -157,7 +157,7 @@ class JarFile extends ZipFile {
* @param mode the mode in which the file is to be opened * @param mode the mode in which the file is to be opened
* @throws IOException if an I/O error has occurred * @throws IOException if an I/O error has occurred
* @throws IllegalArgumentException * @throws IllegalArgumentException
* if the <tt>mode</tt> argument is invalid * if the {@code mode} argument is invalid
* @throws SecurityException if access to the file is denied * @throws SecurityException if access to the file is denied
* by the SecurityManager * by the SecurityManager
* @since 1.3 * @since 1.3
@ -168,9 +168,9 @@ class JarFile extends ZipFile {
} }
/** /**
* Returns the jar file manifest, or <code>null</code> if none. * Returns the jar file manifest, or {@code null} if none.
* *
* @return the jar file manifest, or <code>null</code> if none * @return the jar file manifest, or {@code null} if none
* *
* @throws IllegalStateException * @throws IllegalStateException
* may be thrown if the jar file has been closed * may be thrown if the jar file has been closed
@ -207,12 +207,12 @@ class JarFile extends ZipFile {
private native String[] getMetaInfEntryNames(); private native String[] getMetaInfEntryNames();
/** /**
* Returns the <code>JarEntry</code> for the given entry name or * Returns the {@code JarEntry} for the given entry name or
* <code>null</code> if not found. * {@code null} if not found.
* *
* @param name the jar file entry name * @param name the jar file entry name
* @return the <code>JarEntry</code> for the given entry name or * @return the {@code JarEntry} for the given entry name or
* <code>null</code> if not found. * {@code null} if not found.
* *
* @throws IllegalStateException * @throws IllegalStateException
* may be thrown if the jar file has been closed * may be thrown if the jar file has been closed
@ -224,12 +224,12 @@ class JarFile extends ZipFile {
} }
/** /**
* Returns the <code>ZipEntry</code> for the given entry name or * Returns the {@code ZipEntry} for the given entry name or
* <code>null</code> if not found. * {@code null} if not found.
* *
* @param name the jar file entry name * @param name the jar file entry name
* @return the <code>ZipEntry</code> for the given entry name or * @return the {@code ZipEntry} for the given entry name or
* <code>null</code> if not found * {@code null} if not found
* *
* @throws IllegalStateException * @throws IllegalStateException
* may be thrown if the jar file has been closed * may be thrown if the jar file has been closed

View file

@ -95,7 +95,7 @@ import java.io.IOException;
* the file encoded with Pack200 and further compressed with gzip. Please * the file encoded with Pack200 and further compressed with gzip. Please
* refer to the Java Deployment Guide for techniques and details. * refer to the Java Deployment Guide for techniques and details.
* <p> * <p>
* Unless otherwise noted, passing a <tt>null</tt> argument to a constructor or * Unless otherwise noted, passing a {@code null} argument to a constructor or
* method in this class will cause a {@link NullPointerException} to be thrown. * method in this class will cause a {@link NullPointerException} to be thrown.
* *
* @author John Rose * @author John Rose
@ -109,7 +109,7 @@ public abstract class Pack200 {
/** /**
* Obtain new instance of a class that implements Packer. * Obtain new instance of a class that implements Packer.
* <ul> * <ul>
* <li><p>If the system property <tt>java.util.jar.Pack200.Packer</tt> * <li><p>If the system property {@code java.util.jar.Pack200.Packer}
* is defined, then the value is taken to be the fully-qualified name * is defined, then the value is taken to be the fully-qualified name
* of a concrete implementation class, which must implement Packer. * of a concrete implementation class, which must implement Packer.
* This class is loaded and instantiated. If this process fails * This class is loaded and instantiated. If this process fails
@ -135,7 +135,7 @@ public abstract class Pack200 {
/** /**
* Obtain new instance of a class that implements Unpacker. * Obtain new instance of a class that implements Unpacker.
* <ul> * <ul>
* <li><p>If the system property <tt>java.util.jar.Pack200.Unpacker</tt> * <li><p>If the system property {@code java.util.jar.Pack200.Unpacker}
* is defined, then the value is taken to be the fully-qualified * is defined, then the value is taken to be the fully-qualified
* name of a concrete implementation class, which must implement Unpacker. * name of a concrete implementation class, which must implement Unpacker.
* The class is loaded and instantiated. If this process fails * The class is loaded and instantiated. If this process fails
@ -220,7 +220,7 @@ public abstract class Pack200 {
* If the input JAR-files contains a 1.6 class file, then the pack file * If the input JAR-files contains a 1.6 class file, then the pack file
* version will be set to 1.6. * version will be set to 1.6.
* <p> * <p>
* Note: Unless otherwise noted, passing a <tt>null</tt> argument to a * Note: Unless otherwise noted, passing a {@code null} argument to a
* constructor or method in this class will cause a {@link NullPointerException} * constructor or method in this class will cause a {@link NullPointerException}
* to be thrown. * to be thrown.
* *
@ -367,7 +367,7 @@ public abstract class Pack200 {
* {@link #STRIP}, and {@link #PASS}. * {@link #STRIP}, and {@link #PASS}.
* <p> * <p>
* The string {@link #ERROR} means that the pack operation * The string {@link #ERROR} means that the pack operation
* as a whole will fail, with an exception of type <code>IOException</code>. * as a whole will fail, with an exception of type {@code IOException}.
* The string * The string
* {@link #STRIP} means that the attribute will be dropped. * {@link #STRIP} means that the attribute will be dropped.
* The string * The string
@ -391,7 +391,7 @@ public abstract class Pack200 {
* using the layout language specified in the JSR 200 specification. * using the layout language specified in the JSR 200 specification.
* <p> * <p>
* For example, the effect of this option is built in: * For example, the effect of this option is built in:
* <code>pack.class.attribute.SourceFile=RUH</code>. * {@code pack.class.attribute.SourceFile=RUH}.
* <p> * <p>
* The special strings {@link #ERROR}, {@link #STRIP}, and {@link #PASS} are * The special strings {@link #ERROR}, {@link #STRIP}, and {@link #PASS} are
* also allowed, with the same meaning as {@link #UNKNOWN_ATTRIBUTE}. * also allowed, with the same meaning as {@link #UNKNOWN_ATTRIBUTE}.
@ -399,21 +399,21 @@ public abstract class Pack200 {
* refused, stripped, or passed bitwise (with no class compression). * refused, stripped, or passed bitwise (with no class compression).
* <p> * <p>
* Code like this might be used to support attributes for JCOV: * Code like this might be used to support attributes for JCOV:
* <pre><code> * <pre>{@code
* Map p = packer.properties(); * Map p = packer.properties();
* p.put(CODE_ATTRIBUTE_PFX+"CoverageTable", "NH[PHHII]"); * p.put(CODE_ATTRIBUTE_PFX+"CoverageTable", "NH[PHHII]");
* p.put(CODE_ATTRIBUTE_PFX+"CharacterRangeTable", "NH[PHPOHIIH]"); * p.put(CODE_ATTRIBUTE_PFX+"CharacterRangeTable", "NH[PHPOHIIH]");
* p.put(CLASS_ATTRIBUTE_PFX+"SourceID", "RUH"); * p.put(CLASS_ATTRIBUTE_PFX+"SourceID", "RUH");
* p.put(CLASS_ATTRIBUTE_PFX+"CompilationID", "RUH"); * p.put(CLASS_ATTRIBUTE_PFX+"CompilationID", "RUH");
* </code></pre> * }</pre>
* <p> * <p>
* Code like this might be used to strip debugging attributes: * Code like this might be used to strip debugging attributes:
* <pre><code> * <pre>{@code
* Map p = packer.properties(); * Map p = packer.properties();
* p.put(CODE_ATTRIBUTE_PFX+"LineNumberTable", STRIP); * p.put(CODE_ATTRIBUTE_PFX+"LineNumberTable", STRIP);
* p.put(CODE_ATTRIBUTE_PFX+"LocalVariableTable", STRIP); * p.put(CODE_ATTRIBUTE_PFX+"LocalVariableTable", STRIP);
* p.put(CLASS_ATTRIBUTE_PFX+"SourceFile", STRIP); * p.put(CLASS_ATTRIBUTE_PFX+"SourceFile", STRIP);
* </code></pre> * }</pre>
*/ */
String CLASS_ATTRIBUTE_PFX = "pack.class.attribute."; String CLASS_ATTRIBUTE_PFX = "pack.class.attribute.";
@ -421,7 +421,7 @@ public abstract class Pack200 {
* When concatenated with a field attribute name, * When concatenated with a field attribute name,
* indicates the format of that attribute. * indicates the format of that attribute.
* For example, the effect of this option is built in: * For example, the effect of this option is built in:
* <code>pack.field.attribute.Deprecated=</code>. * {@code pack.field.attribute.Deprecated=}.
* The special strings {@link #ERROR}, {@link #STRIP}, and * The special strings {@link #ERROR}, {@link #STRIP}, and
* {@link #PASS} are also allowed. * {@link #PASS} are also allowed.
* @see #CLASS_ATTRIBUTE_PFX * @see #CLASS_ATTRIBUTE_PFX
@ -432,7 +432,7 @@ public abstract class Pack200 {
* When concatenated with a method attribute name, * When concatenated with a method attribute name,
* indicates the format of that attribute. * indicates the format of that attribute.
* For example, the effect of this option is built in: * For example, the effect of this option is built in:
* <code>pack.method.attribute.Exceptions=NH[RCH]</code>. * {@code pack.method.attribute.Exceptions=NH[RCH]}.
* The special strings {@link #ERROR}, {@link #STRIP}, and {@link #PASS} * The special strings {@link #ERROR}, {@link #STRIP}, and {@link #PASS}
* are also allowed. * are also allowed.
* @see #CLASS_ATTRIBUTE_PFX * @see #CLASS_ATTRIBUTE_PFX
@ -443,7 +443,7 @@ public abstract class Pack200 {
* When concatenated with a code attribute name, * When concatenated with a code attribute name,
* indicates the format of that attribute. * indicates the format of that attribute.
* For example, the effect of this option is built in: * For example, the effect of this option is built in:
* <code>pack.code.attribute.LocalVariableTable=NH[PHOHRUHRSHH]</code>. * {@code pack.code.attribute.LocalVariableTable=NH[PHOHRUHRSHH]}.
* The special strings {@link #ERROR}, {@link #STRIP}, and {@link #PASS} * The special strings {@link #ERROR}, {@link #STRIP}, and {@link #PASS}
* are also allowed. * are also allowed.
* @see #CLASS_ATTRIBUTE_PFX * @see #CLASS_ATTRIBUTE_PFX
@ -527,9 +527,9 @@ public abstract class Pack200 {
* <p> * <p>
* Implementation specific properties are prefixed with a * Implementation specific properties are prefixed with a
* package name associated with the implementor, beginning * package name associated with the implementor, beginning
* with <tt>com.</tt> or a similar prefix. * with {@code com.} or a similar prefix.
* All property names beginning with <tt>pack.</tt> and * All property names beginning with {@code pack.} and
* <tt>unpack.</tt> are reserved for use by this API. * {@code unpack.} are reserved for use by this API.
* <p> * <p>
* Unknown properties may be ignored or rejected with an * Unknown properties may be ignored or rejected with an
* unspecified error, and invalid entries may cause an * unspecified error, and invalid entries may cause an
@ -575,10 +575,10 @@ public abstract class Pack200 {
* using {@link #newUnpacker}. * using {@link #newUnpacker}.
* <p> * <p>
* Every JAR file produced by this engine will include the string * Every JAR file produced by this engine will include the string
* "<tt>PACK200</tt>" as a zip file comment. * "{@code PACK200}" as a zip file comment.
* This allows a deployer to detect if a JAR archive was packed and unpacked. * This allows a deployer to detect if a JAR archive was packed and unpacked.
* <p> * <p>
* Note: Unless otherwise noted, passing a <tt>null</tt> argument to a * Note: Unless otherwise noted, passing a {@code null} argument to a
* constructor or method in this class will cause a {@link NullPointerException} * constructor or method in this class will cause a {@link NullPointerException}
* to be thrown. * to be thrown.
* <p> * <p>
@ -641,9 +641,9 @@ public abstract class Pack200 {
* <p> * <p>
* Implementation specific properties are prefixed with a * Implementation specific properties are prefixed with a
* package name associated with the implementor, beginning * package name associated with the implementor, beginning
* with <tt>com.</tt> or a similar prefix. * with {@code com.} or a similar prefix.
* All property names beginning with <tt>pack.</tt> and * All property names beginning with {@code pack.} and
* <tt>unpack.</tt> are reserved for use by this API. * {@code unpack.} are reserved for use by this API.
* <p> * <p>
* Unknown properties may be ignored or rejected with an * Unknown properties may be ignored or rejected with an
* unspecified error, and invalid entries may cause an * unspecified error, and invalid entries may cause an

View file

@ -34,8 +34,8 @@ package java.util.zip;
* package description</a>. * package description</a>.
* *
* <p>The following code fragment demonstrates a trivial compression * <p>The following code fragment demonstrates a trivial compression
* and decompression of a string using <tt>Deflater</tt> and * and decompression of a string using {@code Deflater} and
* <tt>Inflater</tt>. * {@code Inflater}.
* *
* <blockquote><pre> * <blockquote><pre>
* try { * try {

View file

@ -34,8 +34,8 @@ package java.util.zip;
* package description</a>. * package description</a>.
* *
* <p>The following code fragment demonstrates a trivial compression * <p>The following code fragment demonstrates a trivial compression
* and decompression of a string using <tt>Deflater</tt> and * and decompression of a string using {@code Deflater} and
* <tt>Inflater</tt>. * {@code Inflater}.
* *
* <blockquote><pre> * <blockquote><pre>
* try { * try {

View file

@ -50,7 +50,7 @@ import static java.util.zip.ZipConstants64.*;
/** /**
* This class is used to read entries from a zip file. * This class is used to read entries from a zip file.
* *
* <p> Unless otherwise noted, passing a <tt>null</tt> argument to a constructor * <p> Unless otherwise noted, passing a {@code null} argument to a constructor
* or method in this class will cause a {@link NullPointerException} to be * or method in this class will cause a {@link NullPointerException} to be
* thrown. * thrown.
* *
@ -76,7 +76,7 @@ class ZipFile implements ZipConstants, Closeable {
* Mode flag to open a zip file and mark it for deletion. The file will be * Mode flag to open a zip file and mark it for deletion. The file will be
* deleted some time between the moment that it is opened and the moment * deleted some time between the moment that it is opened and the moment
* that it is closed, but its contents will remain accessible via the * that it is closed, but its contents will remain accessible via the
* <tt>ZipFile</tt> object until either the close method is invoked or the * {@code ZipFile} object until either the close method is invoked or the
* virtual machine exits. * virtual machine exits.
*/ */
public static final int OPEN_DELETE = 0x4; public static final int OPEN_DELETE = 0x4;
@ -101,8 +101,8 @@ class ZipFile implements ZipConstants, Closeable {
/** /**
* Opens a zip file for reading. * Opens a zip file for reading.
* *
* <p>First, if there is a security manager, its <code>checkRead</code> * <p>First, if there is a security manager, its {@code checkRead}
* method is called with the <code>name</code> argument as its argument * method is called with the {@code name} argument as its argument
* to ensure the read is allowed. * to ensure the read is allowed.
* *
* <p>The UTF-8 {@link java.nio.charset.Charset charset} is used to * <p>The UTF-8 {@link java.nio.charset.Charset charset} is used to
@ -112,7 +112,7 @@ class ZipFile implements ZipConstants, Closeable {
* @throws ZipException if a ZIP format error has occurred * @throws ZipException if a ZIP format error has occurred
* @throws IOException if an I/O error has occurred * @throws IOException if an I/O error has occurred
* @throws SecurityException if a security manager exists and its * @throws SecurityException if a security manager exists and its
* <code>checkRead</code> method doesn't allow read access to the file. * {@code checkRead} method doesn't allow read access to the file.
* *
* @see SecurityManager#checkRead(java.lang.String) * @see SecurityManager#checkRead(java.lang.String)
*/ */
@ -121,12 +121,12 @@ class ZipFile implements ZipConstants, Closeable {
} }
/** /**
* Opens a new <code>ZipFile</code> to read from the specified * Opens a new {@code ZipFile} to read from the specified
* <code>File</code> object in the specified mode. The mode argument * {@code File} object in the specified mode. The mode argument
* must be either <tt>OPEN_READ</tt> or <tt>OPEN_READ | OPEN_DELETE</tt>. * must be either {@code OPEN_READ} or {@code OPEN_READ | OPEN_DELETE}.
* *
* <p>First, if there is a security manager, its <code>checkRead</code> * <p>First, if there is a security manager, its {@code checkRead}
* method is called with the <code>name</code> argument as its argument to * method is called with the {@code name} argument as its argument to
* ensure the read is allowed. * ensure the read is allowed.
* *
* <p>The UTF-8 {@link java.nio.charset.Charset charset} is used to * <p>The UTF-8 {@link java.nio.charset.Charset charset} is used to
@ -137,11 +137,11 @@ class ZipFile implements ZipConstants, Closeable {
* @throws ZipException if a ZIP format error has occurred * @throws ZipException if a ZIP format error has occurred
* @throws IOException if an I/O error has occurred * @throws IOException if an I/O error has occurred
* @throws SecurityException if a security manager exists and * @throws SecurityException if a security manager exists and
* its <code>checkRead</code> method * its {@code checkRead} method
* doesn't allow read access to the file, * doesn't allow read access to the file,
* or its <code>checkDelete</code> method doesn't allow deleting * or its {@code checkDelete} method doesn't allow deleting
* the file when the <tt>OPEN_DELETE</tt> flag is set. * the file when the {@code OPEN_DELETE} flag is set.
* @throws IllegalArgumentException if the <tt>mode</tt> argument is invalid * @throws IllegalArgumentException if the {@code mode} argument is invalid
* @see SecurityManager#checkRead(java.lang.String) * @see SecurityManager#checkRead(java.lang.String)
* @since 1.3 * @since 1.3
*/ */
@ -166,12 +166,12 @@ class ZipFile implements ZipConstants, Closeable {
private ZipCoder zc; private ZipCoder zc;
/** /**
* Opens a new <code>ZipFile</code> to read from the specified * Opens a new {@code ZipFile} to read from the specified
* <code>File</code> object in the specified mode. The mode argument * {@code File} object in the specified mode. The mode argument
* must be either <tt>OPEN_READ</tt> or <tt>OPEN_READ | OPEN_DELETE</tt>. * must be either {@code OPEN_READ} or {@code OPEN_READ | OPEN_DELETE}.
* *
* <p>First, if there is a security manager, its <code>checkRead</code> * <p>First, if there is a security manager, its {@code checkRead}
* method is called with the <code>name</code> argument as its argument to * method is called with the {@code name} argument as its argument to
* ensure the read is allowed. * ensure the read is allowed.
* *
* @param file the ZIP file to be opened for reading * @param file the ZIP file to be opened for reading
@ -186,12 +186,12 @@ class ZipFile implements ZipConstants, Closeable {
* @throws IOException if an I/O error has occurred * @throws IOException if an I/O error has occurred
* *
* @throws SecurityException * @throws SecurityException
* if a security manager exists and its <code>checkRead</code> * if a security manager exists and its {@code checkRead}
* method doesn't allow read access to the file,or its * method doesn't allow read access to the file,or its
* <code>checkDelete</code> method doesn't allow deleting the * {@code checkDelete} method doesn't allow deleting the
* file when the <tt>OPEN_DELETE</tt> flag is set * file when the {@code OPEN_DELETE} flag is set
* *
* @throws IllegalArgumentException if the <tt>mode</tt> argument is invalid * @throws IllegalArgumentException if the {@code mode} argument is invalid
* *
* @see SecurityManager#checkRead(java.lang.String) * @see SecurityManager#checkRead(java.lang.String)
* *
@ -227,8 +227,8 @@ class ZipFile implements ZipConstants, Closeable {
/** /**
* Opens a zip file for reading. * Opens a zip file for reading.
* *
* <p>First, if there is a security manager, its <code>checkRead</code> * <p>First, if there is a security manager, its {@code checkRead}
* method is called with the <code>name</code> argument as its argument * method is called with the {@code name} argument as its argument
* to ensure the read is allowed. * to ensure the read is allowed.
* *
* @param name the name of the zip file * @param name the name of the zip file
@ -241,7 +241,7 @@ class ZipFile implements ZipConstants, Closeable {
* @throws ZipException if a ZIP format error has occurred * @throws ZipException if a ZIP format error has occurred
* @throws IOException if an I/O error has occurred * @throws IOException if an I/O error has occurred
* @throws SecurityException * @throws SecurityException
* if a security manager exists and its <code>checkRead</code> * if a security manager exists and its {@code checkRead}
* method doesn't allow read access to the file * method doesn't allow read access to the file
* *
* @see SecurityManager#checkRead(java.lang.String) * @see SecurityManager#checkRead(java.lang.String)
@ -654,8 +654,8 @@ class ZipFile implements ZipConstants, Closeable {
* *
* <p> * <p>
* Since the time when GC would invoke this method is undetermined, * Since the time when GC would invoke this method is undetermined,
* it is strongly recommended that applications invoke the <code>close</code> * it is strongly recommended that applications invoke the {@code close}
* method as soon they have finished accessing this <code>ZipFile</code>. * method as soon they have finished accessing this {@code ZipFile}.
* This will prevent holding up system resources for an undetermined * This will prevent holding up system resources for an undetermined
* length of time. * length of time.
* *

View file

@ -27,25 +27,25 @@
package java.util.logging; package java.util.logging;
/** /**
* This <tt>Handler</tt> publishes log records to <tt>System.err</tt>. * This {@code Handler} publishes log records to {@code System.err}.
* By default the <tt>SimpleFormatter</tt> is used to generate brief summaries. * By default the {@code SimpleFormatter} is used to generate brief summaries.
* <p> * <p>
* <b>Configuration:</b> * <b>Configuration:</b>
* By default each <tt>ConsoleHandler</tt> is initialized using the following * By default each {@code ConsoleHandler} is initialized using the following
* <tt>LogManager</tt> configuration properties where {@code <handler-name>} * {@code LogManager} configuration properties where {@code <handler-name>}
* refers to the fully-qualified class name of the handler. * refers to the fully-qualified class name of the handler.
* If properties are not defined * If properties are not defined
* (or have invalid values) then the specified default values are used. * (or have invalid values) then the specified default values are used.
* <ul> * <ul>
* <li> &lt;handler-name&gt;.level * <li> &lt;handler-name&gt;.level
* specifies the default level for the <tt>Handler</tt> * specifies the default level for the {@code Handler}
* (defaults to <tt>Level.INFO</tt>). </li> * (defaults to {@code Level.INFO}). </li>
* <li> &lt;handler-name&gt;.filter * <li> &lt;handler-name&gt;.filter
* specifies the name of a <tt>Filter</tt> class to use * specifies the name of a {@code Filter} class to use
* (defaults to no <tt>Filter</tt>). </li> * (defaults to no {@code Filter}). </li>
* <li> &lt;handler-name&gt;.formatter * <li> &lt;handler-name&gt;.formatter
* specifies the name of a <tt>Formatter</tt> class to use * specifies the name of a {@code Formatter} class to use
* (defaults to <tt>java.util.logging.SimpleFormatter</tt>). </li> * (defaults to {@code java.util.logging.SimpleFormatter}). </li>
* <li> &lt;handler-name&gt;.encoding * <li> &lt;handler-name&gt;.encoding
* the name of the character set encoding to use (defaults to * the name of the character set encoding to use (defaults to
* the default platform encoding). </li> * the default platform encoding). </li>
@ -68,10 +68,10 @@ package java.util.logging;
public class ConsoleHandler extends StreamHandler { public class ConsoleHandler extends StreamHandler {
/** /**
* Create a <tt>ConsoleHandler</tt> for <tt>System.err</tt>. * Create a {@code ConsoleHandler} for {@code System.err}.
* <p> * <p>
* The <tt>ConsoleHandler</tt> is configured based on * The {@code ConsoleHandler} is configured based on
* <tt>LogManager</tt> properties (or their default values). * {@code LogManager} properties (or their default values).
* *
*/ */
public ConsoleHandler() { public ConsoleHandler() {
@ -82,10 +82,10 @@ public class ConsoleHandler extends StreamHandler {
} }
/** /**
* Publish a <tt>LogRecord</tt>. * Publish a {@code LogRecord}.
* <p> * <p>
* The logging request was made initially to a <tt>Logger</tt> object, * The logging request was made initially to a {@code Logger} object,
* which initialized the <tt>LogRecord</tt> and forwarded it here. * which initialized the {@code LogRecord} and forwarded it here.
* *
* @param record description of the log event. A null record is * @param record description of the log event. A null record is
* silently ignored and is not published * silently ignored and is not published
@ -97,9 +97,9 @@ public class ConsoleHandler extends StreamHandler {
} }
/** /**
* Override <tt>StreamHandler.close</tt> to do a flush but not * Override {@code StreamHandler.close} to do a flush but not
* to close the output stream. That is, we do <b>not</b> * to close the output stream. That is, we do <b>not</b>
* close <tt>System.err</tt>. * close {@code System.err}.
*/ */
@Override @Override
public void close() { public void close() {

View file

@ -48,9 +48,9 @@ import java.util.HashSet;
import java.util.Set; import java.util.Set;
/** /**
* Simple file logging <tt>Handler</tt>. * Simple file logging {@code Handler}.
* <p> * <p>
* The <tt>FileHandler</tt> can either write to a specified file, * The {@code FileHandler} can either write to a specified file,
* or it can write to a rotating set of files. * or it can write to a rotating set of files.
* <p> * <p>
* For a rotating set of files, as each file reaches a given size * For a rotating set of files, as each file reaches a given size
@ -61,24 +61,24 @@ import java.util.Set;
* By default buffering is enabled in the IO libraries but each log * By default buffering is enabled in the IO libraries but each log
* record is flushed out when it is complete. * record is flushed out when it is complete.
* <p> * <p>
* By default the <tt>XMLFormatter</tt> class is used for formatting. * By default the {@code XMLFormatter} class is used for formatting.
* <p> * <p>
* <b>Configuration:</b> * <b>Configuration:</b>
* By default each <tt>FileHandler</tt> is initialized using the following * By default each {@code FileHandler} is initialized using the following
* <tt>LogManager</tt> configuration properties where <tt>&lt;handler-name&gt;</tt> * {@code LogManager} configuration properties where {@code <handler-name>}
* refers to the fully-qualified class name of the handler. * refers to the fully-qualified class name of the handler.
* If properties are not defined * If properties are not defined
* (or have invalid values) then the specified default values are used. * (or have invalid values) then the specified default values are used.
* <ul> * <ul>
* <li> &lt;handler-name&gt;.level * <li> &lt;handler-name&gt;.level
* specifies the default level for the <tt>Handler</tt> * specifies the default level for the {@code Handler}
* (defaults to <tt>Level.ALL</tt>). </li> * (defaults to {@code Level.ALL}). </li>
* <li> &lt;handler-name&gt;.filter * <li> &lt;handler-name&gt;.filter
* specifies the name of a <tt>Filter</tt> class to use * specifies the name of a {@code Filter} class to use
* (defaults to no <tt>Filter</tt>). </li> * (defaults to no {@code Filter}). </li>
* <li> &lt;handler-name&gt;.formatter * <li> &lt;handler-name&gt;.formatter
* specifies the name of a <tt>Formatter</tt> class to use * specifies the name of a {@code Formatter} class to use
* (defaults to <tt>java.util.logging.XMLFormatter</tt>) </li> * (defaults to {@code java.util.logging.XMLFormatter}) </li>
* <li> &lt;handler-name&gt;.encoding * <li> &lt;handler-name&gt;.encoding
* the name of the character set encoding to use (defaults to * the name of the character set encoding to use (defaults to
* the default platform encoding). </li> * the default platform encoding). </li>
@ -129,10 +129,10 @@ import java.util.Set;
* <p> * <p>
* Generation numbers follow the sequence 0, 1, 2, etc. * Generation numbers follow the sequence 0, 1, 2, etc.
* <p> * <p>
* Normally the "%u" unique field is set to 0. However, if the <tt>FileHandler</tt> * Normally the "%u" unique field is set to 0. However, if the {@code FileHandler}
* tries to open the filename and finds the file is currently in use by * tries to open the filename and finds the file is currently in use by
* another process it will increment the unique number field and try * another process it will increment the unique number field and try
* again. This will be repeated until <tt>FileHandler</tt> finds a file name that * again. This will be repeated until {@code FileHandler} finds a file name that
* is not currently in use. If there is a conflict and no "%u" field has * is not currently in use. If there is a conflict and no "%u" field has
* been specified, it will be added at the end of the filename after a dot. * been specified, it will be added at the end of the filename after a dot.
* (This will be after any automatically added generation number.) * (This will be after any automatically added generation number.)
@ -249,12 +249,12 @@ public class FileHandler extends StreamHandler {
/** /**
* Construct a default <tt>FileHandler</tt>. This will be configured * Construct a default {@code FileHandler}. This will be configured
* entirely from <tt>LogManager</tt> properties (or their default values). * entirely from {@code LogManager} properties (or their default values).
* *
* @exception IOException if there are IO problems opening the files. * @exception IOException if there are IO problems opening the files.
* @exception SecurityException if a security manager exists and if * @exception SecurityException if a security manager exists and if
* the caller does not have <tt>LoggingPermission("control"))</tt>. * the caller does not have {@code LoggingPermission("control"))}.
* @exception NullPointerException if pattern property is an empty String. * @exception NullPointerException if pattern property is an empty String.
*/ */
public FileHandler() throws IOException, SecurityException { public FileHandler() throws IOException, SecurityException {
@ -269,9 +269,9 @@ public class FileHandler extends StreamHandler {
} }
/** /**
* Initialize a <tt>FileHandler</tt> to write to the given filename. * Initialize a {@code FileHandler} to write to the given filename.
* <p> * <p>
* The <tt>FileHandler</tt> is configured based on <tt>LogManager</tt> * The {@code FileHandler} is configured based on {@code LogManager}
* properties (or their default values) except that the given pattern * properties (or their default values) except that the given pattern
* argument is used as the filename pattern, the file limit is * argument is used as the filename pattern, the file limit is
* set to no limit, and the file count is set to one. * set to no limit, and the file count is set to one.
@ -282,7 +282,7 @@ public class FileHandler extends StreamHandler {
* @param pattern the name of the output file * @param pattern the name of the output file
* @exception IOException if there are IO problems opening the files. * @exception IOException if there are IO problems opening the files.
* @exception SecurityException if a security manager exists and if * @exception SecurityException if a security manager exists and if
* the caller does not have <tt>LoggingPermission("control")</tt>. * the caller does not have {@code LoggingPermission("control")}.
* @exception IllegalArgumentException if pattern is an empty string * @exception IllegalArgumentException if pattern is an empty string
*/ */
public FileHandler(String pattern) throws IOException, SecurityException { public FileHandler(String pattern) throws IOException, SecurityException {
@ -298,14 +298,14 @@ public class FileHandler extends StreamHandler {
} }
/** /**
* Initialize a <tt>FileHandler</tt> to write to the given filename, * Initialize a {@code FileHandler} to write to the given filename,
* with optional append. * with optional append.
* <p> * <p>
* The <tt>FileHandler</tt> is configured based on <tt>LogManager</tt> * The {@code FileHandler} is configured based on {@code LogManager}
* properties (or their default values) except that the given pattern * properties (or their default values) except that the given pattern
* argument is used as the filename pattern, the file limit is * argument is used as the filename pattern, the file limit is
* set to no limit, the file count is set to one, and the append * set to no limit, the file count is set to one, and the append
* mode is set to the given <tt>append</tt> argument. * mode is set to the given {@code append} argument.
* <p> * <p>
* There is no limit on the amount of data that may be written, * There is no limit on the amount of data that may be written,
* so use this with care. * so use this with care.
@ -314,7 +314,7 @@ public class FileHandler extends StreamHandler {
* @param append specifies append mode * @param append specifies append mode
* @exception IOException if there are IO problems opening the files. * @exception IOException if there are IO problems opening the files.
* @exception SecurityException if a security manager exists and if * @exception SecurityException if a security manager exists and if
* the caller does not have <tt>LoggingPermission("control")</tt>. * the caller does not have {@code LoggingPermission("control")}.
* @exception IllegalArgumentException if pattern is an empty string * @exception IllegalArgumentException if pattern is an empty string
*/ */
public FileHandler(String pattern, boolean append) throws IOException, public FileHandler(String pattern, boolean append) throws IOException,
@ -332,12 +332,12 @@ public class FileHandler extends StreamHandler {
} }
/** /**
* Initialize a <tt>FileHandler</tt> to write to a set of files. When * Initialize a {@code FileHandler} to write to a set of files. When
* (approximately) the given limit has been written to one file, * (approximately) the given limit has been written to one file,
* another file will be opened. The output will cycle through a set * another file will be opened. The output will cycle through a set
* of count files. * of count files.
* <p> * <p>
* The <tt>FileHandler</tt> is configured based on <tt>LogManager</tt> * The {@code FileHandler} is configured based on {@code LogManager}
* properties (or their default values) except that the given pattern * properties (or their default values) except that the given pattern
* argument is used as the filename pattern, the file limit is * argument is used as the filename pattern, the file limit is
* set to the limit argument, and the file count is set to the * set to the limit argument, and the file count is set to the
@ -350,7 +350,7 @@ public class FileHandler extends StreamHandler {
* @param count the number of files to use * @param count the number of files to use
* @exception IOException if there are IO problems opening the files. * @exception IOException if there are IO problems opening the files.
* @exception SecurityException if a security manager exists and if * @exception SecurityException if a security manager exists and if
* the caller does not have <tt>LoggingPermission("control")</tt>. * the caller does not have {@code LoggingPermission("control")}.
* @exception IllegalArgumentException if {@code limit < 0}, or {@code count < 1}. * @exception IllegalArgumentException if {@code limit < 0}, or {@code count < 1}.
* @exception IllegalArgumentException if pattern is an empty string * @exception IllegalArgumentException if pattern is an empty string
*/ */
@ -368,17 +368,17 @@ public class FileHandler extends StreamHandler {
} }
/** /**
* Initialize a <tt>FileHandler</tt> to write to a set of files * Initialize a {@code FileHandler} to write to a set of files
* with optional append. When (approximately) the given limit has * with optional append. When (approximately) the given limit has
* been written to one file, another file will be opened. The * been written to one file, another file will be opened. The
* output will cycle through a set of count files. * output will cycle through a set of count files.
* <p> * <p>
* The <tt>FileHandler</tt> is configured based on <tt>LogManager</tt> * The {@code FileHandler} is configured based on {@code LogManager}
* properties (or their default values) except that the given pattern * properties (or their default values) except that the given pattern
* argument is used as the filename pattern, the file limit is * argument is used as the filename pattern, the file limit is
* set to the limit argument, and the file count is set to the * set to the limit argument, and the file count is set to the
* given count argument, and the append mode is set to the given * given count argument, and the append mode is set to the given
* <tt>append</tt> argument. * {@code append} argument.
* <p> * <p>
* The count must be at least 1. * The count must be at least 1.
* *
@ -388,7 +388,7 @@ public class FileHandler extends StreamHandler {
* @param append specifies append mode * @param append specifies append mode
* @exception IOException if there are IO problems opening the files. * @exception IOException if there are IO problems opening the files.
* @exception SecurityException if a security manager exists and if * @exception SecurityException if a security manager exists and if
* the caller does not have <tt>LoggingPermission("control")</tt>. * the caller does not have {@code LoggingPermission("control")}.
* @exception IllegalArgumentException if {@code limit < 0}, or {@code count < 1}. * @exception IllegalArgumentException if {@code limit < 0}, or {@code count < 1}.
* @exception IllegalArgumentException if pattern is an empty string * @exception IllegalArgumentException if pattern is an empty string
* *
@ -711,7 +711,7 @@ public class FileHandler extends StreamHandler {
} }
/** /**
* Format and publish a <tt>LogRecord</tt>. * Format and publish a {@code LogRecord}.
* *
* @param record description of the log event. A null record is * @param record description of the log event. A null record is
* silently ignored and is not published * silently ignored and is not published
@ -743,7 +743,7 @@ public class FileHandler extends StreamHandler {
* Close all the files. * Close all the files.
* *
* @exception SecurityException if a security manager exists and if * @exception SecurityException if a security manager exists and if
* the caller does not have <tt>LoggingPermission("control")</tt>. * the caller does not have {@code LoggingPermission("control")}.
*/ */
@Override @Override
public synchronized void close() throws SecurityException { public synchronized void close() throws SecurityException {

View file

@ -32,18 +32,18 @@ import java.security.AccessController;
import java.security.PrivilegedAction; import java.security.PrivilegedAction;
/** /**
* A <tt>Handler</tt> object takes log messages from a <tt>Logger</tt> and * A {@code Handler} object takes log messages from a {@code Logger} and
* exports them. It might for example, write them to a console * exports them. It might for example, write them to a console
* or write them to a file, or send them to a network logging service, * or write them to a file, or send them to a network logging service,
* or forward them to an OS log, or whatever. * or forward them to an OS log, or whatever.
* <p> * <p>
* A <tt>Handler</tt> can be disabled by doing a <tt>setLevel(Level.OFF)</tt> * A {@code Handler} can be disabled by doing a {@code setLevel(Level.OFF)}
* and can be re-enabled by doing a <tt>setLevel</tt> with an appropriate level. * and can be re-enabled by doing a {@code setLevel} with an appropriate level.
* <p> * <p>
* <tt>Handler</tt> classes typically use <tt>LogManager</tt> properties to set * {@code Handler} classes typically use {@code LogManager} properties to set
* default values for the <tt>Handler</tt>'s <tt>Filter</tt>, <tt>Formatter</tt>, * default values for the {@code Handler}'s {@code Filter}, {@code Formatter},
* and <tt>Level</tt>. See the specific documentation for each concrete * and {@code Level}. See the specific documentation for each concrete
* <tt>Handler</tt> class. * {@code Handler} class.
* *
* *
* @since 1.4 * @since 1.4
@ -67,10 +67,10 @@ public abstract class Handler {
private volatile String encoding; private volatile String encoding;
/** /**
* Default constructor. The resulting <tt>Handler</tt> has a log * Default constructor. The resulting {@code Handler} has a log
* level of <tt>Level.ALL</tt>, no <tt>Formatter</tt>, and no * level of {@code Level.ALL}, no {@code Formatter}, and no
* <tt>Filter</tt>. A default <tt>ErrorManager</tt> instance is installed * {@code Filter}. A default {@code ErrorManager} instance is installed
* as the <tt>ErrorManager</tt>. * as the {@code ErrorManager}.
*/ */
protected Handler() { protected Handler() {
} }
@ -122,12 +122,12 @@ public abstract class Handler {
} }
/** /**
* Publish a <tt>LogRecord</tt>. * Publish a {@code LogRecord}.
* <p> * <p>
* The logging request was made initially to a <tt>Logger</tt> object, * The logging request was made initially to a {@code Logger} object,
* which initialized the <tt>LogRecord</tt> and forwarded it here. * which initialized the {@code LogRecord} and forwarded it here.
* <p> * <p>
* The <tt>Handler</tt> is responsible for formatting the message, when and * The {@code Handler} is responsible for formatting the message, when and
* if necessary. The formatting should include localization. * if necessary. The formatting should include localization.
* *
* @param record description of the log event. A null record is * @param record description of the log event. A null record is
@ -141,28 +141,28 @@ public abstract class Handler {
public abstract void flush(); public abstract void flush();
/** /**
* Close the <tt>Handler</tt> and free all associated resources. * Close the {@code Handler} and free all associated resources.
* <p> * <p>
* The close method will perform a <tt>flush</tt> and then close the * The close method will perform a {@code flush} and then close the
* <tt>Handler</tt>. After close has been called this <tt>Handler</tt> * {@code Handler}. After close has been called this {@code Handler}
* should no longer be used. Method calls may either be silently * should no longer be used. Method calls may either be silently
* ignored or may throw runtime exceptions. * ignored or may throw runtime exceptions.
* *
* @exception SecurityException if a security manager exists and if * @exception SecurityException if a security manager exists and if
* the caller does not have <tt>LoggingPermission("control")</tt>. * the caller does not have {@code LoggingPermission("control")}.
*/ */
public abstract void close() throws SecurityException; public abstract void close() throws SecurityException;
/** /**
* Set a <tt>Formatter</tt>. This <tt>Formatter</tt> will be used * Set a {@code Formatter}. This {@code Formatter} will be used
* to format <tt>LogRecords</tt> for this <tt>Handler</tt>. * to format {@code LogRecords} for this {@code Handler}.
* <p> * <p>
* Some <tt>Handlers</tt> may not use <tt>Formatters</tt>, in * Some {@code Handlers} may not use {@code Formatters}, in
* which case the <tt>Formatter</tt> will be remembered, but not used. * which case the {@code Formatter} will be remembered, but not used.
* *
* @param newFormatter the <tt>Formatter</tt> to use (may not be null) * @param newFormatter the {@code Formatter} to use (may not be null)
* @exception SecurityException if a security manager exists and if * @exception SecurityException if a security manager exists and if
* the caller does not have <tt>LoggingPermission("control")</tt>. * the caller does not have {@code LoggingPermission("control")}.
*/ */
public synchronized void setFormatter(Formatter newFormatter) throws SecurityException { public synchronized void setFormatter(Formatter newFormatter) throws SecurityException {
checkPermission(); checkPermission();
@ -170,23 +170,23 @@ public abstract class Handler {
} }
/** /**
* Return the <tt>Formatter</tt> for this <tt>Handler</tt>. * Return the {@code Formatter} for this {@code Handler}.
* @return the <tt>Formatter</tt> (may be null). * @return the {@code Formatter} (may be null).
*/ */
public Formatter getFormatter() { public Formatter getFormatter() {
return formatter; return formatter;
} }
/** /**
* Set the character encoding used by this <tt>Handler</tt>. * Set the character encoding used by this {@code Handler}.
* <p> * <p>
* The encoding should be set before any <tt>LogRecords</tt> are written * The encoding should be set before any {@code LogRecords} are written
* to the <tt>Handler</tt>. * to the {@code Handler}.
* *
* @param encoding The name of a supported character encoding. * @param encoding The name of a supported character encoding.
* May be null, to indicate the default platform encoding. * May be null, to indicate the default platform encoding.
* @exception SecurityException if a security manager exists and if * @exception SecurityException if a security manager exists and if
* the caller does not have <tt>LoggingPermission("control")</tt>. * the caller does not have {@code LoggingPermission("control")}.
* @exception UnsupportedEncodingException if the named encoding is * @exception UnsupportedEncodingException if the named encoding is
* not supported. * not supported.
*/ */
@ -206,7 +206,7 @@ public abstract class Handler {
} }
/** /**
* Return the character encoding for this <tt>Handler</tt>. * Return the character encoding for this {@code Handler}.
* *
* @return The encoding name. May be null, which indicates the * @return The encoding name. May be null, which indicates the
* default encoding should be used. * default encoding should be used.
@ -216,15 +216,15 @@ public abstract class Handler {
} }
/** /**
* Set a <tt>Filter</tt> to control output on this <tt>Handler</tt>. * Set a {@code Filter} to control output on this {@code Handler}.
* <P> * <P>
* For each call of <tt>publish</tt> the <tt>Handler</tt> will call * For each call of {@code publish} the {@code Handler} will call
* this <tt>Filter</tt> (if it is non-null) to check if the * this {@code Filter} (if it is non-null) to check if the
* <tt>LogRecord</tt> should be published or discarded. * {@code LogRecord} should be published or discarded.
* *
* @param newFilter a <tt>Filter</tt> object (may be null) * @param newFilter a {@code Filter} object (may be null)
* @exception SecurityException if a security manager exists and if * @exception SecurityException if a security manager exists and if
* the caller does not have <tt>LoggingPermission("control")</tt>. * the caller does not have {@code LoggingPermission("control")}.
*/ */
public synchronized void setFilter(Filter newFilter) throws SecurityException { public synchronized void setFilter(Filter newFilter) throws SecurityException {
checkPermission(); checkPermission();
@ -232,9 +232,9 @@ public abstract class Handler {
} }
/** /**
* Get the current <tt>Filter</tt> for this <tt>Handler</tt>. * Get the current {@code Filter} for this {@code Handler}.
* *
* @return a <tt>Filter</tt> object (may be null) * @return a {@code Filter} object (may be null)
*/ */
public Filter getFilter() { public Filter getFilter() {
return filter; return filter;
@ -248,7 +248,7 @@ public abstract class Handler {
* *
* @param em the new ErrorManager * @param em the new ErrorManager
* @exception SecurityException if a security manager exists and if * @exception SecurityException if a security manager exists and if
* the caller does not have <tt>LoggingPermission("control")</tt>. * the caller does not have {@code LoggingPermission("control")}.
*/ */
public synchronized void setErrorManager(ErrorManager em) { public synchronized void setErrorManager(ErrorManager em) {
checkPermission(); checkPermission();
@ -263,7 +263,7 @@ public abstract class Handler {
* *
* @return the ErrorManager for this Handler * @return the ErrorManager for this Handler
* @exception SecurityException if a security manager exists and if * @exception SecurityException if a security manager exists and if
* the caller does not have <tt>LoggingPermission("control")</tt>. * the caller does not have {@code LoggingPermission("control")}.
*/ */
public ErrorManager getErrorManager() { public ErrorManager getErrorManager() {
checkPermission(); checkPermission();
@ -291,16 +291,16 @@ public abstract class Handler {
/** /**
* Set the log level specifying which message levels will be * Set the log level specifying which message levels will be
* logged by this <tt>Handler</tt>. Message levels lower than this * logged by this {@code Handler}. Message levels lower than this
* value will be discarded. * value will be discarded.
* <p> * <p>
* The intention is to allow developers to turn on voluminous * The intention is to allow developers to turn on voluminous
* logging, but to limit the messages that are sent to certain * logging, but to limit the messages that are sent to certain
* <tt>Handlers</tt>. * {@code Handlers}.
* *
* @param newLevel the new value for the log level * @param newLevel the new value for the log level
* @exception SecurityException if a security manager exists and if * @exception SecurityException if a security manager exists and if
* the caller does not have <tt>LoggingPermission("control")</tt>. * the caller does not have {@code LoggingPermission("control")}.
*/ */
public synchronized void setLevel(Level newLevel) throws SecurityException { public synchronized void setLevel(Level newLevel) throws SecurityException {
if (newLevel == null) { if (newLevel == null) {
@ -312,7 +312,7 @@ public abstract class Handler {
/** /**
* Get the log level specifying which messages will be * Get the log level specifying which messages will be
* logged by this <tt>Handler</tt>. Message levels lower * logged by this {@code Handler}. Message levels lower
* than this level will be discarded. * than this level will be discarded.
* @return the level of messages being logged. * @return the level of messages being logged.
*/ */
@ -321,16 +321,16 @@ public abstract class Handler {
} }
/** /**
* Check if this <tt>Handler</tt> would actually log a given <tt>LogRecord</tt>. * Check if this {@code Handler} would actually log a given {@code LogRecord}.
* <p> * <p>
* This method checks if the <tt>LogRecord</tt> has an appropriate * This method checks if the {@code LogRecord} has an appropriate
* <tt>Level</tt> and whether it satisfies any <tt>Filter</tt>. It also * {@code Level} and whether it satisfies any {@code Filter}. It also
* may make other <tt>Handler</tt> specific checks that might prevent a * may make other {@code Handler} specific checks that might prevent a
* handler from logging the <tt>LogRecord</tt>. It will return false if * handler from logging the {@code LogRecord}. It will return false if
* the <tt>LogRecord</tt> is null. * the {@code LogRecord} is null.
* *
* @param record a <tt>LogRecord</tt> * @param record a {@code LogRecord}
* @return true if the <tt>LogRecord</tt> would be logged. * @return true if the {@code LogRecord} would be logged.
* *
*/ */
public boolean isLoggable(LogRecord record) { public boolean isLoggable(LogRecord record) {

View file

@ -72,7 +72,7 @@ import sun.misc.SharedSecrets;
* loaded, an object will be instantiated, and that object's constructor * loaded, an object will be instantiated, and that object's constructor
* is responsible for reading in the initial configuration. (That object * is responsible for reading in the initial configuration. (That object
* may use other system properties to control its configuration.) The * may use other system properties to control its configuration.) The
* alternate configuration class can use <tt>readConfiguration(InputStream)</tt> * alternate configuration class can use {@code readConfiguration(InputStream)}
* to define properties in the LogManager. * to define properties in the LogManager.
* <p> * <p>
* If "java.util.logging.config.class" property is <b>not</b> set, * If "java.util.logging.config.class" property is <b>not</b> set,
@ -1800,7 +1800,7 @@ public class LogManager {
= "java.util.logging:type=Logging"; = "java.util.logging:type=Logging";
/** /**
* Returns <tt>LoggingMXBean</tt> for managing loggers. * Returns {@code LoggingMXBean} for managing loggers.
* An alternative way to manage loggers is through the * An alternative way to manage loggers is through the
* {@link java.lang.management.PlatformLoggingMXBean} interface * {@link java.lang.management.PlatformLoggingMXBean} interface
* that can be obtained by calling: * that can be obtained by calling:

View file

@ -65,7 +65,7 @@ import sun.reflect.Reflection;
* <p> * <p>
* Each Logger has a "Level" associated with it. This reflects * Each Logger has a "Level" associated with it. This reflects
* a minimum Level that this logger cares about. If a Logger's * a minimum Level that this logger cares about. If a Logger's
* level is set to <tt>null</tt>, then its effective level is inherited * level is set to {@code null}, then its effective level is inherited
* from its parent, which may in turn obtain it recursively from its * from its parent, which may in turn obtain it recursively from its
* parent, and so on up the tree. * parent, and so on up the tree.
* <p> * <p>
@ -74,7 +74,7 @@ import sun.reflect.Reflection;
* of the LogManager class. However it may also be dynamically changed * of the LogManager class. However it may also be dynamically changed
* by calls on the Logger.setLevel method. If a logger's level is * by calls on the Logger.setLevel method. If a logger's level is
* changed the change may also affect child loggers, since any child * changed the change may also affect child loggers, since any child
* logger that has <tt>null</tt> as its level will inherit its * logger that has {@code null} as its level will inherit its
* effective level from its parent. * effective level from its parent.
* <p> * <p>
* On each logging call the Logger initially performs a cheap * On each logging call the Logger initially performs a cheap
@ -116,25 +116,25 @@ import sun.reflect.Reflection;
* unnecessary message construction. For example, if the developer wants to * unnecessary message construction. For example, if the developer wants to
* log system health status for diagnosis, with the String-accepting version, * log system health status for diagnosis, with the String-accepting version,
* the code would look like: * the code would look like:
<pre><code> * <pre>{@code
*
class DiagnosisMessages { * class DiagnosisMessages {
static String systemHealthStatus() { * static String systemHealthStatus() {
// collect system health information * // collect system health information
... * ...
} * }
} * }
... * ...
logger.log(Level.FINER, DiagnosisMessages.systemHealthStatus()); * logger.log(Level.FINER, DiagnosisMessages.systemHealthStatus());
</code></pre> * }</pre>
* With the above code, the health status is collected unnecessarily even when * With the above code, the health status is collected unnecessarily even when
* the log level FINER is disabled. With the Supplier-accepting version as * the log level FINER is disabled. With the Supplier-accepting version as
* below, the status will only be collected when the log level FINER is * below, the status will only be collected when the log level FINER is
* enabled. * enabled.
<pre><code> * <pre>{@code
*
logger.log(Level.FINER, DiagnosisMessages::systemHealthStatus); * logger.log(Level.FINER, DiagnosisMessages::systemHealthStatus);
</code></pre> * }</pre>
* <p> * <p>
* When looking for a {@code ResourceBundle}, the logger will first look at * When looking for a {@code ResourceBundle}, the logger will first look at
* whether a bundle was specified using {@link * whether a bundle was specified using {@link
@ -345,11 +345,11 @@ public class Logger {
* which may cause deadlocks with the LogManager class initialization. * which may cause deadlocks with the LogManager class initialization.
* In such cases two class initialization wait for each other to complete. * In such cases two class initialization wait for each other to complete.
* The preferred way to get the global logger object is via the call * The preferred way to get the global logger object is via the call
* <code>Logger.getGlobal()</code>. * {@code Logger.getGlobal()}.
* For compatibility with old JDK versions where the * For compatibility with old JDK versions where the
* <code>Logger.getGlobal()</code> is not available use the call * {@code Logger.getGlobal()} is not available use the call
* <code>Logger.getLogger(Logger.GLOBAL_LOGGER_NAME)</code> * {@code Logger.getLogger(Logger.GLOBAL_LOGGER_NAME)}
* or <code>Logger.getLogger("global")</code>. * or {@code Logger.getLogger("global")}.
*/ */
@Deprecated @Deprecated
public static final Logger global = new Logger(GLOBAL_LOGGER_NAME); public static final Logger global = new Logger(GLOBAL_LOGGER_NAME);

View file

@ -32,7 +32,7 @@ import java.util.ArrayList;
/** /**
* Logging is the implementation class of LoggingMXBean. * Logging is the implementation class of LoggingMXBean.
* *
* The <tt>LoggingMXBean</tt> interface provides a standard * The {@code LoggingMXBean} interface provides a standard
* method for management access to the individual * method for management access to the individual
* {@code Logger} objects available at runtime. * {@code Logger} objects available at runtime.
* *

View file

@ -36,12 +36,12 @@ package java.util.logging;
* the {@code PlatformLoggingMXBean} object representing the management * the {@code PlatformLoggingMXBean} object representing the management
* interface for logging. * interface for logging.
* *
* <p>There is a single global instance of the <tt>LoggingMXBean</tt>. * <p>There is a single global instance of the {@code LoggingMXBean}.
* This instance is an {@link javax.management.MXBean MXBean} that * This instance is an {@link javax.management.MXBean MXBean} that
* can be obtained by calling the {@link LogManager#getLoggingMXBean} * can be obtained by calling the {@link LogManager#getLoggingMXBean}
* method or from the * method or from the
* {@linkplain java.lang.management.ManagementFactory#getPlatformMBeanServer * {@linkplain java.lang.management.ManagementFactory#getPlatformMBeanServer
* platform <tt>MBeanServer</tt>}. * platform MBeanServer}.
* <p> * <p>
* The {@link javax.management.ObjectName ObjectName} that uniquely identifies * The {@link javax.management.ObjectName ObjectName} that uniquely identifies
* the management interface for logging within the {@code MBeanServer} is: * the management interface for logging within the {@code MBeanServer} is:
@ -65,14 +65,14 @@ public interface LoggingMXBean {
* calls {@link LogManager#getLoggerNames} and returns a list * calls {@link LogManager#getLoggerNames} and returns a list
* of the logger names. * of the logger names.
* *
* @return A list of <tt>String</tt> each of which is a * @return A list of {@code String} each of which is a
* currently registered <tt>Logger</tt> name. * currently registered {@code Logger} name.
*/ */
public java.util.List<String> getLoggerNames(); public java.util.List<String> getLoggerNames();
/** /**
* Gets the name of the log level associated with the specified logger. * Gets the name of the log level associated with the specified logger.
* If the specified logger does not exist, <tt>null</tt> * If the specified logger does not exist, {@code null}
* is returned. * is returned.
* This method first finds the logger of the given name and * This method first finds the logger of the given name and
* then returns the name of the log level by calling: * then returns the name of the log level by calling:
@ -81,16 +81,16 @@ public interface LoggingMXBean {
* </blockquote> * </blockquote>
* *
* <p> * <p>
* If the <tt>Level</tt> of the specified logger is <tt>null</tt>, * If the {@code Level} of the specified logger is {@code null},
* which means that this logger's effective level is inherited * which means that this logger's effective level is inherited
* from its parent, an empty string will be returned. * from its parent, an empty string will be returned.
* *
* @param loggerName The name of the <tt>Logger</tt> to be retrieved. * @param loggerName The name of the {@code Logger} to be retrieved.
* *
* @return The name of the log level of the specified logger; or * @return The name of the log level of the specified logger; or
* an empty string if the log level of the specified logger * an empty string if the log level of the specified logger
* is <tt>null</tt>. If the specified logger does not * is {@code null}. If the specified logger does not
* exist, <tt>null</tt> is returned. * exist, {@code null} is returned.
* *
* @see Logger#getLevel * @see Logger#getLevel
*/ */
@ -98,22 +98,22 @@ public interface LoggingMXBean {
/** /**
* Sets the specified logger to the specified new level. * Sets the specified logger to the specified new level.
* If the <tt>levelName</tt> is not <tt>null</tt>, the level * If the {@code levelName} is not {@code null}, the level
* of the specified logger is set to the parsed <tt>Level</tt> * of the specified logger is set to the parsed {@code Level}
* matching the <tt>levelName</tt>. * matching the {@code levelName}.
* If the <tt>levelName</tt> is <tt>null</tt>, the level * If the {@code levelName} is {@code null}, the level
* of the specified logger is set to <tt>null</tt> and * of the specified logger is set to {@code null} and
* the effective level of the logger is inherited from * the effective level of the logger is inherited from
* its nearest ancestor with a specific (non-null) level value. * its nearest ancestor with a specific (non-null) level value.
* *
* @param loggerName The name of the <tt>Logger</tt> to be set. * @param loggerName The name of the {@code Logger} to be set.
* Must be non-null. * Must be non-null.
* @param levelName The name of the level to set on the specified logger, * @param levelName The name of the level to set on the specified logger,
* or <tt>null</tt> if setting the level to inherit * or {@code null} if setting the level to inherit
* from its nearest ancestor. * from its nearest ancestor.
* *
* @throws IllegalArgumentException if the specified logger * @throws IllegalArgumentException if the specified logger
* does not exist, or <tt>levelName</tt> is not a valid level name. * does not exist, or {@code levelName} is not a valid level name.
* *
* @throws SecurityException if a security manager exists and if * @throws SecurityException if a security manager exists and if
* the caller does not have LoggingPermission("control"). * the caller does not have LoggingPermission("control").
@ -124,15 +124,15 @@ public interface LoggingMXBean {
/** /**
* Returns the name of the parent for the specified logger. * Returns the name of the parent for the specified logger.
* If the specified logger does not exist, <tt>null</tt> is returned. * If the specified logger does not exist, {@code null} is returned.
* If the specified logger is the root <tt>Logger</tt> in the namespace, * If the specified logger is the root {@code Logger} in the namespace,
* the result will be an empty string. * the result will be an empty string.
* *
* @param loggerName The name of a <tt>Logger</tt>. * @param loggerName The name of a {@code Logger}.
* *
* @return the name of the nearest existing parent logger; * @return the name of the nearest existing parent logger;
* an empty string if the specified logger is the root logger. * an empty string if the specified logger is the root logger.
* If the specified logger does not exist, <tt>null</tt> * If the specified logger does not exist, {@code null}
* is returned. * is returned.
*/ */
public String getParentLoggerName(String loggerName); public String getParentLoggerName(String loggerName);

View file

@ -26,48 +26,48 @@
package java.util.logging; package java.util.logging;
/** /**
* <tt>Handler</tt> that buffers requests in a circular buffer in memory. * {@code Handler} that buffers requests in a circular buffer in memory.
* <p> * <p>
* Normally this <tt>Handler</tt> simply stores incoming <tt>LogRecords</tt> * Normally this {@code Handler} simply stores incoming {@code LogRecords}
* into its memory buffer and discards earlier records. This buffering * into its memory buffer and discards earlier records. This buffering
* is very cheap and avoids formatting costs. On certain trigger * is very cheap and avoids formatting costs. On certain trigger
* conditions, the <tt>MemoryHandler</tt> will push out its current buffer * conditions, the {@code MemoryHandler} will push out its current buffer
* contents to a target <tt>Handler</tt>, which will typically publish * contents to a target {@code Handler}, which will typically publish
* them to the outside world. * them to the outside world.
* <p> * <p>
* There are three main models for triggering a push of the buffer: * There are three main models for triggering a push of the buffer:
* <ul> * <ul>
* <li> * <li>
* An incoming <tt>LogRecord</tt> has a type that is greater than * An incoming {@code LogRecord} has a type that is greater than
* a pre-defined level, the <tt>pushLevel</tt>. </li> * a pre-defined level, the {@code pushLevel}. </li>
* <li> * <li>
* An external class calls the <tt>push</tt> method explicitly. </li> * An external class calls the {@code push} method explicitly. </li>
* <li> * <li>
* A subclass overrides the <tt>log</tt> method and scans each incoming * A subclass overrides the {@code log} method and scans each incoming
* <tt>LogRecord</tt> and calls <tt>push</tt> if a record matches some * {@code LogRecord} and calls {@code push} if a record matches some
* desired criteria. </li> * desired criteria. </li>
* </ul> * </ul>
* <p> * <p>
* <b>Configuration:</b> * <b>Configuration:</b>
* By default each <tt>MemoryHandler</tt> is initialized using the following * By default each {@code MemoryHandler} is initialized using the following
* <tt>LogManager</tt> configuration properties where <tt>&lt;handler-name&gt;</tt> * {@code LogManager} configuration properties where {@code <handler-name>}
* refers to the fully-qualified class name of the handler. * refers to the fully-qualified class name of the handler.
* If properties are not defined * If properties are not defined
* (or have invalid values) then the specified default values are used. * (or have invalid values) then the specified default values are used.
* If no default value is defined then a RuntimeException is thrown. * If no default value is defined then a RuntimeException is thrown.
* <ul> * <ul>
* <li> &lt;handler-name&gt;.level * <li> &lt;handler-name&gt;.level
* specifies the level for the <tt>Handler</tt> * specifies the level for the {@code Handler}
* (defaults to <tt>Level.ALL</tt>). </li> * (defaults to {@code Level.ALL}). </li>
* <li> &lt;handler-name&gt;.filter * <li> &lt;handler-name&gt;.filter
* specifies the name of a <tt>Filter</tt> class to use * specifies the name of a {@code Filter} class to use
* (defaults to no <tt>Filter</tt>). </li> * (defaults to no {@code Filter}). </li>
* <li> &lt;handler-name&gt;.size * <li> &lt;handler-name&gt;.size
* defines the buffer size (defaults to 1000). </li> * defines the buffer size (defaults to 1000). </li>
* <li> &lt;handler-name&gt;.push * <li> &lt;handler-name&gt;.push
* defines the <tt>pushLevel</tt> (defaults to <tt>level.SEVERE</tt>). </li> * defines the {@code pushLevel} (defaults to {@code level.SEVERE}). </li>
* <li> &lt;handler-name&gt;.target * <li> &lt;handler-name&gt;.target
* specifies the name of the target <tt>Handler </tt> class. * specifies the name of the target {@code Handler } class.
* (no default). </li> * (no default). </li>
* </ul> * </ul>
* <p> * <p>
@ -95,8 +95,8 @@ public class MemoryHandler extends Handler {
int start, count; int start, count;
/** /**
* Create a <tt>MemoryHandler</tt> and configure it based on * Create a {@code MemoryHandler} and configure it based on
* <tt>LogManager</tt> configuration properties. * {@code LogManager} configuration properties.
*/ */
public MemoryHandler() { public MemoryHandler() {
// configure with specific defaults for MemoryHandler // configure with specific defaults for MemoryHandler
@ -132,10 +132,10 @@ public class MemoryHandler extends Handler {
} }
/** /**
* Create a <tt>MemoryHandler</tt>. * Create a {@code MemoryHandler}.
* <p> * <p>
* The <tt>MemoryHandler</tt> is configured based on <tt>LogManager</tt> * The {@code MemoryHandler} is configured based on {@code LogManager}
* properties (or their default values) except that the given <tt>pushLevel</tt> * properties (or their default values) except that the given {@code pushLevel}
* argument and buffer size argument are used. * argument and buffer size argument are used.
* *
* @param target the Handler to which to publish output. * @param target the Handler to which to publish output.
@ -161,16 +161,16 @@ public class MemoryHandler extends Handler {
} }
/** /**
* Store a <tt>LogRecord</tt> in an internal buffer. * Store a {@code LogRecord} in an internal buffer.
* <p> * <p>
* If there is a <tt>Filter</tt>, its <tt>isLoggable</tt> * If there is a {@code Filter}, its {@code isLoggable}
* method is called to check if the given log record is loggable. * method is called to check if the given log record is loggable.
* If not we return. Otherwise the given record is copied into * If not we return. Otherwise the given record is copied into
* an internal circular buffer. Then the record's level property is * an internal circular buffer. Then the record's level property is
* compared with the <tt>pushLevel</tt>. If the given level is * compared with the {@code pushLevel}. If the given level is
* greater than or equal to the <tt>pushLevel</tt> then <tt>push</tt> * greater than or equal to the {@code pushLevel} then {@code push}
* is called to write all buffered records to the target output * is called to write all buffered records to the target output
* <tt>Handler</tt>. * {@code Handler}.
* *
* @param record description of the log event. A null record is * @param record description of the log event. A null record is
* silently ignored and is not published * silently ignored and is not published
@ -194,7 +194,7 @@ public class MemoryHandler extends Handler {
} }
/** /**
* Push any buffered output to the target <tt>Handler</tt>. * Push any buffered output to the target {@code Handler}.
* <p> * <p>
* The buffer is then cleared. * The buffer is then cleared.
*/ */
@ -210,9 +210,9 @@ public class MemoryHandler extends Handler {
} }
/** /**
* Causes a flush on the target <tt>Handler</tt>. * Causes a flush on the target {@code Handler}.
* <p> * <p>
* Note that the current contents of the <tt>MemoryHandler</tt> * Note that the current contents of the {@code MemoryHandler}
* buffer are <b>not</b> written out. That requires a "push". * buffer are <b>not</b> written out. That requires a "push".
*/ */
@Override @Override
@ -221,11 +221,11 @@ public class MemoryHandler extends Handler {
} }
/** /**
* Close the <tt>Handler</tt> and free all associated resources. * Close the {@code Handler} and free all associated resources.
* This will also close the target <tt>Handler</tt>. * This will also close the target {@code Handler}.
* *
* @exception SecurityException if a security manager exists and if * @exception SecurityException if a security manager exists and if
* the caller does not have <tt>LoggingPermission("control")</tt>. * the caller does not have {@code LoggingPermission("control")}.
*/ */
@Override @Override
public void close() throws SecurityException { public void close() throws SecurityException {
@ -234,13 +234,13 @@ public class MemoryHandler extends Handler {
} }
/** /**
* Set the <tt>pushLevel</tt>. After a <tt>LogRecord</tt> is copied * Set the {@code pushLevel}. After a {@code LogRecord} is copied
* into our internal buffer, if its level is greater than or equal to * into our internal buffer, if its level is greater than or equal to
* the <tt>pushLevel</tt>, then <tt>push</tt> will be called. * the {@code pushLevel}, then {@code push} will be called.
* *
* @param newLevel the new value of the <tt>pushLevel</tt> * @param newLevel the new value of the {@code pushLevel}
* @exception SecurityException if a security manager exists and if * @exception SecurityException if a security manager exists and if
* the caller does not have <tt>LoggingPermission("control")</tt>. * the caller does not have {@code LoggingPermission("control")}.
*/ */
public synchronized void setPushLevel(Level newLevel) throws SecurityException { public synchronized void setPushLevel(Level newLevel) throws SecurityException {
if (newLevel == null) { if (newLevel == null) {
@ -251,25 +251,25 @@ public class MemoryHandler extends Handler {
} }
/** /**
* Get the <tt>pushLevel</tt>. * Get the {@code pushLevel}.
* *
* @return the value of the <tt>pushLevel</tt> * @return the value of the {@code pushLevel}
*/ */
public Level getPushLevel() { public Level getPushLevel() {
return pushLevel; return pushLevel;
} }
/** /**
* Check if this <tt>Handler</tt> would actually log a given * Check if this {@code Handler} would actually log a given
* <tt>LogRecord</tt> into its internal buffer. * {@code LogRecord} into its internal buffer.
* <p> * <p>
* This method checks if the <tt>LogRecord</tt> has an appropriate level and * This method checks if the {@code LogRecord} has an appropriate level and
* whether it satisfies any <tt>Filter</tt>. However it does <b>not</b> * whether it satisfies any {@code Filter}. However it does <b>not</b>
* check whether the <tt>LogRecord</tt> would result in a "push" of the * check whether the {@code LogRecord} would result in a "push" of the
* buffer contents. It will return false if the <tt>LogRecord</tt> is null. * buffer contents. It will return false if the {@code LogRecord} is null.
* *
* @param record a <tt>LogRecord</tt> * @param record a {@code LogRecord}
* @return true if the <tt>LogRecord</tt> would be logged. * @return true if the {@code LogRecord} would be logged.
* *
*/ */
@Override @Override

View file

@ -30,27 +30,27 @@ import java.io.*;
import java.net.*; import java.net.*;
/** /**
* Simple network logging <tt>Handler</tt>. * Simple network logging {@code Handler}.
* <p> * <p>
* <tt>LogRecords</tt> are published to a network stream connection. By default * {@code LogRecords} are published to a network stream connection. By default
* the <tt>XMLFormatter</tt> class is used for formatting. * the {@code XMLFormatter} class is used for formatting.
* <p> * <p>
* <b>Configuration:</b> * <b>Configuration:</b>
* By default each <tt>SocketHandler</tt> is initialized using the following * By default each {@code SocketHandler} is initialized using the following
* <tt>LogManager</tt> configuration properties where <tt>&lt;handler-name&gt;</tt> * {@code LogManager} configuration properties where {@code <handler-name>}
* refers to the fully-qualified class name of the handler. * refers to the fully-qualified class name of the handler.
* If properties are not defined * If properties are not defined
* (or have invalid values) then the specified default values are used. * (or have invalid values) then the specified default values are used.
* <ul> * <ul>
* <li> &lt;handler-name&gt;.level * <li> &lt;handler-name&gt;.level
* specifies the default level for the <tt>Handler</tt> * specifies the default level for the {@code Handler}
* (defaults to <tt>Level.ALL</tt>). </li> * (defaults to {@code Level.ALL}). </li>
* <li> &lt;handler-name&gt;.filter * <li> &lt;handler-name&gt;.filter
* specifies the name of a <tt>Filter</tt> class to use * specifies the name of a {@code Filter} class to use
* (defaults to no <tt>Filter</tt>). </li> * (defaults to no {@code Filter}). </li>
* <li> &lt;handler-name&gt;.formatter * <li> &lt;handler-name&gt;.formatter
* specifies the name of a <tt>Formatter</tt> class to use * specifies the name of a {@code Formatter} class to use
* (defaults to <tt>java.util.logging.XMLFormatter</tt>). </li> * (defaults to {@code java.util.logging.XMLFormatter}). </li>
* <li> &lt;handler-name&gt;.encoding * <li> &lt;handler-name&gt;.encoding
* the name of the character set encoding to use (defaults to * the name of the character set encoding to use (defaults to
* the default platform encoding). </li> * the default platform encoding). </li>
@ -73,7 +73,7 @@ import java.net.*;
* </ul> * </ul>
* <p> * <p>
* The output IO stream is buffered, but is flushed after each * The output IO stream is buffered, but is flushed after each
* <tt>LogRecord</tt> is written. * {@code LogRecord} is written.
* *
* @since 1.4 * @since 1.4
*/ */
@ -84,7 +84,7 @@ public class SocketHandler extends StreamHandler {
private int port; private int port;
/** /**
* Create a <tt>SocketHandler</tt>, using only <tt>LogManager</tt> properties * Create a {@code SocketHandler}, using only {@code LogManager} properties
* (or their defaults). * (or their defaults).
* @throws IllegalArgumentException if the host or port are invalid or * @throws IllegalArgumentException if the host or port are invalid or
* are not specified as LogManager properties. * are not specified as LogManager properties.
@ -109,9 +109,9 @@ public class SocketHandler extends StreamHandler {
} }
/** /**
* Construct a <tt>SocketHandler</tt> using a specified host and port. * Construct a {@code SocketHandler} using a specified host and port.
* *
* The <tt>SocketHandler</tt> is configured based on <tt>LogManager</tt> * The {@code SocketHandler} is configured based on {@code LogManager}
* properties (or their default values) except that the given target host * properties (or their default values) except that the given target host
* and port arguments are used. If the host argument is empty, but not * and port arguments are used. If the host argument is empty, but not
* null String then the localhost is used. * null String then the localhost is used.
@ -153,7 +153,7 @@ public class SocketHandler extends StreamHandler {
* Close this output stream. * Close this output stream.
* *
* @exception SecurityException if a security manager exists and if * @exception SecurityException if a security manager exists and if
* the caller does not have <tt>LoggingPermission("control")</tt>. * the caller does not have {@code LoggingPermission("control")}.
*/ */
@Override @Override
public synchronized void close() throws SecurityException { public synchronized void close() throws SecurityException {
@ -169,7 +169,7 @@ public class SocketHandler extends StreamHandler {
} }
/** /**
* Format and publish a <tt>LogRecord</tt>. * Format and publish a {@code LogRecord}.
* *
* @param record description of the log event. A null record is * @param record description of the log event. A null record is
* silently ignored and is not published * silently ignored and is not published

View file

@ -32,29 +32,29 @@ import java.security.PrivilegedAction;
import java.util.Objects; import java.util.Objects;
/** /**
* Stream based logging <tt>Handler</tt>. * Stream based logging {@code Handler}.
* <p> * <p>
* This is primarily intended as a base class or support class to * This is primarily intended as a base class or support class to
* be used in implementing other logging <tt>Handlers</tt>. * be used in implementing other logging {@code Handlers}.
* <p> * <p>
* <tt>LogRecords</tt> are published to a given <tt>java.io.OutputStream</tt>. * {@code LogRecords} are published to a given {@code java.io.OutputStream}.
* <p> * <p>
* <b>Configuration:</b> * <b>Configuration:</b>
* By default each <tt>StreamHandler</tt> is initialized using the following * By default each {@code StreamHandler} is initialized using the following
* <tt>LogManager</tt> configuration properties where <tt>&lt;handler-name&gt;</tt> * {@code LogManager} configuration properties where {@code <handler-name>}
* refers to the fully-qualified class name of the handler. * refers to the fully-qualified class name of the handler.
* If properties are not defined * If properties are not defined
* (or have invalid values) then the specified default values are used. * (or have invalid values) then the specified default values are used.
* <ul> * <ul>
* <li> &lt;handler-name&gt;.level * <li> &lt;handler-name&gt;.level
* specifies the default level for the <tt>Handler</tt> * specifies the default level for the {@code Handler}
* (defaults to <tt>Level.INFO</tt>). </li> * (defaults to {@code Level.INFO}). </li>
* <li> &lt;handler-name&gt;.filter * <li> &lt;handler-name&gt;.filter
* specifies the name of a <tt>Filter</tt> class to use * specifies the name of a {@code Filter} class to use
* (defaults to no <tt>Filter</tt>). </li> * (defaults to no {@code Filter}). </li>
* <li> &lt;handler-name&gt;.formatter * <li> &lt;handler-name&gt;.formatter
* specifies the name of a <tt>Formatter</tt> class to use * specifies the name of a {@code Formatter} class to use
* (defaults to <tt>java.util.logging.SimpleFormatter</tt>). </li> * (defaults to {@code java.util.logging.SimpleFormatter}). </li>
* <li> &lt;handler-name&gt;.encoding * <li> &lt;handler-name&gt;.encoding
* the name of the character set encoding to use (defaults to * the name of the character set encoding to use (defaults to
* the default platform encoding). </li> * the default platform encoding). </li>
@ -81,7 +81,7 @@ public class StreamHandler extends Handler {
private volatile Writer writer; private volatile Writer writer;
/** /**
* Create a <tt>StreamHandler</tt>, with no current output stream. * Create a {@code StreamHandler}, with no current output stream.
*/ */
public StreamHandler() { public StreamHandler() {
// configure with specific defaults for StreamHandler // configure with specific defaults for StreamHandler
@ -89,7 +89,7 @@ public class StreamHandler extends Handler {
} }
/** /**
* Create a <tt>StreamHandler</tt> with a given <tt>Formatter</tt> * Create a {@code StreamHandler} with a given {@code Formatter}
* and output stream. * and output stream.
* *
* @param out the target output stream * @param out the target output stream
@ -114,13 +114,13 @@ public class StreamHandler extends Handler {
/** /**
* Change the output stream. * Change the output stream.
* <P> * <P>
* If there is a current output stream then the <tt>Formatter</tt>'s * If there is a current output stream then the {@code Formatter}'s
* tail string is written and the stream is flushed and closed. * tail string is written and the stream is flushed and closed.
* Then the output stream is replaced with the new output stream. * Then the output stream is replaced with the new output stream.
* *
* @param out New output stream. May not be null. * @param out New output stream. May not be null.
* @exception SecurityException if a security manager exists and if * @exception SecurityException if a security manager exists and if
* the caller does not have <tt>LoggingPermission("control")</tt>. * the caller does not have {@code LoggingPermission("control")}.
*/ */
protected synchronized void setOutputStream(OutputStream out) throws SecurityException { protected synchronized void setOutputStream(OutputStream out) throws SecurityException {
if (out == null) { if (out == null) {
@ -144,15 +144,15 @@ public class StreamHandler extends Handler {
} }
/** /**
* Set (or change) the character encoding used by this <tt>Handler</tt>. * Set (or change) the character encoding used by this {@code Handler}.
* <p> * <p>
* The encoding should be set before any <tt>LogRecords</tt> are written * The encoding should be set before any {@code LogRecords} are written
* to the <tt>Handler</tt>. * to the {@code Handler}.
* *
* @param encoding The name of a supported character encoding. * @param encoding The name of a supported character encoding.
* May be null, to indicate the default platform encoding. * May be null, to indicate the default platform encoding.
* @exception SecurityException if a security manager exists and if * @exception SecurityException if a security manager exists and if
* the caller does not have <tt>LoggingPermission("control")</tt>. * the caller does not have {@code LoggingPermission("control")}.
* @exception UnsupportedEncodingException if the named encoding is * @exception UnsupportedEncodingException if the named encoding is
* not supported. * not supported.
*/ */
@ -173,18 +173,18 @@ public class StreamHandler extends Handler {
} }
/** /**
* Format and publish a <tt>LogRecord</tt>. * Format and publish a {@code LogRecord}.
* <p> * <p>
* The <tt>StreamHandler</tt> first checks if there is an <tt>OutputStream</tt> * The {@code StreamHandler} first checks if there is an {@code OutputStream}
* and if the given <tt>LogRecord</tt> has at least the required log level. * and if the given {@code LogRecord} has at least the required log level.
* If not it silently returns. If so, it calls any associated * If not it silently returns. If so, it calls any associated
* <tt>Filter</tt> to check if the record should be published. If so, * {@code Filter} to check if the record should be published. If so,
* it calls its <tt>Formatter</tt> to format the record and then writes * it calls its {@code Formatter} to format the record and then writes
* the result to the current output stream. * the result to the current output stream.
* <p> * <p>
* If this is the first <tt>LogRecord</tt> to be written to a given * If this is the first {@code LogRecord} to be written to a given
* <tt>OutputStream</tt>, the <tt>Formatter</tt>'s "head" string is * {@code OutputStream}, the {@code Formatter}'s "head" string is
* written to the stream before the <tt>LogRecord</tt> is written. * written to the stream before the {@code LogRecord} is written.
* *
* @param record description of the log event. A null record is * @param record description of the log event. A null record is
* silently ignored and is not published * silently ignored and is not published
@ -219,14 +219,14 @@ public class StreamHandler extends Handler {
/** /**
* Check if this <tt>Handler</tt> would actually log a given <tt>LogRecord</tt>. * Check if this {@code Handler} would actually log a given {@code LogRecord}.
* <p> * <p>
* This method checks if the <tt>LogRecord</tt> has an appropriate level and * This method checks if the {@code LogRecord} has an appropriate level and
* whether it satisfies any <tt>Filter</tt>. It will also return false if * whether it satisfies any {@code Filter}. It will also return false if
* no output stream has been assigned yet or the LogRecord is null. * no output stream has been assigned yet or the LogRecord is null.
* *
* @param record a <tt>LogRecord</tt> * @param record a {@code LogRecord}
* @return true if the <tt>LogRecord</tt> would be logged. * @return true if the {@code LogRecord} would be logged.
* *
*/ */
@Override @Override
@ -277,8 +277,8 @@ public class StreamHandler extends Handler {
/** /**
* Close the current output stream. * Close the current output stream.
* <p> * <p>
* The <tt>Formatter</tt>'s "tail" string is written to the stream before it * The {@code Formatter}'s "tail" string is written to the stream before it
* is closed. In addition, if the <tt>Formatter</tt>'s "head" string has not * is closed. In addition, if the {@code Formatter}'s "head" string has not
* yet been written to the stream, it will be written before the * yet been written to the stream, it will be written before the
* "tail" string. * "tail" string.
* *

View file

@ -40,8 +40,8 @@ import java.lang.Double;
* This class provides a skeletal implementation of the {@link Preferences} * This class provides a skeletal implementation of the {@link Preferences}
* class, greatly easing the task of implementing it. * class, greatly easing the task of implementing it.
* *
* <p><strong>This class is for <tt>Preferences</tt> implementers only. * <p><strong>This class is for {@code Preferences} implementers only.
* Normal users of the <tt>Preferences</tt> facility should have no need to * Normal users of the {@code Preferences} facility should have no need to
* consult this documentation. The {@link Preferences} documentation * consult this documentation. The {@link Preferences} documentation
* should suffice.</strong> * should suffice.</strong>
* *
@ -56,11 +56,11 @@ import java.lang.Double;
* performance. * performance.
* *
* <p>The SPI methods fall into three groups concerning exception * <p>The SPI methods fall into three groups concerning exception
* behavior. The <tt>getSpi</tt> method should never throw exceptions, but it * behavior. The {@code getSpi} method should never throw exceptions, but it
* doesn't really matter, as any exception thrown by this method will be * doesn't really matter, as any exception thrown by this method will be
* intercepted by {@link #get(String,String)}, which will return the specified * intercepted by {@link #get(String,String)}, which will return the specified
* default value to the caller. The <tt>removeNodeSpi, keysSpi, * default value to the caller. The {@code removeNodeSpi, keysSpi,
* childrenNamesSpi, syncSpi</tt> and <tt>flushSpi</tt> methods are specified * childrenNamesSpi, syncSpi} and {@code flushSpi} methods are specified
* to throw {@link BackingStoreException}, and the implementation is required * to throw {@link BackingStoreException}, and the implementation is required
* to throw this checked exception if it is unable to perform the operation. * to throw this checked exception if it is unable to perform the operation.
* The exception propagates outward, causing the corresponding API method * The exception propagates outward, causing the corresponding API method
@ -69,7 +69,7 @@ import java.lang.Double;
* <p>The remaining SPI methods {@link #putSpi(String,String)}, {@link * <p>The remaining SPI methods {@link #putSpi(String,String)}, {@link
* #removeSpi(String)} and {@link #childSpi(String)} have more complicated * #removeSpi(String)} and {@link #childSpi(String)} have more complicated
* exception behavior. They are not specified to throw * exception behavior. They are not specified to throw
* <tt>BackingStoreException</tt>, as they can generally obey their contracts * {@code BackingStoreException}, as they can generally obey their contracts
* even if the backing store is unavailable. This is true because they return * even if the backing store is unavailable. This is true because they return
* no information and their effects are not required to become permanent until * no information and their effects are not required to become permanent until
* a subsequent call to {@link Preferences#flush()} or * a subsequent call to {@link Preferences#flush()} or
@ -79,11 +79,11 @@ import java.lang.Double;
* later processing. Even under these circumstances it is generally better to * later processing. Even under these circumstances it is generally better to
* simply ignore the invocation and return, rather than throwing an * simply ignore the invocation and return, rather than throwing an
* exception. Under these circumstances, however, subsequently invoking * exception. Under these circumstances, however, subsequently invoking
* <tt>flush()</tt> or <tt>sync</tt> would not imply that all previous * {@code flush()} or {@code sync} would not imply that all previous
* operations had successfully been made permanent. * operations had successfully been made permanent.
* *
* <p>There is one circumstance under which <tt>putSpi, removeSpi and * <p>There is one circumstance under which {@code putSpi, removeSpi and
* childSpi</tt> <i>should</i> throw an exception: if the caller lacks * childSpi} <i>should</i> throw an exception: if the caller lacks
* sufficient privileges on the underlying operating system to perform the * sufficient privileges on the underlying operating system to perform the
* requested operation. This will, for instance, occur on most systems * requested operation. This will, for instance, occur on most systems
* if a non-privileged user attempts to modify system preferences. * if a non-privileged user attempts to modify system preferences.
@ -103,18 +103,18 @@ import java.lang.Double;
* backing store. It is the implementation's responsibility to recreate the * backing store. It is the implementation's responsibility to recreate the
* node if it has been deleted. * node if it has been deleted.
* *
* <p>Implementation note: In Sun's default <tt>Preferences</tt> * <p>Implementation note: In Sun's default {@code Preferences}
* implementations, the user's identity is inherited from the underlying * implementations, the user's identity is inherited from the underlying
* operating system and does not change for the lifetime of the virtual * operating system and does not change for the lifetime of the virtual
* machine. It is recognized that server-side <tt>Preferences</tt> * machine. It is recognized that server-side {@code Preferences}
* implementations may have the user identity change from request to request, * implementations may have the user identity change from request to request,
* implicitly passed to <tt>Preferences</tt> methods via the use of a * implicitly passed to {@code Preferences} methods via the use of a
* static {@link ThreadLocal} instance. Authors of such implementations are * static {@link ThreadLocal} instance. Authors of such implementations are
* <i>strongly</i> encouraged to determine the user at the time preferences * <i>strongly</i> encouraged to determine the user at the time preferences
* are accessed (for example by the {@link #get(String,String)} or {@link * are accessed (for example by the {@link #get(String,String)} or {@link
* #put(String,String)} method) rather than permanently associating a user * #put(String,String)} method) rather than permanently associating a user
* with each <tt>Preferences</tt> instance. The latter behavior conflicts * with each {@code Preferences} instance. The latter behavior conflicts
* with normal <tt>Preferences</tt> usage and would lead to great confusion. * with normal {@code Preferences} usage and would lead to great confusion.
* *
* @author Josh Bloch * @author Josh Bloch
* @see Preferences * @see Preferences
@ -149,7 +149,7 @@ public abstract class AbstractPreferences extends Preferences {
private final AbstractPreferences root; // Relative to this node private final AbstractPreferences root; // Relative to this node
/** /**
* This field should be <tt>true</tt> if this node did not exist in the * This field should be {@code true} if this node did not exist in the
* backing store prior to the creation of this object. The field * backing store prior to the creation of this object. The field
* is initialized to false, but may be set to true by a subclass * is initialized to false, but may be set to true by a subclass
* constructor (and should not be modified thereafter). This field * constructor (and should not be modified thereafter). This field
@ -197,10 +197,10 @@ public abstract class AbstractPreferences extends Preferences {
* @param parent the parent of this preference node, or null if this * @param parent the parent of this preference node, or null if this
* is the root. * is the root.
* @param name the name of this preference node, relative to its parent, * @param name the name of this preference node, relative to its parent,
* or <tt>""</tt> if this is the root. * or {@code ""} if this is the root.
* @throws IllegalArgumentException if <tt>name</tt> contains a slash * @throws IllegalArgumentException if {@code name} contains a slash
* (<tt>'/'</tt>), or <tt>parent</tt> is <tt>null</tt> and * ({@code '/'}), or {@code parent} is {@code null} and
* name isn't <tt>""</tt>. * name isn't {@code ""}.
*/ */
protected AbstractPreferences(AbstractPreferences parent, String name) { protected AbstractPreferences(AbstractPreferences parent, String name) {
if (parent==null) { if (parent==null) {
@ -225,7 +225,7 @@ public abstract class AbstractPreferences extends Preferences {
} }
/** /**
* Implements the <tt>put</tt> method as per the specification in * Implements the {@code put} method as per the specification in
* {@link Preferences#put(String,String)}. * {@link Preferences#put(String,String)}.
* *
* <p>This implementation checks that the key and value are legal, * <p>This implementation checks that the key and value are legal,
@ -236,10 +236,10 @@ public abstract class AbstractPreferences extends Preferences {
* *
* @param key key with which the specified value is to be associated. * @param key key with which the specified value is to be associated.
* @param value value to be associated with the specified key. * @param value value to be associated with the specified key.
* @throws NullPointerException if key or value is <tt>null</tt>. * @throws NullPointerException if key or value is {@code null}.
* @throws IllegalArgumentException if <tt>key.length()</tt> exceeds * @throws IllegalArgumentException if {@code key.length()} exceeds
* <tt>MAX_KEY_LENGTH</tt> or if <tt>value.length</tt> exceeds * {@code MAX_KEY_LENGTH} or if {@code value.length} exceeds
* <tt>MAX_VALUE_LENGTH</tt>. * {@code MAX_VALUE_LENGTH}.
* @throws IllegalArgumentException if either key or value contain * @throws IllegalArgumentException if either key or value contain
* the null control character, code point U+0000. * the null control character, code point U+0000.
* @throws IllegalStateException if this node (or an ancestor) has been * @throws IllegalStateException if this node (or an ancestor) has been
@ -267,26 +267,26 @@ public abstract class AbstractPreferences extends Preferences {
} }
/** /**
* Implements the <tt>get</tt> method as per the specification in * Implements the {@code get} method as per the specification in
* {@link Preferences#get(String,String)}. * {@link Preferences#get(String,String)}.
* *
* <p>This implementation first checks to see if <tt>key</tt> is * <p>This implementation first checks to see if {@code key} is
* <tt>null</tt> throwing a <tt>NullPointerException</tt> if this is * {@code null} throwing a {@code NullPointerException} if this is
* the case. Then it obtains this preference node's lock, * the case. Then it obtains this preference node's lock,
* checks that the node has not been removed, invokes {@link * checks that the node has not been removed, invokes {@link
* #getSpi(String)}, and returns the result, unless the <tt>getSpi</tt> * #getSpi(String)}, and returns the result, unless the {@code getSpi}
* invocation returns <tt>null</tt> or throws an exception, in which case * invocation returns {@code null} or throws an exception, in which case
* this invocation returns <tt>def</tt>. * this invocation returns {@code def}.
* *
* @param key key whose associated value is to be returned. * @param key key whose associated value is to be returned.
* @param def the value to be returned in the event that this * @param def the value to be returned in the event that this
* preference node has no value associated with <tt>key</tt>. * preference node has no value associated with {@code key}.
* @return the value associated with <tt>key</tt>, or <tt>def</tt> * @return the value associated with {@code key}, or {@code def}
* if no value is associated with <tt>key</tt>. * if no value is associated with {@code key}.
* @throws IllegalStateException if this node (or an ancestor) has been * @throws IllegalStateException if this node (or an ancestor) has been
* removed with the {@link #removeNode()} method. * removed with the {@link #removeNode()} method.
* @throws NullPointerException if key is <tt>null</tt>. (A * @throws NullPointerException if key is {@code null}. (A
* <tt>null</tt> default <i>is</i> permitted.) * {@code null} default <i>is</i> permitted.)
* @throws IllegalArgumentException if key contains the null control * @throws IllegalArgumentException if key contains the null control
* character, code point U+0000. * character, code point U+0000.
*/ */
@ -310,7 +310,7 @@ public abstract class AbstractPreferences extends Preferences {
} }
/** /**
* Implements the <tt>remove(String)</tt> method as per the specification * Implements the {@code remove(String)} method as per the specification
* in {@link Preferences#remove(String)}. * in {@link Preferences#remove(String)}.
* *
* <p>This implementation obtains this preference node's lock, * <p>This implementation obtains this preference node's lock,
@ -340,7 +340,7 @@ public abstract class AbstractPreferences extends Preferences {
} }
/** /**
* Implements the <tt>clear</tt> method as per the specification in * Implements the {@code clear} method as per the specification in
* {@link Preferences#clear()}. * {@link Preferences#clear()}.
* *
* <p>This implementation obtains this preference node's lock, * <p>This implementation obtains this preference node's lock,
@ -361,18 +361,18 @@ public abstract class AbstractPreferences extends Preferences {
} }
/** /**
* Implements the <tt>putInt</tt> method as per the specification in * Implements the {@code putInt} method as per the specification in
* {@link Preferences#putInt(String,int)}. * {@link Preferences#putInt(String,int)}.
* *
* <p>This implementation translates <tt>value</tt> to a string with * <p>This implementation translates {@code value} to a string with
* {@link Integer#toString(int)} and invokes {@link #put(String,String)} * {@link Integer#toString(int)} and invokes {@link #put(String,String)}
* on the result. * on the result.
* *
* @param key key with which the string form of value is to be associated. * @param key key with which the string form of value is to be associated.
* @param value value whose string form is to be associated with key. * @param value value whose string form is to be associated with key.
* @throws NullPointerException if key is <tt>null</tt>. * @throws NullPointerException if key is {@code null}.
* @throws IllegalArgumentException if <tt>key.length()</tt> exceeds * @throws IllegalArgumentException if {@code key.length()} exceeds
* <tt>MAX_KEY_LENGTH</tt>. * {@code MAX_KEY_LENGTH}.
* @throws IllegalArgumentException if key contains * @throws IllegalArgumentException if key contains
* the null control character, code point U+0000. * the null control character, code point U+0000.
* @throws IllegalStateException if this node (or an ancestor) has been * @throws IllegalStateException if this node (or an ancestor) has been
@ -383,26 +383,26 @@ public abstract class AbstractPreferences extends Preferences {
} }
/** /**
* Implements the <tt>getInt</tt> method as per the specification in * Implements the {@code getInt} method as per the specification in
* {@link Preferences#getInt(String,int)}. * {@link Preferences#getInt(String,int)}.
* *
* <p>This implementation invokes {@link #get(String,String) <tt>get(key, * <p>This implementation invokes {@link #get(String,String) get(key,
* null)</tt>}. If the return value is non-null, the implementation * null)}. If the return value is non-null, the implementation
* attempts to translate it to an <tt>int</tt> with * attempts to translate it to an {@code int} with
* {@link Integer#parseInt(String)}. If the attempt succeeds, the return * {@link Integer#parseInt(String)}. If the attempt succeeds, the return
* value is returned by this method. Otherwise, <tt>def</tt> is returned. * value is returned by this method. Otherwise, {@code def} is returned.
* *
* @param key key whose associated value is to be returned as an int. * @param key key whose associated value is to be returned as an int.
* @param def the value to be returned in the event that this * @param def the value to be returned in the event that this
* preference node has no value associated with <tt>key</tt> * preference node has no value associated with {@code key}
* or the associated value cannot be interpreted as an int. * or the associated value cannot be interpreted as an int.
* @return the int value represented by the string associated with * @return the int value represented by the string associated with
* <tt>key</tt> in this preference node, or <tt>def</tt> if the * {@code key} in this preference node, or {@code def} if the
* associated value does not exist or cannot be interpreted as * associated value does not exist or cannot be interpreted as
* an int. * an int.
* @throws IllegalStateException if this node (or an ancestor) has been * @throws IllegalStateException if this node (or an ancestor) has been
* removed with the {@link #removeNode()} method. * removed with the {@link #removeNode()} method.
* @throws NullPointerException if <tt>key</tt> is <tt>null</tt>. * @throws NullPointerException if {@code key} is {@code null}.
* @throws IllegalArgumentException if key contains the null control * @throws IllegalArgumentException if key contains the null control
* character, code point U+0000. * character, code point U+0000.
*/ */
@ -420,18 +420,18 @@ public abstract class AbstractPreferences extends Preferences {
} }
/** /**
* Implements the <tt>putLong</tt> method as per the specification in * Implements the {@code putLong} method as per the specification in
* {@link Preferences#putLong(String,long)}. * {@link Preferences#putLong(String,long)}.
* *
* <p>This implementation translates <tt>value</tt> to a string with * <p>This implementation translates {@code value} to a string with
* {@link Long#toString(long)} and invokes {@link #put(String,String)} * {@link Long#toString(long)} and invokes {@link #put(String,String)}
* on the result. * on the result.
* *
* @param key key with which the string form of value is to be associated. * @param key key with which the string form of value is to be associated.
* @param value value whose string form is to be associated with key. * @param value value whose string form is to be associated with key.
* @throws NullPointerException if key is <tt>null</tt>. * @throws NullPointerException if key is {@code null}.
* @throws IllegalArgumentException if <tt>key.length()</tt> exceeds * @throws IllegalArgumentException if {@code key.length()} exceeds
* <tt>MAX_KEY_LENGTH</tt>. * {@code MAX_KEY_LENGTH}.
* @throws IllegalArgumentException if key contains * @throws IllegalArgumentException if key contains
* the null control character, code point U+0000. * the null control character, code point U+0000.
* @throws IllegalStateException if this node (or an ancestor) has been * @throws IllegalStateException if this node (or an ancestor) has been
@ -442,26 +442,26 @@ public abstract class AbstractPreferences extends Preferences {
} }
/** /**
* Implements the <tt>getLong</tt> method as per the specification in * Implements the {@code getLong} method as per the specification in
* {@link Preferences#getLong(String,long)}. * {@link Preferences#getLong(String,long)}.
* *
* <p>This implementation invokes {@link #get(String,String) <tt>get(key, * <p>This implementation invokes {@link #get(String,String) get(key,
* null)</tt>}. If the return value is non-null, the implementation * null)}. If the return value is non-null, the implementation
* attempts to translate it to a <tt>long</tt> with * attempts to translate it to a {@code long} with
* {@link Long#parseLong(String)}. If the attempt succeeds, the return * {@link Long#parseLong(String)}. If the attempt succeeds, the return
* value is returned by this method. Otherwise, <tt>def</tt> is returned. * value is returned by this method. Otherwise, {@code def} is returned.
* *
* @param key key whose associated value is to be returned as a long. * @param key key whose associated value is to be returned as a long.
* @param def the value to be returned in the event that this * @param def the value to be returned in the event that this
* preference node has no value associated with <tt>key</tt> * preference node has no value associated with {@code key}
* or the associated value cannot be interpreted as a long. * or the associated value cannot be interpreted as a long.
* @return the long value represented by the string associated with * @return the long value represented by the string associated with
* <tt>key</tt> in this preference node, or <tt>def</tt> if the * {@code key} in this preference node, or {@code def} if the
* associated value does not exist or cannot be interpreted as * associated value does not exist or cannot be interpreted as
* a long. * a long.
* @throws IllegalStateException if this node (or an ancestor) has been * @throws IllegalStateException if this node (or an ancestor) has been
* removed with the {@link #removeNode()} method. * removed with the {@link #removeNode()} method.
* @throws NullPointerException if <tt>key</tt> is <tt>null</tt>. * @throws NullPointerException if {@code key} is {@code null}.
* @throws IllegalArgumentException if key contains the null control * @throws IllegalArgumentException if key contains the null control
* character, code point U+0000. * character, code point U+0000.
*/ */
@ -479,18 +479,18 @@ public abstract class AbstractPreferences extends Preferences {
} }
/** /**
* Implements the <tt>putBoolean</tt> method as per the specification in * Implements the {@code putBoolean} method as per the specification in
* {@link Preferences#putBoolean(String,boolean)}. * {@link Preferences#putBoolean(String,boolean)}.
* *
* <p>This implementation translates <tt>value</tt> to a string with * <p>This implementation translates {@code value} to a string with
* {@link String#valueOf(boolean)} and invokes {@link #put(String,String)} * {@link String#valueOf(boolean)} and invokes {@link #put(String,String)}
* on the result. * on the result.
* *
* @param key key with which the string form of value is to be associated. * @param key key with which the string form of value is to be associated.
* @param value value whose string form is to be associated with key. * @param value value whose string form is to be associated with key.
* @throws NullPointerException if key is <tt>null</tt>. * @throws NullPointerException if key is {@code null}.
* @throws IllegalArgumentException if <tt>key.length()</tt> exceeds * @throws IllegalArgumentException if {@code key.length()} exceeds
* <tt>MAX_KEY_LENGTH</tt>. * {@code MAX_KEY_LENGTH}.
* @throws IllegalArgumentException if key contains * @throws IllegalArgumentException if key contains
* the null control character, code point U+0000. * the null control character, code point U+0000.
* @throws IllegalStateException if this node (or an ancestor) has been * @throws IllegalStateException if this node (or an ancestor) has been
@ -501,29 +501,29 @@ public abstract class AbstractPreferences extends Preferences {
} }
/** /**
* Implements the <tt>getBoolean</tt> method as per the specification in * Implements the {@code getBoolean} method as per the specification in
* {@link Preferences#getBoolean(String,boolean)}. * {@link Preferences#getBoolean(String,boolean)}.
* *
* <p>This implementation invokes {@link #get(String,String) <tt>get(key, * <p>This implementation invokes {@link #get(String,String) get(key,
* null)</tt>}. If the return value is non-null, it is compared with * null)}. If the return value is non-null, it is compared with
* <tt>"true"</tt> using {@link String#equalsIgnoreCase(String)}. If the * {@code "true"} using {@link String#equalsIgnoreCase(String)}. If the
* comparison returns <tt>true</tt>, this invocation returns * comparison returns {@code true}, this invocation returns
* <tt>true</tt>. Otherwise, the original return value is compared with * {@code true}. Otherwise, the original return value is compared with
* <tt>"false"</tt>, again using {@link String#equalsIgnoreCase(String)}. * {@code "false"}, again using {@link String#equalsIgnoreCase(String)}.
* If the comparison returns <tt>true</tt>, this invocation returns * If the comparison returns {@code true}, this invocation returns
* <tt>false</tt>. Otherwise, this invocation returns <tt>def</tt>. * {@code false}. Otherwise, this invocation returns {@code def}.
* *
* @param key key whose associated value is to be returned as a boolean. * @param key key whose associated value is to be returned as a boolean.
* @param def the value to be returned in the event that this * @param def the value to be returned in the event that this
* preference node has no value associated with <tt>key</tt> * preference node has no value associated with {@code key}
* or the associated value cannot be interpreted as a boolean. * or the associated value cannot be interpreted as a boolean.
* @return the boolean value represented by the string associated with * @return the boolean value represented by the string associated with
* <tt>key</tt> in this preference node, or <tt>def</tt> if the * {@code key} in this preference node, or {@code def} if the
* associated value does not exist or cannot be interpreted as * associated value does not exist or cannot be interpreted as
* a boolean. * a boolean.
* @throws IllegalStateException if this node (or an ancestor) has been * @throws IllegalStateException if this node (or an ancestor) has been
* removed with the {@link #removeNode()} method. * removed with the {@link #removeNode()} method.
* @throws NullPointerException if <tt>key</tt> is <tt>null</tt>. * @throws NullPointerException if {@code key} is {@code null}.
* @throws IllegalArgumentException if key contains the null control * @throws IllegalArgumentException if key contains the null control
* character, code point U+0000. * character, code point U+0000.
*/ */
@ -541,18 +541,18 @@ public abstract class AbstractPreferences extends Preferences {
} }
/** /**
* Implements the <tt>putFloat</tt> method as per the specification in * Implements the {@code putFloat} method as per the specification in
* {@link Preferences#putFloat(String,float)}. * {@link Preferences#putFloat(String,float)}.
* *
* <p>This implementation translates <tt>value</tt> to a string with * <p>This implementation translates {@code value} to a string with
* {@link Float#toString(float)} and invokes {@link #put(String,String)} * {@link Float#toString(float)} and invokes {@link #put(String,String)}
* on the result. * on the result.
* *
* @param key key with which the string form of value is to be associated. * @param key key with which the string form of value is to be associated.
* @param value value whose string form is to be associated with key. * @param value value whose string form is to be associated with key.
* @throws NullPointerException if key is <tt>null</tt>. * @throws NullPointerException if key is {@code null}.
* @throws IllegalArgumentException if <tt>key.length()</tt> exceeds * @throws IllegalArgumentException if {@code key.length()} exceeds
* <tt>MAX_KEY_LENGTH</tt>. * {@code MAX_KEY_LENGTH}.
* @throws IllegalArgumentException if key contains * @throws IllegalArgumentException if key contains
* the null control character, code point U+0000. * the null control character, code point U+0000.
* @throws IllegalStateException if this node (or an ancestor) has been * @throws IllegalStateException if this node (or an ancestor) has been
@ -563,26 +563,26 @@ public abstract class AbstractPreferences extends Preferences {
} }
/** /**
* Implements the <tt>getFloat</tt> method as per the specification in * Implements the {@code getFloat} method as per the specification in
* {@link Preferences#getFloat(String,float)}. * {@link Preferences#getFloat(String,float)}.
* *
* <p>This implementation invokes {@link #get(String,String) <tt>get(key, * <p>This implementation invokes {@link #get(String,String) get(key,
* null)</tt>}. If the return value is non-null, the implementation * null)}. If the return value is non-null, the implementation
* attempts to translate it to an <tt>float</tt> with * attempts to translate it to an {@code float} with
* {@link Float#parseFloat(String)}. If the attempt succeeds, the return * {@link Float#parseFloat(String)}. If the attempt succeeds, the return
* value is returned by this method. Otherwise, <tt>def</tt> is returned. * value is returned by this method. Otherwise, {@code def} is returned.
* *
* @param key key whose associated value is to be returned as a float. * @param key key whose associated value is to be returned as a float.
* @param def the value to be returned in the event that this * @param def the value to be returned in the event that this
* preference node has no value associated with <tt>key</tt> * preference node has no value associated with {@code key}
* or the associated value cannot be interpreted as a float. * or the associated value cannot be interpreted as a float.
* @return the float value represented by the string associated with * @return the float value represented by the string associated with
* <tt>key</tt> in this preference node, or <tt>def</tt> if the * {@code key} in this preference node, or {@code def} if the
* associated value does not exist or cannot be interpreted as * associated value does not exist or cannot be interpreted as
* a float. * a float.
* @throws IllegalStateException if this node (or an ancestor) has been * @throws IllegalStateException if this node (or an ancestor) has been
* removed with the {@link #removeNode()} method. * removed with the {@link #removeNode()} method.
* @throws NullPointerException if <tt>key</tt> is <tt>null</tt>. * @throws NullPointerException if {@code key} is {@code null}.
* @throws IllegalArgumentException if key contains the null control * @throws IllegalArgumentException if key contains the null control
* character, code point U+0000. * character, code point U+0000.
*/ */
@ -600,18 +600,18 @@ public abstract class AbstractPreferences extends Preferences {
} }
/** /**
* Implements the <tt>putDouble</tt> method as per the specification in * Implements the {@code putDouble} method as per the specification in
* {@link Preferences#putDouble(String,double)}. * {@link Preferences#putDouble(String,double)}.
* *
* <p>This implementation translates <tt>value</tt> to a string with * <p>This implementation translates {@code value} to a string with
* {@link Double#toString(double)} and invokes {@link #put(String,String)} * {@link Double#toString(double)} and invokes {@link #put(String,String)}
* on the result. * on the result.
* *
* @param key key with which the string form of value is to be associated. * @param key key with which the string form of value is to be associated.
* @param value value whose string form is to be associated with key. * @param value value whose string form is to be associated with key.
* @throws NullPointerException if key is <tt>null</tt>. * @throws NullPointerException if key is {@code null}.
* @throws IllegalArgumentException if <tt>key.length()</tt> exceeds * @throws IllegalArgumentException if {@code key.length()} exceeds
* <tt>MAX_KEY_LENGTH</tt>. * {@code MAX_KEY_LENGTH}.
* @throws IllegalArgumentException if key contains * @throws IllegalArgumentException if key contains
* the null control character, code point U+0000. * the null control character, code point U+0000.
* @throws IllegalStateException if this node (or an ancestor) has been * @throws IllegalStateException if this node (or an ancestor) has been
@ -622,26 +622,26 @@ public abstract class AbstractPreferences extends Preferences {
} }
/** /**
* Implements the <tt>getDouble</tt> method as per the specification in * Implements the {@code getDouble} method as per the specification in
* {@link Preferences#getDouble(String,double)}. * {@link Preferences#getDouble(String,double)}.
* *
* <p>This implementation invokes {@link #get(String,String) <tt>get(key, * <p>This implementation invokes {@link #get(String,String) get(key,
* null)</tt>}. If the return value is non-null, the implementation * null)}. If the return value is non-null, the implementation
* attempts to translate it to an <tt>double</tt> with * attempts to translate it to an {@code double} with
* {@link Double#parseDouble(String)}. If the attempt succeeds, the return * {@link Double#parseDouble(String)}. If the attempt succeeds, the return
* value is returned by this method. Otherwise, <tt>def</tt> is returned. * value is returned by this method. Otherwise, {@code def} is returned.
* *
* @param key key whose associated value is to be returned as a double. * @param key key whose associated value is to be returned as a double.
* @param def the value to be returned in the event that this * @param def the value to be returned in the event that this
* preference node has no value associated with <tt>key</tt> * preference node has no value associated with {@code key}
* or the associated value cannot be interpreted as a double. * or the associated value cannot be interpreted as a double.
* @return the double value represented by the string associated with * @return the double value represented by the string associated with
* <tt>key</tt> in this preference node, or <tt>def</tt> if the * {@code key} in this preference node, or {@code def} if the
* associated value does not exist or cannot be interpreted as * associated value does not exist or cannot be interpreted as
* a double. * a double.
* @throws IllegalStateException if this node (or an ancestor) has been * @throws IllegalStateException if this node (or an ancestor) has been
* removed with the {@link #removeNode()} method. * removed with the {@link #removeNode()} method.
* @throws NullPointerException if <tt>key</tt> is <tt>null</tt>. * @throws NullPointerException if {@code key} is {@code null}.
* @throws IllegalArgumentException if key contains the null control * @throws IllegalArgumentException if key contains the null control
* character, code point U+0000. * character, code point U+0000.
*/ */
@ -659,12 +659,12 @@ public abstract class AbstractPreferences extends Preferences {
} }
/** /**
* Implements the <tt>putByteArray</tt> method as per the specification in * Implements the {@code putByteArray} method as per the specification in
* {@link Preferences#putByteArray(String,byte[])}. * {@link Preferences#putByteArray(String,byte[])}.
* *
* @param key key with which the string form of value is to be associated. * @param key key with which the string form of value is to be associated.
* @param value value whose string form is to be associated with key. * @param value value whose string form is to be associated with key.
* @throws NullPointerException if key or value is <tt>null</tt>. * @throws NullPointerException if key or value is {@code null}.
* @throws IllegalArgumentException if key.length() exceeds MAX_KEY_LENGTH * @throws IllegalArgumentException if key.length() exceeds MAX_KEY_LENGTH
* or if value.length exceeds MAX_VALUE_LENGTH*3/4. * or if value.length exceeds MAX_VALUE_LENGTH*3/4.
* @throws IllegalArgumentException if key contains * @throws IllegalArgumentException if key contains
@ -677,21 +677,21 @@ public abstract class AbstractPreferences extends Preferences {
} }
/** /**
* Implements the <tt>getByteArray</tt> method as per the specification in * Implements the {@code getByteArray} method as per the specification in
* {@link Preferences#getByteArray(String,byte[])}. * {@link Preferences#getByteArray(String,byte[])}.
* *
* @param key key whose associated value is to be returned as a byte array. * @param key key whose associated value is to be returned as a byte array.
* @param def the value to be returned in the event that this * @param def the value to be returned in the event that this
* preference node has no value associated with <tt>key</tt> * preference node has no value associated with {@code key}
* or the associated value cannot be interpreted as a byte array. * or the associated value cannot be interpreted as a byte array.
* @return the byte array value represented by the string associated with * @return the byte array value represented by the string associated with
* <tt>key</tt> in this preference node, or <tt>def</tt> if the * {@code key} in this preference node, or {@code def} if the
* associated value does not exist or cannot be interpreted as * associated value does not exist or cannot be interpreted as
* a byte array. * a byte array.
* @throws IllegalStateException if this node (or an ancestor) has been * @throws IllegalStateException if this node (or an ancestor) has been
* removed with the {@link #removeNode()} method. * removed with the {@link #removeNode()} method.
* @throws NullPointerException if <tt>key</tt> is <tt>null</tt>. (A * @throws NullPointerException if {@code key} is {@code null}. (A
* <tt>null</tt> value for <tt>def</tt> <i>is</i> permitted.) * {@code null} value for {@code def} <i>is</i> permitted.)
* @throws IllegalArgumentException if key contains the null control * @throws IllegalArgumentException if key contains the null control
* character, code point U+0000. * character, code point U+0000.
*/ */
@ -710,7 +710,7 @@ public abstract class AbstractPreferences extends Preferences {
} }
/** /**
* Implements the <tt>keys</tt> method as per the specification in * Implements the {@code keys} method as per the specification in
* {@link Preferences#keys()}. * {@link Preferences#keys()}.
* *
* <p>This implementation obtains this preference node's lock, checks that * <p>This implementation obtains this preference node's lock, checks that
@ -734,15 +734,15 @@ public abstract class AbstractPreferences extends Preferences {
} }
/** /**
* Implements the <tt>children</tt> method as per the specification in * Implements the {@code children} method as per the specification in
* {@link Preferences#childrenNames()}. * {@link Preferences#childrenNames()}.
* *
* <p>This implementation obtains this preference node's lock, checks that * <p>This implementation obtains this preference node's lock, checks that
* the node has not been removed, constructs a <tt>TreeSet</tt> initialized * the node has not been removed, constructs a {@code TreeSet} initialized
* to the names of children already cached (the children in this node's * to the names of children already cached (the children in this node's
* "child-cache"), invokes {@link #childrenNamesSpi()}, and adds all of the * "child-cache"), invokes {@link #childrenNamesSpi()}, and adds all of the
* returned child-names into the set. The elements of the tree set are * returned child-names into the set. The elements of the tree set are
* dumped into a <tt>String</tt> array using the <tt>toArray</tt> method, * dumped into a {@code String} array using the {@code toArray} method,
* and this array is returned. * and this array is returned.
* *
* @return the names of the children of this preference node. * @return the names of the children of this preference node.
@ -780,7 +780,7 @@ public abstract class AbstractPreferences extends Preferences {
= new AbstractPreferences[0]; = new AbstractPreferences[0];
/** /**
* Implements the <tt>parent</tt> method as per the specification in * Implements the {@code parent} method as per the specification in
* {@link Preferences#parent()}. * {@link Preferences#parent()}.
* *
* <p>This implementation obtains this preference node's lock, checks that * <p>This implementation obtains this preference node's lock, checks that
@ -801,35 +801,35 @@ public abstract class AbstractPreferences extends Preferences {
} }
/** /**
* Implements the <tt>node</tt> method as per the specification in * Implements the {@code node} method as per the specification in
* {@link Preferences#node(String)}. * {@link Preferences#node(String)}.
* *
* <p>This implementation obtains this preference node's lock and checks * <p>This implementation obtains this preference node's lock and checks
* that the node has not been removed. If <tt>path</tt> is <tt>""</tt>, * that the node has not been removed. If {@code path} is {@code ""},
* this node is returned; if <tt>path</tt> is <tt>"/"</tt>, this node's * this node is returned; if {@code path} is {@code "/"}, this node's
* root is returned. If the first character in <tt>path</tt> is * root is returned. If the first character in {@code path} is
* not <tt>'/'</tt>, the implementation breaks <tt>path</tt> into * not {@code '/'}, the implementation breaks {@code path} into
* tokens and recursively traverses the path from this node to the * tokens and recursively traverses the path from this node to the
* named node, "consuming" a name and a slash from <tt>path</tt> at * named node, "consuming" a name and a slash from {@code path} at
* each step of the traversal. At each step, the current node is locked * each step of the traversal. At each step, the current node is locked
* and the node's child-cache is checked for the named node. If it is * and the node's child-cache is checked for the named node. If it is
* not found, the name is checked to make sure its length does not * not found, the name is checked to make sure its length does not
* exceed <tt>MAX_NAME_LENGTH</tt>. Then the {@link #childSpi(String)} * exceed {@code MAX_NAME_LENGTH}. Then the {@link #childSpi(String)}
* method is invoked, and the result stored in this node's child-cache. * method is invoked, and the result stored in this node's child-cache.
* If the newly created <tt>Preferences</tt> object's {@link #newNode} * If the newly created {@code Preferences} object's {@link #newNode}
* field is <tt>true</tt> and there are any node change listeners, * field is {@code true} and there are any node change listeners,
* a notification event is enqueued for processing by the event dispatch * a notification event is enqueued for processing by the event dispatch
* thread. * thread.
* *
* <p>When there are no more tokens, the last value found in the * <p>When there are no more tokens, the last value found in the
* child-cache or returned by <tt>childSpi</tt> is returned by this * child-cache or returned by {@code childSpi} is returned by this
* method. If during the traversal, two <tt>"/"</tt> tokens occur * method. If during the traversal, two {@code "/"} tokens occur
* consecutively, or the final token is <tt>"/"</tt> (rather than a name), * consecutively, or the final token is {@code "/"} (rather than a name),
* an appropriate <tt>IllegalArgumentException</tt> is thrown. * an appropriate {@code IllegalArgumentException} is thrown.
* *
* <p> If the first character of <tt>path</tt> is <tt>'/'</tt> * <p> If the first character of {@code path} is {@code '/'}
* (indicating an absolute path name) this preference node's * (indicating an absolute path name) this preference node's
* lock is dropped prior to breaking <tt>path</tt> into tokens, and * lock is dropped prior to breaking {@code path} into tokens, and
* this method recursively traverses the path starting from the root * this method recursively traverses the path starting from the root
* (rather than starting from this node). The traversal is otherwise * (rather than starting from this node). The traversal is otherwise
* identical to the one described for relative path names. Dropping * identical to the one described for relative path names. Dropping
@ -889,7 +889,7 @@ public abstract class AbstractPreferences extends Preferences {
} }
/** /**
* Implements the <tt>nodeExists</tt> method as per the specification in * Implements the {@code nodeExists} method as per the specification in
* {@link Preferences#nodeExists(String)}. * {@link Preferences#nodeExists(String)}.
* *
* <p>This implementation is very similar to {@link #node(String)}, * <p>This implementation is very similar to {@link #node(String)},
@ -906,7 +906,7 @@ public abstract class AbstractPreferences extends Preferences {
* with a slash character and is more than one character long). * with a slash character and is more than one character long).
* @throws IllegalStateException if this node (or an ancestor) has been * @throws IllegalStateException if this node (or an ancestor) has been
* removed with the {@link #removeNode()} method and * removed with the {@link #removeNode()} method and
* <tt>pathname</tt> is not the empty string (<tt>""</tt>). * {@code pathname} is not the empty string ({@code ""}).
*/ */
public boolean nodeExists(String path) public boolean nodeExists(String path)
throws BackingStoreException throws BackingStoreException
@ -953,7 +953,7 @@ public abstract class AbstractPreferences extends Preferences {
/** /**
* Implements the <tt>removeNode()</tt> method as per the specification in * Implements the {@code removeNode()} method as per the specification in
* {@link Preferences#removeNode()}. * {@link Preferences#removeNode()}.
* *
* <p>This implementation checks to see that this node is the root; if so, * <p>This implementation checks to see that this node is the root; if so,
@ -964,7 +964,7 @@ public abstract class AbstractPreferences extends Preferences {
* of its children are cached: The {@link #childrenNamesSpi()} method is * of its children are cached: The {@link #childrenNamesSpi()} method is
* invoked and each returned child name is checked for containment in the * invoked and each returned child name is checked for containment in the
* child-cache. If a child is not already cached, the {@link * child-cache. If a child is not already cached, the {@link
* #childSpi(String)} method is invoked to create a <tt>Preferences</tt> * #childSpi(String)} method is invoked to create a {@code Preferences}
* instance for it, and this instance is put into the child-cache. Then * instance for it, and this instance is put into the child-cache. Then
* the helper method calls itself recursively on each node contained in its * the helper method calls itself recursively on each node contained in its
* child-cache. Next, it invokes {@link #removeNodeSpi()}, marks itself * child-cache. Next, it invokes {@link #removeNodeSpi()}, marks itself
@ -1024,7 +1024,7 @@ public abstract class AbstractPreferences extends Preferences {
} }
/** /**
* Implements the <tt>name</tt> method as per the specification in * Implements the {@code name} method as per the specification in
* {@link Preferences#name()}. * {@link Preferences#name()}.
* *
* <p>This implementation merely returns the name that was * <p>This implementation merely returns the name that was
@ -1037,7 +1037,7 @@ public abstract class AbstractPreferences extends Preferences {
} }
/** /**
* Implements the <tt>absolutePath</tt> method as per the specification in * Implements the {@code absolutePath} method as per the specification in
* {@link Preferences#absolutePath()}. * {@link Preferences#absolutePath()}.
* *
* <p>This implementation merely returns the absolute path name that * <p>This implementation merely returns the absolute path name that
@ -1052,7 +1052,7 @@ public abstract class AbstractPreferences extends Preferences {
} }
/** /**
* Implements the <tt>isUserNode</tt> method as per the specification in * Implements the {@code isUserNode} method as per the specification in
* {@link Preferences#isUserNode()}. * {@link Preferences#isUserNode()}.
* *
* <p>This implementation compares this node's root node (which is stored * <p>This implementation compares this node's root node (which is stored
@ -1060,8 +1060,8 @@ public abstract class AbstractPreferences extends Preferences {
* {@link Preferences#userRoot()}. If the two object references are * {@link Preferences#userRoot()}. If the two object references are
* identical, this method returns true. * identical, this method returns true.
* *
* @return <tt>true</tt> if this preference node is in the user * @return {@code true} if this preference node is in the user
* preference tree, <tt>false</tt> if it's in the system * preference tree, {@code false} if it's in the system
* preference tree. * preference tree.
*/ */
public boolean isUserNode() { public boolean isUserNode() {
@ -1160,7 +1160,7 @@ public abstract class AbstractPreferences extends Preferences {
/** /**
* Put the given key-value association into this preference node. It is * Put the given key-value association into this preference node. It is
* guaranteed that <tt>key</tt> and <tt>value</tt> are non-null and of * guaranteed that {@code key} and {@code value} are non-null and of
* legal length. Also, it is guaranteed that this node has not been * legal length. Also, it is guaranteed that this node has not been
* removed. (The implementor needn't check for any of these things.) * removed. (The implementor needn't check for any of these things.)
* *
@ -1172,29 +1172,29 @@ public abstract class AbstractPreferences extends Preferences {
/** /**
* Return the value associated with the specified key at this preference * Return the value associated with the specified key at this preference
* node, or <tt>null</tt> if there is no association for this key, or the * node, or {@code null} if there is no association for this key, or the
* association cannot be determined at this time. It is guaranteed that * association cannot be determined at this time. It is guaranteed that
* <tt>key</tt> is non-null. Also, it is guaranteed that this node has * {@code key} is non-null. Also, it is guaranteed that this node has
* not been removed. (The implementor needn't check for either of these * not been removed. (The implementor needn't check for either of these
* things.) * things.)
* *
* <p> Generally speaking, this method should not throw an exception * <p> Generally speaking, this method should not throw an exception
* under any circumstances. If, however, if it does throw an exception, * under any circumstances. If, however, if it does throw an exception,
* the exception will be intercepted and treated as a <tt>null</tt> * the exception will be intercepted and treated as a {@code null}
* return value. * return value.
* *
* <p>This method is invoked with the lock on this node held. * <p>This method is invoked with the lock on this node held.
* *
* @param key the key * @param key the key
* @return the value associated with the specified key at this preference * @return the value associated with the specified key at this preference
* node, or <tt>null</tt> if there is no association for this * node, or {@code null} if there is no association for this
* key, or the association cannot be determined at this time. * key, or the association cannot be determined at this time.
*/ */
protected abstract String getSpi(String key); protected abstract String getSpi(String key);
/** /**
* Remove the association (if any) for the specified key at this * Remove the association (if any) for the specified key at this
* preference node. It is guaranteed that <tt>key</tt> is non-null. * preference node. It is guaranteed that {@code key} is non-null.
* Also, it is guaranteed that this node has not been removed. * Also, it is guaranteed that this node has not been removed.
* (The implementor needn't check for either of these things.) * (The implementor needn't check for either of these things.)
* *
@ -1215,9 +1215,9 @@ public abstract class AbstractPreferences extends Preferences {
* result of a single invocation to {@link Preferences#removeNode()}). * result of a single invocation to {@link Preferences#removeNode()}).
* *
* <p>The removal of a node needn't become persistent until the * <p>The removal of a node needn't become persistent until the
* <tt>flush</tt> method is invoked on this node (or an ancestor). * {@code flush} method is invoked on this node (or an ancestor).
* *
* <p>If this node throws a <tt>BackingStoreException</tt>, the exception * <p>If this node throws a {@code BackingStoreException}, the exception
* will propagate out beyond the enclosing {@link #removeNode()} * will propagate out beyond the enclosing {@link #removeNode()}
* invocation. * invocation.
* *
@ -1235,7 +1235,7 @@ public abstract class AbstractPreferences extends Preferences {
* *
* <p>This method is invoked with the lock on this node held. * <p>This method is invoked with the lock on this node held.
* *
* <p>If this node throws a <tt>BackingStoreException</tt>, the exception * <p>If this node throws a {@code BackingStoreException}, the exception
* will propagate out beyond the enclosing {@link #keys()} invocation. * will propagate out beyond the enclosing {@link #keys()} invocation.
* *
* @return an array of the keys that have an associated value in this * @return an array of the keys that have an associated value in this
@ -1254,7 +1254,7 @@ public abstract class AbstractPreferences extends Preferences {
* *
* <p>This method is invoked with the lock on this node held. * <p>This method is invoked with the lock on this node held.
* *
* <p>If this node throws a <tt>BackingStoreException</tt>, the exception * <p>If this node throws a {@code BackingStoreException}, the exception
* will propagate out beyond the enclosing {@link #childrenNames()} * will propagate out beyond the enclosing {@link #childrenNames()}
* invocation. * invocation.
* *
@ -1268,8 +1268,8 @@ public abstract class AbstractPreferences extends Preferences {
throws BackingStoreException; throws BackingStoreException;
/** /**
* Returns the named child if it exists, or <tt>null</tt> if it does not. * Returns the named child if it exists, or {@code null} if it does not.
* It is guaranteed that <tt>nodeName</tt> is non-null, non-empty, * It is guaranteed that {@code nodeName} is non-null, non-empty,
* does not contain the slash character ('/'), and is no longer than * does not contain the slash character ('/'), and is no longer than
* {@link #MAX_NAME_LENGTH} characters. Also, it is guaranteed * {@link #MAX_NAME_LENGTH} characters. Also, it is guaranteed
* that this node has not been removed. (The implementor needn't check * that this node has not been removed. (The implementor needn't check
@ -1288,7 +1288,7 @@ public abstract class AbstractPreferences extends Preferences {
* with the specified node name. If a child node has the correct name, * with the specified node name. If a child node has the correct name,
* the {@link #childSpi(String)} method is invoked and the resulting * the {@link #childSpi(String)} method is invoked and the resulting
* node is returned. If the iteration completes without finding the * node is returned. If the iteration completes without finding the
* specified name, <tt>null</tt> is returned. * specified name, {@code null} is returned.
* *
* @param nodeName name of the child to be searched for. * @param nodeName name of the child to be searched for.
* @return the named child if it exists, or null if it does not. * @return the named child if it exists, or null if it does not.
@ -1310,7 +1310,7 @@ public abstract class AbstractPreferences extends Preferences {
/** /**
* Returns the named child of this preference node, creating it if it does * Returns the named child of this preference node, creating it if it does
* not already exist. It is guaranteed that <tt>name</tt> is non-null, * not already exist. It is guaranteed that {@code name} is non-null,
* non-empty, does not contain the slash character ('/'), and is no longer * non-empty, does not contain the slash character ('/'), and is no longer
* than {@link #MAX_NAME_LENGTH} characters. Also, it is guaranteed that * than {@link #MAX_NAME_LENGTH} characters. Also, it is guaranteed that
* this node has not been removed. (The implementor needn't check for any * this node has not been removed. (The implementor needn't check for any
@ -1325,12 +1325,12 @@ public abstract class AbstractPreferences extends Preferences {
* *
* <p>The implementer must ensure that the returned node has not been * <p>The implementer must ensure that the returned node has not been
* removed. If a like-named child of this node was previously removed, the * removed. If a like-named child of this node was previously removed, the
* implementer must return a newly constructed <tt>AbstractPreferences</tt> * implementer must return a newly constructed {@code AbstractPreferences}
* node; once removed, an <tt>AbstractPreferences</tt> node * node; once removed, an {@code AbstractPreferences} node
* cannot be "resuscitated." * cannot be "resuscitated."
* *
* <p>If this method causes a node to be created, this node is not * <p>If this method causes a node to be created, this node is not
* guaranteed to be persistent until the <tt>flush</tt> method is * guaranteed to be persistent until the {@code flush} method is
* invoked on this node or one of its ancestors (or descendants). * invoked on this node or one of its ancestors (or descendants).
* *
* <p>This method is invoked with the lock on this node held. * <p>This method is invoked with the lock on this node held.
@ -1350,7 +1350,7 @@ public abstract class AbstractPreferences extends Preferences {
} }
/** /**
* Implements the <tt>sync</tt> method as per the specification in * Implements the {@code sync} method as per the specification in
* {@link Preferences#sync()}. * {@link Preferences#sync()}.
* *
* <p>This implementation calls a recursive helper method that locks this * <p>This implementation calls a recursive helper method that locks this
@ -1398,7 +1398,7 @@ public abstract class AbstractPreferences extends Preferences {
* entire subtree at once, the implementer is encouraged to override * entire subtree at once, the implementer is encouraged to override
* sync(), rather than merely overriding this method. * sync(), rather than merely overriding this method.
* *
* <p>If this node throws a <tt>BackingStoreException</tt>, the exception * <p>If this node throws a {@code BackingStoreException}, the exception
* will propagate out beyond the enclosing {@link #sync()} invocation. * will propagate out beyond the enclosing {@link #sync()} invocation.
* *
* @throws BackingStoreException if this operation cannot be completed * @throws BackingStoreException if this operation cannot be completed
@ -1408,7 +1408,7 @@ public abstract class AbstractPreferences extends Preferences {
protected abstract void syncSpi() throws BackingStoreException; protected abstract void syncSpi() throws BackingStoreException;
/** /**
* Implements the <tt>flush</tt> method as per the specification in * Implements the {@code flush} method as per the specification in
* {@link Preferences#flush()}. * {@link Preferences#flush()}.
* *
* <p>This implementation calls a recursive helper method that locks this * <p>This implementation calls a recursive helper method that locks this
@ -1459,7 +1459,7 @@ public abstract class AbstractPreferences extends Preferences {
* encouraged to override flush(), rather than merely overriding this * encouraged to override flush(), rather than merely overriding this
* method. * method.
* *
* <p>If this node throws a <tt>BackingStoreException</tt>, the exception * <p>If this node throws a {@code BackingStoreException}, the exception
* will propagate out beyond the enclosing {@link #flush()} invocation. * will propagate out beyond the enclosing {@link #flush()} invocation.
* *
* @throws BackingStoreException if this operation cannot be completed * @throws BackingStoreException if this operation cannot be completed
@ -1469,12 +1469,12 @@ public abstract class AbstractPreferences extends Preferences {
protected abstract void flushSpi() throws BackingStoreException; protected abstract void flushSpi() throws BackingStoreException;
/** /**
* Returns <tt>true</tt> iff this node (or an ancestor) has been * Returns {@code true} iff this node (or an ancestor) has been
* removed with the {@link #removeNode()} method. This method * removed with the {@link #removeNode()} method. This method
* locks this node prior to returning the contents of the private * locks this node prior to returning the contents of the private
* field used to track this state. * field used to track this state.
* *
* @return <tt>true</tt> iff this node (or an ancestor) has been * @return {@code true} iff this node (or an ancestor) has been
* removed with the {@link #removeNode()} method. * removed with the {@link #removeNode()} method.
*/ */
protected boolean isRemoved() { protected boolean isRemoved() {
@ -1630,12 +1630,12 @@ public abstract class AbstractPreferences extends Preferences {
} }
/** /**
* Implements the <tt>exportNode</tt> method as per the specification in * Implements the {@code exportNode} method as per the specification in
* {@link Preferences#exportNode(OutputStream)}. * {@link Preferences#exportNode(OutputStream)}.
* *
* @param os the output stream on which to emit the XML document. * @param os the output stream on which to emit the XML document.
* @throws IOException if writing to the specified output stream * @throws IOException if writing to the specified output stream
* results in an <tt>IOException</tt>. * results in an {@code IOException}.
* @throws BackingStoreException if preference data cannot be read from * @throws BackingStoreException if preference data cannot be read from
* backing store. * backing store.
*/ */
@ -1646,12 +1646,12 @@ public abstract class AbstractPreferences extends Preferences {
} }
/** /**
* Implements the <tt>exportSubtree</tt> method as per the specification in * Implements the {@code exportSubtree} method as per the specification in
* {@link Preferences#exportSubtree(OutputStream)}. * {@link Preferences#exportSubtree(OutputStream)}.
* *
* @param os the output stream on which to emit the XML document. * @param os the output stream on which to emit the XML document.
* @throws IOException if writing to the specified output stream * @throws IOException if writing to the specified output stream
* results in an <tt>IOException</tt>. * results in an {@code IOException}.
* @throws BackingStoreException if preference data cannot be read from * @throws BackingStoreException if preference data cannot be read from
* backing store. * backing store.
*/ */

View file

@ -124,7 +124,7 @@ class Base64 {
* Translates the specified Base64 string (as per Preferences.get(byte[])) * Translates the specified Base64 string (as per Preferences.get(byte[]))
* into a byte array. * into a byte array.
* *
* @throw IllegalArgumentException if <tt>s</tt> is not a valid Base64 * @throw IllegalArgumentException if {@code s} is not a valid Base64
* string. * string.
*/ */
static byte[] base64ToByteArray(String s) { static byte[] base64ToByteArray(String s) {
@ -136,7 +136,7 @@ class Base64 {
* into a byte array. * into a byte array.
* *
* @throw IllegalArgumentException or ArrayOutOfBoundsException * @throw IllegalArgumentException or ArrayOutOfBoundsException
* if <tt>s</tt> is not a valid alternate representation * if {@code s} is not a valid alternate representation
* Base64 string. * Base64 string.
*/ */
static byte[] altBase64ToByteArray(String s) { static byte[] altBase64ToByteArray(String s) {

View file

@ -28,7 +28,7 @@ package java.util.prefs;
import java.io.NotSerializableException; import java.io.NotSerializableException;
/** /**
* An event emitted by a <tt>Preferences</tt> node to indicate that * An event emitted by a {@code Preferences} node to indicate that
* a child of that node has been added or removed.<p> * a child of that node has been added or removed.<p>
* *
* Note, that although NodeChangeEvent inherits Serializable interface from * Note, that although NodeChangeEvent inherits Serializable interface from
@ -52,7 +52,7 @@ public class NodeChangeEvent extends java.util.EventObject {
private Preferences child; private Preferences child;
/** /**
* Constructs a new <code>NodeChangeEvent</code> instance. * Constructs a new {@code NodeChangeEvent} instance.
* *
* @param parent The parent of the node that was added or removed. * @param parent The parent of the node that was added or removed.
* @param child The node that was added or removed. * @param child The node that was added or removed.

View file

@ -28,7 +28,7 @@ package java.util.prefs;
import java.io.NotSerializableException; import java.io.NotSerializableException;
/** /**
* An event emitted by a <tt>Preferences</tt> node to indicate that * An event emitted by a {@code Preferences} node to indicate that
* a preference has been added, removed or has had its value changed.<p> * a preference has been added, removed or has had its value changed.<p>
* *
* Note, that although PreferenceChangeEvent inherits Serializable interface * Note, that although PreferenceChangeEvent inherits Serializable interface
@ -52,18 +52,18 @@ public class PreferenceChangeEvent extends java.util.EventObject {
private String key; private String key;
/** /**
* New value for preference, or <tt>null</tt> if it was removed. * New value for preference, or {@code null} if it was removed.
* *
* @serial * @serial
*/ */
private String newValue; private String newValue;
/** /**
* Constructs a new <code>PreferenceChangeEvent</code> instance. * Constructs a new {@code PreferenceChangeEvent} instance.
* *
* @param node The Preferences node that emitted the event. * @param node The Preferences node that emitted the event.
* @param key The key of the preference that was changed. * @param key The key of the preference that was changed.
* @param newValue The new value of the preference, or <tt>null</tt> * @param newValue The new value of the preference, or {@code null}
* if the preference is being removed. * if the preference is being removed.
*/ */
public PreferenceChangeEvent(Preferences node, String key, public PreferenceChangeEvent(Preferences node, String key,
@ -94,7 +94,7 @@ public class PreferenceChangeEvent extends java.util.EventObject {
/** /**
* Returns the new value for the preference. * Returns the new value for the preference.
* *
* @return The new value for the preference, or <tt>null</tt> if the * @return The new value for the preference, or {@code null} if the
* preference was removed. * preference was removed.
*/ */
public String getNewValue() { public String getNewValue() {

View file

@ -72,10 +72,10 @@ import java.lang.Double;
* only restrictions on this name are that it cannot be the empty string, and * only restrictions on this name are that it cannot be the empty string, and
* it cannot contain the slash character ('/'). * it cannot contain the slash character ('/').
* *
* <p>The root node has an absolute path name of <tt>"/"</tt>. Children of * <p>The root node has an absolute path name of {@code "/"}. Children of
* the root node have absolute path names of <tt>"/" + </tt><i>&lt;node * the root node have absolute path names of {@code "/" + }<i>&lt;node
* name&gt;</i>. All other nodes have absolute path names of <i>&lt;parent's * name&gt;</i>. All other nodes have absolute path names of <i>&lt;parent's
* absolute path name&gt;</i><tt> + "/" + </tt><i>&lt;node name&gt;</i>. * absolute path name&gt;</i>{@code + "/" + }<i>&lt;node name&gt;</i>.
* Note that all absolute path names begin with the slash character. * Note that all absolute path names begin with the slash character.
* *
* <p>A node <i>n</i>'s path name relative to its ancestor <i>a</i> * <p>A node <i>n</i>'s path name relative to its ancestor <i>a</i>
@ -102,18 +102,18 @@ import java.lang.Double;
* <p>All of the methods that modify preferences data are permitted to operate * <p>All of the methods that modify preferences data are permitted to operate
* asynchronously; they may return immediately, and changes will eventually * asynchronously; they may return immediately, and changes will eventually
* propagate to the persistent backing store with an implementation-dependent * propagate to the persistent backing store with an implementation-dependent
* delay. The <tt>flush</tt> method may be used to synchronously force * delay. The {@code flush} method may be used to synchronously force
* updates to the backing store. Normal termination of the Java Virtual * updates to the backing store. Normal termination of the Java Virtual
* Machine will <i>not</i> result in the loss of pending updates -- an explicit * Machine will <i>not</i> result in the loss of pending updates -- an explicit
* <tt>flush</tt> invocation is <i>not</i> required upon termination to ensure * {@code flush} invocation is <i>not</i> required upon termination to ensure
* that pending updates are made persistent. * that pending updates are made persistent.
* *
* <p>All of the methods that read preferences from a <tt>Preferences</tt> * <p>All of the methods that read preferences from a {@code Preferences}
* object require the invoker to provide a default value. The default value is * object require the invoker to provide a default value. The default value is
* returned if no value has been previously set <i>or if the backing store is * returned if no value has been previously set <i>or if the backing store is
* unavailable</i>. The intent is to allow applications to operate, albeit * unavailable</i>. The intent is to allow applications to operate, albeit
* with slightly degraded functionality, even if the backing store becomes * with slightly degraded functionality, even if the backing store becomes
* unavailable. Several methods, like <tt>flush</tt>, have semantics that * unavailable. Several methods, like {@code flush}, have semantics that
* prevent them from operating if the backing store is unavailable. Ordinary * prevent them from operating if the backing store is unavailable. Ordinary
* applications should have no need to invoke any of these methods, which can * applications should have no need to invoke any of these methods, which can
* be identified by the fact that they are declared to throw {@link * be identified by the fact that they are declared to throw {@link
@ -181,31 +181,31 @@ import java.lang.Double;
* value CDATA #REQUIRED > * value CDATA #REQUIRED >
* }</pre> * }</pre>
* *
* Every <tt>Preferences</tt> implementation must have an associated {@link * Every {@code Preferences} implementation must have an associated {@link
* PreferencesFactory} implementation. Every Java(TM) SE implementation must provide * PreferencesFactory} implementation. Every Java(TM) SE implementation must provide
* some means of specifying which <tt>PreferencesFactory</tt> implementation * some means of specifying which {@code PreferencesFactory} implementation
* is used to generate the root preferences nodes. This allows the * is used to generate the root preferences nodes. This allows the
* administrator to replace the default preferences implementation with an * administrator to replace the default preferences implementation with an
* alternative implementation. * alternative implementation.
* *
* <p>Implementation note: In Sun's JRE, the <tt>PreferencesFactory</tt> * <p>Implementation note: In Sun's JRE, the {@code PreferencesFactory}
* implementation is located as follows: * implementation is located as follows:
* *
* <ol> * <ol>
* *
* <li><p>If the system property * <li><p>If the system property
* <tt>java.util.prefs.PreferencesFactory</tt> is defined, then it is * {@code java.util.prefs.PreferencesFactory} is defined, then it is
* taken to be the fully-qualified name of a class implementing the * taken to be the fully-qualified name of a class implementing the
* <tt>PreferencesFactory</tt> interface. The class is loaded and * {@code PreferencesFactory} interface. The class is loaded and
* instantiated; if this process fails then an unspecified error is * instantiated; if this process fails then an unspecified error is
* thrown.</p></li> * thrown.</p></li>
* *
* <li><p> If a <tt>PreferencesFactory</tt> implementation class file * <li><p> If a {@code PreferencesFactory} implementation class file
* has been installed in a jar file that is visible to the * has been installed in a jar file that is visible to the
* {@link java.lang.ClassLoader#getSystemClassLoader system class loader}, * {@link java.lang.ClassLoader#getSystemClassLoader system class loader},
* and that jar file contains a provider-configuration file named * and that jar file contains a provider-configuration file named
* <tt>java.util.prefs.PreferencesFactory</tt> in the resource * {@code java.util.prefs.PreferencesFactory} in the resource
* directory <tt>META-INF/services</tt>, then the first class name * directory {@code META-INF/services}, then the first class name
* specified in that file is taken. If more than one such jar file is * specified in that file is taken. If more than one such jar file is
* provided, the first one found will be used. The class is loaded * provided, the first one found will be used. The class is loaded
* and instantiated; if this process fails then an unspecified error * and instantiated; if this process fails then an unspecified error
@ -213,7 +213,7 @@ import java.lang.Double;
* *
* <li><p>Finally, if neither the above-mentioned system property nor * <li><p>Finally, if neither the above-mentioned system property nor
* an extension jar file is provided, then the system-wide default * an extension jar file is provided, then the system-wide default
* <tt>PreferencesFactory</tt> implementation for the underlying * {@code PreferencesFactory} implementation for the underlying
* platform is loaded and instantiated.</p></li> * platform is loaded and instantiated.</p></li>
* *
* </ol> * </ol>
@ -328,19 +328,19 @@ public abstract class Preferences {
* Returns the preference node from the calling user's preference tree * Returns the preference node from the calling user's preference tree
* that is associated (by convention) with the specified class's package. * that is associated (by convention) with the specified class's package.
* The convention is as follows: the absolute path name of the node is the * The convention is as follows: the absolute path name of the node is the
* fully qualified package name, preceded by a slash (<tt>'/'</tt>), and * fully qualified package name, preceded by a slash ({@code '/'}), and
* with each period (<tt>'.'</tt>) replaced by a slash. For example the * with each period ({@code '.'}) replaced by a slash. For example the
* absolute path name of the node associated with the class * absolute path name of the node associated with the class
* <tt>com.acme.widget.Foo</tt> is <tt>/com/acme/widget</tt>. * {@code com.acme.widget.Foo} is {@code /com/acme/widget}.
* *
* <p>This convention does not apply to the unnamed package, whose * <p>This convention does not apply to the unnamed package, whose
* associated preference node is <tt>&lt;unnamed&gt;</tt>. This node * associated preference node is {@code <unnamed>}. This node
* is not intended for long term use, but for convenience in the early * is not intended for long term use, but for convenience in the early
* development of programs that do not yet belong to a package, and * development of programs that do not yet belong to a package, and
* for "throwaway" programs. <i>Valuable data should not be stored * for "throwaway" programs. <i>Valuable data should not be stored
* at this node as it is shared by all programs that use it.</i> * at this node as it is shared by all programs that use it.</i>
* *
* <p>A class <tt>Foo</tt> wishing to access preferences pertaining to its * <p>A class {@code Foo} wishing to access preferences pertaining to its
* package can obtain a preference node as follows: <pre> * package can obtain a preference node as follows: <pre>
* static Preferences prefs = Preferences.userNodeForPackage(Foo.class); * static Preferences prefs = Preferences.userNodeForPackage(Foo.class);
* </pre> * </pre>
@ -353,15 +353,15 @@ public abstract class Preferences {
* node and its ancestors if they do not already exist. If the returned * node and its ancestors if they do not already exist. If the returned
* node did not exist prior to this call, this node and any ancestors that * node did not exist prior to this call, this node and any ancestors that
* were created by this call are not guaranteed to become permanent until * were created by this call are not guaranteed to become permanent until
* the <tt>flush</tt> method is called on the returned node (or one of its * the {@code flush} method is called on the returned node (or one of its
* ancestors or descendants). * ancestors or descendants).
* *
* @param c the class for whose package a user preference node is desired. * @param c the class for whose package a user preference node is desired.
* @return the user preference node associated with the package of which * @return the user preference node associated with the package of which
* <tt>c</tt> is a member. * {@code c} is a member.
* @throws NullPointerException if <tt>c</tt> is <tt>null</tt>. * @throws NullPointerException if {@code c} is {@code null}.
* @throws SecurityException if a security manager is present and * @throws SecurityException if a security manager is present and
* it denies <tt>RuntimePermission("preferences")</tt>. * it denies {@code RuntimePermission("preferences")}.
* @see RuntimePermission * @see RuntimePermission
*/ */
public static Preferences userNodeForPackage(Class<?> c) { public static Preferences userNodeForPackage(Class<?> c) {
@ -372,19 +372,19 @@ public abstract class Preferences {
* Returns the preference node from the system preference tree that is * Returns the preference node from the system preference tree that is
* associated (by convention) with the specified class's package. The * associated (by convention) with the specified class's package. The
* convention is as follows: the absolute path name of the node is the * convention is as follows: the absolute path name of the node is the
* fully qualified package name, preceded by a slash (<tt>'/'</tt>), and * fully qualified package name, preceded by a slash ({@code '/'}), and
* with each period (<tt>'.'</tt>) replaced by a slash. For example the * with each period ({@code '.'}) replaced by a slash. For example the
* absolute path name of the node associated with the class * absolute path name of the node associated with the class
* <tt>com.acme.widget.Foo</tt> is <tt>/com/acme/widget</tt>. * {@code com.acme.widget.Foo} is {@code /com/acme/widget}.
* *
* <p>This convention does not apply to the unnamed package, whose * <p>This convention does not apply to the unnamed package, whose
* associated preference node is <tt>&lt;unnamed&gt;</tt>. This node * associated preference node is {@code <unnamed>}. This node
* is not intended for long term use, but for convenience in the early * is not intended for long term use, but for convenience in the early
* development of programs that do not yet belong to a package, and * development of programs that do not yet belong to a package, and
* for "throwaway" programs. <i>Valuable data should not be stored * for "throwaway" programs. <i>Valuable data should not be stored
* at this node as it is shared by all programs that use it.</i> * at this node as it is shared by all programs that use it.</i>
* *
* <p>A class <tt>Foo</tt> wishing to access preferences pertaining to its * <p>A class {@code Foo} wishing to access preferences pertaining to its
* package can obtain a preference node as follows: <pre> * package can obtain a preference node as follows: <pre>
* static Preferences prefs = Preferences.systemNodeForPackage(Foo.class); * static Preferences prefs = Preferences.systemNodeForPackage(Foo.class);
* </pre> * </pre>
@ -397,15 +397,15 @@ public abstract class Preferences {
* node and its ancestors if they do not already exist. If the returned * node and its ancestors if they do not already exist. If the returned
* node did not exist prior to this call, this node and any ancestors that * node did not exist prior to this call, this node and any ancestors that
* were created by this call are not guaranteed to become permanent until * were created by this call are not guaranteed to become permanent until
* the <tt>flush</tt> method is called on the returned node (or one of its * the {@code flush} method is called on the returned node (or one of its
* ancestors or descendants). * ancestors or descendants).
* *
* @param c the class for whose package a system preference node is desired. * @param c the class for whose package a system preference node is desired.
* @return the system preference node associated with the package of which * @return the system preference node associated with the package of which
* <tt>c</tt> is a member. * {@code c} is a member.
* @throws NullPointerException if <tt>c</tt> is <tt>null</tt>. * @throws NullPointerException if {@code c} is {@code null}.
* @throws SecurityException if a security manager is present and * @throws SecurityException if a security manager is present and
* it denies <tt>RuntimePermission("preferences")</tt>. * it denies {@code RuntimePermission("preferences")}.
* @see RuntimePermission * @see RuntimePermission
*/ */
public static Preferences systemNodeForPackage(Class<?> c) { public static Preferences systemNodeForPackage(Class<?> c) {
@ -443,7 +443,7 @@ public abstract class Preferences {
* *
* @return the root preference node for the calling user. * @return the root preference node for the calling user.
* @throws SecurityException If a security manager is present and * @throws SecurityException If a security manager is present and
* it denies <tt>RuntimePermission("preferences")</tt>. * it denies {@code RuntimePermission("preferences")}.
* @see RuntimePermission * @see RuntimePermission
*/ */
public static Preferences userRoot() { public static Preferences userRoot() {
@ -459,7 +459,7 @@ public abstract class Preferences {
* *
* @return the root preference node for the system. * @return the root preference node for the system.
* @throws SecurityException If a security manager is present and * @throws SecurityException If a security manager is present and
* it denies <tt>RuntimePermission("preferences")</tt>. * it denies {@code RuntimePermission("preferences")}.
* @see RuntimePermission * @see RuntimePermission
*/ */
public static Preferences systemRoot() { public static Preferences systemRoot() {
@ -483,10 +483,10 @@ public abstract class Preferences {
* *
* @param key key with which the specified value is to be associated. * @param key key with which the specified value is to be associated.
* @param value value to be associated with the specified key. * @param value value to be associated with the specified key.
* @throws NullPointerException if key or value is <tt>null</tt>. * @throws NullPointerException if key or value is {@code null}.
* @throws IllegalArgumentException if <tt>key.length()</tt> exceeds * @throws IllegalArgumentException if {@code key.length()} exceeds
* <tt>MAX_KEY_LENGTH</tt> or if <tt>value.length</tt> exceeds * {@code MAX_KEY_LENGTH} or if {@code value.length} exceeds
* <tt>MAX_VALUE_LENGTH</tt>. * {@code MAX_VALUE_LENGTH}.
* @throws IllegalStateException if this node (or an ancestor) has been * @throws IllegalStateException if this node (or an ancestor) has been
* removed with the {@link #removeNode()} method. * removed with the {@link #removeNode()} method.
* @throws IllegalArgumentException if either key or value contain * @throws IllegalArgumentException if either key or value contain
@ -506,14 +506,14 @@ public abstract class Preferences {
* *
* @param key key whose associated value is to be returned. * @param key key whose associated value is to be returned.
* @param def the value to be returned in the event that this * @param def the value to be returned in the event that this
* preference node has no value associated with <tt>key</tt>. * preference node has no value associated with {@code key}.
* @return the value associated with <tt>key</tt>, or <tt>def</tt> * @return the value associated with {@code key}, or {@code def}
* if no value is associated with <tt>key</tt>, or the backing * if no value is associated with {@code key}, or the backing
* store is inaccessible. * store is inaccessible.
* @throws IllegalStateException if this node (or an ancestor) has been * @throws IllegalStateException if this node (or an ancestor) has been
* removed with the {@link #removeNode()} method. * removed with the {@link #removeNode()} method.
* @throws NullPointerException if <tt>key</tt> is <tt>null</tt>. (A * @throws NullPointerException if {@code key} is {@code null}. (A
* <tt>null</tt> value for <tt>def</tt> <i>is</i> permitted.) * {@code null} value for {@code def} <i>is</i> permitted.)
* @throws IllegalArgumentException if key contains the null control * @throws IllegalArgumentException if key contains the null control
* character, code point U+0000. * character, code point U+0000.
*/ */
@ -526,10 +526,10 @@ public abstract class Preferences {
* <p>If this implementation supports <i>stored defaults</i>, and there is * <p>If this implementation supports <i>stored defaults</i>, and there is
* such a default for the specified preference, the stored default will be * such a default for the specified preference, the stored default will be
* "exposed" by this call, in the sense that it will be returned * "exposed" by this call, in the sense that it will be returned
* by a succeeding call to <tt>get</tt>. * by a succeeding call to {@code get}.
* *
* @param key key whose mapping is to be removed from the preference node. * @param key key whose mapping is to be removed from the preference node.
* @throws NullPointerException if <tt>key</tt> is <tt>null</tt>. * @throws NullPointerException if {@code key} is {@code null}.
* @throws IllegalStateException if this node (or an ancestor) has been * @throws IllegalStateException if this node (or an ancestor) has been
* removed with the {@link #removeNode()} method. * removed with the {@link #removeNode()} method.
* @throws IllegalArgumentException if key contains the null control * @throws IllegalArgumentException if key contains the null control
@ -545,7 +545,7 @@ public abstract class Preferences {
* <p>If this implementation supports <i>stored defaults</i>, and this * <p>If this implementation supports <i>stored defaults</i>, and this
* node in the preferences hierarchy contains any such defaults, * node in the preferences hierarchy contains any such defaults,
* the stored defaults will be "exposed" by this call, in the sense that * the stored defaults will be "exposed" by this call, in the sense that
* they will be returned by succeeding calls to <tt>get</tt>. * they will be returned by succeeding calls to {@code get}.
* *
* @throws BackingStoreException if this operation cannot be completed * @throws BackingStoreException if this operation cannot be completed
* due to a failure in the backing store, or inability to * due to a failure in the backing store, or inability to
@ -565,9 +565,9 @@ public abstract class Preferences {
* *
* @param key key with which the string form of value is to be associated. * @param key key with which the string form of value is to be associated.
* @param value value whose string form is to be associated with key. * @param value value whose string form is to be associated with key.
* @throws NullPointerException if <tt>key</tt> is <tt>null</tt>. * @throws NullPointerException if {@code key} is {@code null}.
* @throws IllegalArgumentException if <tt>key.length()</tt> exceeds * @throws IllegalArgumentException if {@code key.length()} exceeds
* <tt>MAX_KEY_LENGTH</tt>. * {@code MAX_KEY_LENGTH}.
* @throws IllegalStateException if this node (or an ancestor) has been * @throws IllegalStateException if this node (or an ancestor) has been
* removed with the {@link #removeNode()} method. * removed with the {@link #removeNode()} method.
* @throws IllegalArgumentException if key contains * @throws IllegalArgumentException if key contains
@ -582,27 +582,27 @@ public abstract class Preferences {
* an integer as by {@link Integer#parseInt(String)}. Returns the * an integer as by {@link Integer#parseInt(String)}. Returns the
* specified default if there is no value associated with the key, * specified default if there is no value associated with the key,
* the backing store is inaccessible, or if * the backing store is inaccessible, or if
* <tt>Integer.parseInt(String)</tt> would throw a {@link * {@code Integer.parseInt(String)} would throw a {@link
* NumberFormatException} if the associated value were passed. This * NumberFormatException} if the associated value were passed. This
* method is intended for use in conjunction with {@link #putInt}. * method is intended for use in conjunction with {@link #putInt}.
* *
* <p>If the implementation supports <i>stored defaults</i> and such a * <p>If the implementation supports <i>stored defaults</i> and such a
* default exists, is accessible, and could be converted to an int * default exists, is accessible, and could be converted to an int
* with <tt>Integer.parseInt</tt>, this int is returned in preference to * with {@code Integer.parseInt}, this int is returned in preference to
* the specified default. * the specified default.
* *
* @param key key whose associated value is to be returned as an int. * @param key key whose associated value is to be returned as an int.
* @param def the value to be returned in the event that this * @param def the value to be returned in the event that this
* preference node has no value associated with <tt>key</tt> * preference node has no value associated with {@code key}
* or the associated value cannot be interpreted as an int, * or the associated value cannot be interpreted as an int,
* or the backing store is inaccessible. * or the backing store is inaccessible.
* @return the int value represented by the string associated with * @return the int value represented by the string associated with
* <tt>key</tt> in this preference node, or <tt>def</tt> if the * {@code key} in this preference node, or {@code def} if the
* associated value does not exist or cannot be interpreted as * associated value does not exist or cannot be interpreted as
* an int. * an int.
* @throws IllegalStateException if this node (or an ancestor) has been * @throws IllegalStateException if this node (or an ancestor) has been
* removed with the {@link #removeNode()} method. * removed with the {@link #removeNode()} method.
* @throws NullPointerException if <tt>key</tt> is <tt>null</tt>. * @throws NullPointerException if {@code key} is {@code null}.
* @throws IllegalArgumentException if key contains the null control * @throws IllegalArgumentException if key contains the null control
* character, code point U+0000. * character, code point U+0000.
* @see #putInt(String,int) * @see #putInt(String,int)
@ -619,9 +619,9 @@ public abstract class Preferences {
* *
* @param key key with which the string form of value is to be associated. * @param key key with which the string form of value is to be associated.
* @param value value whose string form is to be associated with key. * @param value value whose string form is to be associated with key.
* @throws NullPointerException if <tt>key</tt> is <tt>null</tt>. * @throws NullPointerException if {@code key} is {@code null}.
* @throws IllegalArgumentException if <tt>key.length()</tt> exceeds * @throws IllegalArgumentException if {@code key.length()} exceeds
* <tt>MAX_KEY_LENGTH</tt>. * {@code MAX_KEY_LENGTH}.
* @throws IllegalStateException if this node (or an ancestor) has been * @throws IllegalStateException if this node (or an ancestor) has been
* removed with the {@link #removeNode()} method. * removed with the {@link #removeNode()} method.
* @throws IllegalArgumentException if key contains * @throws IllegalArgumentException if key contains
@ -636,27 +636,27 @@ public abstract class Preferences {
* a long as by {@link Long#parseLong(String)}. Returns the * a long as by {@link Long#parseLong(String)}. Returns the
* specified default if there is no value associated with the key, * specified default if there is no value associated with the key,
* the backing store is inaccessible, or if * the backing store is inaccessible, or if
* <tt>Long.parseLong(String)</tt> would throw a {@link * {@code Long.parseLong(String)} would throw a {@link
* NumberFormatException} if the associated value were passed. This * NumberFormatException} if the associated value were passed. This
* method is intended for use in conjunction with {@link #putLong}. * method is intended for use in conjunction with {@link #putLong}.
* *
* <p>If the implementation supports <i>stored defaults</i> and such a * <p>If the implementation supports <i>stored defaults</i> and such a
* default exists, is accessible, and could be converted to a long * default exists, is accessible, and could be converted to a long
* with <tt>Long.parseLong</tt>, this long is returned in preference to * with {@code Long.parseLong}, this long is returned in preference to
* the specified default. * the specified default.
* *
* @param key key whose associated value is to be returned as a long. * @param key key whose associated value is to be returned as a long.
* @param def the value to be returned in the event that this * @param def the value to be returned in the event that this
* preference node has no value associated with <tt>key</tt> * preference node has no value associated with {@code key}
* or the associated value cannot be interpreted as a long, * or the associated value cannot be interpreted as a long,
* or the backing store is inaccessible. * or the backing store is inaccessible.
* @return the long value represented by the string associated with * @return the long value represented by the string associated with
* <tt>key</tt> in this preference node, or <tt>def</tt> if the * {@code key} in this preference node, or {@code def} if the
* associated value does not exist or cannot be interpreted as * associated value does not exist or cannot be interpreted as
* a long. * a long.
* @throws IllegalStateException if this node (or an ancestor) has been * @throws IllegalStateException if this node (or an ancestor) has been
* removed with the {@link #removeNode()} method. * removed with the {@link #removeNode()} method.
* @throws NullPointerException if <tt>key</tt> is <tt>null</tt>. * @throws NullPointerException if {@code key} is {@code null}.
* @throws IllegalArgumentException if key contains the null control * @throws IllegalArgumentException if key contains the null control
* character, code point U+0000. * character, code point U+0000.
* @see #putLong(String,long) * @see #putLong(String,long)
@ -667,15 +667,15 @@ public abstract class Preferences {
/** /**
* Associates a string representing the specified boolean value with the * Associates a string representing the specified boolean value with the
* specified key in this preference node. The associated string is * specified key in this preference node. The associated string is
* <tt>"true"</tt> if the value is true, and <tt>"false"</tt> if it is * {@code "true"} if the value is true, and {@code "false"} if it is
* false. This method is intended for use in conjunction with * false. This method is intended for use in conjunction with
* {@link #getBoolean}. * {@link #getBoolean}.
* *
* @param key key with which the string form of value is to be associated. * @param key key with which the string form of value is to be associated.
* @param value value whose string form is to be associated with key. * @param value value whose string form is to be associated with key.
* @throws NullPointerException if <tt>key</tt> is <tt>null</tt>. * @throws NullPointerException if {@code key} is {@code null}.
* @throws IllegalArgumentException if <tt>key.length()</tt> exceeds * @throws IllegalArgumentException if {@code key.length()} exceeds
* <tt>MAX_KEY_LENGTH</tt>. * {@code MAX_KEY_LENGTH}.
* @throws IllegalStateException if this node (or an ancestor) has been * @throws IllegalStateException if this node (or an ancestor) has been
* removed with the {@link #removeNode()} method. * removed with the {@link #removeNode()} method.
* @throws IllegalArgumentException if key contains * @throws IllegalArgumentException if key contains
@ -688,34 +688,34 @@ public abstract class Preferences {
/** /**
* Returns the boolean value represented by the string associated with the * Returns the boolean value represented by the string associated with the
* specified key in this preference node. Valid strings * specified key in this preference node. Valid strings
* are <tt>"true"</tt>, which represents true, and <tt>"false"</tt>, which * are {@code "true"}, which represents true, and {@code "false"}, which
* represents false. Case is ignored, so, for example, <tt>"TRUE"</tt> * represents false. Case is ignored, so, for example, {@code "TRUE"}
* and <tt>"False"</tt> are also valid. This method is intended for use in * and {@code "False"} are also valid. This method is intended for use in
* conjunction with {@link #putBoolean}. * conjunction with {@link #putBoolean}.
* *
* <p>Returns the specified default if there is no value * <p>Returns the specified default if there is no value
* associated with the key, the backing store is inaccessible, or if the * associated with the key, the backing store is inaccessible, or if the
* associated value is something other than <tt>"true"</tt> or * associated value is something other than {@code "true"} or
* <tt>"false"</tt>, ignoring case. * {@code "false"}, ignoring case.
* *
* <p>If the implementation supports <i>stored defaults</i> and such a * <p>If the implementation supports <i>stored defaults</i> and such a
* default exists and is accessible, it is used in preference to the * default exists and is accessible, it is used in preference to the
* specified default, unless the stored default is something other than * specified default, unless the stored default is something other than
* <tt>"true"</tt> or <tt>"false"</tt>, ignoring case, in which case the * {@code "true"} or {@code "false"}, ignoring case, in which case the
* specified default is used. * specified default is used.
* *
* @param key key whose associated value is to be returned as a boolean. * @param key key whose associated value is to be returned as a boolean.
* @param def the value to be returned in the event that this * @param def the value to be returned in the event that this
* preference node has no value associated with <tt>key</tt> * preference node has no value associated with {@code key}
* or the associated value cannot be interpreted as a boolean, * or the associated value cannot be interpreted as a boolean,
* or the backing store is inaccessible. * or the backing store is inaccessible.
* @return the boolean value represented by the string associated with * @return the boolean value represented by the string associated with
* <tt>key</tt> in this preference node, or <tt>def</tt> if the * {@code key} in this preference node, or {@code def} if the
* associated value does not exist or cannot be interpreted as * associated value does not exist or cannot be interpreted as
* a boolean. * a boolean.
* @throws IllegalStateException if this node (or an ancestor) has been * @throws IllegalStateException if this node (or an ancestor) has been
* removed with the {@link #removeNode()} method. * removed with the {@link #removeNode()} method.
* @throws NullPointerException if <tt>key</tt> is <tt>null</tt>. * @throws NullPointerException if {@code key} is {@code null}.
* @throws IllegalArgumentException if key contains the null control * @throws IllegalArgumentException if key contains the null control
* character, code point U+0000. * character, code point U+0000.
* @see #get(String,String) * @see #get(String,String)
@ -732,9 +732,9 @@ public abstract class Preferences {
* *
* @param key key with which the string form of value is to be associated. * @param key key with which the string form of value is to be associated.
* @param value value whose string form is to be associated with key. * @param value value whose string form is to be associated with key.
* @throws NullPointerException if <tt>key</tt> is <tt>null</tt>. * @throws NullPointerException if {@code key} is {@code null}.
* @throws IllegalArgumentException if <tt>key.length()</tt> exceeds * @throws IllegalArgumentException if {@code key.length()} exceeds
* <tt>MAX_KEY_LENGTH</tt>. * {@code MAX_KEY_LENGTH}.
* @throws IllegalStateException if this node (or an ancestor) has been * @throws IllegalStateException if this node (or an ancestor) has been
* removed with the {@link #removeNode()} method. * removed with the {@link #removeNode()} method.
* @throws IllegalArgumentException if key contains * @throws IllegalArgumentException if key contains
@ -748,27 +748,27 @@ public abstract class Preferences {
* specified key in this preference node. The string is converted to an * specified key in this preference node. The string is converted to an
* integer as by {@link Float#parseFloat(String)}. Returns the specified * integer as by {@link Float#parseFloat(String)}. Returns the specified
* default if there is no value associated with the key, the backing store * default if there is no value associated with the key, the backing store
* is inaccessible, or if <tt>Float.parseFloat(String)</tt> would throw a * is inaccessible, or if {@code Float.parseFloat(String)} would throw a
* {@link NumberFormatException} if the associated value were passed. * {@link NumberFormatException} if the associated value were passed.
* This method is intended for use in conjunction with {@link #putFloat}. * This method is intended for use in conjunction with {@link #putFloat}.
* *
* <p>If the implementation supports <i>stored defaults</i> and such a * <p>If the implementation supports <i>stored defaults</i> and such a
* default exists, is accessible, and could be converted to a float * default exists, is accessible, and could be converted to a float
* with <tt>Float.parseFloat</tt>, this float is returned in preference to * with {@code Float.parseFloat}, this float is returned in preference to
* the specified default. * the specified default.
* *
* @param key key whose associated value is to be returned as a float. * @param key key whose associated value is to be returned as a float.
* @param def the value to be returned in the event that this * @param def the value to be returned in the event that this
* preference node has no value associated with <tt>key</tt> * preference node has no value associated with {@code key}
* or the associated value cannot be interpreted as a float, * or the associated value cannot be interpreted as a float,
* or the backing store is inaccessible. * or the backing store is inaccessible.
* @return the float value represented by the string associated with * @return the float value represented by the string associated with
* <tt>key</tt> in this preference node, or <tt>def</tt> if the * {@code key} in this preference node, or {@code def} if the
* associated value does not exist or cannot be interpreted as * associated value does not exist or cannot be interpreted as
* a float. * a float.
* @throws IllegalStateException if this node (or an ancestor) has been * @throws IllegalStateException if this node (or an ancestor) has been
* removed with the {@link #removeNode()} method. * removed with the {@link #removeNode()} method.
* @throws NullPointerException if <tt>key</tt> is <tt>null</tt>. * @throws NullPointerException if {@code key} is {@code null}.
* @throws IllegalArgumentException if key contains the null control * @throws IllegalArgumentException if key contains the null control
* character, code point U+0000. * character, code point U+0000.
* @see #putFloat(String,float) * @see #putFloat(String,float)
@ -785,9 +785,9 @@ public abstract class Preferences {
* *
* @param key key with which the string form of value is to be associated. * @param key key with which the string form of value is to be associated.
* @param value value whose string form is to be associated with key. * @param value value whose string form is to be associated with key.
* @throws NullPointerException if <tt>key</tt> is <tt>null</tt>. * @throws NullPointerException if {@code key} is {@code null}.
* @throws IllegalArgumentException if <tt>key.length()</tt> exceeds * @throws IllegalArgumentException if {@code key.length()} exceeds
* <tt>MAX_KEY_LENGTH</tt>. * {@code MAX_KEY_LENGTH}.
* @throws IllegalStateException if this node (or an ancestor) has been * @throws IllegalStateException if this node (or an ancestor) has been
* removed with the {@link #removeNode()} method. * removed with the {@link #removeNode()} method.
* @throws IllegalArgumentException if key contains * @throws IllegalArgumentException if key contains
@ -801,27 +801,27 @@ public abstract class Preferences {
* specified key in this preference node. The string is converted to an * specified key in this preference node. The string is converted to an
* integer as by {@link Double#parseDouble(String)}. Returns the specified * integer as by {@link Double#parseDouble(String)}. Returns the specified
* default if there is no value associated with the key, the backing store * default if there is no value associated with the key, the backing store
* is inaccessible, or if <tt>Double.parseDouble(String)</tt> would throw a * is inaccessible, or if {@code Double.parseDouble(String)} would throw a
* {@link NumberFormatException} if the associated value were passed. * {@link NumberFormatException} if the associated value were passed.
* This method is intended for use in conjunction with {@link #putDouble}. * This method is intended for use in conjunction with {@link #putDouble}.
* *
* <p>If the implementation supports <i>stored defaults</i> and such a * <p>If the implementation supports <i>stored defaults</i> and such a
* default exists, is accessible, and could be converted to a double * default exists, is accessible, and could be converted to a double
* with <tt>Double.parseDouble</tt>, this double is returned in preference * with {@code Double.parseDouble}, this double is returned in preference
* to the specified default. * to the specified default.
* *
* @param key key whose associated value is to be returned as a double. * @param key key whose associated value is to be returned as a double.
* @param def the value to be returned in the event that this * @param def the value to be returned in the event that this
* preference node has no value associated with <tt>key</tt> * preference node has no value associated with {@code key}
* or the associated value cannot be interpreted as a double, * or the associated value cannot be interpreted as a double,
* or the backing store is inaccessible. * or the backing store is inaccessible.
* @return the double value represented by the string associated with * @return the double value represented by the string associated with
* <tt>key</tt> in this preference node, or <tt>def</tt> if the * {@code key} in this preference node, or {@code def} if the
* associated value does not exist or cannot be interpreted as * associated value does not exist or cannot be interpreted as
* a double. * a double.
* @throws IllegalStateException if this node (or an ancestor) has been * @throws IllegalStateException if this node (or an ancestor) has been
* removed with the {@link #removeNode()} method. * removed with the {@link #removeNode()} method.
* @throws NullPointerException if <tt>key</tt> is <tt>null</tt>. * @throws NullPointerException if {@code key} is {@code null}.
* @throws IllegalArgumentException if key contains the null control * @throws IllegalArgumentException if key contains the null control
* character, code point U+0000. * character, code point U+0000.
* @see #putDouble(String,double) * @see #putDouble(String,double)
@ -837,14 +837,14 @@ public abstract class Preferences {
* with one minor change: the string will consist solely of characters * with one minor change: the string will consist solely of characters
* from the <i>Base64 Alphabet</i>; it will not contain any newline * from the <i>Base64 Alphabet</i>; it will not contain any newline
* characters. Note that the maximum length of the byte array is limited * characters. Note that the maximum length of the byte array is limited
* to three quarters of <tt>MAX_VALUE_LENGTH</tt> so that the length * to three quarters of {@code MAX_VALUE_LENGTH} so that the length
* of the Base64 encoded String does not exceed <tt>MAX_VALUE_LENGTH</tt>. * of the Base64 encoded String does not exceed {@code MAX_VALUE_LENGTH}.
* This method is intended for use in conjunction with * This method is intended for use in conjunction with
* {@link #getByteArray}. * {@link #getByteArray}.
* *
* @param key key with which the string form of value is to be associated. * @param key key with which the string form of value is to be associated.
* @param value value whose string form is to be associated with key. * @param value value whose string form is to be associated with key.
* @throws NullPointerException if key or value is <tt>null</tt>. * @throws NullPointerException if key or value is {@code null}.
* @throws IllegalArgumentException if key.length() exceeds MAX_KEY_LENGTH * @throws IllegalArgumentException if key.length() exceeds MAX_KEY_LENGTH
* or if value.length exceeds MAX_VALUE_LENGTH*3/4. * or if value.length exceeds MAX_VALUE_LENGTH*3/4.
* @throws IllegalStateException if this node (or an ancestor) has been * @throws IllegalStateException if this node (or an ancestor) has been
@ -879,17 +879,17 @@ public abstract class Preferences {
* *
* @param key key whose associated value is to be returned as a byte array. * @param key key whose associated value is to be returned as a byte array.
* @param def the value to be returned in the event that this * @param def the value to be returned in the event that this
* preference node has no value associated with <tt>key</tt> * preference node has no value associated with {@code key}
* or the associated value cannot be interpreted as a byte array, * or the associated value cannot be interpreted as a byte array,
* or the backing store is inaccessible. * or the backing store is inaccessible.
* @return the byte array value represented by the string associated with * @return the byte array value represented by the string associated with
* <tt>key</tt> in this preference node, or <tt>def</tt> if the * {@code key} in this preference node, or {@code def} if the
* associated value does not exist or cannot be interpreted as * associated value does not exist or cannot be interpreted as
* a byte array. * a byte array.
* @throws IllegalStateException if this node (or an ancestor) has been * @throws IllegalStateException if this node (or an ancestor) has been
* removed with the {@link #removeNode()} method. * removed with the {@link #removeNode()} method.
* @throws NullPointerException if <tt>key</tt> is <tt>null</tt>. (A * @throws NullPointerException if {@code key} is {@code null}. (A
* <tt>null</tt> value for <tt>def</tt> <i>is</i> permitted.) * {@code null} value for {@code def} <i>is</i> permitted.)
* @throws IllegalArgumentException if key contains the null control * @throws IllegalArgumentException if key contains the null control
* character, code point U+0000. * character, code point U+0000.
* @see #get(String,String) * @see #get(String,String)
@ -932,7 +932,7 @@ public abstract class Preferences {
public abstract String[] childrenNames() throws BackingStoreException; public abstract String[] childrenNames() throws BackingStoreException;
/** /**
* Returns the parent of this preference node, or <tt>null</tt> if this is * Returns the parent of this preference node, or {@code null} if this is
* the root. * the root.
* *
* @return the parent of this preference node. * @return the parent of this preference node.
@ -945,12 +945,12 @@ public abstract class Preferences {
* Returns the named preference node in the same tree as this node, * Returns the named preference node in the same tree as this node,
* creating it and any of its ancestors if they do not already exist. * creating it and any of its ancestors if they do not already exist.
* Accepts a relative or absolute path name. Relative path names * Accepts a relative or absolute path name. Relative path names
* (which do not begin with the slash character <tt>('/')</tt>) are * (which do not begin with the slash character {@code ('/')}) are
* interpreted relative to this preference node. * interpreted relative to this preference node.
* *
* <p>If the returned node did not exist prior to this call, this node and * <p>If the returned node did not exist prior to this call, this node and
* any ancestors that were created by this call are not guaranteed * any ancestors that were created by this call are not guaranteed
* to become permanent until the <tt>flush</tt> method is called on * to become permanent until the {@code flush} method is called on
* the returned node (or one of its ancestors or descendants). * the returned node (or one of its ancestors or descendants).
* *
* @param pathName the path name of the preference node to return. * @param pathName the path name of the preference node to return.
@ -958,7 +958,7 @@ public abstract class Preferences {
* @throws IllegalArgumentException if the path name is invalid (i.e., * @throws IllegalArgumentException if the path name is invalid (i.e.,
* it contains multiple consecutive slash characters, or ends * it contains multiple consecutive slash characters, or ends
* with a slash character and is more than one character long). * with a slash character and is more than one character long).
* @throws NullPointerException if path name is <tt>null</tt>. * @throws NullPointerException if path name is {@code null}.
* @throws IllegalStateException if this node (or an ancestor) has been * @throws IllegalStateException if this node (or an ancestor) has been
* removed with the {@link #removeNode()} method. * removed with the {@link #removeNode()} method.
* @see #flush() * @see #flush()
@ -968,14 +968,14 @@ public abstract class Preferences {
/** /**
* Returns true if the named preference node exists in the same tree * Returns true if the named preference node exists in the same tree
* as this node. Relative path names (which do not begin with the slash * as this node. Relative path names (which do not begin with the slash
* character <tt>('/')</tt>) are interpreted relative to this preference * character {@code ('/')}) are interpreted relative to this preference
* node. * node.
* *
* <p>If this node (or an ancestor) has already been removed with the * <p>If this node (or an ancestor) has already been removed with the
* {@link #removeNode()} method, it <i>is</i> legal to invoke this method, * {@link #removeNode()} method, it <i>is</i> legal to invoke this method,
* but only with the path name <tt>""</tt>; the invocation will return * but only with the path name {@code ""}; the invocation will return
* <tt>false</tt>. Thus, the idiom <tt>p.nodeExists("")</tt> may be * {@code false}. Thus, the idiom {@code p.nodeExists("")} may be
* used to test whether <tt>p</tt> has been removed. * used to test whether {@code p} has been removed.
* *
* @param pathName the path name of the node whose existence * @param pathName the path name of the node whose existence
* is to be checked. * is to be checked.
@ -986,10 +986,10 @@ public abstract class Preferences {
* @throws IllegalArgumentException if the path name is invalid (i.e., * @throws IllegalArgumentException if the path name is invalid (i.e.,
* it contains multiple consecutive slash characters, or ends * it contains multiple consecutive slash characters, or ends
* with a slash character and is more than one character long). * with a slash character and is more than one character long).
* @throws NullPointerException if path name is <tt>null</tt>. * @throws NullPointerException if path name is {@code null}.
* @throws IllegalStateException if this node (or an ancestor) has been * @throws IllegalStateException if this node (or an ancestor) has been
* removed with the {@link #removeNode()} method and * removed with the {@link #removeNode()} method and
* <tt>pathName</tt> is not the empty string (<tt>""</tt>). * {@code pathName} is not the empty string ({@code ""}).
*/ */
public abstract boolean nodeExists(String pathName) public abstract boolean nodeExists(String pathName)
throws BackingStoreException; throws BackingStoreException;
@ -1000,19 +1000,19 @@ public abstract class Preferences {
* removed, attempting any method other than {@link #name()}, * removed, attempting any method other than {@link #name()},
* {@link #absolutePath()}, {@link #isUserNode()}, {@link #flush()} or * {@link #absolutePath()}, {@link #isUserNode()}, {@link #flush()} or
* {@link #node(String) nodeExists("")} on the corresponding * {@link #node(String) nodeExists("")} on the corresponding
* <tt>Preferences</tt> instance will fail with an * {@code Preferences} instance will fail with an
* <tt>IllegalStateException</tt>. (The methods defined on {@link Object} * {@code IllegalStateException}. (The methods defined on {@link Object}
* can still be invoked on a node after it has been removed; they will not * can still be invoked on a node after it has been removed; they will not
* throw <tt>IllegalStateException</tt>.) * throw {@code IllegalStateException}.)
* *
* <p>The removal is not guaranteed to be persistent until the * <p>The removal is not guaranteed to be persistent until the
* <tt>flush</tt> method is called on this node (or an ancestor). * {@code flush} method is called on this node (or an ancestor).
* *
* <p>If this implementation supports <i>stored defaults</i>, removing a * <p>If this implementation supports <i>stored defaults</i>, removing a
* node exposes any stored defaults at or below this node. Thus, a * node exposes any stored defaults at or below this node. Thus, a
* subsequent call to <tt>nodeExists</tt> on this node's path name may * subsequent call to {@code nodeExists} on this node's path name may
* return <tt>true</tt>, and a subsequent call to <tt>node</tt> on this * return {@code true}, and a subsequent call to {@code node} on this
* path name may return a (different) <tt>Preferences</tt> instance * path name may return a (different) {@code Preferences} instance
* representing a non-empty collection of preferences and/or children. * representing a non-empty collection of preferences and/or children.
* *
* @throws BackingStoreException if this operation cannot be completed * @throws BackingStoreException if this operation cannot be completed
@ -1041,19 +1041,19 @@ public abstract class Preferences {
public abstract String absolutePath(); public abstract String absolutePath();
/** /**
* Returns <tt>true</tt> if this preference node is in the user * Returns {@code true} if this preference node is in the user
* preference tree, <tt>false</tt> if it's in the system preference tree. * preference tree, {@code false} if it's in the system preference tree.
* *
* @return <tt>true</tt> if this preference node is in the user * @return {@code true} if this preference node is in the user
* preference tree, <tt>false</tt> if it's in the system * preference tree, {@code false} if it's in the system
* preference tree. * preference tree.
*/ */
public abstract boolean isUserNode(); public abstract boolean isUserNode();
/** /**
* Returns a string representation of this preferences node, * Returns a string representation of this preferences node,
* as if computed by the expression:<tt>(this.isUserNode() ? "User" : * as if computed by the expression:{@code (this.isUserNode() ? "User" :
* "System") + " Preference Node: " + this.absolutePath()</tt>. * "System") + " Preference Node: " + this.absolutePath()}.
*/ */
public abstract String toString(); public abstract String toString();
@ -1086,9 +1086,9 @@ public abstract class Preferences {
/** /**
* Ensures that future reads from this preference node and its * Ensures that future reads from this preference node and its
* descendants reflect any changes that were committed to the persistent * descendants reflect any changes that were committed to the persistent
* store (from any VM) prior to the <tt>sync</tt> invocation. As a * store (from any VM) prior to the {@code sync} invocation. As a
* side-effect, forces any changes in the contents of this preference node * side-effect, forces any changes in the contents of this preference node
* and its descendants to the persistent store, as if the <tt>flush</tt> * and its descendants to the persistent store, as if the {@code flush}
* method had been invoked on this node. * method had been invoked on this node.
* *
* @throws BackingStoreException if this operation cannot be completed * @throws BackingStoreException if this operation cannot be completed
@ -1107,7 +1107,7 @@ public abstract class Preferences {
* node, or when the value associated with a preference is changed. * node, or when the value associated with a preference is changed.
* (Preference change events are <i>not</i> generated by the {@link * (Preference change events are <i>not</i> generated by the {@link
* #removeNode()} method, which generates a <i>node change event</i>. * #removeNode()} method, which generates a <i>node change event</i>.
* Preference change events <i>are</i> generated by the <tt>clear</tt> * Preference change events <i>are</i> generated by the {@code clear}
* method.) * method.)
* *
* <p>Events are only guaranteed for changes made within the same JVM * <p>Events are only guaranteed for changes made within the same JVM
@ -1118,7 +1118,7 @@ public abstract class Preferences {
* desiring such events must register with each descendant. * desiring such events must register with each descendant.
* *
* @param pcl The preference change listener to add. * @param pcl The preference change listener to add.
* @throws NullPointerException if <tt>pcl</tt> is null. * @throws NullPointerException if {@code pcl} is null.
* @throws IllegalStateException if this node (or an ancestor) has been * @throws IllegalStateException if this node (or an ancestor) has been
* removed with the {@link #removeNode()} method. * removed with the {@link #removeNode()} method.
* @see #removePreferenceChangeListener(PreferenceChangeListener) * @see #removePreferenceChangeListener(PreferenceChangeListener)
@ -1132,7 +1132,7 @@ public abstract class Preferences {
* receives preference change events. * receives preference change events.
* *
* @param pcl The preference change listener to remove. * @param pcl The preference change listener to remove.
* @throws IllegalArgumentException if <tt>pcl</tt> was not a registered * @throws IllegalArgumentException if {@code pcl} was not a registered
* preference change listener on this node. * preference change listener on this node.
* @throws IllegalStateException if this node (or an ancestor) has been * @throws IllegalStateException if this node (or an ancestor) has been
* removed with the {@link #removeNode()} method. * removed with the {@link #removeNode()} method.
@ -1163,8 +1163,8 @@ public abstract class Preferences {
* circumstances, implementations are neither required to generate node * circumstances, implementations are neither required to generate node
* change events nor prohibited from doing so. * change events nor prohibited from doing so.
* *
* @param ncl The <tt>NodeChangeListener</tt> to add. * @param ncl The {@code NodeChangeListener} to add.
* @throws NullPointerException if <tt>ncl</tt> is null. * @throws NullPointerException if {@code ncl} is null.
* @throws IllegalStateException if this node (or an ancestor) has been * @throws IllegalStateException if this node (or an ancestor) has been
* removed with the {@link #removeNode()} method. * removed with the {@link #removeNode()} method.
* @see #removeNodeChangeListener(NodeChangeListener) * @see #removeNodeChangeListener(NodeChangeListener)
@ -1173,12 +1173,12 @@ public abstract class Preferences {
public abstract void addNodeChangeListener(NodeChangeListener ncl); public abstract void addNodeChangeListener(NodeChangeListener ncl);
/** /**
* Removes the specified <tt>NodeChangeListener</tt>, so it no longer * Removes the specified {@code NodeChangeListener}, so it no longer
* receives change events. * receives change events.
* *
* @param ncl The <tt>NodeChangeListener</tt> to remove. * @param ncl The {@code NodeChangeListener} to remove.
* @throws IllegalArgumentException if <tt>ncl</tt> was not a registered * @throws IllegalArgumentException if {@code ncl} was not a registered
* <tt>NodeChangeListener</tt> on this node. * {@code NodeChangeListener} on this node.
* @throws IllegalStateException if this node (or an ancestor) has been * @throws IllegalStateException if this node (or an ancestor) has been
* removed with the {@link #removeNode()} method. * removed with the {@link #removeNode()} method.
* @see #addNodeChangeListener(NodeChangeListener) * @see #addNodeChangeListener(NodeChangeListener)
@ -1206,7 +1206,7 @@ public abstract class Preferences {
* *
* @param os the output stream on which to emit the XML document. * @param os the output stream on which to emit the XML document.
* @throws IOException if writing to the specified output stream * @throws IOException if writing to the specified output stream
* results in an <tt>IOException</tt>. * results in an {@code IOException}.
* @throws BackingStoreException if preference data cannot be read from * @throws BackingStoreException if preference data cannot be read from
* backing store. * backing store.
* @see #importPreferences(InputStream) * @see #importPreferences(InputStream)
@ -1237,7 +1237,7 @@ public abstract class Preferences {
* *
* @param os the output stream on which to emit the XML document. * @param os the output stream on which to emit the XML document.
* @throws IOException if writing to the specified output stream * @throws IOException if writing to the specified output stream
* results in an <tt>IOException</tt>. * results in an {@code IOException}.
* @throws BackingStoreException if preference data cannot be read from * @throws BackingStoreException if preference data cannot be read from
* backing store. * backing store.
* @throws IllegalStateException if this node (or an ancestor) has been * @throws IllegalStateException if this node (or an ancestor) has been
@ -1273,11 +1273,11 @@ public abstract class Preferences {
* *
* @param is the input stream from which to read the XML document. * @param is the input stream from which to read the XML document.
* @throws IOException if reading from the specified input stream * @throws IOException if reading from the specified input stream
* results in an <tt>IOException</tt>. * results in an {@code IOException}.
* @throws InvalidPreferencesFormatException Data on input stream does not * @throws InvalidPreferencesFormatException Data on input stream does not
* constitute a valid XML document with the mandated document type. * constitute a valid XML document with the mandated document type.
* @throws SecurityException If a security manager is present and * @throws SecurityException If a security manager is present and
* it denies <tt>RuntimePermission("preferences")</tt>. * it denies {@code RuntimePermission("preferences")}.
* @see RuntimePermission * @see RuntimePermission
*/ */
public static void importPreferences(InputStream is) public static void importPreferences(InputStream is)

View file

@ -29,12 +29,12 @@ import java.util.*;
/** /**
* A factory object that generates Preferences objects. Providers of * A factory object that generates Preferences objects. Providers of
* new {@link Preferences} implementations should provide corresponding * new {@link Preferences} implementations should provide corresponding
* <tt>PreferencesFactory</tt> implementations so that the new * {@code PreferencesFactory} implementations so that the new
* <tt>Preferences</tt> implementation can be installed in place of the * {@code Preferences} implementation can be installed in place of the
* platform-specific default implementation. * platform-specific default implementation.
* *
* <p><strong>This class is for <tt>Preferences</tt> implementers only. * <p><strong>This class is for {@code Preferences} implementers only.
* Normal users of the <tt>Preferences</tt> facility should have no need to * Normal users of the {@code Preferences} facility should have no need to
* consult this documentation.</strong> * consult this documentation.</strong>
* *
* @author Josh Bloch * @author Josh Bloch

View file

@ -88,7 +88,7 @@ class XmlSupport {
* an XML document conforming to the definition in the Preferences spec. * an XML document conforming to the definition in the Preferences spec.
* *
* @throws IOException if writing to the specified output stream * @throws IOException if writing to the specified output stream
* results in an <tt>IOException</tt>. * results in an {@code IOException}.
* @throws BackingStoreException if preference data cannot be read from * @throws BackingStoreException if preference data cannot be read from
* backing store. * backing store.
* @throws IllegalStateException if this node (or an ancestor) has been * @throws IllegalStateException if this node (or an ancestor) has been
@ -188,7 +188,7 @@ class XmlSupport {
* spec. * spec.
* *
* @throws IOException if reading from the specified output stream * @throws IOException if reading from the specified output stream
* results in an <tt>IOException</tt>. * results in an {@code IOException}.
* @throws InvalidPreferencesFormatException Data on input stream does not * @throws InvalidPreferencesFormatException Data on input stream does not
* constitute a valid XML document with the mandated document type. * constitute a valid XML document with the mandated document type.
*/ */
@ -337,7 +337,7 @@ class XmlSupport {
* as the internal (undocumented) format for FileSystemPrefs. * as the internal (undocumented) format for FileSystemPrefs.
* *
* @throws IOException if writing to the specified output stream * @throws IOException if writing to the specified output stream
* results in an <tt>IOException</tt>. * results in an {@code IOException}.
*/ */
static void exportMap(OutputStream os, Map<String, String> map) throws IOException { static void exportMap(OutputStream os, Map<String, String> map) throws IOException {
Document doc = createPrefsDoc("map"); Document doc = createPrefsDoc("map");
@ -363,7 +363,7 @@ class XmlSupport {
* the key-value pairs int the XML-document when this method returns.) * the key-value pairs int the XML-document when this method returns.)
* *
* @throws IOException if reading from the specified output stream * @throws IOException if reading from the specified output stream
* results in an <tt>IOException</tt>. * results in an {@code IOException}.
* @throws InvalidPreferencesFormatException Data on input stream does not * @throws InvalidPreferencesFormatException Data on input stream does not
* constitute a valid XML document with the mandated document type. * constitute a valid XML document with the mandated document type.
*/ */

View file

@ -33,10 +33,10 @@ import java.security.PrivilegedAction;
import sun.util.logging.PlatformLogger; import sun.util.logging.PlatformLogger;
/** /**
* Windows registry based implementation of <tt>Preferences</tt>. * Windows registry based implementation of {@code Preferences}.
* <tt>Preferences</tt>' <tt>systemRoot</tt> and <tt>userRoot</tt> are stored in * {@code Preferences}' {@code systemRoot} and {@code userRoot} are stored in
* <tt>HKEY_LOCAL_MACHINE\SOFTWARE\JavaSoft\Prefs</tt> and * {@code HKEY_LOCAL_MACHINE\SOFTWARE\JavaSoft\Prefs} and
* <tt>HKEY_CURRENT_USER\Software\JavaSoft\Prefs</tt> correspondingly. * {@code HKEY_CURRENT_USER\Software\JavaSoft\Prefs} correspondingly.
* *
* @author Konstantin Kladko * @author Konstantin Kladko
* @see Preferences * @see Preferences
@ -60,31 +60,31 @@ class WindowsPreferences extends AbstractPreferences {
private static PlatformLogger logger; private static PlatformLogger logger;
/** /**
* Windows registry path to <tt>Preferences</tt>'s root nodes. * Windows registry path to {@code Preferences}'s root nodes.
*/ */
private static final byte[] WINDOWS_ROOT_PATH = private static final byte[] WINDOWS_ROOT_PATH =
stringToByteArray("Software\\JavaSoft\\Prefs"); stringToByteArray("Software\\JavaSoft\\Prefs");
/** /**
* Windows handles to <tt>HKEY_CURRENT_USER</tt> and * Windows handles to {@code HKEY_CURRENT_USER} and
* <tt>HKEY_LOCAL_MACHINE</tt> hives. * {@code HKEY_LOCAL_MACHINE} hives.
*/ */
private static final int HKEY_CURRENT_USER = 0x80000001; private static final int HKEY_CURRENT_USER = 0x80000001;
private static final int HKEY_LOCAL_MACHINE = 0x80000002; private static final int HKEY_LOCAL_MACHINE = 0x80000002;
/** /**
* Mount point for <tt>Preferences</tt>' user root. * Mount point for {@code Preferences}' user root.
*/ */
private static final int USER_ROOT_NATIVE_HANDLE = HKEY_CURRENT_USER; private static final int USER_ROOT_NATIVE_HANDLE = HKEY_CURRENT_USER;
/** /**
* Mount point for <tt>Preferences</tt>' system root. * Mount point for {@code Preferences}' system root.
*/ */
private static final int SYSTEM_ROOT_NATIVE_HANDLE = HKEY_LOCAL_MACHINE; private static final int SYSTEM_ROOT_NATIVE_HANDLE = HKEY_LOCAL_MACHINE;
/** /**
* Maximum byte-encoded path length for Windows native functions, * Maximum byte-encoded path length for Windows native functions,
* ending <tt>null</tt> character not included. * ending {@code null} character not included.
*/ */
private static final int MAX_WINDOWS_PATH_LENGTH = 256; private static final int MAX_WINDOWS_PATH_LENGTH = 256;
@ -388,7 +388,7 @@ class WindowsPreferences extends AbstractPreferences {
} }
/** /**
* Constructs a <tt>WindowsPreferences</tt> node, creating underlying * Constructs a {@code WindowsPreferences} node, creating underlying
* Windows registry node and all its Windows parents, if they are not yet * Windows registry node and all its Windows parents, if they are not yet
* created. * created.
* Logs a warning message, if Windows Registry is unavailable. * Logs a warning message, if Windows Registry is unavailable.
@ -617,7 +617,7 @@ class WindowsPreferences extends AbstractPreferences {
} }
/** /**
* Implements <tt>AbstractPreferences</tt> <tt>putSpi()</tt> method. * Implements {@code AbstractPreferences} {@code putSpi()} method.
* Puts name-value pair into the underlying Windows registry node. * Puts name-value pair into the underlying Windows registry node.
* Logs a warning, if Windows registry is unavailable. * Logs a warning, if Windows registry is unavailable.
* @see #getSpi(String) * @see #getSpi(String)
@ -645,7 +645,7 @@ class WindowsPreferences extends AbstractPreferences {
} }
/** /**
* Implements <tt>AbstractPreferences</tt> <tt>getSpi()</tt> method. * Implements {@code AbstractPreferences} {@code getSpi()} method.
* Gets a string value from the underlying Windows registry node. * Gets a string value from the underlying Windows registry node.
* Logs a warning, if Windows registry is unavailable. * Logs a warning, if Windows registry is unavailable.
* @see #putSpi(String, String) * @see #putSpi(String, String)
@ -666,7 +666,7 @@ class WindowsPreferences extends AbstractPreferences {
} }
/** /**
* Implements <tt>AbstractPreferences</tt> <tt>removeSpi()</tt> method. * Implements {@code AbstractPreferences} {@code removeSpi()} method.
* Deletes a string name-value pair from the underlying Windows registry * Deletes a string name-value pair from the underlying Windows registry
* node, if this value still exists. * node, if this value still exists.
* Logs a warning, if Windows registry is unavailable or key has already * Logs a warning, if Windows registry is unavailable or key has already
@ -692,7 +692,7 @@ class WindowsPreferences extends AbstractPreferences {
} }
/** /**
* Implements <tt>AbstractPreferences</tt> <tt>keysSpi()</tt> method. * Implements {@code AbstractPreferences} {@code keysSpi()} method.
* Gets value names from the underlying Windows registry node. * Gets value names from the underlying Windows registry node.
* Throws a BackingStoreException and logs a warning, if * Throws a BackingStoreException and logs a warning, if
* Windows registry is unavailable. * Windows registry is unavailable.
@ -744,7 +744,7 @@ class WindowsPreferences extends AbstractPreferences {
} }
/** /**
* Implements <tt>AbstractPreferences</tt> <tt>childrenNamesSpi()</tt> method. * Implements {@code AbstractPreferences} {@code childrenNamesSpi()} method.
* Calls Windows registry to retrive children of this node. * Calls Windows registry to retrive children of this node.
* Throws a BackingStoreException and logs a warning message, * Throws a BackingStoreException and logs a warning message,
* if Windows registry is not available. * if Windows registry is not available.
@ -798,7 +798,7 @@ class WindowsPreferences extends AbstractPreferences {
} }
/** /**
* Implements <tt>Preferences</tt> <tt>flush()</tt> method. * Implements {@code Preferences} {@code flush()} method.
* Flushes Windows registry changes to disk. * Flushes Windows registry changes to disk.
* Throws a BackingStoreException and logs a warning message if Windows * Throws a BackingStoreException and logs a warning message if Windows
* registry is not available. * registry is not available.
@ -837,7 +837,7 @@ class WindowsPreferences extends AbstractPreferences {
/** /**
* Implements <tt>Preferences</tt> <tt>sync()</tt> method. * Implements {@code Preferences} {@code sync()} method.
* Flushes Windows registry changes to disk. Equivalent to flush(). * Flushes Windows registry changes to disk. Equivalent to flush().
* @see flush() * @see flush()
*/ */
@ -848,7 +848,7 @@ class WindowsPreferences extends AbstractPreferences {
} }
/** /**
* Implements <tt>AbstractPreferences</tt> <tt>childSpi()</tt> method. * Implements {@code AbstractPreferences} {@code childSpi()} method.
* Constructs a child node with a * Constructs a child node with a
* given name and creates its underlying Windows registry node, * given name and creates its underlying Windows registry node,
* if it does not exist. * if it does not exist.
@ -859,7 +859,7 @@ class WindowsPreferences extends AbstractPreferences {
} }
/** /**
* Implements <tt>AbstractPreferences</tt> <tt>removeNodeSpi()</tt> method. * Implements {@code AbstractPreferences} {@code removeNodeSpi()} method.
* Deletes underlying Windows registry node. * Deletes underlying Windows registry node.
* Throws a BackingStoreException and logs a warning, if Windows registry * Throws a BackingStoreException and logs a warning, if Windows registry
* is not available. * is not available.
@ -956,7 +956,7 @@ class WindowsPreferences extends AbstractPreferences {
* "A" is encoded as "/A". Character '\' is encoded as '//', * "A" is encoded as "/A". Character '\' is encoded as '//',
* '/' is encoded as '\'. * '/' is encoded as '\'.
* The constructed string is converted to byte array by truncating the * The constructed string is converted to byte array by truncating the
* highest byte and adding the terminating <tt>null</tt> character. * highest byte and adding the terminating {@code null} character.
* <p> * <p>
* <i>altBase64</i> encoding is used, if java string does contain at least * <i>altBase64</i> encoding is used, if java string does contain at least
* one character less, than 0x0020, or greater, than 0x007f. * one character less, than 0x0020, or greater, than 0x007f.

View file

@ -25,7 +25,7 @@
package java.util.prefs; package java.util.prefs;
/** /**
* Implementation of <tt>PreferencesFactory</tt> to return * Implementation of {@code PreferencesFactory} to return
* WindowsPreferences objects. * WindowsPreferences objects.
* *
* @author Konstantin Kladko * @author Konstantin Kladko