# HG changeset patch
# User duke
# Date 1504960605 -7200
# Node ID 57173ad5c534f971c87cb88e0e44feefc970adac
# Parent 000f4e4ddd396e76ef9a1b0b077f55f3bbf0663b# Parent 75e8600f11364725bf9b64df8de236d3d3dab2a4
Merge
diff -r 000f4e4ddd39 -r 57173ad5c534 .hgtags-top-repo
--- a/.hgtags-top-repo Fri Sep 01 14:13:40 2017 +0000
+++ b/.hgtags-top-repo Sat Sep 09 14:36:45 2017 +0200
@@ -446,3 +446,4 @@
b656dea9398ef601f7fc08d1a5157a560e0ccbe0 jdk-9+181
682e2a6df836f4731f92eb2ddcd467075047f6ea jdk-10+20
90cdfe56f1543267a8005e638bd1b44551fda189 jdk-10+21
+8625e8491887bfd4310b2cfc2b84bac26312ba20 jdk-10+22
diff -r 000f4e4ddd39 -r 57173ad5c534 common/autoconf/configure.ac
--- a/common/autoconf/configure.ac Fri Sep 01 14:13:40 2017 +0000
+++ b/common/autoconf/configure.ac Sat Sep 09 14:36:45 2017 +0200
@@ -209,6 +209,7 @@
# Need toolchain to setup dtrace
HOTSPOT_SETUP_DTRACE
HOTSPOT_ENABLE_DISABLE_AOT
+HOTSPOT_ENABLE_DISABLE_CDS
HOTSPOT_ENABLE_DISABLE_GTEST
###############################################################################
diff -r 000f4e4ddd39 -r 57173ad5c534 common/autoconf/generated-configure.sh
--- a/common/autoconf/generated-configure.sh Fri Sep 01 14:13:40 2017 +0000
+++ b/common/autoconf/generated-configure.sh Sat Sep 09 14:36:45 2017 +0200
@@ -702,6 +702,7 @@
FIXPATH_DETACH_FLAG
FIXPATH
BUILD_GTEST
+ENABLE_CDS
ENABLE_AOT
GCOV_ENABLED
ZIP_EXTERNAL_DEBUG_SYMBOLS
@@ -1191,6 +1192,7 @@
enable_native_coverage
enable_dtrace
enable_aot
+enable_cds
enable_hotspot_gtest
with_stdc__lib
with_msvcr_dll
@@ -1999,6 +2001,8 @@
enable ahead of time compilation feature. Default is
auto, where aot is enabled if all dependencies are
present.
+ --enable-cds[=yes/no] enable class data sharing feature in non-minimal VM.
+ Default is yes.
--disable-hotspot-gtest Disables building of the Hotspot unit tests
--disable-freetype-bundling
disable bundling of the freetype library with the
@@ -2016,7 +2020,8 @@
--disable-generate-classlist
forces enabling or disabling of the generation of a
CDS classlist at build time. Default is to generate
- it when either the server or client JVMs are built.
+ it when either the server or client JVMs are built
+ and enable-cds is true.
--enable-sjavac use sjavac to do fast incremental compiles
[disabled]
--disable-javac-server disable javac server [enabled]
@@ -4295,7 +4300,7 @@
# All valid JVM features, regardless of platform
VALID_JVM_FEATURES="compiler1 compiler2 zero shark minimal dtrace jvmti jvmci \
- graal fprof vm-structs jni-check services management all-gcs nmt cds \
+ graal vm-structs jni-check services management all-gcs nmt cds \
static-build link-time-opt aot"
# All valid JVM variants
@@ -4345,6 +4350,11 @@
#
+################################################################################
+# Allow to disable CDS
+#
+
+
###############################################################################
# Set up all JVM features for each JVM variant.
#
@@ -5151,7 +5161,7 @@
#CUSTOM_AUTOCONF_INCLUDE
# Do not change or remove the following line, it is needed for consistency checks:
-DATE_WHEN_GENERATED=1504187184
+DATE_WHEN_GENERATED=1504441177
###############################################################################
#
@@ -54216,6 +54226,23 @@
+ # Check whether --enable-cds was given.
+if test "${enable_cds+set}" = set; then :
+ enableval=$enable_cds;
+fi
+
+
+ if test "x$enable_cds" = "x" || test "x$enable_cds" = "xyes"; then
+ ENABLE_CDS="true"
+ elif test "x$enable_cds" = "xno"; then
+ ENABLE_CDS="false"
+ else
+ as_fn_error $? "Invalid value for --enable-cds: $enable_cds" "$LINENO" 5
+ fi
+
+
+
+
# Check whether --enable-hotspot-gtest was given.
if test "${enable_hotspot_gtest+set}" = set; then :
enableval=$enable_hotspot_gtest;
@@ -65810,8 +65837,12 @@
fi
INCLUDE_GRAAL="true"
else
- # By default enable graal build where AOT is available
- if test "x$ENABLE_AOT" = "xtrue"; then
+ # By default enable graal build on linux-x64 or where AOT is available.
+ # graal build requires jvmci.
+ if test "x$JVM_FEATURES_jvmci" = "xjvmci" && \
+ (test "x$OPENJDK_TARGET_CPU" = "xx86_64" && \
+ test "x$OPENJDK_TARGET_OS" = "xlinux" || \
+ test "x$ENABLE_AOT" = "xtrue") ; then
{ $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5
$as_echo "yes" >&6; }
JVM_FEATURES_graal="graal"
@@ -65856,7 +65887,10 @@
fi
# All variants but minimal (and custom) get these features
- NON_MINIMAL_FEATURES="$NON_MINIMAL_FEATURES jvmti fprof vm-structs jni-check services management all-gcs nmt cds"
+ NON_MINIMAL_FEATURES="$NON_MINIMAL_FEATURES jvmti vm-structs jni-check services management all-gcs nmt"
+ if test "x$ENABLE_CDS" = "xtrue"; then
+ NON_MINIMAL_FEATURES="$NON_MINIMAL_FEATURES cds"
+ fi
# Enable features depending on variant.
JVM_FEATURES_server="compiler1 compiler2 $NON_MINIMAL_FEATURES $JVM_FEATURES $JVM_FEATURES_jvmci $JVM_FEATURES_aot $JVM_FEATURES_graal"
@@ -65960,7 +65994,7 @@
# Check if it's likely that it's possible to generate the classlist. Depending
# on exact jvm configuration it could be possible anyway.
- if [[ " $JVM_VARIANTS " =~ " server " ]] || [[ " $JVM_VARIANTS " =~ " client " ]] ; then
+ if test "x$ENABLE_CDS" = "xtrue" && ( [[ " $JVM_VARIANTS " =~ " server " ]] || [[ " $JVM_VARIANTS " =~ " client " ]] ); then
ENABLE_GENERATE_CLASSLIST_POSSIBLE="true"
else
ENABLE_GENERATE_CLASSLIST_POSSIBLE="false"
@@ -65973,8 +66007,8 @@
$as_echo "yes, forced" >&6; }
ENABLE_GENERATE_CLASSLIST="true"
if test "x$ENABLE_GENERATE_CLASSLIST_POSSIBLE" = "xfalse"; then
- { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: Generation of classlist might not be possible with JVM Variants $JVM_VARIANTS" >&5
-$as_echo "$as_me: WARNING: Generation of classlist might not be possible with JVM Variants $JVM_VARIANTS" >&2;}
+ { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: Generation of classlist might not be possible with JVM Variants $JVM_VARIANTS and enable-cds=$ENABLE_CDS" >&5
+$as_echo "$as_me: WARNING: Generation of classlist might not be possible with JVM Variants $JVM_VARIANTS and enable-cds=$ENABLE_CDS" >&2;}
fi
elif test "x$enable_generate_classlist" = "xno"; then
{ $as_echo "$as_me:${as_lineno-$LINENO}: result: no, forced" >&5
diff -r 000f4e4ddd39 -r 57173ad5c534 common/autoconf/hotspot.m4
--- a/common/autoconf/hotspot.m4 Fri Sep 01 14:13:40 2017 +0000
+++ b/common/autoconf/hotspot.m4 Sat Sep 09 14:36:45 2017 +0200
@@ -25,7 +25,7 @@
# All valid JVM features, regardless of platform
VALID_JVM_FEATURES="compiler1 compiler2 zero shark minimal dtrace jvmti jvmci \
- graal fprof vm-structs jni-check services management all-gcs nmt cds \
+ graal vm-structs jni-check services management all-gcs nmt cds \
static-build link-time-opt aot"
# All valid JVM variants
@@ -240,6 +240,25 @@
AC_SUBST(ENABLE_AOT)
])
+################################################################################
+# Allow to disable CDS
+#
+AC_DEFUN_ONCE([HOTSPOT_ENABLE_DISABLE_CDS],
+[
+ AC_ARG_ENABLE([cds], [AS_HELP_STRING([--enable-cds@<:@=yes/no@:>@],
+ [enable class data sharing feature in non-minimal VM. Default is yes.])])
+
+ if test "x$enable_cds" = "x" || test "x$enable_cds" = "xyes"; then
+ ENABLE_CDS="true"
+ elif test "x$enable_cds" = "xno"; then
+ ENABLE_CDS="false"
+ else
+ AC_MSG_ERROR([Invalid value for --enable-cds: $enable_cds])
+ fi
+
+ AC_SUBST(ENABLE_CDS)
+])
+
###############################################################################
# Set up all JVM features for each JVM variant.
#
@@ -335,8 +354,12 @@
fi
INCLUDE_GRAAL="true"
else
- # By default enable graal build where AOT is available
- if test "x$ENABLE_AOT" = "xtrue"; then
+ # By default enable graal build on linux-x64 or where AOT is available.
+ # graal build requires jvmci.
+ if test "x$JVM_FEATURES_jvmci" = "xjvmci" && \
+ (test "x$OPENJDK_TARGET_CPU" = "xx86_64" && \
+ test "x$OPENJDK_TARGET_OS" = "xlinux" || \
+ test "x$ENABLE_AOT" = "xtrue") ; then
AC_MSG_RESULT([yes])
JVM_FEATURES_graal="graal"
INCLUDE_GRAAL="true"
@@ -374,7 +397,10 @@
fi
# All variants but minimal (and custom) get these features
- NON_MINIMAL_FEATURES="$NON_MINIMAL_FEATURES jvmti fprof vm-structs jni-check services management all-gcs nmt cds"
+ NON_MINIMAL_FEATURES="$NON_MINIMAL_FEATURES jvmti vm-structs jni-check services management all-gcs nmt"
+ if test "x$ENABLE_CDS" = "xtrue"; then
+ NON_MINIMAL_FEATURES="$NON_MINIMAL_FEATURES cds"
+ fi
# Enable features depending on variant.
JVM_FEATURES_server="compiler1 compiler2 $NON_MINIMAL_FEATURES $JVM_FEATURES $JVM_FEATURES_jvmci $JVM_FEATURES_aot $JVM_FEATURES_graal"
diff -r 000f4e4ddd39 -r 57173ad5c534 common/autoconf/jdk-options.m4
--- a/common/autoconf/jdk-options.m4 Fri Sep 01 14:13:40 2017 +0000
+++ b/common/autoconf/jdk-options.m4 Sat Sep 09 14:36:45 2017 +0200
@@ -496,11 +496,12 @@
[
AC_ARG_ENABLE([generate-classlist], [AS_HELP_STRING([--disable-generate-classlist],
[forces enabling or disabling of the generation of a CDS classlist at build time.
- Default is to generate it when either the server or client JVMs are built.])])
+ Default is to generate it when either the server or client JVMs are built and
+ enable-cds is true.])])
# Check if it's likely that it's possible to generate the classlist. Depending
# on exact jvm configuration it could be possible anyway.
- if HOTSPOT_CHECK_JVM_VARIANT(server) || HOTSPOT_CHECK_JVM_VARIANT(client); then
+ if test "x$ENABLE_CDS" = "xtrue" && (HOTSPOT_CHECK_JVM_VARIANT(server) || HOTSPOT_CHECK_JVM_VARIANT(client)); then
ENABLE_GENERATE_CLASSLIST_POSSIBLE="true"
else
ENABLE_GENERATE_CLASSLIST_POSSIBLE="false"
@@ -511,7 +512,7 @@
AC_MSG_RESULT([yes, forced])
ENABLE_GENERATE_CLASSLIST="true"
if test "x$ENABLE_GENERATE_CLASSLIST_POSSIBLE" = "xfalse"; then
- AC_MSG_WARN([Generation of classlist might not be possible with JVM Variants $JVM_VARIANTS])
+ AC_MSG_WARN([Generation of classlist might not be possible with JVM Variants $JVM_VARIANTS and enable-cds=$ENABLE_CDS])
fi
elif test "x$enable_generate_classlist" = "xno"; then
AC_MSG_RESULT([no, forced])
diff -r 000f4e4ddd39 -r 57173ad5c534 common/conf/jib-profiles.js
--- a/common/conf/jib-profiles.js Fri Sep 01 14:13:40 2017 +0000
+++ b/common/conf/jib-profiles.js Sat Sep 09 14:36:45 2017 +0200
@@ -818,6 +818,49 @@
}
},
+ "macosx-x64-open": {
+ artifacts: {
+ jdk: {
+ local: "bundles/\\(jdk.*bin.tar.gz\\)",
+ remote: [
+ "bundles/openjdk/GPL/osx-x64/jdk-" + data.version
+ + "_osx-x64_bin.tar.gz",
+ "bundles/openjdk/GPL/osx-x64/\\1"
+ ],
+ subdir: "jdk-" + data.version
+ },
+ jre: {
+ local: "bundles/\\(jre.*bin.tar.gz\\)",
+ remote: "bundles/openjdk/GPL/osx-x64/\\1",
+ },
+ test: {
+ local: "bundles/\\(jdk.*bin-tests.tar.gz\\)",
+ remote: [
+ "bundles/openjdk/GPL/osx-x64/jdk-" + data.version
+ + "_osx-x64_bin-tests.tar.gz",
+ "bundles/openjdk/GPL/osx-x64/\\1"
+ ]
+ },
+ jdk_symbols: {
+ local: "bundles/\\(jdk.*bin-symbols.tar.gz\\)",
+ remote: [
+ "bundles/openjdk/GPL/osx-x64/jdk-" + data.version
+ + "_osx-x64_bin-symbols.tar.gz",
+ "bundles/openjdk/GPL/osx-x64/\\1"
+ ],
+ subdir: "jdk-" + data.version
+ },
+ jre_symbols: {
+ local: "bundles/\\(jre.*bin-symbols.tar.gz\\)",
+ remote: "bundles/openjdk/GPL/osx-x64/\\1",
+ },
+ doc_api_spec: {
+ local: "bundles/\\(jdk.*doc-api-spec.tar.gz\\)",
+ remote: "bundles/openjdk/GPL/osx-x64/\\1",
+ },
+ }
+ },
+
"windows-x86-open": {
artifacts: {
jdk: {
@@ -884,10 +927,11 @@
profiles["linux-x64-ri"] = clone(profiles["linux-x64-open"]);
profiles["linux-x86-ri"] = clone(profiles["linux-x86-open"]);
profiles["linux-x86-ri-debug"] = clone(profiles["linux-x86-open-debug"]);
+ profiles["macosx-x64-ri"] = clone(profiles["macosx-x64-open"]);
profiles["windows-x86-ri"] = clone(profiles["windows-x86-open"]);
// Generate artifacts for ri profiles
- [ "linux-x64-ri", "linux-x86-ri", "linux-x86-ri-debug", "windows-x86-ri" ]
+ [ "linux-x64-ri", "linux-x86-ri", "linux-x86-ri-debug", "macosx-x64-ri", "windows-x86-ri" ]
.forEach(function (name) {
// Rewrite all remote dirs to "bundles/openjdk/BCL/..."
for (artifactName in profiles[name].artifacts) {
diff -r 000f4e4ddd39 -r 57173ad5c534 corba/.hgtags
--- a/corba/.hgtags Fri Sep 01 14:13:40 2017 +0000
+++ b/corba/.hgtags Sat Sep 09 14:36:45 2017 +0200
@@ -446,3 +446,4 @@
ba71941ad9dba53b8fffb30602ef673eee88696c jdk-9+181
7a54ec280513a33e49e60546c0cf9ca573925a43 jdk-10+20
68b5f8eeac3325c02aac2f4b452b8a37c20c970e jdk-10+21
+1f4456d51b07098af1848d0d968084b1e9b85a36 jdk-10+22
diff -r 000f4e4ddd39 -r 57173ad5c534 corba/src/java.corba/share/classes/org/omg/CORBA/ORB.java
--- a/corba/src/java.corba/share/classes/org/omg/CORBA/ORB.java Fri Sep 01 14:13:40 2017 +0000
+++ b/corba/src/java.corba/share/classes/org/omg/CORBA/ORB.java Sat Sep 09 14:36:45 2017 +0200
@@ -85,15 +85,15 @@
* three {@code init} methods. Two of the three methods use the properties
* (associations of a name with a value) shown in the
* table below.
- *
Property Name | Property Value |
---|---|
Property Name | Property Value |
org.omg.CORBA.ORBClass | + *|
org.omg.CORBA.ORBClass | *class name of an ORB implementation |
org.omg.CORBA.ORBSingletonClass | + *|
org.omg.CORBA.ORBSingletonClass | *class name of the ORB returned by {@code init()} |
TCKind
constant whose value
field is
- * initialized with TCKind._tk_null
.
+ * initialized with {@code TCKind._tk_null}.
*/
public static final TCKind tk_null = new TCKind(_tk_null);
/**
* The TCKind
constant whose value
field is
- * initialized with TCKind._tk_void
.
+ * initialized with {@code TCKind._tk_void}.
*/
public static final TCKind tk_void = new TCKind(_tk_void);
/**
* The TCKind
constant whose value
field is
- * initialized with TCKind._tk_short
.
+ * initialized with {@code TCKind._tk_short}.
*/
public static final TCKind tk_short = new TCKind(_tk_short);
/**
* The TCKind
constant whose value
field is
- * initialized with TCKind._tk_long
.
+ * initialized with {@code TCKind._tk_long}.
*/
public static final TCKind tk_long = new TCKind(_tk_long);
/**
* The TCKind
constant whose value
field is
- * initialized with TCKind._tk_ushort
.
+ * initialized with {@code TCKind._tk_ushort}.
*/
public static final TCKind tk_ushort = new TCKind(_tk_ushort);
/**
* The TCKind
constant whose value
field is
- * initialized with TCKind._tk_ulong
.
+ * initialized with {@code TCKind._tk_ulong}.
*/
public static final TCKind tk_ulong = new TCKind(_tk_ulong);
/**
* The TCKind
constant whose value
field is
- * initialized with TCKind._tk_float
.
+ * initialized with {@code TCKind._tk_float}.
*/
public static final TCKind tk_float = new TCKind(_tk_float);
/**
* The TCKind
constant whose value
field is
- * initialized with TCKind._tk_double
.
+ * initialized with {@code TCKind._tk_double}.
*/
public static final TCKind tk_double = new TCKind(_tk_double);
/**
* The TCKind
constant whose value
field is
- * initialized with TCKind._tk_boolean
.
+ * initialized with {@code TCKind._tk_boolean}.
*/
public static final TCKind tk_boolean = new TCKind(_tk_boolean);
/**
* The TCKind
constant whose value
field is
- * initialized with TCKind._tk_char
.
+ * initialized with {@code TCKind._tk_char}.
*/
public static final TCKind tk_char = new TCKind(_tk_char);
/**
* The TCKind
constant whose value
field is
- * initialized with TCKind._tk_octet
.
+ * initialized with {@code TCKind._tk_octet}.
*/
public static final TCKind tk_octet = new TCKind(_tk_octet);
/**
* The TCKind
constant whose value
field is
- * initialized with TCKind._tk_any
.
+ * initialized with {@code TCKind._tk_any}.
*/
public static final TCKind tk_any = new TCKind(_tk_any);
/**
* The TCKind
constant whose value
field is
- * initialized with TCKind._tk_TypeCode
.
+ * initialized with {@code TCKind._tk_TypeCode}.
*/
public static final TCKind tk_TypeCode = new TCKind(_tk_TypeCode);
/**
* The TCKind
constant whose value
field is
- * initialized with TCKind._tk_Principal
.
+ * initialized with {@code TCKind._tk_Principal}.
*/
public static final TCKind tk_Principal = new TCKind(_tk_Principal);
/**
* The TCKind
constant whose value
field is
- * initialized with TCKind._tk_objref
.
+ * initialized with {@code TCKind._tk_objref}.
*/
public static final TCKind tk_objref = new TCKind(_tk_objref);
/**
* The TCKind
constant whose value
field is
- * initialized with TCKind._tk_struct
.
+ * initialized with {@code TCKind._tk_struct}.
*/
public static final TCKind tk_struct = new TCKind(_tk_struct);
/**
* The TCKind
constant whose value
field is
- * initialized with TCKind._tk_union
.
+ * initialized with {@code TCKind._tk_union}.
*/
public static final TCKind tk_union = new TCKind(_tk_union);
/**
* The TCKind
constant whose value
field is
- * initialized with TCKind._tk_enum
.
+ * initialized with {@code TCKind._tk_enum}.
*/
public static final TCKind tk_enum = new TCKind(_tk_enum);
/**
* The TCKind
constant whose value
field is
- * initialized with TCKind._tk_string
.
+ * initialized with {@code TCKind._tk_string}.
*/
public static final TCKind tk_string = new TCKind(_tk_string);
/**
* The TCKind
constant whose value
field is
- * initialized with TCKind._tk_sequence
.
+ * initialized with {@code TCKind._tk_sequence}.
*/
public static final TCKind tk_sequence = new TCKind(_tk_sequence);
/**
* The TCKind
constant whose value
field is
- * initialized with TCKind._tk_array
.
+ * initialized with {@code TCKind._tk_array}.
*/
public static final TCKind tk_array = new TCKind(_tk_array);
/**
* The TCKind
constant whose value
field is
- * initialized with TCKind._tk_alias
.
+ * initialized with {@code TCKind._tk_alias}.
*/
public static final TCKind tk_alias = new TCKind(_tk_alias);
/**
* The TCKind
constant whose value
field is
- * initialized with TCKind._tk_except
.
+ * initialized with {@code TCKind._tk_except}.
*/
public static final TCKind tk_except = new TCKind(_tk_except);
/**
* The TCKind
constant whose value
field is
- * initialized with TCKind._tk_longlong
.
+ * initialized with {@code TCKind._tk_longlong}.
*/
public static final TCKind tk_longlong = new TCKind(_tk_longlong);
/**
* The TCKind
constant whose value
field is
- * initialized with TCKind._tk_ulonglong
.
+ * initialized with {@code TCKind._tk_ulonglong}.
*/
public static final TCKind tk_ulonglong = new TCKind(_tk_ulonglong);
/**
* The TCKind
constant whose value
field is
- * initialized with TCKind._tk_longdouble
.
+ * initialized with {@code TCKind._tk_longdouble}.
*/
public static final TCKind tk_longdouble = new TCKind(_tk_longdouble);
/**
* The TCKind
constant whose value
field is
- * initialized with TCKind._tk_wchar
.
+ * initialized with {@code TCKind._tk_wchar}.
*/
public static final TCKind tk_wchar = new TCKind(_tk_wchar);
/**
* The TCKind
constant whose value
field is
- * initialized with TCKind._tk_wstring
.
+ * initialized with {@code TCKind._tk_wstring}.
*/
public static final TCKind tk_wstring = new TCKind(_tk_wstring);
/**
* The TCKind
constant whose value
field is
- * initialized with TCKind._tk_fixed
.
+ * initialized with {@code TCKind._tk_fixed}.
*/
public static final TCKind tk_fixed = new TCKind(_tk_fixed);
@@ -413,26 +413,26 @@
/**
* The TCKind
constant whose value
field is
- * initialized with TCKind._tk_value
.
+ * initialized with {@code TCKind._tk_value}.
*/
public static final TCKind tk_value = new TCKind(_tk_value);
/**
* The TCKind
constant whose value
field is
- * initialized with TCKind._tk_value_box
.
+ * initialized with {@code TCKind._tk_value_box}.
*/
public static final TCKind tk_value_box = new TCKind(_tk_value_box);
// orbos 98-01-18: Objects By Value -- end
/**
* The TCKind
constant whose value
field is
- * initialized with TCKind._tk_native
.
+ * initialized with {@code TCKind._tk_native}.
*/
public static final TCKind tk_native = new TCKind(_tk_native);
/**
* The TCKind
constant whose value
field is
- * initialized with TCKind._tk_abstract_interface
.
+ * initialized with {@code TCKind._tk_abstract_interface}.
*/
public static final TCKind tk_abstract_interface = new TCKind(_tk_abstract_interface);
diff -r 000f4e4ddd39 -r 57173ad5c534 corba/src/java.corba/share/classes/org/omg/CORBA/doc-files/compliance.html
--- a/corba/src/java.corba/share/classes/org/omg/CORBA/doc-files/compliance.html Fri Sep 01 14:13:40 2017 +0000
+++ b/corba/src/java.corba/share/classes/org/omg/CORBA/doc-files/compliance.html Sat Sep 09 14:36:45 2017 +0200
@@ -1,10 +1,10 @@
-
+
The files that are generated by the IDL-to-Java compiler, in accordance with the IDL-to-Java Language Mapping Specification, -which is implemented in JavaTM SE 6 +which is implemented in Java™ SE 6 according the compliance document. diff -r 000f4e4ddd39 -r 57173ad5c534 corba/src/java.corba/share/classes/org/omg/PortableInterceptor/Interceptors.idl --- a/corba/src/java.corba/share/classes/org/omg/PortableInterceptor/Interceptors.idl Fri Sep 01 14:13:40 2017 +0000 +++ b/corba/src/java.corba/share/classes/org/omg/PortableInterceptor/Interceptors.idl Sat Sep 09 14:36:45 2017 +0200 @@ -584,7 +584,7 @@ *
* *request_id
operation
arguments
exceptions
contexts
operation_context
result
response_expected
sync_scope
reply_status
forward_reference
get_slot
get_request_service_context
get_reply_service_context
target
effective_target
effective_profile
received_exception
received_exception_id
get_effective_component
get_effective_components
get_request_policy
add_request_service_context
request_id
operation
arguments
exceptions
contexts
operation_context
result
response_expected
sync_scope
Permission Target Name | - *What the Permission Allows | - *Risks of Allowing this Permission | + *Permission Target Name | + *What the Permission Allows | + *Risks of Allowing this Permission | *
---|---|---|---|---|---|
setDatatypeConverter | + *setDatatypeConverter | ** Allows the code to set VM-wide {@link DatatypeConverterInterface} * via {@link DatatypeConverter#setDatatypeConverter(DatatypeConverterInterface) the setDatatypeConverter method} @@ -63,6 +67,7 @@ * another application running in the same JVM. * | *
- * Unmarshal By Declared Type returned JAXBElement - * | |||||
---|---|---|---|---|---|
JAXBElement Property | - *Value | + *JAXBElement Property | + *Value | *||
name | - *{@code xml element name} | + *name | + *{@code xml element name} | *||
value | + *value | *{@code instanceof declaredType} | *|||
declaredType | + *declaredType | *unmarshal method {@code declaredType} parameter | *|||
scope | + *scope | *{@code null} (actual scope is unknown) | *
Enum Value | + *XML Schema Value | + *||||
---|---|---|---|---|---|
Enum Value | - *XML Schema Value | - *||||
UNQUALIFIED | + *UNQUALIFIED | *unqualified | *|||
QUALIFIED | + *|||||
QUALIFIED | *qualified | *||||
UNSET | + *|||||
UNSET | *namespace qualification attribute is absent from the * XML Schema fragment | *
Target | + *propOrder | + *ClassBody | + *ComplexType | + *SimpleType | + *|
---|---|---|---|---|---|
Target | - *propOrder | - *ClassBody | - *ComplexType | - *SimpleType | - *|
Class | *{} | - *[property]+ {@literal ->} elements | + *[property]+ {@literal ->} elements | *complexcontent xs:all |
* * |
Class | *non empty | - *[property]+ {@literal ->} elements | + *[property]+ {@literal ->} elements | *complexcontent xs:sequence |
* * |
Class | *X | - *no property {@literal ->} element | + *no property {@literal ->} element | *complexcontent empty sequence |
* * |
Class | *X | - *1 [{@code @XmlValue} property] {@literal &&} [property]+ {@literal ->} attributes |
+ * 1 [{@code @XmlValue} property] {@literal &&} [property]+ {@literal ->} attributes |
* simplecontent | ** |
Class | *X | - *1 [{@code @XmlValue} property] {@literal &&} no properties {@literal ->} attribute |
+ * 1 [{@code @XmlValue} property] {@literal &&} no properties {@literal ->} attribute |
* * | simpletype | *
MIME-Type | Description | - *
---|---|
{@code "text/plain"} | - *Plain text in the default character set (US-ASCII) | - *
"text/plain; charset=xxx" |
- * Plain text in character set xxx | - *
{@code "text/html"} | - *HyperText Markup Language in the default character set (US-ASCII) | - *
"text/html; charset=xxx" |
- * HyperText Markup Language in character set xxx | - *
- * In general, preformatted text print data is provided either in a character - * oriented representation class (character array, String, Reader) or in a - * byte oriented representation class (byte array, InputStream, URL). - * - *
MIME-Type | Description | - *
---|---|
{@code "application/pdf"} | - *Portable Document Format document | - *
{@code "application/postscript"} | - *PostScript document | - *
{@code "application/vnd.hp-PCL"} | - *Printer Control Language document | - *
- * In general, preformatted PDL print data is provided in a byte oriented - * representation class (byte array, InputStream, URL). - * - *
MIME-Type + * | Description + * |
---|---|
{@code "text/plain"} + * | Plain text in the default character set (US-ASCII) + * |
"text/plain; charset=xxx"
+ * | Plain text in character set xxx + * |
{@code "text/html"} + * | HyperText Markup Language in the default character set (US-ASCII) + * |
"text/html; charset=xxx"
+ * | HyperText Markup Language in character set xxx + * |
MIME-Type + * | Description + * |
---|---|
{@code "application/pdf"} + * | Portable Document Format document + * |
{@code "application/postscript"} + * | PostScript document + * |
{@code "application/vnd.hp-PCL"} + * | Printer Control Language document + * |
MIME-Type + * | Description + * |
---|---|
{@code "image/gif"} + * | Graphics Interchange Format image + * |
{@code "image/jpeg"} + * | Joint Photographic Experts Group image + * |
{@code "image/png"} + * | Portable Network Graphics image + * |
MIME-Type + * | Description + * |
---|---|
{@code "application/octet-stream"} + * | The print data format is unspecified (just an octet stream) + * |
MIME-Type | Description | - *
---|---|
{@code "image/gif"} | - *Graphics Interchange Format image | - *
{@code "image/jpeg"} | - *Joint Photographic Experts Group image | - *
{@code "image/png"} | - *Portable Network Graphics image | - *
- * In general, preformatted image print data is provided in a byte oriented - * representation class (byte array, InputStream, URL). - * - *
MIME-Type | Description | - *
---|---|
{@code "application/octet-stream"} | - *The print data format is unspecified (just an octet stream) | - *
- * The printer decides how to interpret the print data; the way this - * "autosensing" works is implementation dependent. In general, preformatted - * autosense print data is provided in a byte oriented representation class - * (byte array, InputStream, URL). - *
- * For service formatted print data, the Java Print Service instance + *
+ *
* For service formatted print data, the print data representation class is * typically one of the following (although other representation classes are - * permitted). Nested classes inside class DocFlavor declare predefined static - * constant DocFlavor objects for these example doc flavors; class DocFlavor's - * constructor can be used to create an arbitrary doc flavor. - *
- * A Java Print Service instance is allowed to support any other doc flavors - * (or none) in addition to the above mandatory ones, at the implementation's + *
+ *
* Support for the above doc flavors is desirable so a printing client can rely * on being able to print on any JPS printer, regardless of which doc flavors * the printer supports. If the printer doesn't support the client's preferred * doc flavor, the client can at least print plain text, or the client can * convert its data to a renderable image and print the image. - *
+ *
* Furthermore, every Java Print Service instance must fulfill these * requirements for processing plain text print data: - *
+ *
- * Class DocFlavor in package javax.print.data is similar to class - * {@link java.awt.datatransfer.DataFlavor DataFlavor}. Class - * {@code DataFlavor} - * is not used in the Java Print Service (JPS) API - * for three reasons which are all rooted in allowing the JPS API to be - * shared by other print services APIs which may need to run on Java profiles - * which do not include all of the Java Platform, Standard Edition. - *
- * Class DocFlavor's serialized representation uses the following - * canonical form of a MIME type string. Thus, two doc flavors with MIME types - * that are not identical but that are equivalent (that have the same - * canonical form) may be considered equal. - *
- * Class DocFlavor's serialized representation also contains the - * fully-qualified class name of the representation class - * (a String object), rather than the representation class itself - * (a Class object). This allows a client to examine the doc flavors a - * Java Print Service instance supports without having - * to load the representation classes, which may be problematic for - * limited-resource clients. - * - * @author Alan Kaminsky + * @author Alan Kaminsky */ public class DocFlavor implements Serializable, Cloneable { + /** + * Use serialVersionUID from JDK 1.4 for interoperability. + */ private static final long serialVersionUID = -4512080796965449721L; /** - * A String representing the host operating system encoding. - * This will follow the conventions documented in + * A string representing the host operating system encoding. This will + * follow the conventions documented in * * RFC 2278: IANA Charset Registration Procedures * except where historical names are returned for compatibility with - * previous versions of the Java platform. - * The value returned from method is valid only for the VM which - * returns it, for use in a DocFlavor. - * This is the charset for all the "HOST" pre-defined DocFlavors in + * previous versions of the Java platform. The value returned from method is + * valid only for the VM which returns it, for use in a {@code DocFlavor}. + * This is the charset for all the "HOST" pre-defined {@code DocFlavors} in * the executing VM. */ public static final String hostEncoding; @@ -488,6 +417,7 @@ /** * Representation class name. + * * @serial */ private String myClassName; @@ -497,21 +427,17 @@ */ private transient String myStringValue = null; - /** * Constructs a new doc flavor object from the given MIME type and * representation class name. The given MIME type is converted into * canonical form and stored internally. * - * @param mimeType MIME media type string. - * @param className Fully-qualified representation class name. - * - * @exception NullPointerException - * (unchecked exception) Thrown if {@code mimeType} is null or - * {@code className} is null. - * @exception IllegalArgumentException - * (unchecked exception) Thrown if {@code mimeType} does not - * obey the syntax for a MIME media type string. + * @param mimeType MIME media type string + * @param className fully-qualified representation class name + * @throws NullPointerException if {@code mimeType} or {@code className} is + * {@code null} + * @throws IllegalArgumentException if {@code mimeType} does not obey the + * syntax for a MIME media type string */ public DocFlavor(String mimeType, String className) { if (className == null) { @@ -522,8 +448,9 @@ } /** - * Returns this doc flavor object's MIME type string based on the - * canonical form. Each parameter value is enclosed in quotes. + * Returns this doc flavor object's MIME type string based on the canonical + * form. Each parameter value is enclosed in quotes. + * * @return the mime type */ public String getMimeType() { @@ -532,6 +459,7 @@ /** * Returns this doc flavor object's media type (from the MIME type). + * * @return the media type */ public String getMediaType() { @@ -540,6 +468,7 @@ /** * Returns this doc flavor object's media subtype (from the MIME type). + * * @return the media sub-type */ public String getMediaSubtype() { @@ -547,19 +476,18 @@ } /** - * Returns a {@code String} representing a MIME - * parameter. - * Mime types may include parameters which are usually optional. - * The charset for text types is a commonly useful example. - * This convenience method will return the value of the specified - * parameter if one was specified in the mime type for this flavor. + * Returns a {@code String} representing a MIME parameter. Mime types may + * include parameters which are usually optional. The charset for text types + * is a commonly useful example. This convenience method will return the + * value of the specified parameter if one was specified in the mime type + * for this flavor. * - * @param paramName the name of the paramater. This name is internally - * converted to the canonical lower case format before performing - * the match. - * @return String representing a mime parameter, or - * null if that parameter is not in the mime type string. - * @exception NullPointerException if paramName is null. + * @param paramName the name of the parameter. This name is internally + * converted to the canonical lower case format before performing + * the match. + * @return a string representing a mime parameter, or {@code null} if that + * parameter is not in the mime type string + * @throws NullPointerException if paramName is {@code null} */ public String getParameter(String paramName) { return myMimeType.getParameterMap().get(paramName.toLowerCase()); @@ -567,7 +495,8 @@ /** * Returns the name of this doc flavor object's representation class. - * @return the name of the representation class. + * + * @return the name of the representation class */ public String getRepresentationClassName() { return myClassName; @@ -576,10 +505,9 @@ /** * Converts this {@code DocFlavor} to a string. * - * @return MIME type string based on the canonical form. Each parameter - * value is enclosed in quotes. - * A "class=" parameter is appended to the - * MIME type string to indicate the representation class name. + * @return MIME type string based on the canonical form. Each parameter + * value is enclosed in quotes. A "class=" parameter is appended to + * the MIME type string to indicate the representation class name. */ public String toString() { return getStringValue(); @@ -593,22 +521,21 @@ } /** - * Determines if this doc flavor object is equal to the given object. - * The two are equal if the given object is not null, is an instance - * of {@code DocFlavor}, has a MIME type equivalent to this doc - * flavor object's MIME type (that is, the MIME types have the same media - * type, media subtype, and parameters), and has the same representation - * class name as this doc flavor object. Thus, if two doc flavor objects' - * MIME types are the same except for comments, they are considered equal. - * However, two doc flavor objects with MIME types of "text/plain" and - * "text/plain; charset=US-ASCII" are not considered equal, even though - * they represent the same media type (because the default character - * set for plain text is US-ASCII). + * Determines if this doc flavor object is equal to the given object. The + * two are equal if the given object is not {@code null}, is an instance of + * {@code DocFlavor}, has a MIME type equivalent to this doc flavor object's + * MIME type (that is, the MIME types have the same media type, media + * subtype, and parameters), and has the same representation class name as + * this doc flavor object. Thus, if two doc flavor objects' MIME types are + * the same except for comments, they are considered equal. However, two doc + * flavor objects with MIME types of "text/plain" and "text/plain; + * charset=US-ASCII" are not considered equal, even though they represent + * the same media type (because the default character set for plain text is + * US-ASCII). * - * @param obj Object to test. - * - * @return True if this doc flavor object equals {@code obj}, false - * otherwise. + * @param obj {@code Object} to test + * @return {@code true} if this doc flavor object equals {@code obj}, + * {@code false} otherwise */ public boolean equals(Object obj) { return @@ -619,6 +546,8 @@ /** * Returns this doc flavor object's string value. + * + * @return the string value */ private String getStringValue() { if (myStringValue == null) { @@ -630,8 +559,9 @@ /** * Write the instance to a stream (ie serialize the object). * + * @param s the output stream * @throws IOException if I/O errors occur while writing to the underlying - * stream + * stream */ private void writeObject(ObjectOutputStream s) throws IOException { @@ -642,14 +572,15 @@ /** * Reconstitute an instance from a stream (that is, deserialize it). * + * @param s the input stream * @throws ClassNotFoundException if the class of a serialized object could - * not be found. + * not be found * @throws IOException if I/O errors occur while reading from the underlying - * stream - * @serialData - * The serialised form of a DocFlavor is the String naming the - * representation class followed by the String representing the canonical - * form of the mime type. + * stream + * @serialData The serialised form of a {@code DocFlavor} is the + * {@code String} naming the representation class followed by + * the {@code String} representing the canonical form of the + * mime type */ private void readObject(ObjectInputStream s) throws ClassNotFoundException, IOException { @@ -659,167 +590,140 @@ } /** - * Class DocFlavor.BYTE_ARRAY provides predefined static constant - * DocFlavor objects for example doc flavors using a byte array + * Class {@code DocFlavor.BYTE_ARRAY} provides predefined static constant + * {@code DocFlavor} objects for example doc flavors using a byte array * ({@code byte[]}) as the print data representation class. * - * @author Alan Kaminsky + * @author Alan Kaminsky */ public static class BYTE_ARRAY extends DocFlavor { + /** + * Use serialVersionUID from JDK 1.4 for interoperability. + */ private static final long serialVersionUID = -9065578006593857475L; /** - * Constructs a new doc flavor with the given MIME type and a print - * data representation class name of {@code "[B"} (byte array). - * - * @param mimeType MIME media type string. + * Constructs a new doc flavor with the given MIME type and a print data + * representation class name of {@code "[B"} (byte array). * - * @exception NullPointerException - * (unchecked exception) Thrown if {@code mimeType} is null. - * @exception IllegalArgumentException - * (unchecked exception) Thrown if {@code mimeType} does not - * obey the syntax for a MIME media type string. + * @param mimeType MIME media type string + * @throws NullPointerException if {@code mimeType} is {@code null} + * @throws IllegalArgumentException if {@code mimeType} does not obey + * the syntax for a MIME media type string */ public BYTE_ARRAY (String mimeType) { super (mimeType, "[B"); } /** - * Doc flavor with MIME type = {@code "text/plain"}, - * encoded in the host platform encoding. - * See {@link DocFlavor#hostEncoding hostEncoding} - * Print data representation class name = - * {@code "[B"} (byte array). + * Doc flavor with MIME type = {@code "text/plain"}, encoded in the host + * platform encoding. See {@link DocFlavor#hostEncoding hostEncoding}. + * Print data representation class name = {@code "[B"} (byte array). */ public static final BYTE_ARRAY TEXT_PLAIN_HOST = new BYTE_ARRAY ("text/plain; charset="+hostEncoding); /** - * Doc flavor with MIME type = - * {@code "text/plain; charset=utf-8"}, - * print data representation class name = {@code "[B"} (byte - * array). + * Doc flavor with MIME type = {@code "text/plain; charset=utf-8"}, + * print data representation class name = {@code "[B"} (byte array). */ public static final BYTE_ARRAY TEXT_PLAIN_UTF_8 = new BYTE_ARRAY ("text/plain; charset=utf-8"); /** - * Doc flavor with MIME type = - * {@code "text/plain; charset=utf-16"}, - * print data representation class name = {@code "[B"} (byte - * array). + * Doc flavor with MIME type = {@code "text/plain; charset=utf-16"}, + * print data representation class name = {@code "[B"} (byte array). */ public static final BYTE_ARRAY TEXT_PLAIN_UTF_16 = new BYTE_ARRAY ("text/plain; charset=utf-16"); - /** - * Doc flavor with MIME type = - * {@code "text/plain; charset=utf-16be"} - * (big-endian byte ordering), - * print data representation class name = {@code "[B"} (byte - * array). + * Doc flavor with MIME type = {@code "text/plain; charset=utf-16be"} + * (big-endian byte ordering), print data representation class name = + * {@code "[B"} (byte array). */ public static final BYTE_ARRAY TEXT_PLAIN_UTF_16BE = new BYTE_ARRAY ("text/plain; charset=utf-16be"); /** - * Doc flavor with MIME type = - * {@code "text/plain; charset=utf-16le"} - * (little-endian byte ordering), - * print data representation class name = {@code "[B"} (byte - * array). + * Doc flavor with MIME type = {@code "text/plain; charset=utf-16le"} + * (little-endian byte ordering), print data representation class name = + * {@code "[B"} (byte array). */ public static final BYTE_ARRAY TEXT_PLAIN_UTF_16LE = new BYTE_ARRAY ("text/plain; charset=utf-16le"); /** - * Doc flavor with MIME type = - * {@code "text/plain; charset=us-ascii"}, - * print data representation class name = - * {@code "[B"} (byte array). + * Doc flavor with MIME type = {@code "text/plain; charset=us-ascii"}, + * print data representation class name = {@code "[B"} (byte array). */ public static final BYTE_ARRAY TEXT_PLAIN_US_ASCII = new BYTE_ARRAY ("text/plain; charset=us-ascii"); /** - * Doc flavor with MIME type = {@code "text/html"}, - * encoded in the host platform encoding. - * See {@link DocFlavor#hostEncoding hostEncoding} - * Print data representation class name = - * {@code "[B"} (byte array). + * Doc flavor with MIME type = {@code "text/html"}, encoded in the host + * platform encoding. See {@link DocFlavor#hostEncoding hostEncoding}. + * Print data representation class name = {@code "[B"} (byte array). */ public static final BYTE_ARRAY TEXT_HTML_HOST = new BYTE_ARRAY ("text/html; charset="+hostEncoding); /** - * Doc flavor with MIME type = - * {@code "text/html; charset=utf-8"}, - * print data representation class name = {@code "[B"} (byte - * array). + * Doc flavor with MIME type = {@code "text/html; charset=utf-8"}, print + * data representation class name = {@code "[B"} (byte array). */ public static final BYTE_ARRAY TEXT_HTML_UTF_8 = new BYTE_ARRAY ("text/html; charset=utf-8"); /** - * Doc flavor with MIME type = - * {@code "text/html; charset=utf-16"}, - * print data representation class name = {@code "[B"} (byte - * array). + * Doc flavor with MIME type = {@code "text/html; charset=utf-16"}, + * print data representation class name = {@code "[B"} (byte array). */ public static final BYTE_ARRAY TEXT_HTML_UTF_16 = new BYTE_ARRAY ("text/html; charset=utf-16"); /** - * Doc flavor with MIME type = - * {@code "text/html; charset=utf-16be"} - * (big-endian byte ordering), - * print data representation class name = {@code "[B"} (byte - * array). + * Doc flavor with MIME type = {@code "text/html; charset=utf-16be"} + * (big-endian byte ordering), print data representation class name = + * {@code "[B"} (byte array). */ public static final BYTE_ARRAY TEXT_HTML_UTF_16BE = new BYTE_ARRAY ("text/html; charset=utf-16be"); /** - * Doc flavor with MIME type = - * {@code "text/html; charset=utf-16le"} - * (little-endian byte ordering), - * print data representation class name = {@code "[B"} (byte - * array). + * Doc flavor with MIME type = {@code "text/html; charset=utf-16le"} + * (little-endian byte ordering), print data representation class name = + * {@code "[B"} (byte array). */ public static final BYTE_ARRAY TEXT_HTML_UTF_16LE = new BYTE_ARRAY ("text/html; charset=utf-16le"); /** - * Doc flavor with MIME type = - * {@code "text/html; charset=us-ascii"}, - * print data representation class name = - * {@code "[B"} (byte array). + * Doc flavor with MIME type = {@code "text/html; charset=us-ascii"}, + * print data representation class name = {@code "[B"} (byte array). */ public static final BYTE_ARRAY TEXT_HTML_US_ASCII = new BYTE_ARRAY ("text/html; charset=us-ascii"); /** - * Doc flavor with MIME type = {@code "application/pdf"}, print - * data representation class name = {@code "[B"} (byte array). + * Doc flavor with MIME type = {@code "application/pdf"}, print data + * representation class name = {@code "[B"} (byte array). */ public static final BYTE_ARRAY PDF = new BYTE_ARRAY ("application/pdf"); /** - * Doc flavor with MIME type = {@code "application/postscript"}, - * print data representation class name = {@code "[B"} (byte - * array). + * Doc flavor with MIME type = {@code "application/postscript"}, print + * data representation class name = {@code "[B"} (byte array). */ public static final BYTE_ARRAY POSTSCRIPT = new BYTE_ARRAY ("application/postscript"); /** - * Doc flavor with MIME type = {@code "application/vnd.hp-PCL"}, - * print data representation class name = {@code "[B"} (byte - * array). + * Doc flavor with MIME type = {@code "application/vnd.hp-PCL"}, print + * data representation class name = {@code "[B"} (byte array). */ public static final BYTE_ARRAY PCL = new BYTE_ARRAY ("application/vnd.hp-PCL"); @@ -843,376 +747,337 @@ public static final BYTE_ARRAY PNG = new BYTE_ARRAY ("image/png"); /** - * Doc flavor with MIME type = - * {@code "application/octet-stream"}, - * print data representation class name = {@code "[B"} (byte - * array). The client must determine that data described - * using this DocFlavor is valid for the printer. + * Doc flavor with MIME type = {@code "application/octet-stream"}, print + * data representation class name = {@code "[B"} (byte array). The + * client must determine that data described using this + * {@code DocFlavor} is valid for the printer. */ public static final BYTE_ARRAY AUTOSENSE = new BYTE_ARRAY ("application/octet-stream"); - } /** - * Class DocFlavor.INPUT_STREAM provides predefined static constant - * DocFlavor objects for example doc flavors using a byte stream ({@link - * java.io.InputStream java.io.InputStream}) as the print - * data representation class. + * Class {@code DocFlavor.INPUT_STREAM} provides predefined static constant + * {@code DocFlavor} objects for example doc flavors using a byte stream + * ({@link java.io.InputStream java.io.InputStream}) as the print data + * representation class. * - * @author Alan Kaminsky + * @author Alan Kaminsky */ public static class INPUT_STREAM extends DocFlavor { + /** + * Use serialVersionUID from JDK 1.4 for interoperability. + */ private static final long serialVersionUID = -7045842700749194127L; /** - * Constructs a new doc flavor with the given MIME type and a print - * data representation class name of - * {@code "java.io.InputStream"} (byte stream). - * - * @param mimeType MIME media type string. + * Constructs a new doc flavor with the given MIME type and a print data + * representation class name of {@code "java.io.InputStream"} (byte + * stream). * - * @exception NullPointerException - * (unchecked exception) Thrown if {@code mimeType} is null. - * @exception IllegalArgumentException - * (unchecked exception) Thrown if {@code mimeType} does not - * obey the syntax for a MIME media type string. + * @param mimeType MIME media type string + * @throws NullPointerException if {@code mimeType} is {@code null} + * @throws IllegalArgumentException if {@code mimeType} does not obey + * the syntax for a MIME media type string. */ public INPUT_STREAM (String mimeType) { super (mimeType, "java.io.InputStream"); } /** - * Doc flavor with MIME type = {@code "text/plain"}, - * encoded in the host platform encoding. - * See {@link DocFlavor#hostEncoding hostEncoding} - * Print data representation class name = - * {@code "java.io.InputStream"} (byte stream). + * Doc flavor with MIME type = {@code "text/plain"}, encoded in the host + * platform encoding. See {@link DocFlavor#hostEncoding hostEncoding}. + * Print data representation class name = {@code "java.io.InputStream"} + * (byte stream). */ public static final INPUT_STREAM TEXT_PLAIN_HOST = new INPUT_STREAM ("text/plain; charset="+hostEncoding); /** - * Doc flavor with MIME type = - * {@code "text/plain; charset=utf-8"}, - * print data representation class name = - * {@code "java.io.InputStream"} (byte stream). + * Doc flavor with MIME type = {@code "text/plain; charset=utf-8"}, + * print data representation class name = {@code "java.io.InputStream"} + * (byte stream). */ public static final INPUT_STREAM TEXT_PLAIN_UTF_8 = new INPUT_STREAM ("text/plain; charset=utf-8"); /** - * Doc flavor with MIME type = - * {@code "text/plain; charset=utf-16"}, - * print data representation class name = - * {@code "java.io.InputStream"} (byte stream). + * Doc flavor with MIME type = {@code "text/plain; charset=utf-16"}, + * print data representation class name = {@code "java.io.InputStream"} + * (byte stream). */ public static final INPUT_STREAM TEXT_PLAIN_UTF_16 = new INPUT_STREAM ("text/plain; charset=utf-16"); /** - * Doc flavor with MIME type = - * {@code "text/plain; charset=utf-16be"} - * (big-endian byte ordering), - * print data representation class name = + * Doc flavor with MIME type = {@code "text/plain; charset=utf-16be"} + * (big-endian byte ordering), print data representation class name = * {@code "java.io.InputStream"} (byte stream). */ public static final INPUT_STREAM TEXT_PLAIN_UTF_16BE = new INPUT_STREAM ("text/plain; charset=utf-16be"); /** - * Doc flavor with MIME type = - * {@code "text/plain; charset=utf-16le"} - * (little-endian byte ordering), - * print data representation class name = + * Doc flavor with MIME type = {@code "text/plain; charset=utf-16le"} + * (little-endian byte ordering), print data representation class name = * {@code "java.io.InputStream"} (byte stream). */ public static final INPUT_STREAM TEXT_PLAIN_UTF_16LE = new INPUT_STREAM ("text/plain; charset=utf-16le"); /** - * Doc flavor with MIME type = - * {@code "text/plain; charset=us-ascii"}, - * print data representation class name = - * {@code "java.io.InputStream"} (byte stream). + * Doc flavor with MIME type = {@code "text/plain; charset=us-ascii"}, + * print data representation class name = {@code "java.io.InputStream"} + * (byte stream). */ public static final INPUT_STREAM TEXT_PLAIN_US_ASCII = new INPUT_STREAM ("text/plain; charset=us-ascii"); /** - * Doc flavor with MIME type = {@code "text/html"}, - * encoded in the host platform encoding. - * See {@link DocFlavor#hostEncoding hostEncoding} - * Print data representation class name = - * {@code "java.io.InputStream"} (byte stream). + * Doc flavor with MIME type = {@code "text/html"}, encoded in the host + * platform encoding. See {@link DocFlavor#hostEncoding hostEncoding}. + * Print data representation class name = {@code "java.io.InputStream"} + * (byte stream). */ public static final INPUT_STREAM TEXT_HTML_HOST = new INPUT_STREAM ("text/html; charset="+hostEncoding); /** - * Doc flavor with MIME type = - * {@code "text/html; charset=utf-8"}, - * print data representation class name = - * {@code "java.io.InputStream"} (byte stream). + * Doc flavor with MIME type = {@code "text/html; charset=utf-8"}, print + * data representation class name = {@code "java.io.InputStream"} (byte + * stream). */ public static final INPUT_STREAM TEXT_HTML_UTF_8 = new INPUT_STREAM ("text/html; charset=utf-8"); /** - * Doc flavor with MIME type = - * {@code "text/html; charset=utf-16"}, - * print data representation class name = - * {@code "java.io.InputStream"} (byte stream). + * Doc flavor with MIME type = {@code "text/html; charset=utf-16"}, + * print data representation class name = {@code "java.io.InputStream"} + * (byte stream). */ public static final INPUT_STREAM TEXT_HTML_UTF_16 = new INPUT_STREAM ("text/html; charset=utf-16"); /** - * Doc flavor with MIME type = - * {@code "text/html; charset=utf-16be"} - * (big-endian byte ordering), - * print data representation class name = + * Doc flavor with MIME type = {@code "text/html; charset=utf-16be"} + * (big-endian byte ordering), print data representation class name = * {@code "java.io.InputStream"} (byte stream). */ public static final INPUT_STREAM TEXT_HTML_UTF_16BE = new INPUT_STREAM ("text/html; charset=utf-16be"); /** - * Doc flavor with MIME type = - * {@code "text/html; charset=utf-16le"} - * (little-endian byte ordering), - * print data representation class name = + * Doc flavor with MIME type = {@code "text/html; charset=utf-16le"} + * (little-endian byte ordering), print data representation class name = * {@code "java.io.InputStream"} (byte stream). */ public static final INPUT_STREAM TEXT_HTML_UTF_16LE = new INPUT_STREAM ("text/html; charset=utf-16le"); /** - * Doc flavor with MIME type = - * {@code "text/html; charset=us-ascii"}, - * print data representation class name = - * {@code "java.io.InputStream"} (byte stream). + * Doc flavor with MIME type = {@code "text/html; charset=us-ascii"}, + * print data representation class name = {@code "java.io.InputStream"} + * (byte stream). */ public static final INPUT_STREAM TEXT_HTML_US_ASCII = new INPUT_STREAM ("text/html; charset=us-ascii"); - /** - * Doc flavor with MIME type = {@code "application/pdf"}, print - * data representation class name = {@code "java.io.InputStream"} - * (byte stream). + * Doc flavor with MIME type = {@code "application/pdf"}, print data + * representation class name = {@code "java.io.InputStream"} (byte + * stream). */ public static final INPUT_STREAM PDF = new INPUT_STREAM ("application/pdf"); /** - * Doc flavor with MIME type = {@code "application/postscript"}, - * print data representation class name = - * {@code "java.io.InputStream"} (byte stream). + * Doc flavor with MIME type = {@code "application/postscript"}, print + * data representation class name = {@code "java.io.InputStream"} (byte + * stream). */ public static final INPUT_STREAM POSTSCRIPT = new INPUT_STREAM ("application/postscript"); /** - * Doc flavor with MIME type = {@code "application/vnd.hp-PCL"}, - * print data representation class name = - * {@code "java.io.InputStream"} (byte stream). + * Doc flavor with MIME type = {@code "application/vnd.hp-PCL"}, print + * data representation class name = {@code "java.io.InputStream"} (byte + * stream). */ public static final INPUT_STREAM PCL = new INPUT_STREAM ("application/vnd.hp-PCL"); /** * Doc flavor with MIME type = {@code "image/gif"}, print data - * representation class name = - * {@code "java.io.InputStream"} (byte stream). + * representation class name = {@code "java.io.InputStream"} (byte + * stream). */ public static final INPUT_STREAM GIF = new INPUT_STREAM ("image/gif"); /** * Doc flavor with MIME type = {@code "image/jpeg"}, print data - * representation class name = - * {@code "java.io.InputStream"} (byte stream). + * representation class name = {@code "java.io.InputStream"} (byte + * stream). */ public static final INPUT_STREAM JPEG = new INPUT_STREAM ("image/jpeg"); /** * Doc flavor with MIME type = {@code "image/png"}, print data - * representation class name = - * {@code "java.io.InputStream"} (byte stream). + * representation class name = {@code "java.io.InputStream"} (byte + * stream). */ public static final INPUT_STREAM PNG = new INPUT_STREAM ("image/png"); /** - * Doc flavor with MIME type = - * {@code "application/octet-stream"}, - * print data representation class name = - * {@code "java.io.InputStream"} (byte stream). - * The client must determine that data described - * using this DocFlavor is valid for the printer. + * Doc flavor with MIME type = {@code "application/octet-stream"}, print + * data representation class name = {@code "java.io.InputStream"} (byte + * stream). The client must determine that data described using this + * {@code DocFlavor} is valid for the printer. */ public static final INPUT_STREAM AUTOSENSE = new INPUT_STREAM ("application/octet-stream"); - } /** - * Class DocFlavor.URL provides predefined static constant DocFlavor - * objects. - * For example doc flavors using a Uniform Resource Locator ({@link - * java.net.URL java.net.URL}) as the print data + * Class {@code DocFlavor.URL} provides predefined static constant + * {@code DocFlavor} objects. For example doc flavors using a Uniform + * Resource Locator ({@link java.net.URL java.net.URL}) as the print data * representation class. * - * @author Alan Kaminsky + * @author Alan Kaminsky */ public static class URL extends DocFlavor { + + /** + * Use serialVersionUID from JDK 1.4 for interoperability. + */ private static final long serialVersionUID = 2936725788144902062L; /** - * Constructs a new doc flavor with the given MIME type and a print - * data representation class name of {@code "java.net.URL"}. - * - * @param mimeType MIME media type string. + * Constructs a new doc flavor with the given MIME type and a print data + * representation class name of {@code "java.net.URL"}. * - * @exception NullPointerException - * (unchecked exception) Thrown if {@code mimeType} is null. - * @exception IllegalArgumentException - * (unchecked exception) Thrown if {@code mimeType} does not - * obey the syntax for a MIME media type string. + * @param mimeType MIME media type string + * @throws NullPointerException if {@code mimeType} is {@code null} + * @throws IllegalArgumentException if {@code mimeType} does not obey + * the syntax for a MIME media type string */ public URL (String mimeType) { super (mimeType, "java.net.URL"); } /** - * Doc flavor with MIME type = {@code "text/plain"}, - * encoded in the host platform encoding. - * See {@link DocFlavor#hostEncoding hostEncoding} - * Print data representation class name = - * {@code "java.net.URL"} (byte stream). + * Doc flavor with MIME type = {@code "text/plain"}, encoded in the host + * platform encoding. See {@link DocFlavor#hostEncoding hostEncoding}. + * Print data representation class name = {@code "java.net.URL"} (byte + * stream). */ public static final URL TEXT_PLAIN_HOST = new URL ("text/plain; charset="+hostEncoding); /** - * Doc flavor with MIME type = - * {@code "text/plain; charset=utf-8"}, - * print data representation class name = - * {@code "java.net.URL"} (byte stream). + * Doc flavor with MIME type = {@code "text/plain; charset=utf-8"}, + * print data representation class name = {@code "java.net.URL"} (byte + * stream). */ public static final URL TEXT_PLAIN_UTF_8 = new URL ("text/plain; charset=utf-8"); /** - * Doc flavor with MIME type = - * {@code "text/plain; charset=utf-16"}, - * print data representation class name = - * {@code java.net.URL""} (byte stream). + * Doc flavor with MIME type = {@code "text/plain; charset=utf-16"}, + * print data representation class name = {@code java.net.URL""} (byte + * stream). */ public static final URL TEXT_PLAIN_UTF_16 = new URL ("text/plain; charset=utf-16"); /** - * Doc flavor with MIME type = - * {@code "text/plain; charset=utf-16be"} - * (big-endian byte ordering), - * print data representation class name = + * Doc flavor with MIME type = {@code "text/plain; charset=utf-16be"} + * (big-endian byte ordering), print data representation class name = * {@code "java.net.URL"} (byte stream). */ public static final URL TEXT_PLAIN_UTF_16BE = new URL ("text/plain; charset=utf-16be"); /** - * Doc flavor with MIME type = - * {@code "text/plain; charset=utf-16le"} - * (little-endian byte ordering), - * print data representation class name = + * Doc flavor with MIME type = {@code "text/plain; charset=utf-16le"} + * (little-endian byte ordering), print data representation class name = * {@code "java.net.URL"} (byte stream). */ public static final URL TEXT_PLAIN_UTF_16LE = new URL ("text/plain; charset=utf-16le"); /** - * Doc flavor with MIME type = - * {@code "text/plain; charset=us-ascii"}, - * print data representation class name = - * {@code "java.net.URL"} (byte stream). + * Doc flavor with MIME type = {@code "text/plain; charset=us-ascii"}, + * print data representation class name = {@code "java.net.URL"} (byte + * stream). */ public static final URL TEXT_PLAIN_US_ASCII = new URL ("text/plain; charset=us-ascii"); /** - * Doc flavor with MIME type = {@code "text/html"}, - * encoded in the host platform encoding. - * See {@link DocFlavor#hostEncoding hostEncoding} - * Print data representation class name = - * {@code "java.net.URL"} (byte stream). + * Doc flavor with MIME type = {@code "text/html"}, encoded in the host + * platform encoding. See {@link DocFlavor#hostEncoding hostEncoding}. + * Print data representation class name = {@code "java.net.URL"} (byte + * stream). */ public static final URL TEXT_HTML_HOST = new URL ("text/html; charset="+hostEncoding); /** - * Doc flavor with MIME type = - * {@code "text/html; charset=utf-8"}, - * print data representation class name = - * {@code "java.net.URL"} (byte stream). + * Doc flavor with MIME type = {@code "text/html; charset=utf-8"}, print + * data representation class name = {@code "java.net.URL"} (byte + * stream). */ public static final URL TEXT_HTML_UTF_8 = new URL ("text/html; charset=utf-8"); /** - * Doc flavor with MIME type = - * {@code "text/html; charset=utf-16"}, - * print data representation class name = - * {@code "java.net.URL"} (byte stream). + * Doc flavor with MIME type = {@code "text/html; charset=utf-16"}, + * print data representation class name = {@code "java.net.URL"} (byte + * stream). */ public static final URL TEXT_HTML_UTF_16 = new URL ("text/html; charset=utf-16"); /** - * Doc flavor with MIME type = - * {@code "text/html; charset=utf-16be"} - * (big-endian byte ordering), - * print data representation class name = + * Doc flavor with MIME type = {@code "text/html; charset=utf-16be"} + * (big-endian byte ordering), print data representation class name = * {@code "java.net.URL"} (byte stream). */ public static final URL TEXT_HTML_UTF_16BE = new URL ("text/html; charset=utf-16be"); /** - * Doc flavor with MIME type = - * {@code "text/html; charset=utf-16le"} - * (little-endian byte ordering), - * print data representation class name = + * Doc flavor with MIME type = {@code "text/html; charset=utf-16le"} + * (little-endian byte ordering), print data representation class name = * {@code "java.net.URL"} (byte stream). */ public static final URL TEXT_HTML_UTF_16LE = new URL ("text/html; charset=utf-16le"); /** - * Doc flavor with MIME type = - * {@code "text/html; charset=us-ascii"}, - * print data representation class name = - * {@code "java.net.URL"} (byte stream). + * Doc flavor with MIME type = {@code "text/html; charset=us-ascii"}, + * print data representation class name = {@code "java.net.URL"} (byte + * stream). */ public static final URL TEXT_HTML_US_ASCII = new URL ("text/html; charset=us-ascii"); - /** - * Doc flavor with MIME type = {@code "application/pdf"}, print - * data representation class name = {@code "java.net.URL"}. + * Doc flavor with MIME type = {@code "application/pdf"}, print data + * representation class name = {@code "java.net.URL"}. */ public static final URL PDF = new URL ("application/pdf"); /** - * Doc flavor with MIME type = {@code "application/postscript"}, - * print data representation class name = {@code "java.net.URL"}. + * Doc flavor with MIME type = {@code "application/postscript"}, print + * data representation class name = {@code "java.net.URL"}. */ public static final URL POSTSCRIPT = new URL ("application/postscript"); /** - * Doc flavor with MIME type = {@code "application/vnd.hp-PCL"}, - * print data representation class name = {@code "java.net.URL"}. + * Doc flavor with MIME type = {@code "application/vnd.hp-PCL"}, print + * data representation class name = {@code "java.net.URL"}. */ public static final URL PCL = new URL ("application/vnd.hp-PCL"); @@ -1235,42 +1100,39 @@ public static final URL PNG = new URL ("image/png"); /** - * Doc flavor with MIME type = - * {@code "application/octet-stream"}, - * print data representation class name = {@code "java.net.URL"}. - * The client must determine that data described - * using this DocFlavor is valid for the printer. + * Doc flavor with MIME type = {@code "application/octet-stream"}, print + * data representation class name = {@code "java.net.URL"}. The client + * must determine that data described using this {@code DocFlavor} is + * valid for the printer. */ public static final URL AUTOSENSE = new URL ("application/octet-stream"); - } /** - * Class DocFlavor.CHAR_ARRAY provides predefined static constant - * DocFlavor objects for example doc flavors using a character array - * ({@code char[]}) as the print data representation class. As such, - * the character set is Unicode. + * Class {@code DocFlavor.CHAR_ARRAY} provides predefined static constant + * {@code DocFlavor} objects for example doc flavors using a character array + * ({@code char[]}) as the print data representation class. As such, the + * character set is Unicode. * - * @author Alan Kaminsky + * @author Alan Kaminsky */ public static class CHAR_ARRAY extends DocFlavor { + /** + * Use serialVersionUID from JDK 1.4 for interoperability. + */ private static final long serialVersionUID = -8720590903724405128L; /** - * Constructs a new doc flavor with the given MIME type and a print - * data representation class name of - * {@code "[C"} (character array). + * Constructs a new doc flavor with the given MIME type and a print data + * representation class name of {@code "[C"} (character array). * - * @param mimeType MIME media type string. If it is a text media - * type, it is assumed to contain a - * {@code "charset=utf-16"} parameter. - * - * @exception NullPointerException - * (unchecked exception) Thrown if {@code mimeType} is null. - * @exception IllegalArgumentException - * (unchecked exception) Thrown if {@code mimeType} does not - * obey the syntax for a MIME media type string. + * @param mimeType MIME media type string. If it is a text media type, + * it is assumed to contain a {@code "charset=utf-16"} + * parameter. + * @throws NullPointerException if {@code mimeType} is {@code null} + * @throws IllegalArgumentException if {@code mimeType} does not obey + * the syntax for a MIME media type string */ public CHAR_ARRAY (String mimeType) { super (mimeType, "[C"); @@ -1278,47 +1140,46 @@ /** * Doc flavor with MIME type = {@code "text/plain; charset=utf-16"}, - * print data representation class name = - * {@code "[C"} (character array). + * print data representation class name = {@code "[C"} (character + * array). */ public static final CHAR_ARRAY TEXT_PLAIN = new CHAR_ARRAY ("text/plain; charset=utf-16"); /** * Doc flavor with MIME type = {@code "text/html; charset=utf-16"}, - * print data representation class name = - * {@code "[C"} (character array). + * print data representation class name = {@code "[C"} (character + * array). */ public static final CHAR_ARRAY TEXT_HTML = new CHAR_ARRAY ("text/html; charset=utf-16"); - } /** - * Class DocFlavor.STRING provides predefined static constant DocFlavor - * objects for example doc flavors using a string ({@link java.lang.String - * java.lang.String}) as the print data representation class. + * Class {@code DocFlavor.STRING} provides predefined static constant + * {@code DocFlavor} objects for example doc flavors using a string + * ({@link String java.lang.String}) as the print data representation class. * As such, the character set is Unicode. * - * @author Alan Kaminsky + * @author Alan Kaminsky */ public static class STRING extends DocFlavor { + /** + * Use serialVersionUID from JDK 1.4 for interoperability. + */ private static final long serialVersionUID = 4414407504887034035L; /** - * Constructs a new doc flavor with the given MIME type and a print - * data representation class name of {@code "java.lang.String"}. + * Constructs a new doc flavor with the given MIME type and a print data + * representation class name of {@code "java.lang.String"}. * - * @param mimeType MIME media type string. If it is a text media - * type, it is assumed to contain a - * {@code "charset=utf-16"} parameter. - * - * @exception NullPointerException - * (unchecked exception) Thrown if {@code mimeType} is null. - * @exception IllegalArgumentException - * (unchecked exception) Thrown if {@code mimeType} does not - * obey the syntax for a MIME media type string. + * @param mimeType MIME media type string. If it is a text media type, + * it is assumed to contain a {@code "charset=utf-16"} + * parameter. + * @throws NullPointerException if {@code mimeType} is {@code null} + * @throws IllegalArgumentException if {@code mimeType} does not obey + * the syntax for a MIME media type string */ public STRING (String mimeType) { super (mimeType, "java.lang.String"); @@ -1326,47 +1187,45 @@ /** * Doc flavor with MIME type = {@code "text/plain; charset=utf-16"}, - * print data representation class name = - * {@code "java.lang.String"}. + * print data representation class name = {@code "java.lang.String"}. */ public static final STRING TEXT_PLAIN = new STRING ("text/plain; charset=utf-16"); /** * Doc flavor with MIME type = {@code "text/html; charset=utf-16"}, - * print data representation class name = - * {@code "java.lang.String"}. + * print data representation class name = {@code "java.lang.String"}. */ public static final STRING TEXT_HTML = new STRING ("text/html; charset=utf-16"); } /** - * Class DocFlavor.READER provides predefined static constant DocFlavor - * objects for example doc flavors using a character stream ({@link - * java.io.Reader java.io.Reader}) as the print data + * Class {@code DocFlavor.READER} provides predefined static constant + * {@code DocFlavor} objects for example doc flavors using a character + * stream ({@link java.io.Reader java.io.Reader}) as the print data * representation class. As such, the character set is Unicode. * - * @author Alan Kaminsky + * @author Alan Kaminsky */ public static class READER extends DocFlavor { + /** + * Use serialVersionUID from JDK 1.4 for interoperability. + */ private static final long serialVersionUID = 7100295812579351567L; /** - * Constructs a new doc flavor with the given MIME type and a print - * data representation class name of\ - * {@code "java.io.Reader"} (character stream). + * Constructs a new doc flavor with the given MIME type and a print data + * representation class name of {@code "java.io.Reader"} (character + * stream). * - * @param mimeType MIME media type string. If it is a text media - * type, it is assumed to contain a - * {@code "charset=utf-16"} parameter. - * - * @exception NullPointerException - * (unchecked exception) Thrown if {@code mimeType} is null. - * @exception IllegalArgumentException - * (unchecked exception) Thrown if {@code mimeType} does not - * obey the syntax for a MIME media type string. + * @param mimeType MIME media type string. If it is a text media type, + * it is assumed to contain a {@code "charset=utf-16"} + * parameter. + * @throws NullPointerException if {@code mimeType} is {@code null} + * @throws IllegalArgumentException if {@code mimeType} does not obey + * the syntax for a MIME media type string */ public READER (String mimeType) { super (mimeType, "java.io.Reader"); @@ -1374,16 +1233,16 @@ /** * Doc flavor with MIME type = {@code "text/plain; charset=utf-16"}, - * print data representation class name = - * {@code "java.io.Reader"} (character stream). + * print data representation class name = {@code "java.io.Reader"} + * (character stream). */ public static final READER TEXT_PLAIN = new READER ("text/plain; charset=utf-16"); /** * Doc flavor with MIME type = {@code "text/html; charset=utf-16"}, - * print data representation class name = - * {@code "java.io.Reader"} (character stream). + * print data representation class name = {@code "java.io.Reader"} + * (character stream). */ public static final READER TEXT_HTML = new READER ("text/html; charset=utf-16"); @@ -1391,27 +1250,27 @@ } /** - * Class DocFlavor.SERVICE_FORMATTED provides predefined static constant - * DocFlavor objects for example doc flavors for service formatted print - * data. + * Class {@code DocFlavor.SERVICE_FORMATTED} provides predefined static + * constant {@code DocFlavor} objects for example doc flavors for service + * formatted print data. * - * @author Alan Kaminsky + * @author Alan Kaminsky */ public static class SERVICE_FORMATTED extends DocFlavor { + /** + * Use serialVersionUID from JDK 1.4 for interoperability. + */ private static final long serialVersionUID = 6181337766266637256L; /** * Constructs a new doc flavor with a MIME type of - * {@code "application/x-java-jvm-local-objectref"} indicating - * service formatted print data and the given print data - * representation class name. + * {@code "application/x-java-jvm-local-objectref"} indicating service + * formatted print data and the given print data representation class + * name. * - * @param className Fully-qualified representation class name. - * - * @exception NullPointerException - * (unchecked exception) Thrown if {@code className} is - * null. + * @param className fully-qualified representation class name + * @throws NullPointerException if {@code className} is {@code null} */ public SERVICE_FORMATTED (String className) { super ("application/x-java-jvm-local-objectref", className); @@ -1420,8 +1279,8 @@ /** * Service formatted print data doc flavor with print data * representation class name = - * {@code "java.awt.image.renderable.RenderableImage"} - * (renderable image object). + * {@code "java.awt.image.renderable.RenderableImage"} (renderable image + * object). */ public static final SERVICE_FORMATTED RENDERABLE_IMAGE = new SERVICE_FORMATTED("java.awt.image.renderable.RenderableImage"); @@ -1443,5 +1302,4 @@ new SERVICE_FORMATTED ("java.awt.print.Pageable"); } - } diff -r 000f4e4ddd39 -r 57173ad5c534 jdk/src/java.desktop/share/classes/javax/print/DocPrintJob.java --- a/jdk/src/java.desktop/share/classes/javax/print/DocPrintJob.java Fri Sep 01 14:13:40 2017 +0000 +++ b/jdk/src/java.desktop/share/classes/javax/print/DocPrintJob.java Sat Sep 09 14:36:45 2017 +0200 @@ -1,5 +1,5 @@ /* - * Copyright (c) 2000, 2013, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2000, 2017, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -29,146 +29,132 @@ import javax.print.attribute.PrintRequestAttributeSet; import javax.print.event.PrintJobAttributeListener; import javax.print.event.PrintJobListener; -import javax.print.PrintException; /** - * - * This interface represents a print job that can print a specified - * document with a set of job attributes. An object implementing - * this interface is obtained from a print service. - * + * This interface represents a print job that can print a specified document + * with a set of job attributes. An object implementing this interface is + * obtained from a print service. */ - public interface DocPrintJob { /** - * Determines the {@link PrintService} object to which this print job - * object is bound. + * Determines the {@link PrintService} object to which this print job object + * is bound. * - * @return {@code PrintService} object. - * + * @return {@code PrintService} object */ public PrintService getPrintService(); /** - * Obtains this Print Job's set of printing attributes. - * The returned attribute set object is unmodifiable. - * The returned attribute set object is a "snapshot" of this Print Job's - * attribute set at the time of the {@link #getAttributes()} method - * call; that is, the returned attribute set's object's contents will - * not be updated if this Print Job's attribute set's contents change - * in the future. To detect changes in attribute values, call - * {@code getAttributes()} again and compare the new attribute - * set to the previous attribute set; alternatively, register a - * listener for print job events. - * The returned value may be an empty set but should not be null. + * Obtains this Print Job's set of printing attributes. The returned + * attribute set object is unmodifiable. The returned attribute set object + * is a "snapshot" of this Print Job's attribute set at the time of the + * {@code getAttributes()} method call; that is, the returned attribute + * set's object's contents will not be updated if this Print Job's attribute + * set's contents change in the future. To detect changes in attribute + * values, call {@code getAttributes()} again and compare the new attribute + * set to the previous attribute set; alternatively, register a listener for + * print job events. The returned value may be an empty set but should not + * be {@code null}. + * * @return the print job attributes */ public PrintJobAttributeSet getAttributes(); /** - * Registers a listener for event occurring during this print job. - * If listener is null, no exception is thrown and no action is - * performed. - * If listener is already registered, it will be registered again. + * Registers a listener for event occurring during this print job. If + * listener is {@code null}, no exception is thrown and no action is + * performed. If listener is already registered, it will be registered + * again. + * + * @param listener the object implementing the listener interface * @see #removePrintJobListener - * - * @param listener The object implementing the listener interface - * */ public void addPrintJobListener(PrintJobListener listener); /** - * Removes a listener from this print job. - * This method performs no function, nor does it throw an exception, - * if the listener specified by the argument was not previously added - * to this component. If listener is null, no exception is thrown and - * no action is performed. If a listener was registered more than once - * only one of the registrations will be removed. + * Removes a listener from this print job. This method performs no function, + * nor does it throw an exception, if the listener specified by the argument + * was not previously added to this print job. If listener is {@code null}, + * no exception is thrown and no action is performed. If a listener was + * registered more than once only one of the registrations will be removed. + * + * @param listener the object implementing the listener interface * @see #addPrintJobListener - * - * @param listener The object implementing the listener interface */ public void removePrintJobListener(PrintJobListener listener); /** - * Registers a listener for changes in the specified attributes. - * If listener is null, no exception is thrown and no action is - * performed. - * To determine the attribute updates that may be reported by this job, - * a client can call {@code getAttributes()} and identify the - * subset that are interesting and likely to be reported to the - * listener. Clients expecting to be updated about changes in a - * specific job attribute should verify it is in that set, but - * updates about an attribute will be made only if it changes and this - * is detected by the job. Also updates may be subject to batching - * by the job. To minimize overhead in print job processing it is - * recommended to listen on only that subset of attributes which - * are likely to change. - * If the specified set is empty no attribute updates will be reported - * to the listener. - * If the attribute set is null, then this means to listen on all - * dynamic attributes that the job supports. This may result in no - * update notifications if a job can not report any attribute updates. + * Registers a listener for changes in the specified attributes. If listener + * is {@code null}, no exception is thrown and no action is performed. To + * determine the attribute updates that may be reported by this job, a + * client can call {@code getAttributes()} and identify the subset that are + * interesting and likely to be reported to the listener. Clients expecting + * to be updated about changes in a specific job attribute should verify it + * is in that set, but updates about an attribute will be made only if it + * changes and this is detected by the job. Also updates may be subject to + * batching by the job. To minimize overhead in print job processing it is + * recommended to listen on only that subset of attributes which are likely + * to change. If the specified set is empty no attribute updates will be + * reported to the listener. If the attribute set is {@code null}, then this + * means to listen on all dynamic attributes that the job supports. This may + * result in no update notifications if a job can not report any attribute + * updates. + *
+ * If listener is already registered, it will be registered again. * - * If listener is already registered, it will be registered again. + * @param listener the object implementing the listener interface + * @param attributes the attributes to listen on, or {@code null} to mean + * all attributes that can change, as determined by the job * @see #removePrintJobAttributeListener - * - * @param listener The object implementing the listener interface - * @param attributes The attributes to listen on, or null to mean - * all attributes that can change, as determined by the job. */ public void addPrintJobAttributeListener( PrintJobAttributeListener listener, PrintJobAttributeSet attributes); /** - * Removes an attribute listener from this print job. - * This method performs no function, nor does it throw an exception, - * if the listener specified by the argument was not previously added - * to this component. If the listener is null, no exception is thrown - * and no action is performed. - * If a listener is registered more than once, even for a different - * set of attributes, no guarantee is made which listener is removed. + * Removes an attribute listener from this print job. This method performs + * no function, nor does it throw an exception, if the listener specified by + * the argument was not previously added to this print job. If the listener + * is {@code null}, no exception is thrown and no action is performed. If a + * listener is registered more than once, even for a different set of + * attributes, no guarantee is made which listener is removed. + * + * @param listener the object implementing the listener interface * @see #addPrintJobAttributeListener - * - * @param listener The object implementing the listener interface - * */ public void removePrintJobAttributeListener( PrintJobAttributeListener listener); /** - * Prints a document with the specified job attributes. - * This method should only be called once for a given print job. - * Calling it again will not result in a new job being spooled to - * the printer. The service implementation will define policy - * for service interruption and recovery. + * Prints a document with the specified job attributes. This method should + * only be called once for a given print job. Calling it again will not + * result in a new job being spooled to the printer. The service + * implementation will define policy for service interruption and recovery. * When the print method returns, printing may not yet have completed as * printing may happen asynchronously, perhaps in a different thread. - * Application clients which want to monitor the success or failure - * should register a PrintJobListener. + * Application clients which want to monitor the success or failure should + * register a {@code PrintJobListener}. *
* Print service implementors should close any print data streams (ie - * Reader or InputStream implementations) that they obtain - * from the client doc. Robust clients may still wish to verify this. - * An exception is always generated if a {@code DocFlavor} cannot - * be printed. - * - * @param doc The document to be printed. If must be a flavor - * supported by this PrintJob. + * {@code Reader} or {@code InputStream} implementations) that they obtain + * from the client doc. Robust clients may still wish to verify this. An + * exception is always generated if a {@code DocFlavor} cannot be printed. * - * @param attributes The job attributes to be applied to this print job. - * If this parameter is null then the default attributes are used. - * @throws PrintException The exception additionally may implement - * an interface that more precisely describes the cause of the - * exception - *
- * Class MimeType is similar to the like-named - * class in package {@link java.awt.datatransfer java.awt.datatransfer}. Class - * java.awt.datatransfer.MimeType is not used in the Jini Print Service API - * for two reasons: - *
+ * Class {@code MimeType} encapsulates a Multipurpose Internet Mail Extensions + * (MIME) media type as defined in + * RFC 2045 and + * RFC 2046. A MIME type + * object is part of a {@link DocFlavor DocFlavor} object and specifies the + * format of the print data. + *
+ * Class {@code MimeType} is similar to the like-named class in package + * {@link java.awt.datatransfer java.awt.datatransfer}. Class + * {@link java.awt.datatransfer.MimeType} is not used in the Jini Print Service + * API for two reasons: + *
+ *
* Special rules applied: - *
- * Interface MultiDoc provides an abstraction similar to a "linked list" of - * docs. A multidoc object is like a node in the linked list, containing the + * is a group of several docs. The client passes to the Print Job an object that + * implements interface {@code MultiDoc}, and the Print Job calls methods on + * that object to obtain the print data. + *
+ * Interface {@code MultiDoc} provides an abstraction similar to a "linked list" + * of docs. A multidoc object is like a node in the linked list, containing the * current doc in the list and a pointer to the next node (multidoc) in the - * list. The Print Job can call the multidoc's {@link #getDoc() - * getDoc()} method to get the current doc. When it's ready to go - * on to the next doc, the Print Job can call the multidoc's {@link #next() - * next()} method to get the next multidoc, which contains the - * next doc. So Print Job code for accessing a multidoc might look like this: - *
+ * list. The Print Job can call the multidoc's {@link #getDoc() getDoc()} method + * to get the current doc. When it's ready to go on to the next doc, the Print + * Job can call the multidoc's {@link #next() next()} method to get the next + * multidoc, which contains the next doc. So Print Job code for accessing a + * multidoc might look like this: + * + *+ * Of course, interface {@code MultiDoc} can be implemented in any way that + * fulfills the contract; it doesn't have to use a linked list in the + * implementation. + ** void processMultiDoc(MultiDoc theMultiDoc) { * * MultiDoc current = theMultiDoc; - + * * while (current != null) { * processDoc (current.getDoc()); * current = current.next(); * } * } - *- *- * Of course, interface MultiDoc can be implemented in any way that fulfills - * the contract; it doesn't have to use a linked list in the implementation. - *
- * To get all the print data for a multidoc print job, a Print Service - * proxy could use either of two patterns: - *
- *
+ *- - * The interleaved pattern: Get the doc from the current multidoc. Get - * the print data representation object from the current doc. Get all the print - * data from the print data representation object. Get the next multidoc from - * the current multidoc, and repeat until there are no more. (The code example - * above uses the interleaved pattern.) - * - *
- - * The all-at-once pattern: Get the doc from the current multidoc, and - * save the doc in a list. Get the next multidoc from the current multidoc, and - * repeat until there are no more. Then iterate over the list of saved docs. Get - * the print data representation object from the current doc. Get all the print - * data from the print data representation object. Go to the next doc in the - * list, and repeat until there are no more. - *
+ * To get all the print data for a multidoc print job, a Print Service proxy + * could use either of two patterns: + *
+ *
* To address this problem, and to simplify the design of clients providing -* multiple docs to a Print Job, every Print Service proxy that supports - * multidoc print jobs is required to access a MultiDoc object using the - * interleaved pattern. That is, given a MultiDoc object, the print service - * proxy will call {@link #getDoc() getDoc()} one or more times - * until it successfully obtains the current Doc object. The print service proxy + * multiple docs to a Print Job, every Print Service proxy that supports + * multidoc print jobs is required to access a {@code MultiDoc} object using the + * interleaved pattern. That is, given a {@code MultiDoc} object, the print + * service proxy will call {@link #getDoc() getDoc()} one or more times until it + * successfully obtains the current {@code Doc} object. The print service proxy * will then obtain the current doc's print data, not proceeding until all the * print data is obtained or an unrecoverable error occurs. If it is able to - * continue, the print service proxy will then call {@link #next() - * next()} one or more times until it successfully obtains either - * the next MultiDoc object or an indication that there are no more. An - * implementation of interface MultiDoc can assume the print service proxy will - * follow this interleaved pattern; for any other pattern of usage, the MultiDoc - * implementation's behavior is unspecified. - *
+ * continue, the print service proxy will then call {@link #next() next()} one + * or more times until it successfully obtains either the next {@code MultiDoc} + * object or an indication that there are no more. An implementation of + * interface {@code MultiDoc} can assume the print service proxy will follow + * this interleaved pattern; for any other pattern of usage, the + * {@code MultiDoc} implementation's behavior is unspecified. + *
* There is no restriction on the number of client threads that may be * simultaneously accessing the same multidoc. Therefore, all implementations of * interface MultiDoc must be designed to be multiple thread safe. In fact, a * client thread could be adding docs to the end of the (conceptual) list while * a Print Job thread is simultaneously obtaining docs from the beginning of the * list; provided the multidoc object synchronizes the threads properly, the two - * threads will not interfere with each other + * threads will not interfere with each other. */ - public interface MultiDoc { - /** * Obtain the current doc object. * - * @return Current doc object. - * - * @exception IOException - * Thrown if a error occurred reading the document. + * @return current doc object + * @throws IOException if an error occurred when reading the document */ public Doc getDoc() throws IOException; @@ -125,12 +119,9 @@ * Go to the multidoc object that contains the next doc object in the * sequence of doc objects. * - * @return Multidoc object containing the next doc object, or null if - * there are no further doc objects. - * - * @exception IOException - * Thrown if an error occurred locating the next document + * @return multidoc object containing the next doc object, or {@code null} + * if there are no further doc objects + * @throws IOException if an error occurred locating the next document */ public MultiDoc next() throws IOException; - } diff -r 000f4e4ddd39 -r 57173ad5c534 jdk/src/java.desktop/share/classes/javax/print/MultiDocPrintJob.java --- a/jdk/src/java.desktop/share/classes/javax/print/MultiDocPrintJob.java Fri Sep 01 14:13:40 2017 +0000 +++ b/jdk/src/java.desktop/share/classes/javax/print/MultiDocPrintJob.java Sat Sep 09 14:36:45 2017 +0200 @@ -1,5 +1,5 @@ /* - * Copyright (c) 2000, 2013, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2000, 2017, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -28,39 +28,35 @@ import javax.print.attribute.PrintRequestAttributeSet; /** - * - * Obtained from a MultiDocPrintService, a MultiDocPrintJob can print a - * specified collection of documents as a single print job with a set of + * Obtained from a {@code MultiDocPrintService}, a {@code MultiDocPrintJob} can + * print a specified collection of documents as a single print job with a set of * job attributes. */ - public interface MultiDocPrintJob extends DocPrintJob { - /** - * Print a MultiDoc with the specified job attributes. - * This method should only be called once for a given print job. - * Calling it again will not result in a new job being spooled to - * the printer. The service implementation will define policy - * for service interruption and recovery. Application clients which - * want to monitor the success or failure should register a - * PrintJobListener. - * - * @param multiDoc The documents to be printed. ALL must be a flavor - * supported by the PrintJob {@literal &} PrintService. + /** + * Print a {@code MultiDoc} with the specified job attributes. This method + * should only be called once for a given print job. Calling it again will + * not result in a new job being spooled to the printer. The service + * implementation will define policy for service interruption and recovery. + * Application clients which want to monitor the success or failure should + * register a {@code PrintJobListener}. * - * @param attributes The job attributes to be applied to this print job. - * If this parameter is null then the default attributes are used. - * - * @throws PrintException The exception additionally may implement - * an interfaces which more precisely describes the cause of the exception - *
+ * Interface {@code PrintService} is the factory for a {@code DocPrintJob}. A + * {@code PrintService} describes the capabilities of a printer and can be + * queried regarding a printer's supported attributes. + *
* Example: - *
{@code + **/ public interface PrintService { - /** Returns a String name for this print service which may be used - * by applications to request a particular print service. - * In a suitable context, such as a name service, this name must be - * unique. - * In some environments this unique name may be the same as the user - * friendly printer name defined as the - * {@link javax.print.attribute.standard.PrinterName PrinterName} - * attribute. - * @return name of the service. - */ + /** + * Returns a string name for this print service which may be used by + * applications to request a particular print service. In a suitable + * context, such as a name service, this name must be unique. In some + * environments this unique name may be the same as the user friendly + * printer name defined as the + * {@link javax.print.attribute.standard.PrinterName PrinterName} attribute. + * + * @return name of the service + */ public String getName(); /** - * Creates and returns a PrintJob capable of handling data from - * any of the supported document flavors. - * @return a DocPrintJob object + * Creates and returns a {@code PrintJob} capable of handling data from any + * of the supported document flavors. + * + * @return a {@code DocPrintJob} object */ public DocPrintJob createPrintJob(); /** - * Registers a listener for events on this PrintService. - * @param listener a PrintServiceAttributeListener, which - * monitors the status of a print service + * Registers a listener for events on this {@code PrintService}. + * + * @param listener a PrintServiceAttributeListener, which monitors the + * status of a print service * @see #removePrintServiceAttributeListener */ public void addPrintServiceAttributeListener( PrintServiceAttributeListener listener); /** - * Removes the print-service listener from this print service. - * This means the listener is no longer interested in - * {@code PrintService} events. - * @param listener a PrintServiceAttributeListener object + * Removes the print-service listener from this print service. This means + * the listener is no longer interested in {@code PrintService} events. + * + * @param listener a {@code PrintServiceAttributeListener} object * @see #addPrintServiceAttributeListener */ public void removePrintServiceAttributeListener( PrintServiceAttributeListener listener); /** - * Obtains this print service's set of printer description attributes - * giving this Print Service's status. The returned attribute set object - * is unmodifiable. The returned attribute set object is a "snapshot" of - * this Print Service's attribute set at the time of the - * {@code getAttributes()} method call: that is, the returned - * attribute set's contents will not be updated if this print - * service's attribute set's contents change in the future. To detect - * changes in attribute values, call {@code getAttributes()} again - * and compare the new attribute set to the previous attribute set; - * alternatively, register a listener for print service events. + * Obtains this print service's set of printer description attributes giving + * this Print Service's status. The returned attribute set object is + * unmodifiable. The returned attribute set object is a "snapshot" of this + * Print Service's attribute set at the time of the {@code getAttributes()} + * method call: that is, the returned attribute set's contents will + * not be updated if this print service's attribute set's contents + * change in the future. To detect changes in attribute values, call + * {@code getAttributes()} again and compare the new attribute set to the + * previous attribute set; alternatively, register a listener for print + * service events. * - * @return Unmodifiable snapshot of this Print Service's attribute set. - * May be empty, but not null. + * @return unmodifiable snapshot of this Print Service's attribute set. May + * be empty, but not {@code null}. */ public PrintServiceAttributeSet getAttributes(); /** - * Gets the value of the single specified service attribute. - * This may be useful to clients which only need the value of one - * attribute and want to minimize overhead. - * @param{@code * DocFlavor flavor = DocFlavor.INPUT_STREAM.POSTSCRIPT; * PrintRequestAttributeSet aset = new HashPrintRequestAttributeSet(); * aset.add(MediaSizeName.ISO_A4); @@ -56,299 +53,263 @@ * } catch (PrintException e) { * } * } - * }+ * }
- * Note that some doc flavors may not be supported in combination - * with all attributes. Use {@code getUnsupportedAttributes(..)} - * to validate specific combinations. + * Determines the print data formats a client can specify when setting up a + * job for this {@code PrintService}. A print data format is designated by a + * "doc flavor" (class {@link DocFlavor DocFlavor}) consisting of a MIME + * type plus a print data representation class. + *
+ * Note that some doc flavors may not be supported in combination with all + * attributes. Use {@code getUnsupportedAttributes(..)} to validate specific + * combinations. * - * @return Array of supported doc flavors, should have at least - * one element. - * + * @return array of supported doc flavors, should have at least one element */ public DocFlavor[] getSupportedDocFlavors(); /** - * Determines if this print service supports a specific - * {@code DocFlavor}. This is a convenience method to determine - * if the {@code DocFlavor} would be a member of the result of - * {@code getSupportedDocFlavors()}. + * Determines if this print service supports a specific {@code DocFlavor}. + * This is a convenience method to determine if the {@code DocFlavor} would + * be a member of the result of {@code getSupportedDocFlavors()}. *
- * Note that some doc flavors may not be supported in combination - * with all attributes. Use {@code getUnsupportedAttributes(..)} - * to validate specific combinations. + * Note that some doc flavors may not be supported in combination with all + * attributes. Use {@code getUnsupportedAttributes(..)} to validate specific + * combinations. * - * @param flavor the {@code DocFlavor} to query for support. - * @return {@code true} if this print service supports the - * specified {@code DocFlavor}; {@code false} otherwise. - * @exception NullPointerException - * (unchecked exception) Thrown if {@code flavor} is null. + * @param flavor the {@code DocFlavor} to query for support + * @return {@code true} if this print service supports the specified + * {@code DocFlavor}; {@code false} otherwise + * @throws NullPointerException if {@code flavor} is {@code null} */ public boolean isDocFlavorSupported(DocFlavor flavor); - /** - * Determines the printing attribute categories a client can specify - * when setting up a job for this print service. - * A printing attribute category is + * Determines the printing attribute categories a client can specify when + * setting up a job for this print service. A printing attribute category is * designated by a {@code Class} that implements interface - * {@link javax.print.attribute.Attribute Attribute}. This method returns - * just the attribute categories that are supported; it does not - * return the particular attribute values that are supported. - *
- * This method returns all the printing attribute - * categories this print service supports for any possible job. - * Some categories may not be supported in a particular context (ie - * for a particular {@code DocFlavor}). - * Use one of the methods that include a {@code DocFlavor} to - * validate the request before submitting it, such as + * {@link Attribute Attribute}. This method returns just the attribute + * categories that are supported; it does not return the particular + * attribute values that are supported. + *
+ * This method returns all the printing attribute categories this print + * service supports for any possible job. Some categories may not be + * supported in a particular context (ie for a particular + * {@code DocFlavor}). Use one of the methods that include a + * {@code DocFlavor} to validate the request before submitting it, such as * {@code getSupportedAttributeValues(..)}. * - * @return Array of printing attribute categories that the client can - * specify as a doc-level or job-level attribute in a Print - * Request. Each element in the array is a {@link java.lang.Class - * Class} that implements interface {@link - * javax.print.attribute.Attribute Attribute}. - * The array is empty if no categories are supported. + * @return array of printing attribute categories that the client can + * specify as a doc-level or job-level attribute in a Print Request. + * Each element in the array is a {@link Class Class} that + * implements interface {@link Attribute Attribute}. The array is + * empty if no categories are supported. */ public Class>[] getSupportedAttributeCategories(); /** - * Determines whether a client can specify the given printing - * attribute category when setting up a job for this print service. A - * printing attribute category is designated by a {@code Class} - * that implements interface {@link javax.print.attribute.Attribute - * Attribute}. This method tells whether the attribute category is - * supported; it does not tell whether a particular attribute value - * is supported. + * Determines whether a client can specify the given printing attribute + * category when setting up a job for this print service. A printing + * attribute category is designated by a {@code Class} that implements + * interface {@link Attribute Attribute}. This method + * tells whether the attribute category is supported; it does not + * tell whether a particular attribute value is supported. *
- * Some categories may not be supported in a particular context (ie - * for a particular {@code DocFlavor}). - * Use one of the methods which include a {@code DocFlavor} to - * validate the request before submitting it, such as + * Some categories may not be supported in a particular context (ie for a + * particular {@code DocFlavor}). Use one of the methods which include a + * {@code DocFlavor} to validate the request before submitting it, such as * {@code getSupportedAttributeValues(..)}. - *
- * This is a convenience method to determine if the category - * would be a member of the result of - * {@code getSupportedAttributeCategories()}. - * - * @param category Printing attribute category to test. It must be a - * {@code Class} that implements - * interface - * {@link javax.print.attribute.Attribute Attribute}. + *
+ * This is a convenience method to determine if the category would be a + * member of the result of {@code getSupportedAttributeCategories()}. * - * @return {@code true} if this print service supports - * specifying a doc-level or - * job-level attribute in {@code category} in a Print - * Request; {@code false} if it doesn't. - * - * @exception NullPointerException - * (unchecked exception) Thrown if {@code category} is null. - * @exception IllegalArgumentException - * (unchecked exception) Thrown if {@code category} is not a - * {@code Class} that implements interface - * {@link javax.print.attribute.Attribute Attribute}. + * @param category printing attribute category to test. It must be a + * {@code Class} that implements interface + * {@link Attribute Attribute}. + * @return {@code true} if this print service supports specifying a + * doc-level or job-level attribute in {@code category} in a Print + * Request; {@code false} if it doesn't + * @throws NullPointerException if {@code category} is {@code null} + * @throws IllegalArgumentException if {@code category} is not a + * {@code Class} that implements interface + * {@link Attribute Attribute} */ public boolean isAttributeCategorySupported(Class extends Attribute> category); /** - * Determines this print service's default printing attribute value in - * the given category. A printing attribute value is an instance of - * a class that implements interface - * {@link javax.print.attribute.Attribute Attribute}. If a client sets - * up a print job and does not specify any attribute value in the - * given category, this Print Service will use the - * default attribute value instead. + * Determines this print service's default printing attribute value in the + * given category. A printing attribute value is an instance of a class that + * implements interface {@link Attribute Attribute}. If a client sets up a + * print job and does not specify any attribute value in the given category, + * this Print Service will use the default attribute value instead. *
- * Some attributes may not be supported in a particular context (ie - * for a particular {@code DocFlavor}). - * Use one of the methods that include a {@code DocFlavor} to - * validate the request before submitting it, such as + * Some attributes may not be supported in a particular context (ie for a + * particular {@code DocFlavor}). Use one of the methods that include a + * {@code DocFlavor} to validate the request before submitting it, such as * {@code getSupportedAttributeValues(..)}. - *
- * Not all attributes have a default value. For example the - * service will not have a defaultvalue for {@code RequestingUser} - * i.e. a null return for a supported category means there is no - * service default value for that category. Use the - * {@code isAttributeCategorySupported(Class)} method to - * distinguish these cases. + *
+ * Not all attributes have a default value. For example the service will not + * have a default value for {@code RequestingUser} i.e. a {@code null} + * return for a supported category means there is no service default value + * for that category. Use the {@code isAttributeCategorySupported(Class)} + * method to distinguish these cases. * - * @param category Printing attribute category for which the default - * attribute value is requested. It must be a {@link - * java.lang.Class Class} that implements interface - * {@link javax.print.attribute.Attribute - * Attribute}. - * - * @return Default attribute value for {@code category}, or null - * if this Print Service does not support specifying a doc-level or - * job-level attribute in {@code category} in a Print - * Request, or the service does not have a default value - * for this attribute. - * - * @exception NullPointerException - * (unchecked exception) Thrown if {@code category} is null. - * @exception IllegalArgumentException - * (unchecked exception) Thrown if {@code category} is not a - * {@link java.lang.Class Class} that implements interface {@link - * javax.print.attribute.Attribute Attribute}. + * @param category printing attribute category for which the default + * attribute value is requested. It must be a {@link Class Class} + * that implements interface {@link Attribute Attribute}. + * @return default attribute value for {@code category}, or {@code null} if + * this Print Service does not support specifying a doc-level or + * job-level attribute in {@code category} in a Print Request, or + * the service does not have a default value for this attribute + * @throws NullPointerException if {@code category} is {@code null} + * @throws IllegalArgumentException if {@code category} is not a + * {@link Class Class} that implements interface + * {@link Attribute Attribute} */ public Object getDefaultAttributeValue(Class extends Attribute> category); /** - * Determines the printing attribute values a client can specify in - * the given category when setting up a job for this print service. A - * printing + * Determines the printing attribute values a client can specify in the + * given category when setting up a job for this print service. A printing * attribute value is an instance of a class that implements interface - * {@link javax.print.attribute.Attribute Attribute}. - *
- * If {@code flavor} is null and {@code attributes} is null - * or is an empty set, this method returns all the printing attribute - * values this Print Service supports for any possible job. If - * {@code flavor} is not null or {@code attributes} is not - * an empty set, this method returns just the printing attribute values - * that are compatible with the given doc flavor and/or set of attributes. - * That is, a null return value may indicate that specifying this attribute - * is incompatible with the specified DocFlavor. - * Also if DocFlavor is not null it must be a flavor supported by this - * PrintService, else IllegalArgumentException will be thrown. - *
- * If the {@code attributes} parameter contains an Attribute whose - * category is the same as the {@code category} parameter, the service - * must ignore this attribute in the AttributeSet. + * {@link Attribute Attribute}. *
- * {@code DocAttribute}s which are to be specified on the - * {@code Doc} must be included in this set to accurately - * represent the context. + * If {@code flavor} is {@code null} and {@code attributes} is {@code null} + * or is an empty set, this method returns all the printing attribute values + * this Print Service supports for any possible job. If {@code flavor} is not + * {@code null} or {@code attributes} is not an empty set, this method + * returns just the printing attribute values that are compatible with the + * given doc flavor and/or set of attributes. That is, a {@code null} return + * value may indicate that specifying this attribute is incompatible with + * the specified DocFlavor. Also if {@code DocFlavor} is not {@code null} it + * must be a flavor supported by this {@code PrintService}, else + * {@code IllegalArgumentException} will be thrown. *
- * This method returns an Object because different printing attribute - * categories indicate the supported attribute values in different ways. - * The documentation for each printing attribute in package {@link - * javax.print.attribute.standard javax.print.attribute.standard} + * If the {@code attributes} parameter contains an {@code Attribute} whose + * category is the same as the {@code category} parameter, the service must + * ignore this attribute in the {@code AttributeSet}. + *
+ * {@code DocAttribute}s which are to be specified on the {@code Doc} must + * be included in this set to accurately represent the context. + *
+ * This method returns an {@code Object} because different printing + * attribute categories indicate the supported attribute values in different + * ways. The documentation for each printing attribute in package + * {@link javax.print.attribute.standard javax.print.attribute.standard} * describes how each attribute indicates its supported values. Possible * ways of indicating support include: - *
- * If {@code flavor} is null and {@code attributes} is null or - * is an empty set, this method tells whether this Print Service supports + * Determines whether a client can specify the given printing attribute + * value when setting up a job for this Print Service. A printing attribute + * value is an instance of a class that implements interface + * {@link Attribute Attribute}. + *
+ * If {@code flavor} is {@code null} and {@code attributes} is {@code null} + * or is an empty set, this method tells whether this Print Service supports * the given printing attribute value for some possible combination of doc - * flavor and set of attributes. If {@code flavor} is not null or - * {@code attributes} is not an empty set, this method tells whether - * this Print Service supports the given printing attribute value in - * combination with the given doc flavor and/or set of attributes. + * flavor and set of attributes. If {@code flavor} is not {@code null} or + * {@code attributes} is not an empty set, this method tells whether this + * Print Service supports the given printing attribute value in combination + * with the given doc flavor and/or set of attributes. *
- * Also if DocFlavor is not null it must be a flavor supported by this - * PrintService, else IllegalArgumentException will be thrown. + * Also if {@code DocFlavor} is not {@code null} it must be a flavor + * supported by this {@code PrintService}, else + * {@code IllegalArgumentException} will be thrown. *
- * {@code DocAttribute}s which are to be specified on the - * {@code Doc} must be included in this set to accurately - * represent the context. + * {@code DocAttribute}s which are to be specified on the {@code Doc} must + * be included in this set to accurately represent the context. *
- * This is a convenience method to determine if the value - * would be a member of the result of - * {@code getSupportedAttributeValues(...)}. + * This is a convenience method to determine if the value would be a member + * of the result of {@code getSupportedAttributeValues(...)}. * - * @param attrval Printing attribute value to test. - * @param flavor Doc flavor for a supposed job, or null. - * @param attributes Set of printing attributes for a supposed job - * (both job-level attributes and document-level - * attributes), or null. - * - * @return True if this Print Service supports specifying - * {@code attrval} as a doc-level or job-level attribute in a - * Print Request, false if it doesn't. - * - * @exception NullPointerException - * (unchecked exception) if {@code attrval} is null. - * @exception IllegalArgumentException if flavor is not supported by - * this PrintService. + * @param attrval printing attribute value to test + * @param flavor doc flavor for a supposed job, or {@code null} + * @param attributes set of printing attributes for a supposed job (both + * job-level attributes and document-level attributes), or + * {@code null} + * @return {@code true} if this Print Service supports specifying + * {@code attrval} as a doc-level or job-level attribute in a Print + * Request, {@code false} if it doesn't + * @throws NullPointerException if {@code attrval} is {@code null} + * @throws IllegalArgumentException if flavor is not supported by this + * {@code PrintService} */ public boolean isAttributeValueSupported(Attribute attrval, DocFlavor flavor, AttributeSet attributes); - /** - * Identifies the attributes that are unsupported for a print request - * in the context of a particular DocFlavor. - * This method is useful for validating a potential print job and - * identifying the specific attributes which cannot be supported. - * It is important to supply only a supported DocFlavor or an - * IllegalArgumentException will be thrown. If the - * return value from this method is null, all attributes are supported. + * Identifies the attributes that are unsupported for a print request in the + * context of a particular {@code DocFlavor}. This method is useful for + * validating a potential print job and identifying the specific attributes + * which cannot be supported. It is important to supply only a supported + * {@code DocFlavor} or an {@code IllegalArgumentException} will be thrown. + * If the return value from this method is {@code null}, all attributes are + * supported. *
- * {@code DocAttribute}s which are to be specified on the - * {@code Doc} must be included in this set to accurately - * represent the context. + * {@code DocAttribute}s which are to be specified on the {@code Doc} must + * be included in this set to accurately represent the context. *
- * If the return value is non-null, all attributes in the returned - * set are unsupported with this DocFlavor. The returned set does not - * distinguish attribute categories that are unsupported from + * If the return value is {@code non-null}, all attributes in the returned + * set are unsupported with this {@code DocFlavor}. The returned set does + * not distinguish attribute categories that are unsupported from * unsupported attribute values. *
- * A supported print request can then be created by removing - * all unsupported attributes from the original attribute set, - * except in the case that the DocFlavor is unsupported. + * A supported print request can then be created by removing all unsupported + * attributes from the original attribute set, except in the case that the + * {@code DocFlavor} is unsupported. *
- * If any attributes are unsupported only because they are in conflict - * with other attributes then it is at the discretion of the service - * to select the attribute(s) to be identified as the cause of the - * conflict. + * If any attributes are unsupported only because they are in conflict with + * other attributes then it is at the discretion of the service to select + * the attribute(s) to be identified as the cause of the conflict. *
- * Use {@code isDocFlavorSupported()} to verify that a DocFlavor - * is supported before calling this method. + * Use {@code isDocFlavorSupported()} to verify that a {@code DocFlavor} is + * supported before calling this method. * - * @param flavor Doc flavor to test, or null - * @param attributes Set of printing attributes for a supposed job - * (both job-level attributes and document-level - * attributes), or null. - * - * @return null if this Print Service supports the print request - * specification, else the unsupported attributes. - * - * @exception IllegalArgumentException if {@code flavor} is - * not supported by this PrintService. + * @param flavor doc flavor to test, or {@code null} + * @param attributes set of printing attributes for a supposed job (both + * job-level attributes and document-level attributes), or + * {@code null} + * @return {@code null} if this Print Service supports the print request + * specification, else the unsupported attributes + * @throws IllegalArgumentException if {@code flavor} is not supported by + * this {@code PrintService} */ public AttributeSet getUnsupportedAttributes(DocFlavor flavor, AttributeSet attributes); /** - * Returns a factory for UI components which allow users to interact - * with the service in various roles. - * Services which do not provide any UI should return null. - * Print Services which do provide UI but want to be supported in - * an environment with no UI support should ensure that the factory - * is not initialised unless the application calls this method to - * obtain the factory. - * See {@code ServiceUIFactory} for more information. - * @return null or a factory for UI components. + * Returns a factory for UI components which allow users to interact with + * the service in various roles. Services which do not provide any UI should + * return {@code null}. Print Services which do provide UI but want to be + * supported in an environment with no UI support should ensure that the + * factory is not initialised unless the application calls this method to + * obtain the factory. See {@code ServiceUIFactory} for more information. + * + * @return {@code null} or a factory for UI components */ public ServiceUIFactory getServiceUIFactory(); /** - * Determines if two services are referring to the same underlying - * service. Objects encapsulating a print service may not exhibit - * equality of reference even though they refer to the same underlying - * service. + * Determines if two services are referring to the same underlying service. + * Objects encapsulating a print service may not exhibit equality of + * reference even though they refer to the same underlying service. *
* Clients should call this method to determine if two services are * referring to the same underlying service. *
- * Services must implement this method and return true only if the - * service objects being compared may be used interchangeably by the - * client. + * Services must implement this method and return {@code true} only if the + * service objects being compared may be used interchangeably by the client. * Services are free to return the same object reference to an underlying * service if that, but clients must not depend on equality of reference. - * @param obj the reference object with which to compare. - * @return true if this service is the same as the obj argument, - * false otherwise. + * + * @param obj the reference object with which to compare + * @return {@code true} if this service is the same as the obj argument, + * {@code false} otherwise */ public boolean equals(Object obj); /** * This method should be implemented consistently with * {@code equals(Object)}. - * @return hash code of this object. + * + * @return hash code of this object */ public int hashCode(); - } diff -r 000f4e4ddd39 -r 57173ad5c534 jdk/src/java.desktop/share/classes/javax/print/PrintServiceLookup.java --- a/jdk/src/java.desktop/share/classes/javax/print/PrintServiceLookup.java Fri Sep 01 14:13:40 2017 +0000 +++ b/jdk/src/java.desktop/share/classes/javax/print/PrintServiceLookup.java Sat Sep 09 14:36:45 2017 +0200 @@ -1,5 +1,5 @@ /* - * Copyright (c) 2000, 2014, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2000, 2017, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -23,56 +23,69 @@ * questions. */ - package javax.print; import java.util.ArrayList; import java.util.Iterator; +import java.util.ServiceConfigurationError; +import java.util.ServiceLoader; + import javax.print.attribute.AttributeSet; import sun.awt.AppContext; -import java.util.ServiceLoader; -import java.util.ServiceConfigurationError; -/** Implementations of this class provide lookup services for - * print services (typically equivalent to printers) of a particular type. - *
- * Multiple implementations may be installed concurrently. - * All implementations must be able to describe the located printers - * as instances of a PrintService. - * Typically implementations of this service class are located - * automatically in JAR files (see the SPI JAR file specification). - * These classes must be instantiable using a default constructor. - * Alternatively applications may explicitly register instances - * at runtime. - *
- * Applications use only the static methods of this abstract class. - * The instance methods are implemented by a service provider in a subclass - * and the unification of the results from all installed lookup classes - * are reported by the static methods of this class when called by - * the application. - *
- * A PrintServiceLookup implementor is recommended to check for the - * SecurityManager.checkPrintJobAccess() to deny access to untrusted code. - * Following this recommended policy means that untrusted code may not - * be able to locate any print services. Downloaded applets are the most - * common example of untrusted code. - *
- * This check is made on a per lookup service basis to allow flexibility in - * the policy to reflect the needs of different lookup services. - *
- * Services which are registered by registerService(PrintService) - * will not be included in lookup results if a security manager is - * installed and its checkPrintJobAccess() method denies access. - */ - +/** + * Implementations of this class provide lookup services for print services + * (typically equivalent to printers) of a particular type. + *
+ * Multiple implementations may be installed concurrently. All implementations + * must be able to describe the located printers as instances of a + * {@code PrintService}. Typically implementations of this service class are + * located automatically in JAR files (see the SPI JAR file specification). + * These classes must be instantiable using a default constructor. Alternatively + * applications may explicitly register instances at runtime. + *
+ * Applications use only the static methods of this abstract class. The instance + * methods are implemented by a service provider in a subclass and the + * unification of the results from all installed lookup classes are reported by + * the static methods of this class when called by the application. + *
+ * A {@code PrintServiceLookup} implementor is recommended to check for the + * {@code SecurityManager.checkPrintJobAccess()} to deny access to untrusted + * code. Following this recommended policy means that untrusted code may not be + * able to locate any print services. Downloaded applets are the most common + * example of untrusted code. + *
+ * This check is made on a per lookup service basis to allow flexibility in the + * policy to reflect the needs of different lookup services. + *
+ * Services which are registered by {@link #registerService(PrintService)} will
+ * not be included in lookup results if a security manager is installed and its
+ * {@code checkPrintJobAccess()} method denies access.
+ */
public abstract class PrintServiceLookup {
+ /**
+ * Contains a lists of services.
+ */
static class Services {
+
+ /**
+ * The list of lookup services.
+ */
private ArrayList This method is useful to help locate a service that can print
- * a {@code MultiDoc} in which the elements may be different
- * flavors. An application could perform this itself by multiple lookups
- * on each {@code DocFlavor} in turn and collating the results,
- * but the lookup service may be able to do this more efficiently.
+ * Locates {@code MultiDoc} print {@code Services} capable of printing
+ * {@code MultiDocs} containing all the specified doc flavors.
+ *
+ * This method is useful to help locate a service that can print a
+ * {@code MultiDoc} in which the elements may be different flavors. An
+ * application could perform this itself by multiple lookups on each
+ * {@code DocFlavor} in turn and collating the results, but the lookup
+ * service may be able to do this more efficiently.
*
- * @param flavors the flavors to print. If null or empty this
- * constraint is not used.
- * Otherwise return only multidoc print services that can print all
- * specified doc flavors.
- * @param attributes attributes that the print service must
- * support. If null this constraint is not used.
- *
- * @return array of matching {@link MultiDocPrintService} objects.
- * If no services match, the array is zero-length.
- *
+ * @param flavors the flavors to print. If {@code null} or empty this
+ * constraint is not used. Otherwise return only multidoc print
+ * services that can print all specified doc flavors.
+ * @param attributes attributes that the print service must support. If
+ * {@code null} this constraint is not used.
+ * @return array of matching {@link MultiDocPrintService} objects. If no
+ * services match, the array is zero-length.
*/
public static final MultiDocPrintService[]
lookupMultiDocPrintServices(DocFlavor[] flavors,
@@ -152,28 +180,23 @@
return list.toArray(new MultiDocPrintService[list.size()]);
}
-
/**
- * Locates the default print service for this environment.
- * This may return null.
- * If multiple lookup services each specify a default, the
- * chosen service is not precisely defined, but a
- * platform native service, rather than an installed service,
- * is usually returned as the default. If there is no clearly
- * identifiable
- * platform native default print service, the default is the first
- * to be located in an implementation-dependent manner.
+ * Locates the default print service for this environment. This may return
+ * {@code null}. If multiple lookup services each specify a default, the
+ * chosen service is not precisely defined, but a platform native service,
+ * rather than an installed service, is usually returned as the default. If
+ * there is no clearly identifiable platform native default print service,
+ * the default is the first to be located in an implementation-dependent
+ * manner.
*
- * This may include making use of any preferences API that is available
- * as part of the Java or native platform.
- * This algorithm may be overridden by a user setting the property
- * javax.print.defaultPrinter.
- * A service specified must be discovered to be valid and currently
- * available to be returned as the default.
+ * This may include making use of any preferences API that is available as
+ * part of the Java or native platform. This algorithm may be overridden by
+ * a user setting the property {@code javax.print.defaultPrinter}. A service
+ * specified must be discovered to be valid and currently available to be
+ * returned as the default.
*
- * @return the default PrintService.
+ * @return the default {@code PrintService}
*/
-
public static final PrintService lookupDefaultPrintService() {
Iterator
- * Implemented by a service provider, used by the static methods
- * of this class.
- *
- * The results should be the same as obtaining all the PrintServices
- * and querying each one individually on its support for the
- * specified attributes and flavors, but the process can be more
- * efficient by taking advantage of the capabilities of lookup services
- * for the print services.
- *
- * @param flavor of document required. If null it is ignored.
- * @param attributes required to be supported. If null this
- * constraint is not used.
- * @return array of matching PrintServices. If no services match, the
- * array is zero-length.
- */
+ /**
+ * Locates services that can be positively confirmed to support the
+ * combination of attributes and {@code DocFlavors} specified. This method
+ * is not called directly by applications.
+ *
+ * Implemented by a service provider, used by the static methods of this
+ * class.
+ *
+ * The results should be the same as obtaining all the {@code PrintServices}
+ * and querying each one individually on its support for the specified
+ * attributes and flavors, but the process can be more efficient by taking
+ * advantage of the capabilities of lookup services for the print services.
+ *
+ * @param flavor of document required. If {@code null} it is ignored.
+ * @param attributes required to be supported. If {@code null} this
+ * constraint is not used.
+ * @return array of matching {@code PrintServices}. If no services match,
+ * the array is zero-length.
+ */
public abstract PrintService[] getPrintServices(DocFlavor flavor,
AttributeSet attributes);
/**
- * Not called directly by applications.
- * Implemented by a service provider, used by the static methods
- * of this class.
- * @return array of all PrintServices known to this lookup service
- * class. If none are found, the array is zero-length.
+ * Not called directly by applications. Implemented by a service provider,
+ * used by the static methods of this class.
+ *
+ * @return array of all {@code PrintServices} known to this lookup service
+ * class. If none are found, the array is zero-length.
*/
public abstract PrintService[] getPrintServices() ;
-
- /**
- * Not called directly by applications.
- *
- * Implemented by a service provider, used by the static methods
- * of this class.
- *
- * Locates MultiDoc print services which can be positively confirmed
- * to support the combination of attributes and DocFlavors specified.
- *
- * @param flavors of documents required. If null or empty it is ignored.
- * @param attributes required to be supported. If null this
- * constraint is not used.
- * @return array of matching PrintServices. If no services match, the
- * array is zero-length.
- */
+ /**
+ * Not called directly by applications.
+ *
+ * Implemented by a service provider, used by the static methods of this
+ * class.
+ *
+ * Locates {@code MultiDoc} print services which can be positively confirmed
+ * to support the combination of attributes and {@code DocFlavors}
+ * specified.
+ *
+ * @param flavors of documents required. If {@code null} or empty it is
+ * ignored.
+ * @param attributes required to be supported. If {@code null} this
+ * constraint is not used.
+ * @return array of matching {@code PrintServices}. If no services match,
+ * the array is zero-length.
+ */
public abstract MultiDocPrintService[]
getMultiDocPrintServices(DocFlavor[] flavors,
AttributeSet attributes);
/**
- * Not called directly by applications.
- * Implemented by a service provider, and called by the print lookup
- * service
- * @return the default PrintService for this lookup service.
- * If there is no default, returns null.
+ * Not called directly by applications. Implemented by a service provider,
+ * and called by the print lookup service.
+ *
+ * @return the default {@code PrintService} for this lookup service. If
+ * there is no default, returns {@code null}.
*/
public abstract PrintService getDefaultPrintService();
+ /**
+ * Returns all lookup services for this environment.
+ *
+ * @return all lookup services for this environment
+ */
private static ArrayList
* The dialogs follow a standard pattern of acting as a continue/cancel option
- *for a user as well as allowing the user to select the print service to use
- *and specify choices such as paper size and number of copies.
+ * for a user as well as allowing the user to select the print service to use
+ * and specify choices such as paper size and number of copies.
*
* The dialogs are designed to work with pluggable print services though the
* public APIs of those print services.
*
* If a print service provides any vendor extensions these may be made
- * accessible to the user through a vendor supplied tab panel Component.
+ * accessible to the user through a vendor supplied tab panel {@code Component}.
* Such a vendor extension is encouraged to use Swing! and to support its
- * accessibility APIs.
- * The vendor extensions should return the settings as part of the
- * AttributeSet.
- * Applications which want to preserve the user settings should use those
- * settings to specify the print job.
- * Note that this class is not referenced by any other part of the Java
- * Print Service and may not be included in profiles which cannot depend
- * on the presence of the AWT packages.
+ * accessibility APIs. The vendor extensions should return the settings as part
+ * of the {@code AttributeSet}. Applications which want to preserve the user
+ * settings should use those settings to specify the print job. Note that this
+ * class is not referenced by any other part of the Java Print Service and may
+ * not be included in profiles which cannot depend on the presence of the AWT
+ * packages.
*/
-
public class ServiceUI {
-
/**
- * Presents a dialog to the user for selecting a print service (printer).
- * It is displayed at the location specified by the application and
- * is modal.
+ * Presents a dialog to the user for selecting a print service (printer). It
+ * is displayed at the location specified by the application and is modal.
* If the specification is invalid or would make the dialog not visible it
- * will be displayed at a location determined by the implementation.
- * The dialog blocks its calling thread and is application modal.
+ * will be displayed at a location determined by the implementation. The
+ * dialog blocks its calling thread and is application modal.
*
* The dialog may include a tab panel with custom UI lazily obtained from
- * the PrintService's ServiceUIFactory when the PrintService is browsed.
- * The dialog will attempt to locate a MAIN_UIROLE first as a JComponent,
- * then as a Panel. If there is no ServiceUIFactory or no matching role
- * the custom tab will be empty or not visible.
+ * the {@code PrintService}'s {@code ServiceUIFactory} when the
+ * {@code PrintService} is browsed. The dialog will attempt to locate a
+ * {@code MAIN_UIROLE} first as a {@code JComponent}, then as a
+ * {@code Panel}. If there is no {@code ServiceUIFactory} or no matching
+ * role the custom tab will be empty or not visible.
*
* The dialog returns the print service selected by the user if the user
- * OK's the dialog and null if the user cancels the dialog.
+ * OK's the dialog and {@code null} if the user cancels the dialog.
*
- * An application must pass in an array of print services to browse.
- * The array must be non-null and non-empty.
- * Typically an application will pass in only PrintServices capable
- * of printing a particular document flavor.
+ * An application must pass in an array of print services to browse. The
+ * array must be {@code non-null} and non-empty. Typically an application
+ * will pass in only {@code PrintServices} capable of printing a particular
+ * document flavor.
*
- * An application may pass in a PrintService to be initially displayed.
- * A non-null parameter must be included in the array of browsable
- * services.
- * If this parameter is null a service is chosen by the implementation.
+ * An application may pass in a {@code PrintService} to be initially
+ * displayed. A {@code non-null} parameter must be included in the array of
+ * browsable services. If this parameter is {@code null} a service is chosen
+ * by the implementation.
*
- * An application may optionally pass in the flavor to be printed.
- * If this is non-null choices presented to the user can be better
- * validated against those supported by the services.
- * An application must pass in a PrintRequestAttributeSet for returning
- * user choices.
- * On calling the PrintRequestAttributeSet may be empty, or may contain
+ * An application may optionally pass in the flavor to be printed. If this
+ * is {@code non-null} choices presented to the user can be better validated
+ * against those supported by the services. An application must pass in a
+ * {@code PrintRequestAttributeSet} for returning user choices. On calling
+ * the {@code PrintRequestAttributeSet} may be empty, or may contain
* application-specified values.
*
- * These are used to set the initial settings for the initially
- * displayed print service. Values which are not supported by the print
- * service are ignored. As the user browses print services, attributes
- * and values are copied to the new display. If a user browses a
- * print service which does not support a particular attribute-value, the
- * default for that service is used as the new value to be copied.
+ * These are used to set the initial settings for the initially displayed
+ * print service. Values which are not supported by the print service are
+ * ignored. As the user browses print services, attributes and values are
+ * copied to the new display. If a user browses a print service which does
+ * not support a particular attribute-value, the default for that service is
+ * used as the new value to be copied.
*
* If the user cancels the dialog, the returned attributes will not reflect
* any changes made by the user.
- *
- * A typical basic usage of this method may be :
+ *
+ * A typical basic usage of this method may be:
*
* Although the Print Service API does not presently provide standardised
- * support for administering a print service, monitoring of the print
- * service is possible and a UI may provide for private update mechanisms.
+ * support for administering a print service, monitoring of the print service is
+ * possible and a UI may provide for private update mechanisms.
*
* The basic design intent is to allow applications to lazily locate and
- * initialize services only when needed without any API dependencies
- * except in an environment in which they are used.
+ * initialize services only when needed without any API dependencies except in
+ * an environment in which they are used.
*
- * Swing UIs are preferred as they provide a more consistent {@literal L&F}
- * and can support accessibility APIs.
+ * Swing UIs are preferred as they provide a more consistent {@literal L&F} and
+ * can support accessibility APIs.
*
* Example usage:
*
* In particular this class implements certain required semantics of the
- * Doc specification as follows:
+ * {@code Doc} specification as follows:
*
- * If the print data is a stream, or a print job requests data as a
- * stream, then {@code SimpleDoc} does not monitor if the service
- * properly closes the stream after data transfer completion or job
- * termination.
- * Clients may prefer to use provide their own implementation of doc that
- * adds a listener to monitor job completion and to validate that
- * resources such as streams are freed (ie closed).
+ * If the print data is a stream, or a print job requests data as a stream, then
+ * {@code SimpleDoc} does not monitor if the service properly closes the stream
+ * after data transfer completion or job termination. Clients may prefer to use
+ * provide their own implementation of doc that adds a listener to monitor job
+ * completion and to validate that resources such as streams are freed (ie
+ * closed).
*/
-
public final class SimpleDoc implements Doc {
+ /**
+ * The doc flavor in which this doc will supply its piece of print data.
+ */
private DocFlavor flavor;
+
+ /**
+ * The set of printing attributes for this doc.
+ */
private DocAttributeSet attributes;
+
+ /**
+ * The print data.
+ */
private Object printData;
+
+ /**
+ * The reader for extracting character print data from this doc.
+ */
private Reader reader;
+
+ /**
+ * The input stream for extracting byte print data from this doc.
+ */
private InputStream inStream;
/**
- * Constructs a {@code SimpleDoc} with the specified
- * print data, doc flavor and doc attribute set.
- * @param printData the print data object
- * @param flavor the {@code DocFlavor} object
- * @param attributes a {@code DocAttributeSet}, which can
- * be {@code null}
- * @throws IllegalArgumentException if {@code flavor} or
- * {@code printData} is {@code null}, or the
- * {@code printData} does not correspond
- * to the specified doc flavor--for example, the data is
- * not of the type specified as the representation in the
- * {@code DocFlavor}.
+ * Constructs a {@code SimpleDoc} with the specified print data, doc flavor
+ * and doc attribute set.
+ *
+ * @param printData the print data object
+ * @param flavor the {@code DocFlavor} object
+ * @param attributes a {@code DocAttributeSet}, which can be {@code null}
+ * @throws IllegalArgumentException if {@code flavor} or {@code printData}
+ * is {@code null}, or the {@code printData} does not correspond to
+ * the specified doc flavor--for example, the data is not of the
+ * type specified as the representation in the {@code DocFlavor}
*/
public SimpleDoc(Object printData,
DocFlavor flavor, DocAttributeSet attributes) {
@@ -110,11 +126,11 @@
this.printData = printData;
}
- /**
- * Determines the doc flavor in which this doc object will supply its
- * piece of print data.
+ /**
+ * Determines the doc flavor in which this doc object will supply its piece
+ * of print data.
*
- * @return Doc flavor.
+ * @return doc flavor
*/
public DocFlavor getDocFlavor() {
return flavor;
@@ -123,67 +139,60 @@
/**
* Obtains the set of printing attributes for this doc object. If the
* returned attribute set includes an instance of a particular attribute
- * X, the printer must use that attribute value for this doc,
- * overriding any value of attribute X in the job's attribute set.
- * If the returned attribute set does not include an instance
- * of a particular attribute X or if null is returned, the printer
- * must consult the job's attribute set to obtain the value for
- * attribute X, and if not found there, the printer must use an
+ * X, the printer must use that attribute value for this doc,
+ * overriding any value of attribute X in the job's attribute set. If
+ * the returned attribute set does not include an instance of a particular
+ * attribute X or if {@code null} is returned, the printer must
+ * consult the job's attribute set to obtain the value for attribute
+ * X, and if not found there, the printer must use an
* implementation-dependent default value. The returned attribute set is
* unmodifiable.
*
- * @return Unmodifiable set of printing attributes for this doc, or null
- * to obtain all attribute values from the job's attribute
- * set.
+ * @return unmodifiable set of printing attributes for this doc, or
+ * {@code null} to obtain all attribute values from the job's
+ * attribute set
*/
public DocAttributeSet getAttributes() {
return attributes;
}
- /*
+ /**
* Obtains the print data representation object that contains this doc
- * object's piece of print data in the format corresponding to the
- * supported doc flavor.
- * The {@code getPrintData()} method returns an instance of
- * the representation class whose name is given by
- * {@link DocFlavor#getRepresentationClassName() getRepresentationClassName},
- * and the return value can be cast
- * from class Object to that representation class.
+ * object's piece of print data in the format corresponding to the supported
+ * doc flavor. The {@code getPrintData()} method returns an instance of the
+ * representation class whose name is given by {@link #getDocFlavor()
+ * getDocFlavor()}.{@link DocFlavor#getRepresentationClassName()
+ * getRepresentationClassName()}, and the return value can be cast from
+ * class {@code Object} to that representation class.
*
- * @return Print data representation object.
- *
- * @exception IOException if the representation class is a stream and
- * there was an I/O error while constructing the stream.
+ * @return print data representation object
+ * @throws IOException if the representation class is a stream and there was
+ * an I/O error while constructing the stream
*/
public Object getPrintData() throws IOException {
return printData;
}
/**
- * Obtains a reader for extracting character print data from this doc.
- * The {@code Doc} implementation is required to support this
- * method if the {@code DocFlavor} has one of the following print
- * data representation classes, and return {@code null}
- * otherwise:
- *
* Note that a {@code StreamPrintService} is different from a
* {@code PrintService}, which supports a
- * {@link javax.print.attribute.standard.Destination Destination}
- * attribute. A {@code StreamPrintService} always requires an output
- * stream, whereas a {@code PrintService} optionally accepts a
- * {@code Destination}. A {@code StreamPrintService}
- * has no default destination for its formatted output.
- * Additionally a {@code StreamPrintService} is expected to generate
-output in
- * a format useful in other contexts.
- * StreamPrintService's are not expected to support the Destination attribute.
+ * {@link javax.print.attribute.standard.Destination Destination} attribute. A
+ * {@code StreamPrintService} always requires an output stream, whereas a
+ * {@code PrintService} optionally accepts a {@code Destination}. A
+ * {@code StreamPrintService} has no default destination for its formatted
+ * output. Additionally a {@code StreamPrintService} is expected to generate
+ * output in a format useful in other contexts. {@code StreamPrintService}'s are
+ * not expected to support the {@code Destination} attribute.
*/
-
public abstract class StreamPrintService implements PrintService {
+ /**
+ * The output stream to which this service will send formatted print data.
+ */
private OutputStream outStream;
+
+ /**
+ * Whether or not this {@code StreamPrintService} has been disposed.
+ */
private boolean disposed = false;
+ /**
+ * Constructs a {@code StreamPrintService} object.
+ */
private StreamPrintService() {
};
/**
- * Constructs a StreamPrintService object.
+ * Constructs a {@code StreamPrintService} object.
*
- * @param out stream to which to send formatted print data.
+ * @param out stream to which to send formatted print data
*/
protected StreamPrintService(OutputStream out) {
this.outStream = out;
@@ -73,42 +77,44 @@
/**
* Gets the output stream.
*
- * @return the stream to which this service will send formatted print data.
+ * @return the stream to which this service will send formatted print data
*/
public OutputStream getOutputStream() {
return outStream;
}
/**
- * Returns the document format emitted by this print service.
- * Must be in mimetype format, compatible with the mime type
- * components of DocFlavors @see DocFlavor.
- * @return mime type identifying the output format.
+ * Returns the document format emitted by this print service. Must be in
+ * mimetype format, compatible with the mime type components of
+ * {@code DocFlavors}
+ *
+ * @return mime type identifying the output format
+ * @see DocFlavor
*/
public abstract String getOutputFormat();
/**
- * Disposes this {@code StreamPrintService}.
- * If a stream service cannot be re-used, it must be disposed
- * to indicate this. Typically the client will call this method.
- * Services which write data which cannot meaningfully be appended to
- * may also dispose the stream. This does not close the stream. It
- * just marks it as not for further use by this service.
+ * Disposes this {@code StreamPrintService}. If a stream service cannot be
+ * re-used, it must be disposed to indicate this. Typically the client will
+ * call this method. Services which write data which cannot meaningfully be
+ * appended to may also dispose the stream. This does not close the stream.
+ * It just marks it as not for further use by this service.
*/
public void dispose() {
disposed = true;
}
/**
- * Returns a {@code boolean} indicating whether or not
- * this {@code StreamPrintService} has been disposed.
- * If this object has been disposed, will return true.
- * Used by services and client applications to recognize streams
- * to which no further data should be written.
- * @return if this {@code StreamPrintService} has been disposed
+ * Returns a {@code boolean} indicating whether or not this
+ * {@code StreamPrintService} has been disposed. If this object has been
+ * disposed, will return {@code true}. Used by services and client
+ * applications to recognize streams to which no further data should be
+ * written.
+ *
+ * @return {@code true} if this {@code StreamPrintService} has been
+ * disposed; {@code false} otherwise
*/
public boolean isDisposed() {
return disposed;
}
-
}
diff -r 000f4e4ddd39 -r 57173ad5c534 jdk/src/java.desktop/share/classes/javax/print/StreamPrintServiceFactory.java
--- a/jdk/src/java.desktop/share/classes/javax/print/StreamPrintServiceFactory.java Fri Sep 01 14:13:40 2017 +0000
+++ b/jdk/src/java.desktop/share/classes/javax/print/StreamPrintServiceFactory.java Sat Sep 09 14:36:45 2017 +0200
@@ -26,40 +26,48 @@
package javax.print;
import java.io.OutputStream;
-
import java.util.ArrayList;
import java.util.Iterator;
+import java.util.ServiceConfigurationError;
+import java.util.ServiceLoader;
-import javax.print.DocFlavor;
+import javax.print.attribute.PrintRequestAttributeSet;
import sun.awt.AppContext;
-import java.util.ServiceLoader;
-import java.util.ServiceConfigurationError;
/**
* A {@code StreamPrintServiceFactory} is the factory for
- * {@link StreamPrintService} instances,
- * which can print to an output stream in a particular
- * document format described as a mime type.
- * A typical output document format may be Postscript(TM).
+ * {@link StreamPrintService} instances, which can print to an output stream in
+ * a particular document format described as a mime type. A typical output
+ * document format may be Postscript(TM).
*
- * This class is implemented by a service and located by the
- * implementation using the {@link java.util.ServiceLoader} facility.
+ * This class is implemented by a service and located by the implementation
+ * using the {@link ServiceLoader} facility.
*
* Applications locate instances of this class by calling the
* {@link #lookupStreamPrintServiceFactories(DocFlavor, String)} method.
*
- * Applications can use a {@code StreamPrintService} obtained from a
- * factory in place of a {@code PrintService} which represents a
- * physical printer device.
+ * Applications can use a {@code StreamPrintService} obtained from a factory in
+ * place of a {@code PrintService} which represents a physical printer device.
*/
-
public abstract class StreamPrintServiceFactory {
+ /**
+ * Contains a list of factories.
+ */
static class Services {
+
+ /**
+ * The list of factories which will be stored per appcontext.
+ */
private ArrayList
- * The {@code outputMimeType} parameter describes the document type that
- * you want to create, whereas the {@code flavor} parameter describes the
- * format in which the input data will be provided by the application
- * to the {@code StreamPrintService}.
+ * The {@code outputMimeType} parameter describes the document type that you
+ * want to create, whereas the {@code flavor} parameter describes the format
+ * in which the input data will be provided by the application to the
+ * {@code StreamPrintService}.
*
- * Although null is an acceptable value to use in the lookup of stream
- * printing services, it's typical to search for a particular
- * desired format, such as Postscript(TM).
+ * Although {@code null} is an acceptable value to use in the lookup of
+ * stream printing services, it's typical to search for a particular desired
+ * format, such as Postscript(TM).
*
- * @param flavor of the input document type - null means match all
- * types.
- * @param outputMimeType representing the required output format, used to
- * identify suitable stream printer factories. A value of null means
- * match all formats.
- * @return matching factories for stream print service instance,
- * empty if no suitable factories could be located.
+ * @param flavor of the input document type - {@code null} means match all
+ * types
+ * @param outputMimeType representing the required output format, used to
+ * identify suitable stream printer factories. A value of
+ * {@code null} means match all formats.
+ * @return matching factories for stream print service instance, empty if no
+ * suitable factories could be located
*/
public static StreamPrintServiceFactory[]
lookupStreamPrintServiceFactories(DocFlavor flavor,
@@ -110,55 +128,56 @@
return list.toArray(new StreamPrintServiceFactory[list.size()]);
}
- /** Queries the factory for the document format that is emitted
- * by printers obtained from this factory.
+ /**
+ * Queries the factory for the document format that is emitted by printers
+ * obtained from this factory.
*
- * @return the output format described as a mime type.
+ * @return the output format described as a mime type
*/
public abstract String getOutputFormat();
/**
- * Queries the factory for the document flavors that can be accepted
- * by printers obtained from this factory.
- * @return array of supported doc flavors.
+ * Queries the factory for the document flavors that can be accepted by
+ * printers obtained from this factory.
+ *
+ * @return array of supported doc flavors
*/
public abstract DocFlavor[] getSupportedDocFlavors();
/**
- * Returns a {@code StreamPrintService} that can print to
- * the specified output stream.
- * The output stream is created and managed by the application.
- * It is the application's responsibility to close the stream and
- * to ensure that this Printer is not reused.
- * The application should not close this stream until any print job
- * created from the printer is complete. Doing so earlier may generate
- * a {@code PrinterException} and an event indicating that the
- * job failed.
+ * Returns a {@code StreamPrintService} that can print to the specified
+ * output stream. The output stream is created and managed by the
+ * application. It is the application's responsibility to close the stream
+ * and to ensure that this {@code Printer} is not reused. The application
+ * should not close this stream until any print job created from the printer
+ * is complete. Doing so earlier may generate a {@code PrinterException} and
+ * an event indicating that the job failed.
*
- * Whereas a {@code PrintService} connected to a physical printer
- * can be reused,
- * a {@code StreamPrintService} connected to a stream cannot.
- * The underlying {@code StreamPrintService} may be disposed by
- * the print system with
- * the {@link StreamPrintService#dispose() dispose} method
- * before returning from the
- * {@link DocPrintJob#print(Doc, javax.print.attribute.PrintRequestAttributeSet) print}
- * method of {@code DocPrintJob} so that the print system knows
- * this printer is no longer usable.
- * This is equivalent to a physical printer going offline - permanently.
- * Applications may supply a null print stream to create a queryable
- * service. It is not valid to create a PrintJob for such a stream.
- * Implementations which allocate resources on construction should examine
- * the stream and may wish to only allocate resources if the stream is
- * non-null.
+ * Whereas a {@code PrintService} connected to a physical printer can be
+ * reused, a {@code StreamPrintService} connected to a stream cannot. The
+ * underlying {@code StreamPrintService} may be disposed by the print system
+ * with the {@link StreamPrintService#dispose() dispose} method before
+ * returning from the
+ * {@link DocPrintJob#print(Doc, PrintRequestAttributeSet) print} method of
+ * {@code DocPrintJob} so that the print system knows this printer is no
+ * longer usable. This is equivalent to a physical printer going offline -
+ * permanently. Applications may supply a {@code null} print stream to
+ * create a queryable service. It is not valid to create a {@code PrintJob}
+ * for such a stream. Implementations which allocate resources on
+ * construction should examine the stream and may wish to only allocate
+ * resources if the stream is {@code non-null}.
*
- * @param out destination stream for generated output.
- * @return a PrintService which will generate the format specified by the
- * DocFlavor supported by this Factory.
+ * @param out destination stream for generated output
+ * @return a {@code PrintService} which will generate the format specified
+ * by the {@code DocFlavor} supported by this factory
*/
public abstract StreamPrintService getPrintService(OutputStream out);
-
+ /**
+ * Returns all factories for print services.
+ *
+ * @return all factories
+ */
private static ArrayList
- * Note: This method is intended to provide a default, nonlocalized
- * string for the attribute's category. If two attribute objects return the
- * same category from the {@code getCategory()} method, they should
- * return the same name from the {@code getName()} method.
- *
- * @return Attribute category name.
- */
- public String getName();
-
+ /**
+ * Get the name of the category of which this attribute value is an
+ * instance.
+ *
+ * Note: This method is intended to provide a default, nonlocalized
+ * string for the attribute's category. If two attribute objects return the
+ * same category from the {@code getCategory()} method, they should return
+ * the same name from the {@code getName()} method.
+ *
+ * @return attribute category name
+ */
+ public String getName();
}
diff -r 000f4e4ddd39 -r 57173ad5c534 jdk/src/java.desktop/share/classes/javax/print/attribute/AttributeSet.java
--- a/jdk/src/java.desktop/share/classes/javax/print/attribute/AttributeSet.java Fri Sep 01 14:13:40 2017 +0000
+++ b/jdk/src/java.desktop/share/classes/javax/print/attribute/AttributeSet.java Sat Sep 09 14:36:45 2017 +0200
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2000, 2013, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2000, 2017, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
@@ -26,284 +26,240 @@
package javax.print.attribute;
/**
- * Interface AttributeSet specifies the interface for a set of printing
+ * Interface {@code AttributeSet} specifies the interface for a set of printing
* attributes. A printing attribute is an object whose class implements
* interface {@link Attribute Attribute}.
- *
- * An attribute set contains a group of attribute values,
- * where duplicate values are not allowed in the set.
- * Furthermore, each value in an attribute set is
- * a member of some category, and at most one value in any particular
- * category is allowed in the set. For an attribute set, the values are {@link
- * Attribute Attribute} objects, and the categories are {@link java.lang.Class
- * Class} objects. An attribute's category is the class (or interface) at the
- * root of the class hierarchy for that kind of attribute. Note that an
- * attribute object's category may be a superclass of the attribute object's
- * class rather than the attribute object's class itself. An attribute
- * object's
- * category is determined by calling the {@link Attribute#getCategory()
- * getCategory()} method defined in interface {@link Attribute
- * Attribute}.
- *
- * The interfaces of an AttributeSet resemble those of the Java Collections
- * API's java.util.Map interface, but is more restrictive in the types
- * it will accept, and combines keys and values into an Attribute.
- *
- * Attribute sets are used in several places in the Print Service API. In
- * each context, only certain kinds of attributes are allowed to appear in the
+ *
+ * An attribute set contains a group of attribute values, where duplicate
+ * values are not allowed in the set. Furthermore, each value in an attribute
+ * set is a member of some category, and at most one value in any
+ * particular category is allowed in the set. For an attribute set, the values
+ * are {@link Attribute Attribute} objects, and the categories are
+ * {@link Class Class} objects. An attribute's category is the class (or
+ * interface) at the root of the class hierarchy for that kind of attribute.
+ * Note that an attribute object's category may be a superclass of the attribute
+ * object's class rather than the attribute object's class itself. An attribute
+ * object's category is determined by calling the
+ * {@link Attribute#getCategory() getCategory()} method defined in interface
+ * {@link Attribute Attribute}.
+ *
+ * The interfaces of an {@code AttributeSet} resemble those of the Java
+ * Collections API's {@code java.util.Map} interface, but is more restrictive in
+ * the types it will accept, and combines keys and values into an
+ * {@code Attribute}.
+ *
+ * Attribute sets are used in several places in the Print Service API. In each
+ * context, only certain kinds of attributes are allowed to appear in the
* attribute set, as determined by the tagging interfaces which the attribute
- * class implements -- {@link DocAttribute DocAttribute}, {@link
- * PrintRequestAttribute PrintRequestAttribute}, {@link PrintJobAttribute
- * PrintJobAttribute}, and {@link PrintServiceAttribute
- * PrintServiceAttribute}.
+ * class implements -- {@link DocAttribute DocAttribute},
+ * {@link PrintRequestAttribute PrintRequestAttribute},
+ * {@link PrintJobAttribute PrintJobAttribute}, and
+ * {@link PrintServiceAttribute PrintServiceAttribute}.
* There are four specializations of an attribute set that are restricted to
- * contain just one of the four kinds of attribute -- {@link DocAttributeSet
- * DocAttributeSet}, {@link PrintRequestAttributeSet
- * PrintRequestAttributeSet},
- * {@link PrintJobAttributeSet PrintJobAttributeSet}, and {@link
- * PrintServiceAttributeSet PrintServiceAttributeSet}, respectively. Note that
- * many attribute classes implement more than one tagging interface and so may
- * appear in more than one context.
- *
+ * contain just one of the four kinds of attribute --
+ * {@link DocAttributeSet DocAttributeSet},
+ * {@link PrintRequestAttributeSet PrintRequestAttributeSet},
+ * {@link PrintJobAttributeSet PrintJobAttributeSet}, and
+ * {@link PrintServiceAttributeSet PrintServiceAttributeSet}, respectively. Note
+ * that many attribute classes implement more than one tagging interface and so
+ * may appear in more than one context.
+ *
+ * operation throws an {@code UnmodifiableSetException}.
+ *
* The Print Service API provides one implementation of interface
- * AttributeSet, class {@link HashAttributeSet HashAttributeSet}.
- * A client can use class {@link
- * HashAttributeSet HashAttributeSet} or provide its own implementation of
- * interface AttributeSet. The Print Service API also provides
- * implementations of interface AttributeSet's subinterfaces -- classes {@link
- * HashDocAttributeSet HashDocAttributeSet},
- * {@link HashPrintRequestAttributeSet
- * HashPrintRequestAttributeSet}, {@link HashPrintJobAttributeSet
- * HashPrintJobAttributeSet}, and {@link HashPrintServiceAttributeSet
- * HashPrintServiceAttributeSet}.
+ * {@code AttributeSet}, class {@link HashAttributeSet HashAttributeSet}. A
+ * client can use class {@link HashAttributeSet HashAttributeSet} or provide its
+ * own implementation of interface {@code AttributeSet}. The Print Service API
+ * also provides implementations of interface {@code AttributeSet}'s
+ * subinterfaces -- classes
+ * {@link HashDocAttributeSet HashDocAttributeSet},
+ * {@link HashPrintRequestAttributeSet HashPrintRequestAttributeSet},
+ * {@link HashPrintJobAttributeSet HashPrintJobAttributeSet}, and
+ * {@link HashPrintServiceAttributeSet HashPrintServiceAttributeSet}.
*
- * @author Alan Kaminsky
+ * @author Alan Kaminsky
*/
public interface AttributeSet {
-
/**
* Returns the attribute value which this attribute set contains in the
- * given attribute category. Returns {@code null} if this attribute set
- * does not contain any attribute value in the given attribute category.
- *
- * @param category Attribute category whose associated attribute value
- * is to be returned. It must be a
- * {@link java.lang.Class Class}
- * that implements interface {@link Attribute
- * Attribute}.
+ * given attribute category. Returns {@code null} if this attribute set does
+ * not contain any attribute value in the given attribute category.
*
- * @return The attribute value in the given attribute category contained
- * in this attribute set, or {@code null} if this attribute set
- * does not contain any attribute value in the given attribute
- * category.
- *
- * @throws NullPointerException
- * (unchecked exception) Thrown if the {@code category} is null.
- * @throws ClassCastException
- * (unchecked exception) Thrown if the {@code category} is not a
- * {@link java.lang.Class Class} that implements interface {@link
- * Attribute Attribute}.
+ * @param category attribute category whose associated attribute value is
+ * to be returned. It must be a {@link Class Class} that implements
+ * interface {@link Attribute Attribute}.
+ * @return the attribute value in the given attribute category contained in
+ * this attribute set, or {@code null} if this attribute set does
+ * not contain any attribute value in the given attribute category
+ * @throws NullPointerException if the {@code category} is {@code null}
+ * @throws ClassCastException if the {@code category} is not a
+ * {@link Class Class} that implements interface
+ * {@link Attribute Attribute}
*/
public Attribute get(Class> category);
/**
- * Adds the specified attribute to this attribute set if it is not
- * already present, first removing any existing value in the same
- * attribute category as the specified attribute value.
- *
- * @param attribute Attribute value to be added to this attribute set.
+ * Adds the specified attribute to this attribute set if it is not already
+ * present, first removing any existing value in the same attribute category
+ * as the specified attribute value.
*
- * @return {@code true} if this attribute set changed as a result of the
- * call, i.e., the given attribute value was not already a member
- * of this attribute set.
- *
- * @throws NullPointerException
- * (unchecked exception) Thrown if the {@code attribute} is null.
- * @throws UnmodifiableSetException
- * (unchecked exception) Thrown if this attribute set does not support
- * the {@code add()} operation.
+ * @param attribute attribute value to be added to this attribute set
+ * @return {@code true} if this attribute set changed as a result of the
+ * call, i.e., the given attribute value was not already a member of
+ * this attribute set
+ * @throws NullPointerException if the {@code attribute} is {@code null}
+ * @throws UnmodifiableSetException if this attribute set does not support
+ * the {@code add()} operation
*/
public boolean add(Attribute attribute);
-
/**
* Removes any attribute for this category from this attribute set if
- * present. If {@code category} is null, then
- * {@code remove()} does nothing and returns {@code false}.
- *
- * @param category Attribute category to be removed from this
- * attribute set.
+ * present. If {@code category} is {@code null}, then {@code remove()} does
+ * nothing and returns {@code false}.
*
- * @return {@code true} if this attribute set changed as a result of the
+ * @param category attribute category to be removed from this attribute set
+ * @return {@code true} if this attribute set changed as a result of the
* call, i.e., the given attribute value had been a member of this
- * attribute set.
- *
- * @throws UnmodifiableSetException
- * (unchecked exception) Thrown if this attribute set does not support
- * the {@code remove()} operation.
+ * attribute set
+ * @throws UnmodifiableSetException if this attribute set does not support
+ * the {@code remove()} operation
*/
public boolean remove(Class> category);
/**
- * Removes the specified attribute from this attribute set if
- * present. If {@code attribute} is null, then
- * {@code remove()} does nothing and returns {@code false}.
- *
- * @param attribute Attribute value to be removed from this attribute set.
+ * Removes the specified attribute from this attribute set if present. If
+ * {@code attribute} is {@code null}, then {@code remove()} does nothing and
+ * returns {@code false}.
*
- * @return {@code true} if this attribute set changed as a result of the
+ * @param attribute attribute value to be removed from this attribute set
+ * @return {@code true} if this attribute set changed as a result of the
* call, i.e., the given attribute value had been a member of this
- * attribute set.
- *
- * @throws UnmodifiableSetException
- * (unchecked exception) Thrown if this attribute set does not support
- * the {@code remove()} operation.
+ * attribute set
+ * @throws UnmodifiableSetException if this attribute set does not support
+ * the {@code remove()} operation
*/
public boolean remove(Attribute attribute);
/**
- * Returns {@code true} if this attribute set contains an
- * attribute for the specified category.
+ * Returns {@code true} if this attribute set contains an attribute for the
+ * specified category.
*
- * @param category whose presence in this attribute set is
- * to be tested.
- *
- * @return {@code true} if this attribute set contains an attribute
- * value for the specified category.
+ * @param category whose presence in this attribute set is to be tested
+ * @return {@code true} if this attribute set contains an attribute value
+ * for the specified category
*/
public boolean containsKey(Class> category);
/**
- * Returns {@code true} if this attribute set contains the given
- * attribute value.
+ * Returns {@code true} if this attribute set contains the given attribute
+ * value.
*
- * @param attribute Attribute value whose presence in this
- * attribute set is to be tested.
- *
- * @return {@code true} if this attribute set contains the given
- * attribute value.
+ * @param attribute attribute value whose presence in this attribute set is
+ * to be tested
+ * @return {@code true} if this attribute set contains the given attribute
+ * value
*/
public boolean containsValue(Attribute attribute);
/**
- * Adds all of the elements in the specified set to this attribute.
- * The outcome is the same as if the =
- * {@link #add(Attribute) add(Attribute)}
+ * Adds all of the elements in the specified set to this attribute. The
+ * outcome is the same as if the = {@link #add(Attribute) add(Attribute)}
* operation had been applied to this attribute set successively with each
- * element from the specified set.
- * The behavior of the {@code addAll(AttributeSet)}
- * operation is unspecified if the specified set is modified while
- * the operation is in progress.
- *
- * If the {@code addAll(AttributeSet)} operation throws an exception,
- * the effect on this attribute set's state is implementation dependent;
- * elements from the specified set before the point of the exception may
- * or may not have been added to this attribute set.
+ * element from the specified set. The behavior of the
+ * {@code addAll(AttributeSet)} operation is unspecified if the specified
+ * set is modified while the operation is in progress.
+ *
+ * If the {@code addAll(AttributeSet)} operation throws an exception, the
+ * effect on this attribute set's state is implementation dependent;
+ * elements from the specified set before the point of the exception may or
+ * may not have been added to this attribute set.
*
- * @param attributes whose elements are to be added to this attribute
- * set.
- *
- * @return {@code true} if this attribute set changed as a result of the
- * call.
- *
- * @throws UnmodifiableSetException
- * (Unchecked exception) Thrown if this attribute set does not support
- * the {@code addAll(AttributeSet)} method.
- * @throws NullPointerException
- * (Unchecked exception) Thrown if some element in the specified
- * set is null.
- *
+ * @param attributes whose elements are to be added to this attribute set
+ * @return {@code true} if this attribute set changed as a result of the
+ * call
+ * @throws UnmodifiableSetException if this attribute set does not support
+ * the {@code addAll(AttributeSet)} method
+ * @throws NullPointerException if some element in the specified set is
+ * {@code null}
* @see #add(Attribute)
*/
public boolean addAll(AttributeSet attributes);
/**
- * Returns the number of attributes in this attribute set. If this
- * attribute set contains more than {@code Integer.MAX_VALUE} elements,
- * returns {@code Integer.MAX_VALUE}.
+ * Returns the number of attributes in this attribute set. If this attribute
+ * set contains more than {@code Integer.MAX_VALUE} elements, returns
+ * {@code Integer.MAX_VALUE}.
*
- * @return The number of attributes in this attribute set.
+ * @return the number of attributes in this attribute set
*/
public int size();
/**
* Returns an array of the attributes contained in this set.
- * @return the Attributes contained in this set as an array, zero length
- * if the AttributeSet is empty.
+ *
+ * @return the {@code Attributes} contained in this set as an array, zero
+ * length if the {@code AttributeSet} is empty
*/
public Attribute[] toArray();
-
/**
* Removes all attributes from this attribute set.
*
- * @throws UnmodifiableSetException
- * (unchecked exception) Thrown if this attribute set does not support
- * the {@code clear()} operation.
+ * @throws UnmodifiableSetException if this attribute set does not support
+ * the {@code clear()} operation
*/
public void clear();
/**
- * Returns true if this attribute set contains no attributes.
+ * Returns {@code true} if this attribute set contains no attributes.
*
- * @return true if this attribute set contains no attributes.
+ * @return {@code true} if this attribute set contains no attributes
*/
public boolean isEmpty();
/**
* Compares the specified object with this attribute set for equality.
- * Returns {@code true} if the given object is also an attribute set and
- * the two attribute sets contain the same attribute category-attribute
- * value mappings. This ensures that the
- * {@code equals()} method works properly across different
- * implementations of the AttributeSet interface.
+ * Returns {@code true} if the given object is also an attribute set and the
+ * two attribute sets contain the same attribute category-attribute value
+ * mappings. This ensures that the {@code equals()} method works properly
+ * across different implementations of the {@code AttributeSet} interface.
*
- * @param object to be compared for equality with this attribute set.
- *
- * @return {@code true} if the specified object is equal to this
- * attribute set.
+ * @param object to be compared for equality with this attribute set
+ * @return {@code true} if the specified object is equal to this attribute
+ * set
*/
public boolean equals(Object object);
/**
* Returns the hash code value for this attribute set. The hash code of an
- * attribute set is defined to be the sum of the hash codes of each entry
- * in the AttributeSet.
- * This ensures that {@code t1.equals(t2)} implies that
- * {@code t1.hashCode()==t2.hashCode()} for any two attribute sets
+ * attribute set is defined to be the sum of the hash codes of each entry in
+ * the {@code AttributeSet}. This ensures that {@code t1.equals(t2)} implies
+ * that {@code t1.hashCode()==t2.hashCode()} for any two attribute sets
* {@code t1} and {@code t2}, as required by the general contract of
- * {@link java.lang.Object#hashCode() Object.hashCode()}.
+ * {@link Object#hashCode() Object.hashCode()}.
*
- * @return The hash code value for this attribute set.
+ * @return the hash code value for this attribute set
*/
public int hashCode();
-
}
diff -r 000f4e4ddd39 -r 57173ad5c534 jdk/src/java.desktop/share/classes/javax/print/attribute/AttributeSetUtilities.java
--- a/jdk/src/java.desktop/share/classes/javax/print/attribute/AttributeSetUtilities.java Fri Sep 01 14:13:40 2017 +0000
+++ b/jdk/src/java.desktop/share/classes/javax/print/attribute/AttributeSetUtilities.java Sat Sep 09 14:36:45 2017 +0200
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2000, 2014, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2000, 2017, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
@@ -23,65 +23,75 @@
* questions.
*/
-
package javax.print.attribute;
import java.io.Serializable;
/**
- * Class AttributeSetUtilities provides static methods for manipulating
- * AttributeSets.
+ * Class {@code AttributeSetUtilities} provides static methods for manipulating
+ * {@code AttributeSets}.
*
- * An unmodifiable view U of an AttributeSet S provides a
- * client with "read-only" access to S. Query operations on U
- * "read through" to S; thus, changes in S are reflected in
- * U. However, any attempt to modify U,
- * results in an UnmodifiableSetException.
- * The unmodifiable view object U will be serializable if the
- * attribute set object S is serializable.
- *
- * A synchronized view V of an attribute set S provides a
- * client with synchronized (multiple thread safe) access to S. Each
- * operation of V is synchronized using V itself as the lock
- * object and then merely invokes the corresponding operation of S. In
- * order to guarantee mutually exclusive access, it is critical that all
- * access to S is accomplished through V. The synchronized view
- * object V will be serializable if the attribute set object S
- * is serializable.
- *
- * As mentioned in the package description of javax.print, a null reference
- * parameter to methods is
- * incorrect unless explicitly documented on the method as having a meaningful
- * interpretation. Usage to the contrary is incorrect coding and may result in
- * a run time exception either immediately
- * or at some later time. IllegalArgumentException and NullPointerException
- * are examples of typical and acceptable run time exceptions for such cases.
+ * An unmodifiable view U of an {@code AttributeSet} S
+ * provides a client with "read-only" access to S. Query operations on
+ * U "read through" to S; thus, changes in S are reflected
+ * in U. However, any attempt to modify U, results in an
+ * {@code UnmodifiableSetException}. The unmodifiable view object U will
+ * be serializable if the attribute set object S is serializable.
+ *
+ * A synchronized view V of an attribute set S provides a
+ * client with synchronized (multiple thread safe) access to S. Each
+ * operation of V is synchronized using V itself as the lock
+ * object and then merely invokes the corresponding operation of S. In
+ * order to guarantee mutually exclusive access, it is critical that all access
+ * to S is accomplished through V. The synchronized view object
+ * V will be serializable if the attribute set object S is
+ * serializable.
+ *
+ * As mentioned in the package description of {@code javax.print}, a
+ * {@code null} reference parameter to methods is incorrect unless explicitly
+ * documented on the method as having a meaningful interpretation. Usage to the
+ * contrary is incorrect coding and may result in a run time exception either
+ * immediately or at some later time. {@code IllegalArgumentException} and
+ * {@code NullPointerException} are examples of typical and acceptable run time
+ * exceptions for such cases.
*
- * @author Alan Kaminsky
+ * @author Alan Kaminsky
*/
public final class AttributeSetUtilities {
- /* Suppress default constructor, ensuring non-instantiability.
+ /**
+ * Suppress default constructor, ensuring non-instantiability.
*/
private AttributeSetUtilities() {
}
/**
- * @serial include
- */
+ * Unmodifiable view of {@code AttributeSet}.
+ *
+ * @serial include
+ */
private static class UnmodifiableAttributeSet
implements AttributeSet, Serializable {
+
+ /**
+ * Use serialVersionUID from JDK 1.4 for interoperability.
+ */
private static final long serialVersionUID = -6131802583863447813L;
+ /**
+ * The attribute set.
+ */
private AttributeSet attrset;
- /* Unmodifiable view of the underlying attribute set.
+ /**
+ * Constructs unmodifiable view of the underlying attribute set.
+ *
+ * @param attributeSet the attribute set
*/
public UnmodifiableAttributeSet(AttributeSet attributeSet) {
@@ -139,17 +149,27 @@
public int hashCode() {
return attrset.hashCode();
}
-
}
/**
- * @serial include
- */
+ * Unmodifiable view of {@code DocAttributeSet}.
+ *
+ * @serial include
+ */
private static class UnmodifiableDocAttributeSet
extends UnmodifiableAttributeSet
implements DocAttributeSet, Serializable {
+
+ /**
+ * Use serialVersionUID from JDK 1.4 for interoperability.
+ */
private static final long serialVersionUID = -6349408326066898956L;
+ /**
+ * Constructs a new unmodifiable doc attribute set.
+ *
+ * @param attributeSet the doc attribute set
+ */
public UnmodifiableDocAttributeSet(DocAttributeSet attributeSet) {
super (attributeSet);
@@ -157,13 +177,25 @@
}
/**
- * @serial include
- */
+ * Unmodifiable view of {@code PrintRequestAttributeSet}.
+ *
+ * @serial include
+ */
private static class UnmodifiablePrintRequestAttributeSet
extends UnmodifiableAttributeSet
implements PrintRequestAttributeSet, Serializable
{
+
+ /**
+ * Use serialVersionUID from JDK 1.4 for interoperability.
+ */
private static final long serialVersionUID = 7799373532614825073L;
+
+ /**
+ * Constructs a new unmodifiable print request attribute set.
+ *
+ * @param attributeSet the print request attribute set
+ */
public UnmodifiablePrintRequestAttributeSet
(PrintRequestAttributeSet attributeSet) {
@@ -172,13 +204,24 @@
}
/**
- * @serial include
- */
+ * Unmodifiable view of {@code PrintJobAttributeSet}.
+ *
+ * @serial include
+ */
private static class UnmodifiablePrintJobAttributeSet
extends UnmodifiableAttributeSet
implements PrintJobAttributeSet, Serializable
{
+ /**
+ * Use serialVersionUID from JDK 1.4 for interoperability.
+ */
private static final long serialVersionUID = -8002245296274522112L;
+
+ /**
+ * Constructs a new unmodifiable print job attribute set.
+ *
+ * @param attributeSet the print job attribute set
+ */
public UnmodifiablePrintJobAttributeSet
(PrintJobAttributeSet attributeSet) {
@@ -187,13 +230,24 @@
}
/**
- * @serial include
- */
+ * Unmodifiable view of {@code PrintServiceAttributeSet}.
+ *
+ * @serial include
+ */
private static class UnmodifiablePrintServiceAttributeSet
extends UnmodifiableAttributeSet
implements PrintServiceAttributeSet, Serializable
{
+ /**
+ * Use serialVersionUID from JDK 1.4 for interoperability.
+ */
private static final long serialVersionUID = -7112165137107826819L;
+
+ /**
+ * Constructs a new unmodifiable print service attribute set.
+ *
+ * @param attributeSet the print service attribute set
+ */
public UnmodifiablePrintServiceAttributeSet
(PrintServiceAttributeSet attributeSet) {
@@ -204,12 +258,9 @@
/**
* Creates an unmodifiable view of the given attribute set.
*
- * @param attributeSet Underlying attribute set.
- *
- * @return Unmodifiable view of {@code attributeSet}.
- *
- * @exception NullPointerException
- * Thrown if {@code attributeSet} is null. Null is never a
+ * @param attributeSet underlying attribute set
+ * @return unmodifiable view of {@code attributeSet}
+ * @throws NullPointerException if {@code attributeSet} is {@code null}
*/
public static AttributeSet unmodifiableView(AttributeSet attributeSet) {
if (attributeSet == null) {
@@ -222,12 +273,9 @@
/**
* Creates an unmodifiable view of the given doc attribute set.
*
- * @param attributeSet Underlying doc attribute set.
- *
- * @return Unmodifiable view of {@code attributeSet}.
- *
- * @exception NullPointerException
- * Thrown if {@code attributeSet} is null.
+ * @param attributeSet underlying doc attribute set
+ * @return unmodifiable view of {@code attributeSet}
+ * @throws NullPointerException if {@code attributeSet} is {@code null}
*/
public static DocAttributeSet unmodifiableView
(DocAttributeSet attributeSet) {
@@ -240,12 +288,9 @@
/**
* Creates an unmodifiable view of the given print request attribute set.
*
- * @param attributeSet Underlying print request attribute set.
- *
- * @return Unmodifiable view of {@code attributeSet}.
- *
- * @exception NullPointerException
- * Thrown if {@code attributeSet} is null.
+ * @param attributeSet underlying print request attribute set
+ * @return unmodifiable view of {@code attributeSet}
+ * @throws NullPointerException if {@code attributeSet} is {@code null}
*/
public static PrintRequestAttributeSet
unmodifiableView(PrintRequestAttributeSet attributeSet) {
@@ -258,12 +303,9 @@
/**
* Creates an unmodifiable view of the given print job attribute set.
*
- * @param attributeSet Underlying print job attribute set.
- *
- * @return Unmodifiable view of {@code attributeSet}.
- *
- * @exception NullPointerException
- * Thrown if {@code attributeSet} is null.
+ * @param attributeSet underlying print job attribute set
+ * @return unmodifiable view of {@code attributeSet}
+ * @throws NullPointerException if {@code attributeSet} is {@code null}
*/
public static PrintJobAttributeSet
unmodifiableView(PrintJobAttributeSet attributeSet) {
@@ -276,12 +318,9 @@
/**
* Creates an unmodifiable view of the given print service attribute set.
*
- * @param attributeSet Underlying print service attribute set.
- *
- * @return Unmodifiable view of {@code attributeSet}.
- *
- * @exception NullPointerException
- * Thrown if {@code attributeSet} is null.
+ * @param attributeSet underlying print service attribute set
+ * @return unmodifiable view of {@code attributeSet}
+ * @throws NullPointerException if {@code attributeSet} is {@code null}
*/
public static PrintServiceAttributeSet
unmodifiableView(PrintServiceAttributeSet attributeSet) {
@@ -292,14 +331,28 @@
}
/**
- * @serial include
- */
+ * Synchronized view of {@code AttributeSet}.
+ *
+ * @serial include
+ */
private static class SynchronizedAttributeSet
implements AttributeSet, Serializable {
+
+ /**
+ * Use serialVersionUID from JDK 1.4 for interoperability.
+ */
private static final long serialVersionUID = 8365731020128564925L;
+ /**
+ * The attribute set.
+ */
private AttributeSet attrset;
+ /**
+ * Constructs a new synchronized attribute set.
+ *
+ * @param attributeSet the attribute set
+ */
public SynchronizedAttributeSet(AttributeSet attributeSet) {
attrset = attributeSet;
}
@@ -358,26 +411,48 @@
}
/**
- * @serial include
- */
+ * Synchronized view of {@code DocAttributeSet}.
+ *
+ * @serial include
+ */
private static class SynchronizedDocAttributeSet
extends SynchronizedAttributeSet
implements DocAttributeSet, Serializable {
+
+ /**
+ * Use serialVersionUID from JDK 1.4 for interoperability.
+ */
private static final long serialVersionUID = 6455869095246629354L;
+ /**
+ * Constructs a new synchronized doc attribute set.
+ *
+ * @param attributeSet the doc attribute set
+ */
public SynchronizedDocAttributeSet(DocAttributeSet attributeSet) {
super(attributeSet);
}
}
/**
- * @serial include
- */
+ * Synchronized view of {@code PrintRequestAttributeSet}.
+ *
+ * @serial include
+ */
private static class SynchronizedPrintRequestAttributeSet
extends SynchronizedAttributeSet
implements PrintRequestAttributeSet, Serializable {
+
+ /**
+ * Use serialVersionUID from JDK 1.4 for interoperability.
+ */
private static final long serialVersionUID = 5671237023971169027L;
+ /**
+ * Constructs a new synchronized print request attribute set.
+ *
+ * @param attributeSet the print request attribute set
+ */
public SynchronizedPrintRequestAttributeSet
(PrintRequestAttributeSet attributeSet) {
super(attributeSet);
@@ -385,13 +460,24 @@
}
/**
- * @serial include
- */
+ * Synchronized view of {@code PrintJobAttributeSet}.
+ *
+ * @serial include
+ */
private static class SynchronizedPrintJobAttributeSet
extends SynchronizedAttributeSet
implements PrintJobAttributeSet, Serializable {
+
+ /**
+ * Use serialVersionUID from JDK 1.4 for interoperability.
+ */
private static final long serialVersionUID = 2117188707856965749L;
+ /**
+ * Constructs a new synchronized print job attribute set.
+ *
+ * @param attributeSet the print job attribute set
+ */
public SynchronizedPrintJobAttributeSet
(PrintJobAttributeSet attributeSet) {
super(attributeSet);
@@ -399,13 +485,24 @@
}
/**
- * @serial include
- */
+ * Synchronized view of {@code PrintServiceAttributeSet}.
+ *
+ * @serial include
+ */
private static class SynchronizedPrintServiceAttributeSet
extends SynchronizedAttributeSet
implements PrintServiceAttributeSet, Serializable {
+
+ /**
+ * Use serialVersionUID from JDK 1.4 for interoperability.
+ */
private static final long serialVersionUID = -2830705374001675073L;
+ /**
+ * Constructs a new synchronized print service attribute set.
+ *
+ * @param attributeSet the print service attribute set
+ */
public SynchronizedPrintServiceAttributeSet
(PrintServiceAttributeSet attributeSet) {
super(attributeSet);
@@ -415,12 +512,9 @@
/**
* Creates a synchronized view of the given attribute set.
*
- * @param attributeSet Underlying attribute set.
- *
- * @return Synchronized view of {@code attributeSet}.
- *
- * @exception NullPointerException
- * Thrown if {@code attributeSet} is null.
+ * @param attributeSet underlying attribute set
+ * @return synchronized view of {@code attributeSet}
+ * @throws NullPointerException if {@code attributeSet} is {@code null}
*/
public static AttributeSet synchronizedView
(AttributeSet attributeSet) {
@@ -433,12 +527,9 @@
/**
* Creates a synchronized view of the given doc attribute set.
*
- * @param attributeSet Underlying doc attribute set.
- *
- * @return Synchronized view of {@code attributeSet}.
- *
- * @exception NullPointerException
- * Thrown if {@code attributeSet} is null.
+ * @param attributeSet underlying doc attribute set
+ * @return synchronized view of {@code attributeSet}
+ * @throws NullPointerException if {@code attributeSet} is {@code null}
*/
public static DocAttributeSet
synchronizedView(DocAttributeSet attributeSet) {
@@ -451,12 +542,9 @@
/**
* Creates a synchronized view of the given print request attribute set.
*
- * @param attributeSet Underlying print request attribute set.
- *
- * @return Synchronized view of {@code attributeSet}.
- *
- * @exception NullPointerException
- * Thrown if {@code attributeSet} is null.
+ * @param attributeSet underlying print request attribute set
+ * @return synchronized view of {@code attributeSet}
+ * @throws NullPointerException if {@code attributeSet} is {@code null}
*/
public static PrintRequestAttributeSet
synchronizedView(PrintRequestAttributeSet attributeSet) {
@@ -469,12 +557,9 @@
/**
* Creates a synchronized view of the given print job attribute set.
*
- * @param attributeSet Underlying print job attribute set.
- *
- * @return Synchronized view of {@code attributeSet}.
- *
- * @exception NullPointerException
- * Thrown if {@code attributeSet} is null.
+ * @param attributeSet underlying print job attribute set
+ * @return synchronized view of {@code attributeSet}
+ * @throws NullPointerException if {@code attributeSet} is {@code null}
*/
public static PrintJobAttributeSet
synchronizedView(PrintJobAttributeSet attributeSet) {
@@ -487,9 +572,9 @@
/**
* Creates a synchronized view of the given print service attribute set.
*
- * @param attributeSet Underlying print service attribute set.
- *
- * @return Synchronized view of {@code attributeSet}.
+ * @param attributeSet underlying print service attribute set
+ * @return synchronized view of {@code attributeSet}
+ * @throws NullPointerException if {@code attributeSet} is {@code null}
*/
public static PrintServiceAttributeSet
synchronizedView(PrintServiceAttributeSet attributeSet) {
@@ -499,26 +584,19 @@
return new SynchronizedPrintServiceAttributeSet(attributeSet);
}
-
/**
- * Verify that the given object is a {@link java.lang.Class Class} that
- * implements the given interface, which is assumed to be interface {@link
- * Attribute Attribute} or a subinterface thereof.
- *
- * @param object Object to test.
- * @param interfaceName Interface the object must implement.
+ * Verify that the given object is a {@link Class Class} that implements the
+ * given interface, which is assumed to be interface
+ * {@link Attribute Attribute} or a subinterface thereof.
*
- * @return If {@code object} is a {@link java.lang.Class Class}
- * that implements {@code interfaceName},
- * {@code object} is returned downcast to type {@link
- * java.lang.Class Class}; otherwise an exception is thrown.
- *
- * @exception NullPointerException
- * (unchecked exception) Thrown if {@code object} is null.
- * @exception ClassCastException
- * (unchecked exception) Thrown if {@code object} is not a
- * {@link java.lang.Class Class} that implements
- * {@code interfaceName}.
+ * @param object {@code Object} to test
+ * @param interfaceName interface the object must implement
+ * @return if {@code object} is a {@link Class Class} that implements
+ * {@code interfaceName}, {@code object} is returned downcast to
+ * type {@link Class Class}; otherwise an exception is thrown
+ * @throws NullPointerException if {@code object} is {@code null}
+ * @throws ClassCastException if {@code object} is not a
+ * {@link Class Class} that implements {@code interfaceName}
*/
public static Class>
verifyAttributeCategory(Object object, Class> interfaceName) {
@@ -537,19 +615,14 @@
* is assumed to be interface {@link Attribute Attribute} or a subinterface
* thereof.
*
- * @param object Object to test.
- * @param interfaceName Interface of which the object must be an instance.
- *
- * @return If {@code object} is an instance of
- * {@code interfaceName}, {@code object} is returned
- * downcast to type {@link Attribute Attribute}; otherwise an
- * exception is thrown.
- *
- * @exception NullPointerException
- * (unchecked exception) Thrown if {@code object} is null.
- * @exception ClassCastException
- * (unchecked exception) Thrown if {@code object} is not an
- * instance of {@code interfaceName}.
+ * @param object {@code Object} to test
+ * @param interfaceName interface of which the object must be an instance
+ * @return if {@code object} is an instance of {@code interfaceName},
+ * {@code object} is returned downcast to type
+ * {@link Attribute Attribute}; otherwise an exception is thrown
+ * @throws NullPointerException if {@code object} is {@code null}
+ * @throws ClassCastException if {@code object} is not an instance of
+ * {@code interfaceName}
*/
public static Attribute
verifyAttributeValue(Object object, Class> interfaceName) {
@@ -565,19 +638,16 @@
}
/**
- * Verify that the given attribute category object is equal to the
- * category of the given attribute value object. If so, this method
- * returns doing nothing. If not, this method throws an exception.
- *
- * @param category Attribute category to test.
- * @param attribute Attribute value to test.
+ * Verify that the given attribute category object is equal to the category
+ * of the given attribute value object. If so, this method returns doing
+ * nothing. If not, this method throws an exception.
*
- * @exception NullPointerException
- * (unchecked exception) Thrown if the {@code category} is
- * null or if the {@code attribute} is null.
- * @exception IllegalArgumentException
- * (unchecked exception) Thrown if the {@code category} is not
- * equal to the category of the {@code attribute}.
+ * @param category attribute category to test
+ * @param attribute attribute value to test
+ * @throws NullPointerException if the {@code category} or {@code attribute}
+ * are {@code null}
+ * @throws IllegalArgumentException if the {@code category} is not equal to
+ * the category of the {@code attribute}
*/
public static void
verifyCategoryForValue(Class> category, Attribute attribute) {
diff -r 000f4e4ddd39 -r 57173ad5c534 jdk/src/java.desktop/share/classes/javax/print/attribute/DateTimeSyntax.java
--- a/jdk/src/java.desktop/share/classes/javax/print/attribute/DateTimeSyntax.java Fri Sep 01 14:13:40 2017 +0000
+++ b/jdk/src/java.desktop/share/classes/javax/print/attribute/DateTimeSyntax.java Sat Sep 09 14:36:45 2017 +0200
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2000, 2014, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2000, 2017, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
@@ -23,47 +23,48 @@
* questions.
*/
-
package javax.print.attribute;
import java.io.Serializable;
-
import java.util.Date;
/**
- * Class DateTimeSyntax is an abstract base class providing the common
+ * Class {@code DateTimeSyntax} is an abstract base class providing the common
* implementation of all attributes whose value is a date and time.
- *
+ *
* Under the hood, a date-time attribute is stored as a value of class
- * {@code java.util.Date}. You can get a date-time attribute's Date value by
- * calling {@link #getValue() getValue()}. A date-time attribute's
- * Date value is established when it is constructed (see {@link
- * #DateTimeSyntax(Date) DateTimeSyntax(Date)}). Once
- * constructed, a date-time attribute's value is immutable.
- *
+ * {@code java.util.Date}. You can get a date-time attribute's {@code Date}
+ * value by calling {@link #getValue() getValue()}. A date-time attribute's
+ * {@code Date} value is established when it is constructed (see
+ * {@link #DateTimeSyntax(Date) DateTimeSyntax(Date)}). Once constructed, a
+ * date-time attribute's value is immutable.
+ *
* To construct a date-time attribute from separate values of the year, month,
- * day, hour, minute, and so on, use a {@code java.util.Calendar}
- * object to construct a {@code java.util.Date} object, then use the
- * {@code java.util.Date} object to construct the date-time attribute.
- * To convert
- * a date-time attribute to separate values of the year, month, day, hour,
- * minute, and so on, create a {@code java.util.Calendar} object and
- * set it to the {@code java.util.Date} from the date-time attribute. Class
- * DateTimeSyntax stores its value in the form of a {@code java.util.Date}
- * rather than a {@code java.util.Calendar} because it typically takes
- * less memory to store and less time to compare a {@code java.util.Date}
- * than a {@code java.util.Calendar}.
+ * day, hour, minute, and so on, use a {@code java.util.Calendar} object to
+ * construct a {@code java.util.Date} object, then use the
+ * {@code java.util.Date} object to construct the date-time attribute. To
+ * convert a date-time attribute to separate values of the year, month, day,
+ * hour, minute, and so on, create a {@code java.util.Calendar} object and set
+ * it to the {@code java.util.Date} from the date-time attribute. Class
+ * {@code DateTimeSyntax} stores its value in the form of a
+ * {@code java.util.Date} rather than a {@code java.util.Calendar} because it
+ * typically takes less memory to store and less time to compare a
+ * {@code java.util.Date} than a {@code java.util.Calendar}.
*
- * @author Alan Kaminsky
+ * @author Alan Kaminsky
*/
public abstract class DateTimeSyntax implements Serializable, Cloneable {
+ /**
+ * Use serialVersionUID from JDK 1.4 for interoperability.
+ */
private static final long serialVersionUID = -1400819079791208582L;
// Hidden data members.
/**
* This date-time attribute's {@code java.util.Date} value.
+ *
* @serial
*/
private Date value;
@@ -71,13 +72,11 @@
// Hidden constructors.
/**
- * Construct a new date-time attribute with the given
- * {@code java.util.Date} value.
+ * Construct a new date-time attribute with the given {@code java.util.Date}
+ * value.
*
- * @param value {@code java.util.Date} value.
- *
- * @exception NullPointerException
- * (unchecked exception) Thrown if {@code theValue} is null.
+ * @param value {@code java.util.Date} value
+ * @throws NullPointerException if {@code value} is {@code null}
*/
protected DateTimeSyntax(Date value) {
if (value == null) {
@@ -89,9 +88,9 @@
// Exported operations.
/**
- * Returns this date-time attribute's {@code java.util.Date}
- * value.
- * @return the Date.
+ * Returns this date-time attribute's {@code java.util.Date} value.
+ *
+ * @return the {@code Date}
*/
public Date getValue() {
return new Date (value.getTime());
@@ -102,20 +101,16 @@
/**
* Returns whether this date-time attribute is equivalent to the passed in
* object. To be equivalent, all of the following conditions must be true:
- *
- * A DocAttributeSet is just an {@link AttributeSet AttributeSet} whose
+ * Interface {@code DocAttributeSet} specifies the interface for a set of doc
+ * attributes, i.e. printing attributes that implement interface
+ * {@link DocAttribute DocAttribute}. In the Print Service API, the client uses
+ * a {@code DocAttributeSet} to specify the characteristics of an individual doc
+ * and the print job settings to be applied to an individual doc.
+ *
+ * A {@code DocAttributeSet} is just an {@link AttributeSet AttributeSet} whose
* constructors and mutating operations guarantee an additional invariant,
- * namely that all attribute values in the DocAttributeSet must be instances
- * of interface {@link DocAttribute DocAttribute}.
- * The {@link #add(Attribute) add(Attribute)}, and
- * {@link #addAll(AttributeSet) addAll(AttributeSet)} operations
- * are respecified below to guarantee this additional invariant.
+ * namely that all attribute values in the {@code DocAttributeSet} must be
+ * instances of interface {@link DocAttribute DocAttribute}. The
+ * {@link #add(Attribute) add(Attribute)}, and
+ * {@link #addAll(AttributeSet) addAll(AttributeSet)} operations are respecified
+ * below to guarantee this additional invariant.
*
- * @author Alan Kaminsky
+ * @author Alan Kaminsky
*/
public interface DocAttributeSet extends AttributeSet {
-
/**
* Adds the specified attribute value to this attribute set if it is not
- * already present, first removing any existing value in the same
- * attribute category as the specified attribute value (optional
- * operation).
- *
- * @param attribute Attribute value to be added to this attribute set.
- *
- * @return {@code true} if this attribute set changed as a result of
- * the call, i.e., the given attribute value was not already a
- * member of this attribute set.
+ * already present, first removing any existing value in the same attribute
+ * category as the specified attribute value (optional operation).
*
- * @throws UnmodifiableSetException
- * (unchecked exception) Thrown if this attribute set does not
- * support the {@code add()} operation.
- * @throws ClassCastException
- * (unchecked exception) Thrown if the {@code attribute} is
- * not an instance of interface
- * {@link DocAttribute DocAttribute}.
- * @throws NullPointerException
- * (unchecked exception) Thrown if the {@code attribute} is null.
+ * @param attribute attribute value to be added to this attribute set
+ * @return {@code true} if this attribute set changed as a result of the
+ * call, i.e., the given attribute value was not already a member of
+ * this attribute set
+ * @throws UnmodifiableSetException if this attribute set does not support
+ * the {@code add()} operation
+ * @throws ClassCastException if the {@code attribute} is not an instance of
+ * interface {@link DocAttribute DocAttribute}
+ * @throws NullPointerException if the {@code attribute} is {@code null}
*/
public boolean add(Attribute attribute);
/**
- * Adds all of the elements in the specified set to this attribute.
- * The outcome is the same as if the
- * {@link #add(Attribute) add(Attribute)}
- * operation had been applied to this attribute set successively with
- * each element from the specified set. If none of the categories in the
- * specified set are the same as any categories in this attribute set,
- * the {@code addAll()} operation effectively modifies this attribute
- * set so that its value is the union of the two sets.
- *
- * The behavior of the {@code addAll()} operation is unspecified if
- * the specified set is modified while the operation is in progress.
- *
- * If the {@code addAll()} operation throws an exception, the effect
- * on this attribute set's state is implementation dependent; elements
- * from the specified set before the point of the exception may or
- * may not have been added to this attribute set.
+ * Adds all of the elements in the specified set to this attribute. The
+ * outcome is the same as if the {@link #add(Attribute) add(Attribute)}
+ * operation had been applied to this attribute set successively with each
+ * element from the specified set. If none of the categories in the
+ * specified set are the same as any categories in this attribute set, the
+ * {@code addAll()} operation effectively modifies this attribute set so
+ * that its value is the union of the two sets.
+ *
+ * The behavior of the {@code addAll()} operation is unspecified if the
+ * specified set is modified while the operation is in progress.
+ *
+ * If the {@code addAll()} operation throws an exception, the effect on this
+ * attribute set's state is implementation dependent; elements from the
+ * specified set before the point of the exception may or may not have been
+ * added to this attribute set.
*
- * @param attributes whose elements are to be added to this attribute
- * set.
- *
- * @return {@code true} if this attribute set changed as a result of
- * the call.
- *
- * @throws UnmodifiableSetException
- * (Unchecked exception) Thrown if this attribute set does not
- * support the {@code addAll()} method.
- * @throws ClassCastException
- * (Unchecked exception) Thrown if some element in the specified
- * set is not an instance of interface {@link DocAttribute
- * DocAttribute}.
- * @throws NullPointerException
- * (Unchecked exception) Thrown if the specified set is null.
- *
+ * @param attributes whose elements are to be added to this attribute set
+ * @return {@code true} if this attribute set changed as a result of the
+ * call
+ * @throws UnmodifiableSetException if this attribute set does not support
+ * the {@code addAll()} method
+ * @throws ClassCastException if some element in the specified set is not an
+ * instance of interface {@link DocAttribute DocAttribute}
+ * @throws NullPointerException if the specified set is {@code null}
* @see #add(Attribute)
*/
- public boolean addAll(AttributeSet attributes);
+ public boolean addAll(AttributeSet attributes);
}
diff -r 000f4e4ddd39 -r 57173ad5c534 jdk/src/java.desktop/share/classes/javax/print/attribute/EnumSyntax.java
--- a/jdk/src/java.desktop/share/classes/javax/print/attribute/EnumSyntax.java Fri Sep 01 14:13:40 2017 +0000
+++ b/jdk/src/java.desktop/share/classes/javax/print/attribute/EnumSyntax.java Sat Sep 09 14:36:45 2017 +0200
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2000, 2014, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2000, 2017, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
@@ -23,7 +23,6 @@
* questions.
*/
-
package javax.print.attribute;
import java.io.InvalidObjectException;
@@ -31,11 +30,13 @@
import java.io.Serializable;
/**
- * Class EnumSyntax is an abstract base class providing the common
+ * Class {@code EnumSyntax} is an abstract base class providing the common
* implementation of all "type safe enumeration" objects. An enumeration class
- * (which extends class EnumSyntax) provides a group of enumeration values
- * (objects) that are singleton instances of the enumeration class; for example:
- *
- * You can convert an enumeration value to a string by calling {@link
- * #toString() toString()}. The string is obtained from a table
- * supplied by the enumeration class.
- *
+ *
+ * You can convert an enumeration value to a string by calling
+ * {@link #toString() toString()}. The string is obtained from a table supplied
+ * by the enumeration class.
+ *
* Under the hood, an enumeration value is just an integer, a different integer
* for each enumeration value within an enumeration class. You can get an
- * enumeration value's integer value by calling {@link #getValue()
- * getValue()}. An enumeration value's integer value is established
- * when it is constructed (see {@link #EnumSyntax(int)
- * EnumSyntax(int)}). Since the constructor is protected, the only
- * possible enumeration values are the singleton objects declared in the
- * enumeration class; additional enumeration values cannot be created at run
- * time.
- *
+ * enumeration value's integer value by calling {@link #getValue() getValue()}.
+ * An enumeration value's integer value is established when it is constructed
+ * (see {@link #EnumSyntax(int) EnumSyntax(int)}). Since the constructor is
+ * protected, the only possible enumeration values are the singleton objects
+ * declared in the enumeration class; additional enumeration values cannot be
+ * created at run time.
+ *
* You can define a subclass of an enumeration class that extends it with
* additional enumeration values. The subclass's enumeration values' integer
* values need not be distinct from the superclass's enumeration values' integer
- * values; the {@code ==}, {@code !=}, {@code equals()}, and
- * {@code toString()} methods will still work properly even if the subclass
- * uses some of the same integer values as the superclass. However, the
- * application in which the enumeration class and subclass are used may need to
- * have distinct integer values in the superclass and subclass.
+ * values; the {@code ==}, {@code !=}, {@code equals()}, and {@code toString()}
+ * methods will still work properly even if the subclass uses some of the same
+ * integer values as the superclass. However, the application in which the
+ * enumeration class and subclass are used may need to have distinct integer
+ * values in the superclass and subclass.
*
- * @author David Mendenhall
- * @author Alan Kaminsky
+ * @author David Mendenhall
+ * @author Alan Kaminsky
*/
public abstract class EnumSyntax implements Serializable, Cloneable {
+ /**
+ * Use serialVersionUID from JDK 1.4 for interoperability.
+ */
private static final long serialVersionUID = -2739521845085831642L;
/**
* This enumeration value's integer value.
+ *
* @serial
*/
private int value;
@@ -119,7 +123,7 @@
/**
* Construct a new enumeration value with the given integer value.
*
- * @param value Integer value.
+ * @param value Integer value
*/
protected EnumSyntax(int value) {
this.value = value;
@@ -127,6 +131,7 @@
/**
* Returns this enumeration value's integer value.
+ *
* @return the value
*/
public int getValue() {
@@ -167,22 +172,20 @@
* During object input, convert this deserialized enumeration instance to
* the proper enumeration value defined in the enumeration attribute class.
*
- * @return The enumeration singleton value stored at index
- * i-L in the enumeration value table returned by
- * {@link #getEnumValueTable() getEnumValueTable()},
- * where i is this enumeration value's integer value and
- * L is the value returned by {@link #getOffset()
- * getOffset()}.
- *
+ * @return The enumeration singleton value stored at index i-L
+ * in the enumeration value table returned by
+ * {@link #getEnumValueTable() getEnumValueTable()}, where i
+ * is this enumeration value's integer value and L is the
+ * value returned by {@link #getOffset() getOffset()}
* @throws ObjectStreamException if the stream can't be deserialised
- * @throws InvalidObjectException
- * Thrown if the enumeration value table is null, this enumeration
- * value's integer value does not correspond to an element in the
- * enumeration value table, or the corresponding element in the
- * enumeration value table is null. (Note: {@link
- * java.io.InvalidObjectException InvalidObjectException} is a subclass
- * of {@link java.io.ObjectStreamException ObjectStreamException}, which
- * {@code readResolve()} is declared to throw.)
+ * @throws InvalidObjectException if the enumeration value table is
+ * {@code null}, this enumeration value's integer value does not
+ * correspond to an element in the enumeration value table, or the
+ * corresponding element in the enumeration value table is
+ * {@code null}. (Note:
+ * {@link InvalidObjectException InvalidObjectException} is a
+ * subclass of {@link ObjectStreamException ObjectStreamException},
+ * which {@code readResolve()} is declared to throw.)
*/
protected Object readResolve() throws ObjectStreamException {
@@ -218,20 +221,21 @@
/**
* Returns the string table for this enumeration value's enumeration class.
* The enumeration class's integer values are assumed to lie in the range
- * L..L+N-1, where L is the value returned by
- * {@link #getOffset() getOffset()} and N is the length
- * of the string table. The element in the string table at index
- * i-L is the value returned by {@link #toString()
- * toString()} for the enumeration value whose integer value
- * is i. If an integer within the above range is not used by any
- * enumeration value, leave the corresponding table element null.
- *
- * The default implementation returns null. If the enumeration class (a
- * subclass of class EnumSyntax) does not override this method to return a
- * non-null string table, and the subclass does not override the {@link
- * #toString() toString()} method, the base class {@link
- * #toString() toString()} method will return just a string
+ * L..L+N-1, where L is the value returned by
+ * {@link #getOffset() getOffset()} and N is the length of the string
+ * table. The element in the string table at index i-L is the
+ * value returned by {@link #toString() toString()} for the enumeration
+ * value whose integer value is i. If an integer within the above
+ * range is not used by any enumeration value, leave the corresponding table
+ * element {@code null}.
+ *
+ * The default implementation returns {@code null}. If the enumeration class
+ * (a subclass of class {@code EnumSyntax}) does not override this method to
+ * return a {@code non-null} string table, and the subclass does not
+ * override the {@link #toString() toString()} method, the base class
+ * {@link #toString() toString()} method will return just a string
* representation of this enumeration value's integer value.
+ *
* @return the string table
*/
protected String[] getStringTable() {
@@ -241,23 +245,24 @@
/**
* Returns the enumeration value table for this enumeration value's
* enumeration class. The enumeration class's integer values are assumed to
- * lie in the range L..L+N-1, where L is the
- * value returned by {@link #getOffset() getOffset()} and
- * N is the length of the enumeration value table. The element in the
- * enumeration value table at index i-L is the enumeration
- * value object whose integer value is i; the {@link #readResolve()
- * readResolve()} method needs this to preserve singleton
- * semantics during deserialization of an enumeration instance. If an
- * integer within the above range is not used by any enumeration value,
- * leave the corresponding table element null.
- *
- * The default implementation returns null. If the enumeration class (a
- * subclass of class EnumSyntax) does not override this method to return
- * a non-null enumeration value table, and the subclass does not override
- * the {@link #readResolve() readResolve()} method, the base
- * class {@link #readResolve() readResolve()} method will throw
- * an exception whenever an enumeration instance is deserialized from an
- * object input stream.
+ * lie in the range L..L+N-1, where L is the
+ * value returned by {@link #getOffset() getOffset()} and N is the
+ * length of the enumeration value table. The element in the enumeration
+ * value table at index i-L is the enumeration value object
+ * whose integer value is i; the {@link #readResolve() readResolve()}
+ * method needs this to preserve singleton semantics during deserialization
+ * of an enumeration instance. If an integer within the above range is not
+ * used by any enumeration value, leave the corresponding table element
+ * {@code null}.
+ *
+ * The default implementation returns {@code null}. If the enumeration class
+ * (a subclass of class EnumSyntax) does not override this method to return
+ * a {@code non-null} enumeration value table, and the subclass does not
+ * override the {@link #readResolve() readResolve()} method, the base class
+ * {@link #readResolve() readResolve()} method will throw an exception
+ * whenever an enumeration instance is deserialized from an object input
+ * stream.
+ *
* @return the value table
*/
protected EnumSyntax[] getEnumValueTable() {
@@ -267,14 +272,14 @@
/**
* Returns the lowest integer value used by this enumeration value's
* enumeration class.
- *
+ *
* The default implementation returns 0. If the enumeration class (a
- * subclass of class EnumSyntax) uses integer values starting at other than
- * 0, override this method in the subclass.
- * @return the offset of the lowest enumeration value.
+ * subclass of class {@code EnumSyntax}) uses integer values starting at
+ * other than 0, override this method in the subclass.
+ *
+ * @return the offset of the lowest enumeration value
*/
protected int getOffset() {
return 0;
}
-
}
diff -r 000f4e4ddd39 -r 57173ad5c534 jdk/src/java.desktop/share/classes/javax/print/attribute/HashAttributeSet.java
--- a/jdk/src/java.desktop/share/classes/javax/print/attribute/HashAttributeSet.java Fri Sep 01 14:13:40 2017 +0000
+++ b/jdk/src/java.desktop/share/classes/javax/print/attribute/HashAttributeSet.java Sat Sep 09 14:36:45 2017 +0200
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2000, 2014, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2000, 2017, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
@@ -32,37 +32,42 @@
import java.util.HashMap;
/**
- * Class HashAttributeSet provides an {@code AttributeSet}
+ * Class {@code HashAttributeSet} provides an {@code AttributeSet}
* implementation with characteristics of a hash map.
*
- * @author Alan Kaminsky
+ * @author Alan Kaminsky
*/
public class HashAttributeSet implements AttributeSet, Serializable {
+ /**
+ * Use serialVersionUID from JDK 1.4 for interoperability.
+ */
private static final long serialVersionUID = 5311560590283707917L;
/**
* The interface of which all members of this attribute set must be an
- * instance. It is assumed to be interface {@link Attribute Attribute}
- * or a subinterface thereof.
+ * instance. It is assumed to be interface {@link Attribute Attribute} or a
+ * subinterface thereof.
+ *
* @serial
*/
private Class> myInterface;
- /*
- * A HashMap used by the implementation.
- * The serialised form doesn't include this instance variable.
+ /**
+ * A {@code HashMap} used by the implementation. The serialised form doesn't
+ * include this instance variable.
*/
private transient HashMap
- * If the {@code addAll(AttributeSet)} operation throws an exception,
- * the effect on this attribute set's state is implementation dependent;
- * elements from the specified set before the point of the exception may
- * or may not have been added to this attribute set.
+ * Adds all of the elements in the specified set to this attribute. The
+ * outcome is the same as if the {@link #add(Attribute) add(Attribute)}
+ * operation had been applied to this attribute set successively with each
+ * element from the specified set. The behavior of the
+ * {@code addAll(AttributeSet)} operation is unspecified if the specified
+ * set is modified while the operation is in progress.
+ *
+ * If the {@code addAll(AttributeSet)} operation throws an exception, the
+ * effect on this attribute set's state is implementation dependent;
+ * elements from the specified set before the point of the exception may or
+ * may not have been added to this attribute set.
*
- * @param attributes whose elements are to be added to this attribute
- * set.
- *
- * @return {@code true} if this attribute set changed as a result of the
- * call.
- *
- * @throws UnmodifiableSetException
- * (Unchecked exception) Thrown if this attribute set does not
- * support the {@code addAll(AttributeSet)} method.
- * @throws NullPointerException
- * (Unchecked exception) Thrown if some element in the specified
- * set is null, or the set is null.
- *
+ * @param attributes whose elements are to be added to this attribute set
+ * @return {@code true} if this attribute set changed as a result of the
+ * call
+ * @throws UnmodifiableSetException if this attribute set does not support
+ * the {@code addAll(AttributeSet)} method
+ * @throws NullPointerException if some element in the specified set is
+ * {@code null}, or the set is {@code null}
* @see #add(Attribute)
*/
public boolean addAll(AttributeSet attributes) {
@@ -428,20 +384,21 @@
}
/**
- * Returns the number of attributes in this attribute set. If this
- * attribute set contains more than {@code Integer.MAX_VALUE} elements,
- * returns {@code Integer.MAX_VALUE}.
+ * Returns the number of attributes in this attribute set. If this attribute
+ * set contains more than {@code Integer.MAX_VALUE} elements, returns
+ * {@code Integer.MAX_VALUE}.
*
- * @return The number of attributes in this attribute set.
+ * @return the number of attributes in this attribute set
*/
public int size() {
return attrMap.size();
}
/**
+ * Returns an array of the attributes contained in this set.
*
- * @return the Attributes contained in this set as an array, zero length
- * if the AttributeSet is empty.
+ * @return the attributes contained in this set as an array, zero length if
+ * the {@code AttributeSet} is empty
*/
public Attribute[] toArray() {
Attribute []attrs = new Attribute[size()];
@@ -449,22 +406,20 @@
return attrs;
}
-
/**
* Removes all attributes from this attribute set.
*
- * @throws UnmodifiableSetException
- * (unchecked exception) Thrown if this attribute set does not support
- * the {@code clear()} operation.
+ * @throws UnmodifiableSetException if this attribute set does not support
+ * the {@code clear()} operation
*/
public void clear() {
attrMap.clear();
}
- /**
- * Returns true if this attribute set contains no attributes.
+ /**
+ * Returns {@code true} if this attribute set contains no attributes.
*
- * @return true if this attribute set contains no attributes.
+ * @return {@code true} if this attribute set contains no attributes
*/
public boolean isEmpty() {
return attrMap.isEmpty();
@@ -472,18 +427,15 @@
/**
* Compares the specified object with this attribute set for equality.
- * Returns {@code true} if the given object is also an attribute set and
- * the two attribute sets contain the same attribute category-attribute
- * value mappings. This ensures that the
- * {@code equals()} method works properly across different
- * implementations of the AttributeSet interface.
+ * Returns {@code true} if the given object is also an attribute set and the
+ * two attribute sets contain the same attribute category-attribute value
+ * mappings. This ensures that the {@code equals()} method works properly
+ * across different implementations of the {@code AttributeSet} interface.
*
- * @param object to be compared for equality with this attribute set.
- *
- * @return {@code true} if the specified object is equal to this
- * attribute set.
+ * @param object to be compared for equality with this attribute set
+ * @return {@code true} if the specified object is equal to this attribute
+ * set
*/
-
public boolean equals(Object object) {
if (object == null || !(object instanceof AttributeSet)) {
return false;
@@ -504,15 +456,14 @@
}
/**
- * Returns the hash code value for this attribute set.
- * The hash code of an attribute set is defined to be the sum
- * of the hash codes of each entry in the AttributeSet.
- * This ensures that {@code t1.equals(t2)} implies that
- * {@code t1.hashCode()==t2.hashCode()} for any two attribute sets
+ * Returns the hash code value for this attribute set. The hash code of an
+ * attribute set is defined to be the sum of the hash codes of each entry in
+ * the {@code AttributeSet}. This ensures that {@code t1.equals(t2)} implies
+ * that {@code t1.hashCode()==t2.hashCode()} for any two attribute sets
* {@code t1} and {@code t2}, as required by the general contract of
- * {@link java.lang.Object#hashCode() Object.hashCode()}.
+ * {@link Object#hashCode() Object.hashCode()}.
*
- * @return The hash code value for this attribute set.
+ * @return the hash code value for this attribute set
*/
public int hashCode() {
int hcode = 0;
@@ -522,5 +473,4 @@
}
return hcode;
}
-
}
diff -r 000f4e4ddd39 -r 57173ad5c534 jdk/src/java.desktop/share/classes/javax/print/attribute/HashDocAttributeSet.java
--- a/jdk/src/java.desktop/share/classes/javax/print/attribute/HashDocAttributeSet.java Fri Sep 01 14:13:40 2017 +0000
+++ b/jdk/src/java.desktop/share/classes/javax/print/attribute/HashDocAttributeSet.java Sat Sep 09 14:36:45 2017 +0200
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2000, 2014, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2000, 2017, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
@@ -23,22 +23,24 @@
* questions.
*/
-
package javax.print.attribute;
import java.io.Serializable;
/**
- * Class HashDocAttributeSet provides an attribute set which
- * inherits its implementation from class {@link HashAttributeSet
- * HashAttributeSet} and enforces the semantic restrictions of interface {@link
- * DocAttributeSet DocAttributeSet}.
+ * Class {@code HashDocAttributeSet} provides an attribute set which inherits
+ * its implementation from class {@link HashAttributeSet HashAttributeSet} and
+ * enforces the semantic restrictions of interface
+ * {@link DocAttributeSet DocAttributeSet}.
*
- * @author Alan Kaminsky
+ * @author Alan Kaminsky
*/
public class HashDocAttributeSet extends HashAttributeSet
implements DocAttributeSet, Serializable {
+ /**
+ * Use serialVersionUID from JDK 1.4 for interoperability.
+ */
private static final long serialVersionUID = -1128534486061432528L;
/**
@@ -49,53 +51,43 @@
}
/**
- * Construct a new hash doc attribute set,
- * initially populated with the given value.
+ * Construct a new hash doc attribute set, initially populated with the
+ * given value.
*
- * @param attribute Attribute value to add to the set.
- *
- * @exception NullPointerException
- * (unchecked exception) Thrown if {@code attribute} is null.
+ * @param attribute attribute value to add to the set
+ * @throws NullPointerException if {@code attribute} is {@code null}
*/
public HashDocAttributeSet(DocAttribute attribute) {
super (attribute, DocAttribute.class);
}
/**
- * Construct a new hash doc attribute set,
- * initially populated with the values from the given array.
- * The new attribute set is populated by
- * adding the elements of {@code attributes} array to the set in
- * sequence, starting at index 0. Thus, later array elements may replace
- * earlier array elements if the array contains duplicate attribute
- * values or attribute categories.
+ * Construct a new hash doc attribute set, initially populated with the
+ * values from the given array. The new attribute set is populated by adding
+ * the elements of {@code attributes} array to the set in sequence, starting
+ * at index 0. Thus, later array elements may replace earlier array elements
+ * if the array contains duplicate attribute values or attribute categories.
*
- * @param attributes Array of attribute values to add to the set.
- * If null, an empty attribute set is constructed.
- *
- * @exception NullPointerException
- * (unchecked exception)
- * Thrown if any element of {@code attributes} is null.
+ * @param attributes array of attribute values to add to the set. If
+ * {@code null}, an empty attribute set is constructed.
+ * @throws NullPointerException if any element of {@code attributes} is
+ * {@code null}
*/
public HashDocAttributeSet(DocAttribute[] attributes) {
super (attributes, DocAttribute.class);
}
/**
- * Construct a new attribute set, initially populated with the
- * values from the given set where the members of the attribute set
- * are restricted to the {@code DocAttribute} interface.
+ * Construct a new attribute set, initially populated with the values from
+ * the given set where the members of the attribute set are restricted to
+ * the {@code DocAttribute} interface.
*
* @param attributes set of attribute values to initialise the set. If
- * null, an empty attribute set is constructed.
- *
- * @exception ClassCastException
- * (unchecked exception) Thrown if any element of
- * {@code attributes} is not an instance of
- * {@code DocAttribute}.
+ * {@code null}, an empty attribute set is constructed.
+ * @throws ClassCastException if any element of {@code attributes} is not an
+ * instance of {@code DocAttribute}
*/
public HashDocAttributeSet(DocAttributeSet attributes) {
super(attributes, DocAttribute.class);
}
-
}
diff -r 000f4e4ddd39 -r 57173ad5c534 jdk/src/java.desktop/share/classes/javax/print/attribute/HashPrintJobAttributeSet.java
--- a/jdk/src/java.desktop/share/classes/javax/print/attribute/HashPrintJobAttributeSet.java Fri Sep 01 14:13:40 2017 +0000
+++ b/jdk/src/java.desktop/share/classes/javax/print/attribute/HashPrintJobAttributeSet.java Sat Sep 09 14:36:45 2017 +0200
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2000, 2014, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2000, 2017, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
@@ -23,22 +23,24 @@
* questions.
*/
-
package javax.print.attribute;
import java.io.Serializable;
/**
- * Class HashPrintJobAttributeSet provides an attribute set
- * which inherits its implementation from class {@link HashAttributeSet
- * HashAttributeSet} and enforces the semantic restrictions of interface
- * {@link PrintJobAttributeSet PrintJobAttributeSet}.
+ * Class {@code HashPrintJobAttributeSet} provides an attribute set which
+ * inherits its implementation from class
+ * {@link HashAttributeSet HashAttributeSet} and enforces the semantic
+ * restrictions of interface {@link PrintJobAttributeSet PrintJobAttributeSet}.
*
- * @author Alan Kaminsky
+ * @author Alan Kaminsky
*/
public class HashPrintJobAttributeSet extends HashAttributeSet
implements PrintJobAttributeSet, Serializable {
+ /**
+ * Use serialVersionUID from JDK 1.4 for interoperability.
+ */
private static final long serialVersionUID = -4204473656070350348L;
/**
@@ -49,49 +51,42 @@
}
/**
- * Construct a new hash print job attribute set,
- * initially populated with the given value.
+ * Construct a new hash print job attribute set, initially populated with
+ * the given value.
*
- * @param attribute Attribute value to add to the set.
- *
- * @exception NullPointerException
- * (unchecked exception) Thrown if {@code attribute} is null.
+ * @param attribute attribute value to add to the set
+ * @throws NullPointerException if {@code attribute} is {@code null}
*/
public HashPrintJobAttributeSet(PrintJobAttribute attribute) {
super(attribute, PrintJobAttribute.class);
}
/**
- * Construct a new hash print job attribute set,
- * initially populated with the values from the given array.
- * The new attribute set is populated
- * by adding the elements of {@code attributes} array to the set in
- * sequence, starting at index 0. Thus, later array elements may replace
- * earlier array elements if the array contains duplicate attribute
- * values or attribute categories.
+ * Construct a new hash print job attribute set, initially populated with
+ * the values from the given array. The new attribute set is populated by
+ * adding the elements of {@code attributes} array to the set in sequence,
+ * starting at index 0. Thus, later array elements may replace earlier array
+ * elements if the array contains duplicate attribute values or attribute
+ * categories.
*
- * @param attributes Array of attribute values to add to the set.
- * If null, an empty attribute set is constructed.
- *
- * @exception NullPointerException (unchecked exception)
- * Thrown if any element of {@code attributes} is null.
+ * @param attributes array of attribute values to add to the set. If
+ * {@code null}, an empty attribute set is constructed.
+ * @throws NullPointerException if any element of {@code attributes} is
+ * {@code null}
*/
public HashPrintJobAttributeSet(PrintJobAttribute[] attributes) {
super (attributes, PrintJobAttribute.class);
}
/**
- * Construct a new attribute set, initially populated with the
- * values from the given set where the members of the attribute set
- * are restricted to the {@code PrintJobAttribute} interface.
+ * Construct a new attribute set, initially populated with the values from
+ * the given set where the members of the attribute set are restricted to
+ * the {@code PrintJobAttribute} interface.
*
* @param attributes set of attribute values to initialise the set. If
- * null, an empty attribute set is constructed.
- *
- * @exception ClassCastException
- * (unchecked exception) Thrown if any element of
- * {@code attributes} is not an instance of
- * {@code PrintJobAttribute}.
+ * {@code null}, an empty attribute set is constructed.
+ * @throws ClassCastException if any element of {@code attributes} is not an
+ * instance of {@code PrintJobAttribute}
*/
public HashPrintJobAttributeSet(PrintJobAttributeSet attributes) {
super(attributes, PrintJobAttribute.class);
diff -r 000f4e4ddd39 -r 57173ad5c534 jdk/src/java.desktop/share/classes/javax/print/attribute/HashPrintRequestAttributeSet.java
--- a/jdk/src/java.desktop/share/classes/javax/print/attribute/HashPrintRequestAttributeSet.java Fri Sep 01 14:13:40 2017 +0000
+++ b/jdk/src/java.desktop/share/classes/javax/print/attribute/HashPrintRequestAttributeSet.java Sat Sep 09 14:36:45 2017 +0200
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2000, 2014, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2000, 2017, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
@@ -23,22 +23,24 @@
* questions.
*/
-
package javax.print.attribute;
import java.io.Serializable;
/**
- * Class HashPrintRequestAttributeSet inherits its implementation from
- * class {@link HashAttributeSet HashAttributeSet} and enforces the
- * semantic restrictions of interface
+ * Class {@code HashPrintRequestAttributeSet} inherits its implementation from
+ * class {@link HashAttributeSet HashAttributeSet} and enforces the semantic
+ * restrictions of interface
* {@link PrintRequestAttributeSet PrintRequestAttributeSet}.
*
- * @author Alan Kaminsky
+ * @author Alan Kaminsky
*/
public class HashPrintRequestAttributeSet extends HashAttributeSet
implements PrintRequestAttributeSet, Serializable {
+ /**
+ * Use serialVersionUID from JDK 1.4 for interoperability.
+ */
private static final long serialVersionUID = 2364756266107751933L;
/**
@@ -49,55 +51,44 @@
}
/**
- * Construct a new print request attribute set,
- * initially populated with the given value.
+ * Construct a new print request attribute set, initially populated with the
+ * given value.
*
- * @param attribute Attribute value to add to the set.
- *
- * @exception NullPointerException
- * (unchecked exception) Thrown if {@code attribute} is null.
+ * @param attribute attribute value to add to the set
+ * @throws NullPointerException if {@code attribute} is {@code null}
*/
public HashPrintRequestAttributeSet(PrintRequestAttribute attribute) {
super (attribute, PrintRequestAttribute.class);
}
/**
- * Construct a new print request attribute set, initially populated with
- * the values from the given array. The new attribute set is populated
- * by adding the elements of {@code attributes} array to the set in
- * sequence, starting at index 0. Thus, later array elements may replace
- * earlier array elements if the array contains duplicate attribute
- * values or attribute categories.
+ * Construct a new print request attribute set, initially populated with the
+ * values from the given array. The new attribute set is populated by adding
+ * the elements of {@code attributes} array to the set in sequence, starting
+ * at index 0. Thus, later array elements may replace earlier array elements
+ * if the array contains duplicate attribute values or attribute categories.
*
- * @param attributes Array of attribute values to add to the set.
- * If null, an empty attribute set is constructed.
- *
- * @exception NullPointerException
- * (unchecked exception)
- * Thrown if any element of {@code attributes} is null.
+ * @param attributes array of attribute values to add to the set. If
+ * {@code null}, an empty attribute set is constructed.
+ * @throws NullPointerException if any element of {@code attributes} is
+ * {@code null}
*/
public HashPrintRequestAttributeSet(PrintRequestAttribute[] attributes) {
super (attributes, PrintRequestAttribute.class);
}
-
/**
- * Construct a new attribute set, initially populated with the
- * values from the given set where the members of the attribute set
- * are restricted to the {@code (PrintRequestAttributeSe} interface.
+ * Construct a new attribute set, initially populated with the values from
+ * the given set where the members of the attribute set are restricted to
+ * the {@code (PrintRequestAttributeSe} interface.
*
* @param attributes set of attribute values to initialise the set. If
- * null, an empty attribute set is constructed.
- *
- * @exception ClassCastException
- * (unchecked exception) Thrown if any element of
- * {@code attributes} is not an instance of
- * {@code (PrintRequestAttributeSe}.
+ * {@code null}, an empty attribute set is constructed.
+ * @throws ClassCastException if any element of {@code attributes} is not an
+ * instance of {@code PrintRequestAttributeSe}
*/
public HashPrintRequestAttributeSet(PrintRequestAttributeSet attributes)
{
super(attributes, PrintRequestAttribute.class);
}
-
-
}
diff -r 000f4e4ddd39 -r 57173ad5c534 jdk/src/java.desktop/share/classes/javax/print/attribute/HashPrintServiceAttributeSet.java
--- a/jdk/src/java.desktop/share/classes/javax/print/attribute/HashPrintServiceAttributeSet.java Fri Sep 01 14:13:40 2017 +0000
+++ b/jdk/src/java.desktop/share/classes/javax/print/attribute/HashPrintServiceAttributeSet.java Sat Sep 09 14:36:45 2017 +0200
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2000, 2014, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2000, 2017, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
@@ -28,16 +28,20 @@
import java.io.Serializable;
/**
- * Class HashPrintServiceAttributeSet provides an attribute set
- * which inherits its implementation from class {@link HashAttributeSet
- * HashAttributeSet} and enforces the semantic restrictions of interface
+ * Class {@code HashPrintServiceAttributeSet} provides an attribute set which
+ * inherits its implementation from class
+ * {@link HashAttributeSet HashAttributeSet} and enforces the semantic
+ * restrictions of interface
* {@link PrintServiceAttributeSet PrintServiceAttributeSet}.
*
- * @author Alan Kaminsky
+ * @author Alan Kaminsky
*/
public class HashPrintServiceAttributeSet extends HashAttributeSet
implements PrintServiceAttributeSet, Serializable {
+ /**
+ * Use serialVersionUID from JDK 1.4 for interoperability.
+ */
private static final long serialVersionUID = 6642904616179203070L;
/**
@@ -47,52 +51,42 @@
super (PrintServiceAttribute.class);
}
-
/**
- * Construct a new hash print service attribute set,
- * initially populated with the given value.
+ * Construct a new hash print service attribute set, initially populated
+ * with the given value.
*
- * @param attribute Attribute value to add to the set.
- *
- * @exception NullPointerException
- * (unchecked exception) Thrown if {@code attribute} is null.
+ * @param attribute attribute value to add to the set
+ * @throws NullPointerException if {@code attribute} is {@code null}
*/
public HashPrintServiceAttributeSet(PrintServiceAttribute attribute) {
super (attribute, PrintServiceAttribute.class);
}
/**
- * Construct a new print service attribute set, initially populated with
- * the values from the given array. The new attribute set is populated
- * by adding the elements of {@code attributes} array to the set in
- * sequence, starting at index 0. Thus, later array elements may replace
- * earlier array elements if the array contains duplicate attribute
- * values or attribute categories.
+ * Construct a new print service attribute set, initially populated with the
+ * values from the given array. The new attribute set is populated by adding
+ * the elements of {@code attributes} array to the set in sequence, starting
+ * at index 0. Thus, later array elements may replace earlier array elements
+ * if the array contains duplicate attribute values or attribute categories.
*
- * @param attributes Array of attribute values to add to the set.
- * If null, an empty attribute set is constructed.
- *
- * @exception NullPointerException
- * (unchecked exception)
- * Thrown if any element of {@code attributes} is null.
+ * @param attributes array of attribute values to add to the set. If
+ * {@code null}, an empty attribute set is constructed.
+ * @throws NullPointerException if any element of {@code attributes} is
+ * {@code null}
*/
public HashPrintServiceAttributeSet(PrintServiceAttribute[] attributes) {
super (attributes, PrintServiceAttribute.class);
}
-
/**
- * Construct a new attribute set, initially populated with the
- * values from the given set where the members of the attribute set
- * are restricted to the {@code PrintServiceAttribute} interface.
+ * Construct a new attribute set, initially populated with the values from
+ * the given set where the members of the attribute set are restricted to
+ * the {@code PrintServiceAttribute} interface.
*
* @param attributes set of attribute values to initialise the set. If
- * null, an empty attribute set is constructed.
- *
- * @exception ClassCastException
- * (unchecked exception) Thrown if any element of
- * {@code attributes} is not an instance of
- * {@code PrintServiceAttribute}.
+ * {@code null}, an empty attribute set is constructed.
+ * @throws ClassCastException if any element of {@code attributes} is not an
+ * instance of {@code PrintServiceAttribute}
*/
public HashPrintServiceAttributeSet(PrintServiceAttributeSet attributes)
{
diff -r 000f4e4ddd39 -r 57173ad5c534 jdk/src/java.desktop/share/classes/javax/print/attribute/IntegerSyntax.java
--- a/jdk/src/java.desktop/share/classes/javax/print/attribute/IntegerSyntax.java Fri Sep 01 14:13:40 2017 +0000
+++ b/jdk/src/java.desktop/share/classes/javax/print/attribute/IntegerSyntax.java Sat Sep 09 14:36:45 2017 +0200
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2000, 2014, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2000, 2017, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
@@ -28,25 +28,28 @@
import java.io.Serializable;
/**
- * Class IntegerSyntax is an abstract base class providing the common
+ * Class {@code IntegerSyntax} is an abstract base class providing the common
* implementation of all attributes with integer values.
- *
+ *
* Under the hood, an integer attribute is just an integer. You can get an
- * integer attribute's integer value by calling {@link #getValue()
- * getValue()}. An integer attribute's integer value is
- * established when it is constructed (see {@link #IntegerSyntax(int)
- * IntegerSyntax(int)}). Once constructed, an integer attribute's
- * value is immutable.
+ * integer attribute's integer value by calling {@link #getValue() getValue()}.
+ * An integer attribute's integer value is established when it is constructed
+ * (see {@link #IntegerSyntax(int) IntegerSyntax(int)}). Once constructed, an
+ * integer attribute's value is immutable.
*
- * @author David Mendenhall
- * @author Alan Kaminsky
+ * @author David Mendenhall
+ * @author Alan Kaminsky
*/
public abstract class IntegerSyntax implements Serializable, Cloneable {
+ /**
+ * Use serialVersionUID from JDK 1.4 for interoperability.
+ */
private static final long serialVersionUID = 3644574816328081943L;
/**
* This integer attribute's integer value.
+ *
* @serial
*/
private int value;
@@ -54,7 +57,7 @@
/**
* Construct a new integer attribute with the given integer value.
*
- * @param value Integer value.
+ * @param value Integer value
*/
protected IntegerSyntax(int value) {
this.value = value;
@@ -64,14 +67,11 @@
* Construct a new integer attribute with the given integer value, which
* must lie within the given range.
*
- * @param value Integer value.
- * @param lowerBound Lower bound.
- * @param upperBound Upper bound.
- *
- * @exception IllegalArgumentException
- * (Unchecked exception) Thrown if {@code value} is less than
- * {@code lowerBound} or greater than
- * {@code upperBound}.
+ * @param value Integer value
+ * @param lowerBound Lower bound
+ * @param upperBound Upper bound
+ * @throws IllegalArgumentException if {@code value} is less than
+ * {@code lowerBound} or greater than {@code upperBound}
*/
protected IntegerSyntax(int value, int lowerBound, int upperBound) {
if (lowerBound > value || value > upperBound) {
@@ -84,6 +84,7 @@
/**
* Returns this integer attribute's integer value.
+ *
* @return the integer value
*/
public int getValue() {
@@ -93,20 +94,16 @@
/**
* Returns whether this integer attribute is equivalent to the passed in
* object. To be equivalent, all of the following conditions must be true:
- *
- * A PrintJobAttributeSet is just an {@link AttributeSet AttributeSet} whose
- * constructors and mutating operations guarantee an additional invariant,
- * namely that all attribute values in the PrintJobAttributeSet must be
- * instances of interface {@link PrintJobAttribute PrintJobAttribute}.
- * The {@link #add(Attribute) add(Attribute)}, and
- * {@link #addAll(AttributeSet) >addAll(AttributeSet)} operations
- * are respecified below to guarantee this additional invariant.
+ * Interface {@code PrintJobAttributeSet} specifies the interface for a set of
+ * print job attributes, i.e. printing attributes that implement interface
+ * {@link PrintJobAttribute PrintJobAttribute}. In the Print Service API, a
+ * service uses a {@code PrintJobAttributeSet} to report the status of a print
+ * job.
+ *
+ * A {@code PrintJobAttributeSet} is just an {@link AttributeSet AttributeSet}
+ * whose constructors and mutating operations guarantee an additional invariant,
+ * namely that all attribute values in the {@code PrintJobAttributeSet} must be
+ * instances of interface {@link PrintJobAttribute PrintJobAttribute}. The
+ * {@link #add(Attribute) add(Attribute)}, and
+ * {@link #addAll(AttributeSet) addAll(AttributeSet)} operations are respecified
+ * below to guarantee this additional invariant.
*
- * @author Alan Kaminsky
+ * @author Alan Kaminsky
*/
public interface PrintJobAttributeSet extends AttributeSet {
/**
* Adds the specified attribute value to this attribute set if it is not
- * already present, first removing any existing value in the same
- * attribute category as the specified attribute value (optional
- * operation).
- *
- * @param attribute Attribute value to be added to this attribute set.
- *
- * @return {@code true} if this attribute set changed as a result of
- * the call, i.e., the given attribute value was not already a
- * member of this attribute set.
+ * already present, first removing any existing value in the same attribute
+ * category as the specified attribute value (optional operation).
*
- * @throws UnmodifiableSetException
- * (unchecked exception) Thrown if this attribute set does not
- * support the {@code add()} operation.
- * @throws ClassCastException
- * (unchecked exception) Thrown if the {@code attribute} is
- * not an instance of interface
- * {@link PrintJobAttribute PrintJobAttribute}.
- * @throws NullPointerException
- * (unchecked exception) Thrown if the {@code attribute} is null.
+ * @param attribute attribute value to be added to this attribute set
+ * @return {@code true} if this attribute set changed as a result of the
+ * call, i.e., the given attribute value was not already a member of
+ * this attribute set
+ * @throws UnmodifiableSetException if this attribute set does not support
+ * the {@code add()} operation
+ * @throws ClassCastException if the {@code attribute} is not an instance of
+ * interface {@link PrintJobAttribute PrintJobAttribute}
+ * @throws NullPointerException if the {@code attribute} is {@code null}
*/
public boolean add(Attribute attribute);
/**
- * Adds all of the elements in the specified set to this attribute.
- * The outcome is the same as if the
- * {@link #add(Attribute) add(Attribute)}
- * operation had been applied to this attribute set successively with
- * each element from the specified set. If none of the categories in the
- * specified set are the same as any categories in this attribute set,
- * the {@code addAll()} operation effectively modifies this attribute
- * set so that its value is the union of the two sets.
- *
- * The behavior of the {@code addAll()} operation is unspecified if
- * the specified set is modified while the operation is in progress.
- *
- * If the {@code addAll()} operation throws an exception, the effect
- * on this attribute set's state is implementation dependent; elements
- * from the specified set before the point of the exception may or
- * may not have been added to this attribute set.
+ * Adds all of the elements in the specified set to this attribute. The
+ * outcome is the same as if the {@link #add(Attribute) add(Attribute)}
+ * operation had been applied to this attribute set successively with each
+ * element from the specified set. If none of the categories in the
+ * specified set are the same as any categories in this attribute set, the
+ * {@code addAll()} operation effectively modifies this attribute set so
+ * that its value is the union of the two sets.
+ *
+ * The behavior of the {@code addAll()} operation is unspecified if the
+ * specified set is modified while the operation is in progress.
+ *
+ * If the {@code addAll()} operation throws an exception, the effect on this
+ * attribute set's state is implementation dependent; elements from the
+ * specified set before the point of the exception may or may not have been
+ * added to this attribute set.
*
- * @param attributes whose elements are to be added to this attribute
- * set.
- *
- * @return {@code true} if this attribute set changed as a result of
- * the call.
- *
- * @throws UnmodifiableSetException
- * (Unchecked exception) Thrown if this attribute set does not
- * support the {@code addAll()} method.
- * @throws ClassCastException
- * (Unchecked exception) Thrown if some element in the specified
- * set is not an instance of interface {@link PrintJobAttribute
- * PrintJobAttribute}.
- * @throws NullPointerException
- * (Unchecked exception) Thrown if the specified set is null.
- *
+ * @param attributes whose elements are to be added to this attribute set
+ * @return {@code true} if this attribute set changed as a result of the
+ * call
+ * @throws UnmodifiableSetException if this attribute set does not support
+ * the {@code addAll()} method
+ * @throws ClassCastException if some element in the specified set is not an
+ * instance of interface {@link PrintJobAttribute PrintJobAttribute}
+ * @throws NullPointerException if the specified set is {@code null}
* @see #add(Attribute)
*/
public boolean addAll(AttributeSet attributes);
diff -r 000f4e4ddd39 -r 57173ad5c534 jdk/src/java.desktop/share/classes/javax/print/attribute/PrintRequestAttribute.java
--- a/jdk/src/java.desktop/share/classes/javax/print/attribute/PrintRequestAttribute.java Fri Sep 01 14:13:40 2017 +0000
+++ b/jdk/src/java.desktop/share/classes/javax/print/attribute/PrintRequestAttribute.java Sat Sep 09 14:36:45 2017 +0200
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2000, 2014, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2000, 2017, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
@@ -23,28 +23,25 @@
* questions.
*/
-
package javax.print.attribute;
/**
- * Interface PrintRequestAttribute is a tagging interface which a printing
- * attribute class implements to indicate the attribute denotes a
+ * Interface {@code PrintRequestAttribute} is a tagging interface which a
+ * printing attribute class implements to indicate the attribute denotes a
* requested setting for a print job.
*
- * Attributes which are tagged with PrintRequestAttribute and are also tagged
- * as PrintJobAttribute, represent the subset of job attributes which
- * can be part of the specification of a job request.
+ * Attributes which are tagged with {@code PrintRequestAttribute} and are also
+ * tagged as {@code PrintJobAttribute}, represent the subset of job attributes
+ * which can be part of the specification of a job request.
*
- * If an attribute implements {@link DocAttribute DocAttribute}
- * as well as PrintRequestAttribute, the client may include the
- * attribute in a {@code Doc}'s attribute set to specify
- * a job setting which pertains just to that doc.
+ * If an attribute implements {@link DocAttribute DocAttribute} as well as
+ * {@code PrintRequestAttribute}, the client may include the attribute in a
+ * {@code Doc}'s attribute set to specify a job setting which pertains just to
+ * that doc.
*
+ * @author Alan Kaminsky
* @see DocAttributeSet
* @see PrintRequestAttributeSet
- *
- * @author Alan Kaminsky
*/
-
public interface PrintRequestAttribute extends Attribute {
}
diff -r 000f4e4ddd39 -r 57173ad5c534 jdk/src/java.desktop/share/classes/javax/print/attribute/PrintRequestAttributeSet.java
--- a/jdk/src/java.desktop/share/classes/javax/print/attribute/PrintRequestAttributeSet.java Fri Sep 01 14:13:40 2017 +0000
+++ b/jdk/src/java.desktop/share/classes/javax/print/attribute/PrintRequestAttributeSet.java Sat Sep 09 14:36:45 2017 +0200
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2000, 2014, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2000, 2017, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
@@ -23,88 +23,72 @@
* questions.
*/
-
package javax.print.attribute;
/**
- * Interface PrintRequestAttributeSet specifies the interface for a set of
- * print request attributes, i.e. printing attributes that implement interface
- * {@link PrintRequestAttribute PrintRequestAttribute}.
- * The client uses a PrintRequestAttributeSet to specify the settings to be
- * applied to a whole print job and to all the docs in the print job.
- *
- * PrintRequestAttributeSet is just an {@link AttributeSet AttributeSet} whose
- * constructors and mutating operations guarantee an additional invariant,
- * namely that all attribute values in the PrintRequestAttributeSet must be
- * instances of interface {@link PrintRequestAttribute PrintRequestAttribute}.
- * The {@link #add(Attribute) add(Attribute)}, and
- * {@link #addAll(AttributeSet) addAll(AttributeSet)} operations
- * are respecified below to guarantee this additional invariant.
+ * Interface {@code PrintRequestAttributeSet} specifies the interface for a set
+ * of print request attributes, i.e. printing attributes that implement
+ * interface {@link PrintRequestAttribute PrintRequestAttribute}. The client
+ * uses a {@code PrintRequestAttributeSet} to specify the settings to be applied
+ * to a whole print job and to all the docs in the print job.
+ *
+ * {@code PrintRequestAttributeSet} is just an {@link AttributeSet AttributeSet}
+ * whose constructors and mutating operations guarantee an additional invariant,
+ * namely that all attribute values in the {@code PrintRequestAttributeSet} must
+ * be instances of interface
+ * {@link PrintRequestAttribute PrintRequestAttribute}. The
+ * {@link #add(Attribute) add(Attribute)}, and
+ * {@link #addAll(AttributeSet) addAll(AttributeSet)} operations are respecified
+ * below to guarantee this additional invariant.
*
- * @author Alan Kaminsky
+ * @author Alan Kaminsky
*/
public interface PrintRequestAttributeSet extends AttributeSet {
/**
* Adds the specified attribute value to this attribute set if it is not
- * already present, first removing any existing value in the same
- * attribute category as the specified attribute value (optional
- * operation).
- *
- * @param attribute Attribute value to be added to this attribute set.
- *
- * @return {@code true} if this attribute set changed as a result of
- * the call, i.e., the given attribute value was not already a
- * member of this attribute set.
+ * already present, first removing any existing value in the same attribute
+ * category as the specified attribute value (optional operation).
*
- * @throws UnmodifiableSetException
- * (unchecked exception) Thrown if this attribute set does not
- * support the {@code add()} operation.
- * @throws ClassCastException
- * (unchecked exception) Thrown if the {@code attribute} is
- * not an instance of interface
- * {@link PrintRequestAttribute PrintRequestAttribute}.
- * @throws NullPointerException
- * (unchecked exception) Thrown if the {@code attribute} is null.
+ * @param attribute attribute value to be added to this attribute set
+ * @return {@code true} if this attribute set changed as a result of the
+ * call, i.e., the given attribute value was not already a member of
+ * this attribute set
+ * @throws UnmodifiableSetException if this attribute set does not support
+ * the {@code add()} operation
+ * @throws ClassCastException if the {@code attribute} is not an instance of
+ * interface {@link PrintRequestAttribute PrintRequestAttribute}
+ * @throws NullPointerException if the {@code attribute} is {@code null}
*/
public boolean add(Attribute attribute);
/**
- * Adds all of the elements in the specified set to this attribute.
- * The outcome is the same as if the
- * {@link #add(Attribute) add(Attribute)}
- * operation had been applied to this attribute set successively with
- * each element from the specified set. If none of the categories in the
- * specified set are the same as any categories in this attribute set,
- * the {@code addAll()} operation effectively modifies this attribute
- * set so that its value is the union of the two sets.
- *
- * The behavior of the {@code addAll()} operation is unspecified if
- * the specified set is modified while the operation is in progress.
- *
- * If the {@code addAll()} operation throws an exception, the effect
- * on this attribute set's state is implementation dependent; elements
- * from the specified set before the point of the exception may or
- * may not have been added to this attribute set.
+ * Adds all of the elements in the specified set to this attribute. The
+ * outcome is the same as if the {@link #add(Attribute) add(Attribute)}
+ * operation had been applied to this attribute set successively with each
+ * element from the specified set. If none of the categories in the
+ * specified set are the same as any categories in this attribute set, the
+ * {@code addAll()} operation effectively modifies this attribute set so
+ * that its value is the union of the two sets.
+ *
+ * The behavior of the {@code addAll()} operation is unspecified if the
+ * specified set is modified while the operation is in progress.
+ *
+ * If the {@code addAll()} operation throws an exception, the effect on this
+ * attribute set's state is implementation dependent; elements from the
+ * specified set before the point of the exception may or may not have been
+ * added to this attribute set.
*
- * @param attributes whose elements are to be added to this attribute
- * set.
- *
- * @return {@code true} if this attribute set changed as a result of
- * the call.
- *
- * @throws UnmodifiableSetException
- * (Unchecked exception) Thrown if this attribute set does not
- * support the {@code addAll()} method.
- * @throws ClassCastException
- * (Unchecked exception) Thrown if some element in the specified
- * set is not an instance of interface {@link PrintRequestAttribute
- * PrintRequestAttribute}.
- * @throws NullPointerException
- * (Unchecked exception) Thrown if the specified set is null.
- *
+ * @param attributes whose elements are to be added to this attribute set
+ * @return {@code true} if this attribute set changed as a result of the
+ * call
+ * @throws UnmodifiableSetException if this attribute set does not support
+ * the {@code addAll()} method
+ * @throws ClassCastException if some element in the specified set is not an
+ * instance of interface
+ * {@link PrintRequestAttribute PrintRequestAttribute}
+ * @throws NullPointerException if the specified set is {@code null}
* @see #add(Attribute)
*/
public boolean addAll(AttributeSet attributes);
-
}
diff -r 000f4e4ddd39 -r 57173ad5c534 jdk/src/java.desktop/share/classes/javax/print/attribute/PrintServiceAttribute.java
--- a/jdk/src/java.desktop/share/classes/javax/print/attribute/PrintServiceAttribute.java Fri Sep 01 14:13:40 2017 +0000
+++ b/jdk/src/java.desktop/share/classes/javax/print/attribute/PrintServiceAttribute.java Sat Sep 09 14:36:45 2017 +0200
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2000, 2014, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2000, 2017, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
@@ -26,15 +26,14 @@
package javax.print.attribute;
/**
- * Interface PrintServiceAttribute is a tagging interface which a printing
- * attribute class implements to indicate the attribute describes the status
- * of a Print Service or some other characteristic of a Print Service. A Print
- * Service instance adds a number of PrintServiceAttributes to a Print
- * service's attribute set to report the Print Service's status.
+ * Interface {@code PrintServiceAttribute} is a tagging interface which a
+ * printing attribute class implements to indicate the attribute describes the
+ * status of a Print Service or some other characteristic of a Print Service. A
+ * Print Service instance adds a number of {@code PrintServiceAttributes} to a
+ * Print service's attribute set to report the Print Service's status.
*
+ * @author Alan Kaminsky
* @see PrintServiceAttributeSet
- *
- * @author Alan Kaminsky
*/
public interface PrintServiceAttribute extends Attribute {
}
diff -r 000f4e4ddd39 -r 57173ad5c534 jdk/src/java.desktop/share/classes/javax/print/attribute/PrintServiceAttributeSet.java
--- a/jdk/src/java.desktop/share/classes/javax/print/attribute/PrintServiceAttributeSet.java Fri Sep 01 14:13:40 2017 +0000
+++ b/jdk/src/java.desktop/share/classes/javax/print/attribute/PrintServiceAttributeSet.java Sat Sep 09 14:36:45 2017 +0200
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2000, 2014, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2000, 2017, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
@@ -23,90 +23,71 @@
* questions.
*/
-
package javax.print.attribute;
/**
- * Interface PrintServiceAttributeSet specifies the interface for a set of
- * print job attributes, i.e. printing attributes that implement interface
- * {@link
- * PrintServiceAttribute PrintServiceAttribute}. In the Print Service API,
- * the Print Service instance uses a PrintServiceAttributeSet to report the
- * status of the print service.
- *
- * A PrintServiceAttributeSet is just an {@link AttributeSet AttributeSet}
- * whose constructors and mutating operations guarantee an additional
- * invariant,
- * namely that all attribute values in the PrintServiceAttributeSet must be
- * instances of interface {@link PrintServiceAttribute PrintServiceAttribute}.
- * The {@link #add(Attribute) add(Attribute)}, and
- * {@link #addAll(AttributeSet) addAll(AttributeSet)} operations
- * are respecified below to guarantee this additional invariant.
+ * Interface {@code PrintServiceAttributeSet} specifies the interface for a set
+ * of print job attributes, i.e. printing attributes that implement interface
+ * {@link PrintServiceAttribute PrintServiceAttribute}. In the Print Service
+ * API, the Print Service instance uses a {@code PrintServiceAttributeSet} to
+ * report the status of the print service.
+ *
+ * A {@code PrintServiceAttributeSet} is just an
+ * {@link AttributeSet AttributeSet} whose constructors and mutating operations
+ * guarantee an additional invariant, namely that all attribute values in the
+ * {@code PrintServiceAttributeSet} must be instances of interface
+ * {@link PrintServiceAttribute PrintServiceAttribute}. The
+ * {@link #add(Attribute) add(Attribute)}, and
+ * {@link #addAll(AttributeSet) addAll(AttributeSet)} operations are respecified
+ * below to guarantee this additional invariant.
*
- * @author Alan Kaminsky
+ * @author Alan Kaminsky
*/
public interface PrintServiceAttributeSet extends AttributeSet {
-
-
/**
* Adds the specified attribute value to this attribute set if it is not
- * already present, first removing any existing value in the same
- * attribute category as the specified attribute value (optional
- * operation).
- *
- * @param attribute Attribute value to be added to this attribute set.
- *
- * @return {@code true} if this attribute set changed as a result of
- * the call, i.e., the given attribute value was not already a
- * member of this attribute set.
+ * already present, first removing any existing value in the same attribute
+ * category as the specified attribute value (optional operation).
*
- * @throws UnmodifiableSetException
- * (unchecked exception) Thrown if this attribute set does not
- * support the {@code add()} operation.
- * @throws ClassCastException
- * (unchecked exception) Thrown if the {@code attribute} is
- * not an instance of interface
- * {@link PrintServiceAttribute PrintServiceAttribute}.
- * @throws NullPointerException
- * (unchecked exception) Thrown if the {@code attribute} is null.
+ * @param attribute attribute value to be added to this attribute set
+ * @return {@code true} if this attribute set changed as a result of the
+ * call, i.e., the given attribute value was not already a member of
+ * this attribute set
+ * @throws UnmodifiableSetException if this attribute set does not support
+ * the {@code add()} operation
+ * @throws ClassCastException if the {@code attribute} is not an instance of
+ * interface {@link PrintServiceAttribute PrintServiceAttribute}
+ * @throws NullPointerException if the {@code attribute} is {@code null}
*/
public boolean add(Attribute attribute);
/**
- * Adds all of the elements in the specified set to this attribute.
- * The outcome is the same as if the
- * {@link #add(Attribute) add(Attribute)}
- * operation had been applied to this attribute set successively with
- * each element from the specified set. If none of the categories in the
- * specified set are the same as any categories in this attribute set,
- * the {@code addAll()} operation effectively modifies this attribute
- * set so that its value is the union of the two sets.
- *
- * The behavior of the {@code addAll()} operation is unspecified if
- * the specified set is modified while the operation is in progress.
- *
- * If the {@code addAll()} operation throws an exception, the effect
- * on this attribute set's state is implementation dependent; elements
- * from the specified set before the point of the exception may or
- * may not have been added to this attribute set.
+ * Adds all of the elements in the specified set to this attribute. The
+ * outcome is the same as if the {@link #add(Attribute) add(Attribute)}
+ * operation had been applied to this attribute set successively with each
+ * element from the specified set. If none of the categories in the
+ * specified set are the same as any categories in this attribute set, the
+ * {@code addAll()} operation effectively modifies this attribute set so
+ * that its value is the union of the two sets.
+ *
+ * The behavior of the {@code addAll()} operation is unspecified if the
+ * specified set is modified while the operation is in progress.
+ *
+ * If the {@code addAll()} operation throws an exception, the effect on this
+ * attribute set's state is implementation dependent; elements from the
+ * specified set before the point of the exception may or may not have been
+ * added to this attribute set.
*
- * @param attributes whose elements are to be added to this attribute
- * set.
- *
- * @return {@code true} if this attribute set changed as a result of
- * the call.
- *
- * @throws UnmodifiableSetException
- * (Unchecked exception) Thrown if this attribute set does not
- * support the {@code addAll()} method.
- * @throws ClassCastException
- * (Unchecked exception) Thrown if some element in the specified
- * set is not an instance of interface {@link PrintServiceAttribute
- * PrintServiceAttribute}.
- * @throws NullPointerException
- * (Unchecked exception) Thrown if the specified set is null.
- *
+ * @param attributes whose elements are to be added to this attribute set
+ * @return {@code true} if this attribute set changed as a result of the
+ * call
+ * @throws UnmodifiableSetException if this attribute set does not support
+ * the {@code addAll()} method
+ * @throws ClassCastException if some element in the specified set is not an
+ * instance of interface
+ * {@link PrintServiceAttribute PrintServiceAttribute}
+ * @throws NullPointerException if the specified set is {@code null}
* @see #add(Attribute)
*/
public boolean addAll(AttributeSet attributes);
diff -r 000f4e4ddd39 -r 57173ad5c534 jdk/src/java.desktop/share/classes/javax/print/attribute/ResolutionSyntax.java
--- a/jdk/src/java.desktop/share/classes/javax/print/attribute/ResolutionSyntax.java Fri Sep 01 14:13:40 2017 +0000
+++ b/jdk/src/java.desktop/share/classes/javax/print/attribute/ResolutionSyntax.java Sat Sep 09 14:36:45 2017 +0200
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2000, 2014, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2000, 2017, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
@@ -23,29 +23,27 @@
* questions.
*/
-
package javax.print.attribute;
import java.io.Serializable;
/**
- * Class ResolutionSyntax is an abstract base class providing the common
+ * Class {@code ResolutionSyntax} is an abstract base class providing the common
* implementation of all attributes denoting a printer resolution.
- *
+ *
* A resolution attribute's value consists of two items, the cross feed
* direction resolution and the feed direction resolution. A resolution
* attribute may be constructed by supplying the two values and indicating the
* units in which the values are measured. Methods are provided to return a
* resolution attribute's values, indicating the units in which the values are
* to be returned. The two most common resolution units are dots per inch (dpi)
- * and dots per centimeter (dpcm), and exported constants {@link #DPI
- * DPI} and {@link #DPCM DPCM} are provided for
- * indicating those units.
- *
+ * and dots per centimeter (dpcm), and exported constants {@link #DPI DPI} and
+ * {@link #DPCM DPCM} are provided for indicating those units.
+ *
* Once constructed, a resolution attribute's value is immutable.
- *
- * Design
- *
+ *
+ * Design
+ *
* A resolution attribute's cross feed direction resolution and feed direction
* resolution values are stored internally using units of dots per 100 inches
* (dphi). Storing the values in dphi rather than, say, metric units allows
@@ -57,43 +55,47 @@
* resolution attribute's values are created in one units and retrieved in
* different units; for example, 600 dpi will be rounded to 236 dpcm, whereas
* the true value (to five figures) is 236.22 dpcm.
- *
+ *
* Storing the values internally in common units of dphi lets two resolution
* attributes be compared without regard to the units in which they were
* created; for example, 300 dpcm will compare equal to 762 dpi, as they both
- * are stored as 76200 dphi. In particular, a lookup service can
- * match resolution attributes based on equality of their serialized
- * representations regardless of the units in which they were created. Again,
- * using integers for internal storage allows precise equality comparisons to be
- * done, which would not be guaranteed if a floating point representation were
- * used.
- *
- * The exported constant {@link #DPI DPI} is actually the
- * conversion factor by which to multiply a value in dpi to get the value in
- * dphi. Likewise, the exported constant {@link #DPCM DPCM} is the
- * conversion factor by which to multiply a value in dpcm to get the value in
- * dphi. A client can specify a resolution value in units other than dpi or dpcm
- * by supplying its own conversion factor. However, since the internal units of
- * dphi was chosen with supporting only the external units of dpi and dpcm in
- * mind, there is no guarantee that the conversion factor for the client's units
- * will be an exact integer. If the conversion factor isn't an exact integer,
- * resolution values in the client's units won't be stored precisely.
+ * are stored as 76200 dphi. In particular, a lookup service can match
+ * resolution attributes based on equality of their serialized representations
+ * regardless of the units in which they were created. Again, using integers for
+ * internal storage allows precise equality comparisons to be done, which would
+ * not be guaranteed if a floating point representation were used.
+ *
+ * The exported constant {@link #DPI DPI} is actually the conversion factor by
+ * which to multiply a value in dpi to get the value in dphi. Likewise, the
+ * exported constant {@link #DPCM DPCM} is the conversion factor by which to
+ * multiply a value in dpcm to get the value in dphi. A client can specify a
+ * resolution value in units other than dpi or dpcm by supplying its own
+ * conversion factor. However, since the internal units of dphi was chosen with
+ * supporting only the external units of dpi and dpcm in mind, there is no
+ * guarantee that the conversion factor for the client's units will be an exact
+ * integer. If the conversion factor isn't an exact integer, resolution values
+ * in the client's units won't be stored precisely.
*
- * @author David Mendenhall
- * @author Alan Kaminsky
+ * @author David Mendenhall
+ * @author Alan Kaminsky
*/
public abstract class ResolutionSyntax implements Serializable, Cloneable {
+ /**
+ * Use serialVersionUID from JDK 1.4 for interoperability.
+ */
private static final long serialVersionUID = 2706743076526672017L;
/**
* Cross feed direction resolution in units of dots per 100 inches (dphi).
+ *
* @serial
*/
private int crossFeedResolution;
/**
* Feed direction resolution in units of dots per 100 inches (dphi).
+ *
* @serial
*/
private int feedResolution;
@@ -105,26 +107,20 @@
public static final int DPI = 100;
/**
- * Value to indicate units of dots per centimeter (dpcm). It is actually
- * the conversion factor by which to multiply dpcm to yield dphi (254).
+ * Value to indicate units of dots per centimeter (dpcm). It is actually the
+ * conversion factor by which to multiply dpcm to yield dphi (254).
*/
public static final int DPCM = 254;
-
/**
* Construct a new resolution attribute from the given items.
*
- * @param crossFeedResolution
- * Cross feed direction resolution.
- * @param feedResolution
- * Feed direction resolution.
- * @param units
- * Unit conversion factor, e.g. {@link #DPI DPI} or
- * {@link #DPCM DPCM}.
- *
- * @exception IllegalArgumentException
- * (unchecked exception) Thrown if {@code crossFeedResolution < 1}
- * or {@code feedResolution < 1} or {@code units < 1}.
+ * @param crossFeedResolution cross feed direction resolution
+ * @param feedResolution feed direction resolution
+ * @param units unit conversion factor, e.g. {@link #DPI DPI} or
+ * {@link #DPCM DPCM}
+ * @throws IllegalArgumentException if {@code crossFeedResolution < 1} or
+ * {@code feedResolution < 1} or {@code units < 1}
*/
public ResolutionSyntax(int crossFeedResolution, int feedResolution,
int units) {
@@ -147,16 +143,11 @@
* Convert a value from dphi to some other units. The result is rounded to
* the nearest integer.
*
- * @param dphi
- * Value (dphi) to convert.
- * @param units
- * Unit conversion factor, e.g. {@link #DPI DPI} or
- * {@link #DPCM DPCM}.
- *
- * @return The value of {@code dphi} converted to the desired units.
- *
- * @exception IllegalArgumentException
- * (unchecked exception) Thrown if {@code units} < 1.
+ * @param dphi value (dphi) to convert
+ * @param units unit conversion factor, e.g. {@link #DPI DPI} or
+ * {@link #DPCM DPCM}
+ * @return the value of {@code dphi} converted to the desired units
+ * @throws IllegalArgumentException if {@code units < 1}
*/
private static int convertFromDphi(int dphi, int units) {
if (units < 1) {
@@ -167,18 +158,14 @@
}
/**
- * Get this resolution attribute's resolution values in the given units.
- * The values are rounded to the nearest integer.
+ * Get this resolution attribute's resolution values in the given units. The
+ * values are rounded to the nearest integer.
*
- * @param units
- * Unit conversion factor, e.g. {@link #DPI DPI} or
- * {@link #DPCM DPCM}.
- *
- * @return A two-element array with the cross feed direction resolution
- * at index 0 and the feed direction resolution at index 1.
- *
- * @exception IllegalArgumentException
- * (unchecked exception) Thrown if {@code units < 1}.
+ * @param units unit conversion factor, e.g. {@link #DPI DPI} or
+ * {@link #DPCM DPCM}
+ * @return a two-element array with the cross feed direction resolution at
+ * index 0 and the feed direction resolution at index 1
+ * @throws IllegalArgumentException if {@code units < 1}
*/
public int[] getResolution(int units) {
return new int[] { getCrossFeedResolution(units),
@@ -190,14 +177,10 @@
* Returns this resolution attribute's cross feed direction resolution in
* the given units. The value is rounded to the nearest integer.
*
- * @param units
- * Unit conversion factor, e.g. {@link #DPI DPI} or
- * {@link #DPCM DPCM}.
- *
- * @return Cross feed direction resolution.
- *
- * @exception IllegalArgumentException
- * (unchecked exception) Thrown if {@code units < 1}.
+ * @param units unit conversion factor, e.g. {@link #DPI DPI} or
+ * {@link #DPCM DPCM}
+ * @return cross feed direction resolution
+ * @throws IllegalArgumentException if {@code units < 1}
*/
public int getCrossFeedResolution(int units) {
return convertFromDphi (crossFeedResolution, units);
@@ -207,14 +190,10 @@
* Returns this resolution attribute's feed direction resolution in the
* given units. The value is rounded to the nearest integer.
*
- * @param units
- * Unit conversion factor, e.g. {@link #DPI DPI} or {@link
- * #DPCM DPCM}.
- *
- * @return Feed direction resolution.
- *
- * @exception IllegalArgumentException
- * (unchecked exception) Thrown if {@code units < 1}.
+ * @param units unit conversion factor, e.g. {@link #DPI DPI} or
+ * {@link #DPCM DPCM}
+ * @return feed direction resolution
+ * @throws IllegalArgumentException if {@code units < 1}
*/
public int getFeedResolution(int units) {
return convertFromDphi (feedResolution, units);
@@ -222,22 +201,18 @@
/**
* Returns a string version of this resolution attribute in the given units.
- * The string takes the form
- * You can construct an instance of SetOfIntegerSyntax by giving it in "string
- * form." The string consists of zero or more comma-separated integer groups.
- * Each integer group consists of either one integer, two integers separated by
- * a hyphen ({@code -}), or two integers separated by a colon
- * ({@code :}). Each integer consists of one or more decimal digits
- * ({@code 0} through {@code 9}). Whitespace characters cannot
- * appear within an integer but are otherwise ignored. For example:
- * {@code ""}, {@code "1"}, {@code "5-10"}, {@code "1:2, 4"}.
- *
- * You can also construct an instance of SetOfIntegerSyntax by giving it in
- * "array form." Array form consists of an array of zero or more integer groups
- * where each integer group is a length-1 or length-2 array of
- * {@code int}s; for example, {@code int[0][]},
- * {@code int[][]{{1}}}, {@code int[][]{{5,10}}},
- * {@code int[][]{{1,2},{4}}}.
- *
+ *
+ * You can construct an instance of {@code SetOfIntegerSyntax} by giving it in
+ * "string form." The string consists of zero or more comma-separated integer
+ * groups. Each integer group consists of either one integer, two integers
+ * separated by a hyphen ({@code -}), or two integers separated by a colon
+ * ({@code :}). Each integer consists of one or more decimal digits ({@code 0}
+ * through {@code 9}). Whitespace characters cannot appear within an integer but
+ * are otherwise ignored. For example: {@code ""}, {@code "1"}, {@code "5-10"},
+ * {@code "1:2, 4"}.
+ *
+ * You can also construct an instance of {@code SetOfIntegerSyntax} by giving it
+ * in "array form." Array form consists of an array of zero or more integer
+ * groups where each integer group is a length-1 or length-2 array of
+ * {@code int}s; for example, {@code int[0][]}, {@code int[][]{{1}}},
+ * {@code int[][]{{5,10}}}, {@code int[][]{{1,2},{4}}}.
+ *
* In both string form and array form, each successive integer group gives a
* range of integers to be included in the set. The first integer in each group
* gives the lower bound of the range; the second integer in each group gives
* the upper bound of the range; if there is only one integer in the group, the
* upper bound is the same as the lower bound. If the upper bound is less than
- * the lower bound, it denotes a null range (no values). If the upper bound is
- * equal to the lower bound, it denotes a range consisting of a single value. If
- * the upper bound is greater than the lower bound, it denotes a range
+ * the lower bound, it denotes a {@code null} range (no values). If the upper
+ * bound is equal to the lower bound, it denotes a range consisting of a single
+ * value. If the upper bound is greater than the lower bound, it denotes a range
* consisting of more than one value. The ranges may appear in any order and are
* allowed to overlap. The union of all the ranges gives the set's contents.
- * Once a SetOfIntegerSyntax instance is constructed, its value is immutable.
- *
- * The SetOfIntegerSyntax object's value is actually stored in "canonical
- * array form." This is the same as array form, except there are no null ranges;
- * the members of the set are represented in as few ranges as possible (i.e.,
- * overlapping ranges are coalesced); the ranges appear in ascending order; and
- * each range is always represented as a length-two array of {@code int}s
- * in the form {lower bound, upper bound}. An empty set is represented as a
- * zero-length array.
- *
- * Class SetOfIntegerSyntax has operations to return the set's members in
- * canonical array form, to test whether a given integer is a member of the
+ * Once a {@code SetOfIntegerSyntax} instance is constructed, its value is
+ * immutable.
+ *
+ * The {@code SetOfIntegerSyntax} object's value is actually stored in
+ * "canonical array form." This is the same as array form, except there
+ * are no {@code null} ranges; the members of the set are represented in as few
+ * ranges as possible (i.e., overlapping ranges are coalesced); the ranges
+ * appear in ascending order; and each range is always represented as a
+ * length-two array of {@code int}s in the form {lower bound, upper bound}. An
+ * empty set is represented as a zero-length array.
+ *
+ * Class {@code SetOfIntegerSyntax} has operations to return the set's members
+ * in canonical array form, to test whether a given integer is a member of the
* set, and to iterate through the members of the set.
*
- * @author David Mendenhall
- * @author Alan Kaminsky
+ * @author David Mendenhall
+ * @author Alan Kaminsky
*/
public abstract class SetOfIntegerSyntax implements Serializable, Cloneable {
+ /**
+ * Use serialVersionUID from JDK 1.4 for interoperability.
+ */
private static final long serialVersionUID = 3666874174847632203L;
/**
* This set's members in canonical array form.
+ *
* @serial
*/
private int[][] members;
-
/**
- * Construct a new set-of-integer attribute with the given members in
- * string form.
+ * Construct a new set-of-integer attribute with the given members in string
+ * form.
*
- * @param members Set members in string form. If null, an empty set is
- * constructed.
- *
- * @exception IllegalArgumentException
- * (Unchecked exception) Thrown if {@code members} does not
- * obey the proper syntax.
+ * @param members set members in string form. If {@code null}, an empty set
+ * is constructed.
+ * @throws IllegalArgumentException if {@code members} does not obey the
+ * proper syntax
*/
protected SetOfIntegerSyntax(String members) {
this.members = parse (members);
@@ -106,6 +106,9 @@
/**
* Parse the given string, returning canonical array form.
+ *
+ * @param members the string
+ * @return the canonical array form
*/
private static int[][] parse(String members) {
// Create vector to hold int[] elements, each element being one range
@@ -238,8 +241,8 @@
}
/**
- * Accumulate the given range (lb .. ub) into the canonical array form
- * into the given vector of int[] objects.
+ * Accumulate the given range (lb .. ub) into the canonical array form into
+ * the given vector of int[] objects.
*/
private static void accumulate(Vector
- * A two-dimensional size attribute's value consists of two items, the X
- * dimension and the Y dimension. A two-dimensional size attribute may be
- * constructed by supplying the two values and indicating the units in which the
- * values are measured. Methods are provided to return a two-dimensional size
- * attribute's values, indicating the units in which the values are to be
+ *
+ * A two-dimensional size attribute's value consists of two items, the {@code X}
+ * dimension and the {@code Y} dimension. A two-dimensional size attribute may
+ * be constructed by supplying the two values and indicating the units in which
+ * the values are measured. Methods are provided to return a two-dimensional
+ * size attribute's values, indicating the units in which the values are to be
* returned. The two most common size units are inches (in) and millimeters
- * (mm), and exported constants {@link #INCH INCH} and {@link #MM
- * MM} are provided for indicating those units.
- *
+ * (mm), and exported constants {@link #INCH INCH} and {@link #MM MM} are
+ * provided for indicating those units.
+ *
* Once constructed, a two-dimensional size attribute's value is immutable.
- *
- * Design
- *
- * A two-dimensional size attribute's X and Y dimension values are stored
- * internally as integers in units of micrometers (µm), where 1 micrometer
- * = 10-6 meter = 1/1000 millimeter = 1/25400 inch. This permits
- * dimensions to be represented exactly to a precision of 1/1000 mm (= 1
+ *
+ * Design
+ *
+ * A two-dimensional size attribute's {@code X} and {@code Y} dimension values
+ * are stored internally as integers in units of micrometers (µm), where 1
+ * micrometer = 10-6 meter = 1/1000 millimeter = 1/25400 inch. This
+ * permits dimensions to be represented exactly to a precision of 1/1000 mm (= 1
* µm) or 1/100 inch (= 254 µm). If fractional inches are expressed in
* negative powers of two, this permits dimensions to be represented exactly to
* a precision of 1/8 inch (= 3175 µm) but not 1/16 inch (because 1/16 inch
* does not equal an integral number of µm).
- *
+ *
* Storing the dimensions internally in common units of µm lets two size
* attributes be compared without regard to the units in which they were
* created; for example, 8.5 in will compare equal to 215.9 mm, as they both are
- * stored as 215900 µm. For example, a lookup service can
- * match resolution attributes based on equality of their serialized
- * representations regardless of the units in which they were created. Using
- * integers for internal storage allows precise equality comparisons to be done,
- * which would not be guaranteed if an internal floating point representation
- * were used. Note that if you're looking for U.S. letter sized media in metric
- * units, you have to search for a media size of 215.9 x 279.4 mm; rounding off
- * to an integral 216 x 279 mm will not match.
- *
- * The exported constant {@link #INCH INCH} is actually the
- * conversion factor by which to multiply a value in inches to get the value in
- * µm. Likewise, the exported constant {@link #MM MM} is the
- * conversion factor by which to multiply a value in mm to get the value in
- * µm. A client can specify a resolution value in units other than inches
- * or mm by supplying its own conversion factor. However, since the internal
- * units of µm was chosen with supporting only the external units of inch
- * and mm in mind, there is no guarantee that the conversion factor for the
- * client's units will be an exact integer. If the conversion factor isn't an
- * exact integer, resolution values in the client's units won't be stored
- * precisely.
+ * stored as 215900 µm. For example, a lookup service can match resolution
+ * attributes based on equality of their serialized representations regardless
+ * of the units in which they were created. Using integers for internal storage
+ * allows precise equality comparisons to be done, which would not be guaranteed
+ * if an internal floating point representation were used. Note that if you're
+ * looking for {@code U.S. letter} sized media in metric units, you have to
+ * search for a media size of 215.9 x 279.4 mm; rounding off to an integral
+ * 216 x 279 mm will not match.
+ *
+ * The exported constant {@link #INCH INCH} is actually the conversion factor by
+ * which to multiply a value in inches to get the value in µm. Likewise,
+ * the exported constant {@link #MM MM} is the conversion factor by which to
+ * multiply a value in mm to get the value in µm. A client can specify a
+ * resolution value in units other than inches or mm by supplying its own
+ * conversion factor. However, since the internal units of µm was chosen
+ * with supporting only the external units of inch and mm in mind, there is no
+ * guarantee that the conversion factor for the client's units will be an exact
+ * integer. If the conversion factor isn't an exact integer, resolution values
+ * in the client's units won't be stored precisely.
*
- * @author Alan Kaminsky
+ * @author Alan Kaminsky
*/
public abstract class Size2DSyntax implements Serializable, Cloneable {
+ /**
+ * Use serialVersionUID from JDK 1.4 for interoperability.
+ */
private static final long serialVersionUID = 5584439964938660530L;
/**
- * X dimension in units of micrometers (µm).
+ * {@code X} dimension in units of micrometers (µm).
+ *
* @serial
*/
private int x;
/**
- * Y dimension in units of micrometers (µm).
+ * {@code Y} dimension in units of micrometers (µm).
+ *
* @serial
*/
private int y;
@@ -108,20 +111,16 @@
*/
public static final int MM = 1000;
-
/**
* Construct a new two-dimensional size attribute from the given
* floating-point values.
*
- * @param x X dimension.
- * @param y Y dimension.
- * @param units
- * Unit conversion factor, e.g. {@link #INCH INCH} or
- * {@link #MM MM}.
- *
- * @exception IllegalArgumentException
- * (Unchecked exception) Thrown if {@code x < 0} or {@code y < 0} or
- * {@code units < 1}.
+ * @param x {@code X} dimension
+ * @param y {@code Y} dimension
+ * @param units unit conversion factor, e.g. {@link #INCH INCH} or
+ * {@link #MM MM}
+ * @throws IllegalArgumentException if {@code x < 0} or {@code y < 0} or
+ * {@code units < 1}
*/
protected Size2DSyntax(float x, float y, int units) {
if (x < 0.0f) {
@@ -141,15 +140,12 @@
* Construct a new two-dimensional size attribute from the given integer
* values.
*
- * @param x X dimension.
- * @param y Y dimension.
- * @param units
- * Unit conversion factor, e.g. {@link #INCH INCH} or
- * {@link #MM MM}.
- *
- * @exception IllegalArgumentException
- * (Unchecked exception) Thrown if {@code x < 0} or {@code y < 0}
- * or {@code units < 1}.
+ * @param x {@code X} dimension
+ * @param y {@code Y} dimension
+ * @param units unit conversion factor, e.g. {@link #INCH INCH} or
+ * {@link #MM MM}
+ * @throws IllegalArgumentException if {@code x < 0} or {@code y < 0} or
+ * {@code units < 1}
*/
protected Size2DSyntax(int x, int y, int units) {
if (x < 0) {
@@ -169,16 +165,11 @@
* Convert a value from micrometers to some other units. The result is
* returned as a floating-point number.
*
- * @param x
- * Value (micrometers) to convert.
- * @param units
- * Unit conversion factor, e.g. {@link #INCH INCH} or
- * {@link #MM MM}.
- *
- * @return The value of {@code x} converted to the desired units.
- *
- * @exception IllegalArgumentException
- * (unchecked exception) Thrown if {@code units} < 1.
+ * @param x value (micrometers) to convert
+ * @param units unit conversion factor, e.g. {@link #INCH INCH} or
+ * {@link #MM MM}
+ * @return the value of {@code x} converted to the desired units
+ * @throws IllegalArgumentException if {@code units < 1}
*/
private static float convertFromMicrometers(int x, int units) {
if (units < 1) {
@@ -191,46 +182,37 @@
* Get this two-dimensional size attribute's dimensions in the given units
* as floating-point values.
*
- * @param units
- * Unit conversion factor, e.g. {@link #INCH INCH} or {@link #MM MM}.
- *
- * @return A two-element array with the X dimension at index 0 and the Y
- * dimension at index 1.
- *
- * @exception IllegalArgumentException
- * (unchecked exception) Thrown if {@code units < 1}.
+ * @param units unit conversion factor, e.g. {@link #INCH INCH} or
+ * {@link #MM MM}
+ * @return a two-element array with the {@code X} dimension at index 0 and
+ * the {@code Y} dimension at index 1
+ * @throws IllegalArgumentException if {@code units < 1}
*/
public float[] getSize(int units) {
return new float[] {getX(units), getY(units)};
}
/**
- * Returns this two-dimensional size attribute's X dimension in the given
- * units as a floating-point value.
+ * Returns this two-dimensional size attribute's {@code X} dimension in the
+ * given units as a floating-point value.
*
- * @param units
- * Unit conversion factor, e.g. {@link #INCH INCH} or {@link #MM MM}.
- *
- * @return X dimension.
- *
- * @exception IllegalArgumentException
- * (unchecked exception) Thrown if {@code units < 1}.
+ * @param units unit conversion factor, e.g. {@link #INCH INCH} or
+ * {@link #MM MM}
+ * @return {@code X} dimension
+ * @throws IllegalArgumentException if {@code units < 1}
*/
public float getX(int units) {
return convertFromMicrometers(x, units);
}
/**
- * Returns this two-dimensional size attribute's Y dimension in the given
- * units as a floating-point value.
+ * Returns this two-dimensional size attribute's {@code Y} dimension in the
+ * given units as a floating-point value.
*
- * @param units
- * Unit conversion factor, e.g. {@link #INCH INCH} or {@link #MM MM}.
- *
- * @return Y dimension.
- *
- * @exception IllegalArgumentException
- * (unchecked exception) Thrown if {@code units < 1}.
+ * @param units unit conversion factor, e.g. {@link #INCH INCH} or
+ * {@link #MM MM}
+ * @return {@code Y} dimension
+ * @throws IllegalArgumentException if {@code units < 1}
*/
public float getY(int units) {
return convertFromMicrometers(y, units);
@@ -238,22 +220,17 @@
/**
* Returns a string version of this two-dimensional size attribute in the
- * given units. The string takes the form
* The processing instruction does not specify how the print job processes the
* request; each processing instruction is only a description of the results of
* a print job. The print job determines the manner in which it achieves the
@@ -97,18 +98,18 @@
* The Java Print Service API defines these different kinds of attributes with
* five subinterfaces of {@code Attribute}:
*
* The {@code AttributeSet} interface is similar to the
* Map interface: it provides a map of
* key to values, in which each key is unique and can contain no more than one
* value. However, the {@code AttributeSet} interface is designed to
- * specifically support the needs of the Java Print Service API. An {@code
- * AttributeSet} requires that:
+ * specifically support the needs of the Java Print Service API. An
+ * {@code AttributeSet} requires that:
*
- * The javax.print.attribute package includes
+ * The {@code javax.print.attribute} package includes
* HashAttributeSet as a concrete
* implementation of the attribute set interface. {@code HashAttributeSet}
* provides an attribute set based on a hash map. You can use this
@@ -167,18 +167,15 @@
* that are restricted to contain just one of the four kinds of attributes, as
* discussed in the Attribute Roles section:
*
@@ -189,17 +186,15 @@
* For a read-only attribute set, calling a mutating operation throws an
* {@code UnmodifiableSetException}.
*
- * Package javax.print.attribute includes one concrete implementation of each of
- * the attribute set subinterfaces:
+ * Package {@code javax.print.attribute} includes one concrete implementation of
+ * each of the attribute set subinterfaces:
*
- * Please note: In the javax.print APIs, a null reference parameter to methods
- * is incorrect unless explicitly documented on the method as having a
- * meaningful interpretation. Usage to the contrary is incorrect coding and may
- * result in a run time exception either immediately or at some later time.
- * IllegalArgumentException and NullPointerException are examples of typical and
- * acceptable run time exceptions for such cases.
+ * Please note: In the {@code javax.print} APIs, a {@code null} reference
+ * parameter to methods is incorrect unless explicitly documented on the method
+ * as having a meaningful interpretation. Usage to the contrary is incorrect
+ * coding and may result in a run time exception either immediately or at some
+ * later time. {@code IllegalArgumentException} and {@code NullPointerException}
+ * are examples of typical and acceptable run time exceptions for such cases.
*
* @since 1.4
*/
diff -r 000f4e4ddd39 -r 57173ad5c534 jdk/src/java.desktop/share/classes/javax/print/attribute/standard/Chromaticity.java
--- a/jdk/src/java.desktop/share/classes/javax/print/attribute/standard/Chromaticity.java Fri Sep 01 14:13:40 2017 +0000
+++ b/jdk/src/java.desktop/share/classes/javax/print/attribute/standard/Chromaticity.java Sat Sep 09 14:36:45 2017 +0200
@@ -22,75 +22,57 @@
* or visit www.oracle.com if you need additional information or have any
* questions.
*/
+
package javax.print.attribute.standard;
import javax.print.attribute.Attribute;
+import javax.print.attribute.DocAttribute;
import javax.print.attribute.EnumSyntax;
-import javax.print.attribute.DocAttribute;
+import javax.print.attribute.PrintJobAttribute;
import javax.print.attribute.PrintRequestAttribute;
-import javax.print.attribute.PrintJobAttribute;
/**
- * Class Chromaticity is a printing attribute class, an enumeration, that
- * specifies monochrome or color printing. This is used by a print client
+ * Class {@code Chromaticity} is a printing attribute class, an enumeration,
+ * that specifies monochrome or color printing. This is used by a print client
* to specify how the print data should be generated or processed. It is not
* descriptive of the color capabilities of the device. Query the service's
* {@link ColorSupported ColorSupported} attribute to determine if the device
* can be verified to support color printing.
- *
+ *
* The table below shows the effects of specifying a Chromaticity attribute of
- * {@link #MONOCHROME MONOCHROME} or {@link #COLOR COLOR}
- * for a monochrome or color document.
- *
+ * {@link #MONOCHROME MONOCHROME} or {@link #COLOR COLOR} for a monochrome or
+ * color document.
*
- * IPP Compatibility: Chromaticity is not an IPP attribute at present.
+ * {@code
* PrintService[] services = PrintServiceLookup.lookupPrintServices(
* DocFlavor.INPUT_STREAM.JPEG, null);
@@ -133,24 +127,25 @@
* }
* }
*
- * @param gc used to select screen. null means primary or default screen.
- * @param x location of dialog including border in screen coordinates
- * relative to the origin of {@code gc}.
- * @param y location of dialog including border in screen coordinates
- * relative to the origin of {@code gc}.
- * @param services to be browsable, must be non-null.
- * @param defaultService initial PrintService to display.
- * @param flavor the flavor to be printed, or null.
- * @param attributes on input is the initial application supplied
- * preferences. This cannot be null but may be empty.
- * On output the attributes reflect changes made by the user.
- * @return print service selected by the user, or null if the user
- * cancelled the dialog.
- * @throws HeadlessException if GraphicsEnvironment.isHeadless()
- * returns true.
- * @throws IllegalArgumentException if services is null or empty,
- * or attributes is null, or the initial PrintService is not in the
- * list of browsable services.
+ * @param gc used to select screen, {@code null} means primary or default
+ * screen
+ * @param x location of dialog including border in screen coordinates
+ * relative to the origin of {@code gc}
+ * @param y location of dialog including border in screen coordinates
+ * relative to the origin of {@code gc}
+ * @param services to be browsable, must be {@code non-null}
+ * @param defaultService initial {@code PrintService} to display
+ * @param flavor the flavor to be printed, or {@code null}
+ * @param attributes on input is the initial application supplied
+ * preferences. This cannot be {@code null} but may be empty. On
+ * output the attributes reflect changes made by the user.
+ * @return print service selected by the user, or {@code null} if the user
+ * cancelled the dialog
+ * @throws HeadlessException if {@code GraphicsEnvironment.isHeadless()}
+ * returns {@code true}
+ * @throws IllegalArgumentException if services is {@code null} or empty, or
+ * attributes is {@code null}, or the initial {@code PrintService}
+ * is not in the list of browsable services
*/
@SuppressWarnings("deprecation")
public static PrintService printDialog(GraphicsConfiguration gc,
@@ -220,8 +215,8 @@
// check if dialog exceed window bounds at left or bottom
// Then position the dialog by moving it by the amount it exceeds
// the window bounds
- // If it results in dialog moving beyond the window bounds at top/left
- // then position it at window top/left
+ // If it results in dialog moving beyond the window bounds at
+ // top/left then position it at window top/left
if (dlgBounds.x + dlgBounds.width > gcBounds.x + gcBounds.width) {
if ((gcBounds.x + gcBounds.width - dlgBounds.width) > gcBounds.x) {
x = (gcBounds.x + gcBounds.width) - dlgBounds.width;
@@ -315,8 +310,8 @@
*/
/**
- * Removes any attributes from the given AttributeSet that are
- * unsupported by the given PrintService/DocFlavor combination.
+ * Removes any attributes from the given {@code AttributeSet} that are
+ * unsupported by the given {@code PrintService/DocFlavor} combination.
*/
private static void removeUnsupportedAttributes(PrintService ps,
DocFlavor flavor,
diff -r 000f4e4ddd39 -r 57173ad5c534 jdk/src/java.desktop/share/classes/javax/print/ServiceUIFactory.java
--- a/jdk/src/java.desktop/share/classes/javax/print/ServiceUIFactory.java Fri Sep 01 14:13:40 2017 +0000
+++ b/jdk/src/java.desktop/share/classes/javax/print/ServiceUIFactory.java Sat Sep 09 14:36:45 2017 +0200
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2000, 2014, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2000, 2017, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
@@ -26,21 +26,20 @@
package javax.print;
/**
- * Services may optionally provide UIs which allow different styles
- * of interaction in different roles.
- * One role may be end-user browsing and setting of print options.
- * Another role may be administering the print service.
+ * Services may optionally provide UIs which allow different styles of
+ * interaction in different roles. One role may be end-user browsing and setting
+ * of print options. Another role may be administering the print service.
*
@@ -55,34 +54,29 @@
* }
*
*/
-
public abstract class ServiceUIFactory {
/**
- * Denotes a UI implemented as a Swing component.
- * The value of the String is the fully qualified classname :
- * "javax.swing.JComponent".
+ * Denotes a UI implemented as a Swing component. The value of the string is
+ * the fully qualified classname : "javax.swing.JComponent".
*/
public static final String JCOMPONENT_UI = "javax.swing.JComponent";
/**
- * Denotes a UI implemented as an AWT panel.
- * The value of the String is the fully qualified classname :
- * "java.awt.Panel"
+ * Denotes a UI implemented as an AWT panel. The value of the string is the
+ * fully qualified classname : "java.awt.Panel"
*/
public static final String PANEL_UI = "java.awt.Panel";
/**
- * Denotes a UI implemented as an AWT dialog.
- * The value of the String is the fully qualified classname :
- * "java.awt.Dialog"
+ * Denotes a UI implemented as an AWT dialog. The value of the string is the
+ * fully qualified classname : "java.awt.Dialog"
*/
public static final String DIALOG_UI = "java.awt.Dialog";
/**
- * Denotes a UI implemented as a Swing dialog.
- * The value of the String is the fully qualified classname :
- * "javax.swing.JDialog"
+ * Denotes a UI implemented as a Swing dialog. The value of the string is
+ * the fully qualified classname : "javax.swing.JDialog"
*/
public static final String JDIALOG_UI = "javax.swing.JDialog";
@@ -102,41 +96,38 @@
public static final int MAIN_UIROLE = 3;
/**
- * Not a valid role but role id's greater than this may be used
- * for private roles supported by a service. Knowledge of the
- * function performed by this role is required to make proper use
- * of it.
+ * Not a valid role but role id's greater than this may be used for private
+ * roles supported by a service. Knowledge of the function performed by this
+ * role is required to make proper use of it.
*/
public static final int RESERVED_UIROLE = 99;
+
/**
- * Get a UI object which may be cast to the requested UI type
- * by the application and used in its user interface.
+ * Get a UI object which may be cast to the requested UI type by the
+ * application and used in its user interface.
*
- * @param role requested. Must be one of the standard roles or
- * a private role supported by this factory.
- * @param ui type in which the role is requested.
- * @return the UI role or null if the requested UI role is not available
- * from this factory
- * @throws IllegalArgumentException if the role or ui is neither
- * one of the standard ones, nor a private one
- * supported by the factory.
+ * @param role requested. Must be one of the standard roles or a private
+ * role supported by this factory.
+ * @param ui type in which the role is requested
+ * @return the UI role or {@code null} if the requested UI role is not
+ * available from this factory
+ * @throws IllegalArgumentException if the role or ui is neither one of the
+ * standard ones, nor a private one supported by the factory
*/
public abstract Object getUI(int role, String ui) ;
/**
- * Given a UI role obtained from this factory obtain the UI
- * types available from this factory which implement this role.
- * The returned Strings should refer to the static variables defined
- * in this class so that applications can use equality of reference
- * ("==").
- * @param role to be looked up.
+ * Given a UI role obtained from this factory obtain the UI types available
+ * from this factory which implement this role. The returned {@code Strings}
+ * should refer to the static variables defined in this class so that
+ * applications can use equality of reference ("==").
+ *
+ * @param role to be looked up
* @return the UI types supported by this class for the specified role,
- * null if no UIs are available for the role.
- * @throws IllegalArgumentException is the role is a non-standard
- * role not supported by this factory.
+ * {@code null} if no UIs are available for the role
+ * @throws IllegalArgumentException is the role is a non-standard role not
+ * supported by this factory
*/
public abstract String[] getUIClassNamesForRole(int role) ;
-
-
}
diff -r 000f4e4ddd39 -r 57173ad5c534 jdk/src/java.desktop/share/classes/javax/print/SimpleDoc.java
--- a/jdk/src/java.desktop/share/classes/javax/print/SimpleDoc.java Fri Sep 01 14:13:40 2017 +0000
+++ b/jdk/src/java.desktop/share/classes/javax/print/SimpleDoc.java Sat Sep 09 14:36:45 2017 +0200
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2001, 2014, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2001, 2017, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
@@ -27,60 +27,76 @@
import java.io.ByteArrayInputStream;
import java.io.CharArrayReader;
-import java.io.StringReader;
+import java.io.IOException;
import java.io.InputStream;
-import java.io.IOException;
import java.io.Reader;
+import java.io.StringReader;
+
import javax.print.attribute.AttributeSetUtilities;
import javax.print.attribute.DocAttributeSet;
/**
- * This class is an implementation of interface {@code Doc} that can
- * be used in many common printing requests.
- * It can handle all of the presently defined "pre-defined" doc flavors
- * defined as static variables in the DocFlavor class.
+ * This class is an implementation of interface {@code Doc} that can be used in
+ * many common printing requests. It can handle all of the presently defined
+ * "pre-defined" doc flavors defined as static variables in the
+ * {@code DocFlavor} class.
*
- *
- * Clients who want to re-use the doc object in other jobs,
- * or need a MultiDoc will not want to use this class.
+ * Clients who want to re-use the doc object in other jobs, or need a
+ * {@code MultiDoc} will not want to use this class.
*
- *
+ * Obtains a reader for extracting character print data from this doc. The
+ * {@code Doc} implementation is required to support this method if the
+ * {@code DocFlavor} has one of the following print data representation
+ * classes, and return {@code null} otherwise:
+ *
+ *
* The doc's print data representation object is used to construct and
- * return a {@code Reader} for reading the print data as a stream
- * of characters from the print data representation object.
- * However, if the print data representation object is itself a
- * {@code Reader} then the print data representation object is
- * simply returned.
+ * return a {@code Reader} for reading the print data as a stream of
+ * characters from the print data representation object. However, if the
+ * print data representation object is itself a {@code Reader} then the
+ * print data representation object is simply returned.
*
- * @return a {@code Reader} for reading the print data
- * characters from this doc.
- * If a reader cannot be provided because this doc does not meet
- * the criteria stated above, {@code null} is returned.
- *
- * @exception IOException if there was an I/O error while creating
- * the reader.
+ * @return a {@code Reader} for reading the print data characters from this
+ * doc. If a reader cannot be provided because this doc does not
+ * meet the criteria stated above, {@code null} is returned.
+ * @throws IOException if there was an I/O error while creating the reader
*/
public Reader getReaderForText() throws IOException {
@@ -207,31 +216,25 @@
}
/**
- * Obtains an input stream for extracting byte print data from
- * this doc.
- * The {@code Doc} implementation is required to support this
- * method if the {@code DocFlavor} has one of the following print
- * data representation classes; otherwise this method
- * returns {@code null}:
- *
- *
- * The doc's print data representation object is obtained. Then, an
- * input stream for reading the print data
- * from the print data representation object as a stream of bytes is
- * created and returned.
- * However, if the print data representation object is itself an
- * input stream then the print data representation object is simply
- * returned.
+ * Obtains an input stream for extracting byte print data from this doc. The
+ * {@code Doc} implementation is required to support this method if the
+ * {@code DocFlavor} has one of the following print data representation
+ * classes; otherwise this method returns {@code null}:
+ *
+ *
+ * The doc's print data representation object is obtained. Then, an input
+ * stream for reading the print data from the print data representation
+ * object as a stream of bytes is created and returned. However, if the
+ * print data representation object is itself an input stream then the print
+ * data representation object is simply returned.
*
- * @return an {@code InputStream} for reading the print data
- * bytes from this doc. If an input stream cannot be
- * provided because this doc does not meet
- * the criteria stated above, {@code null} is returned.
- *
- * @exception IOException
- * if there was an I/O error while creating the input stream.
+ * @return an {@code InputStream} for reading the print data bytes from this
+ * doc. If an input stream cannot be provided because this doc does
+ * not meet the criteria stated above, {@code null} is returned.
+ * @throws IOException if there was an I/O error while creating the input
+ * stream
*/
public InputStream getStreamForBytes() throws IOException {
@@ -250,5 +253,4 @@
}
return inStream;
}
-
}
diff -r 000f4e4ddd39 -r 57173ad5c534 jdk/src/java.desktop/share/classes/javax/print/StreamPrintService.java
--- a/jdk/src/java.desktop/share/classes/javax/print/StreamPrintService.java Fri Sep 01 14:13:40 2017 +0000
+++ b/jdk/src/java.desktop/share/classes/javax/print/StreamPrintService.java Sat Sep 09 14:36:45 2017 +0200
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2000, 2001, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2000, 2017, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
@@ -28,43 +28,47 @@
import java.io.OutputStream;
/**
- * This class extends {@link PrintService} and represents a
- * print service that prints data in different formats to a
- * client-provided output stream.
- * This is principally intended for services where
- * the output format is a document type suitable for viewing
- * or archiving.
- * The output format must be declared as a mime type.
- * This is equivalent to an output document flavor where the
- * representation class is always "java.io.OutputStream"
- * An instance of the {@code StreamPrintService} class is
- * obtained from a {@link StreamPrintServiceFactory} instance.
+ * This class extends {@link PrintService} and represents a print service that
+ * prints data in different formats to a client-provided output stream. This is
+ * principally intended for services where the output format is a document type
+ * suitable for viewing or archiving. The output format must be declared as a
+ * mime type. This is equivalent to an output document flavor where the
+ * representation class is always "java.io.OutputStream" An instance of the
+ * {@code StreamPrintService} class is obtained from a
+ * {@link StreamPrintServiceFactory} instance.
*
- *
- *
+ *
* In some contexts, the client is only allowed to examine an attribute set's
* contents but not change them (the set is read-only). In other places, the
* client is allowed both to examine and to change an attribute set's contents
* (the set is read-write). For a read-only attribute set, calling a mutating
- * operation throws an UnmodifiableSetException.
- *
- *
- *
- *
+ *
+ *
*
- * @param object Object to compare to.
- *
- * @return True if {@code object} is equivalent to this date-time
- * attribute, false otherwise.
+ * @param object {@code Object} to compare to
+ * @return {@code true} if {@code object} is equivalent to this date-time
+ * attribute, {@code false} otherwise
*/
public boolean equals(Object object) {
return (object != null &&
@@ -132,13 +127,11 @@
}
/**
- * Returns a string value corresponding to this date-time attribute.
- * The string value is just this attribute's
- * {@code java.util.Date} value
+ * Returns a string value corresponding to this date-time attribute. The
+ * string value is just this attribute's {@code java.util.Date} value
* converted to a string.
*/
public String toString() {
return "" + value;
}
-
}
diff -r 000f4e4ddd39 -r 57173ad5c534 jdk/src/java.desktop/share/classes/javax/print/attribute/DocAttribute.java
--- a/jdk/src/java.desktop/share/classes/javax/print/attribute/DocAttribute.java Fri Sep 01 14:13:40 2017 +0000
+++ b/jdk/src/java.desktop/share/classes/javax/print/attribute/DocAttribute.java Sat Sep 09 14:36:45 2017 +0200
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2000, 2014, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2000, 2017, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
@@ -23,25 +23,22 @@
* questions.
*/
-
package javax.print.attribute;
/**
- * Interface DocAttribute is a tagging interface which a printing attribute
- * class implements to indicate the attribute denotes a setting for a doc.
- * ("Doc" is a short, easy-to-pronounce term that means "a piece of print
- * data.") The client may include a DocAttribute in a {@code Doc}'s
- * attribute set to specify a characteristic of
- * that doc. If an attribute implements {@link PrintRequestAttribute
- * PrintRequestAttribute} as well as DocAttribute, the client may include the
- * attribute in a attribute set which specifies a print job
- * to specify a characteristic for all the docs in that job.
+ * Interface {@code DocAttribute} is a tagging interface which a printing
+ * attribute class implements to indicate the attribute denotes a setting for a
+ * doc. ("Doc" is a short, easy-to-pronounce term that means "a piece of print
+ * data.") The client may include a {@code DocAttribute} in a {@code Doc}'s
+ * attribute set to specify a characteristic of that doc. If an attribute
+ * implements {@link PrintRequestAttribute PrintRequestAttribute} as well as
+ * {@code DocAttribute}, the client may include the attribute in a attribute set
+ * which specifies a print job to specify a characteristic for all the docs in
+ * that job.
*
+ * @author Alan Kaminsky
* @see DocAttributeSet
* @see PrintRequestAttributeSet
- *
- * @author Alan Kaminsky
*/
public interface DocAttribute extends Attribute {
-
}
diff -r 000f4e4ddd39 -r 57173ad5c534 jdk/src/java.desktop/share/classes/javax/print/attribute/DocAttributeSet.java
--- a/jdk/src/java.desktop/share/classes/javax/print/attribute/DocAttributeSet.java Fri Sep 01 14:13:40 2017 +0000
+++ b/jdk/src/java.desktop/share/classes/javax/print/attribute/DocAttributeSet.java Sat Sep 09 14:36:45 2017 +0200
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2000, 2014, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2000, 2017, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
@@ -23,88 +23,70 @@
* questions.
*/
-
package javax.print.attribute;
/**
- * Interface DocAttributeSet specifies the interface for a set of doc
- * attributes, i.e. printing attributes that implement interface {@link
- * DocAttribute DocAttribute}. In the Print Service API, the client uses a
- * DocAttributeSet to specify the characteristics of an individual doc and
- * the print job settings to be applied to an individual doc.
- *
+ * (which extends class {@code EnumSyntax}) provides a group of enumeration
+ * values (objects) that are singleton instances of the enumeration class; for
+ * example:
+ *
+ *
+ * The {@code equals()} method for an enumeration class just does a test for
+ * identical objects ({@code ==}).
+ *
* public class Bach extends EnumSyntax {
* public static final Bach JOHANN_SEBASTIAN = new Bach(0);
* public static final Bach WILHELM_FRIEDEMANN = new Bach(1);
@@ -67,51 +68,54 @@
* return enumValueTable;
* }
* }
- *
- * You can then write code that uses the {@code ==} and {@code !=}
- * operators to test enumeration values; for example:
- *
+ *
+ * You can then write code that uses the {@code ==} and {@code !=} operators to
+ * test enumeration values; for example:
+ *
* Bach theComposer;
* . . .
* if (theComposer == Bach.JOHANN_SEBASTIAN) {
* System.out.println ("The greatest composer of all time!");
* }
- *
- * The {@code equals()} method for an enumeration class just does a test
- * for identical objects ({@code ==}).
- *
- *
+ *
+ *
*
- * @param object Object to compare to.
- *
- * @return True if {@code object} is equivalent to this integer
- * attribute, false otherwise.
+ * @param object {@code Object} to compare to
+ * @return {@code true} if {@code object} is equivalent to this integer
+ * attribute, {@code false} otherwise
*/
public boolean equals(Object object) {
diff -r 000f4e4ddd39 -r 57173ad5c534 jdk/src/java.desktop/share/classes/javax/print/attribute/PrintJobAttribute.java
--- a/jdk/src/java.desktop/share/classes/javax/print/attribute/PrintJobAttribute.java Fri Sep 01 14:13:40 2017 +0000
+++ b/jdk/src/java.desktop/share/classes/javax/print/attribute/PrintJobAttribute.java Sat Sep 09 14:36:45 2017 +0200
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2000, 2014, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2000, 2017, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
@@ -26,19 +26,18 @@
package javax.print.attribute;
/**
- * PrintJobAttribute is a tagging interface which a printing attribute
+ * {@code PrintJobAttribute} is a tagging interface which a printing attribute
* class implements to indicate the attribute describes the status of a Print
- * Job or some other characteristic of a Print Job. A Print Service
- * instance adds a number of PrintJobAttributes to a Print Job's attribute set
- * to report the Print Job's status. If an attribute implements {@link
- * PrintRequestAttribute PrintRequestAttribute} as well as PrintJobAttribute,
- * the client may include the attribute in a attribute set to
- * specify the attribute's value for the Print Job.
+ * Job or some other characteristic of a Print Job. A Print Service instance
+ * adds a number of {@code PrintJobAttributes} to a Print Job's attribute set to
+ * report the Print Job's status. If an attribute implements
+ * {@link PrintRequestAttribute PrintRequestAttribute} as well as
+ * {@code PrintJobAttribute}, the client may include the attribute in a
+ * attribute set to specify the attribute's value for the Print Job.
*
+ * @author Alan Kaminsky
* @see PrintRequestAttributeSet
* @see PrintJobAttributeSet
- *
- * @author Alan Kaminsky
*/
public interface PrintJobAttribute extends Attribute {
}
diff -r 000f4e4ddd39 -r 57173ad5c534 jdk/src/java.desktop/share/classes/javax/print/attribute/PrintJobAttributeSet.java
--- a/jdk/src/java.desktop/share/classes/javax/print/attribute/PrintJobAttributeSet.java Fri Sep 01 14:13:40 2017 +0000
+++ b/jdk/src/java.desktop/share/classes/javax/print/attribute/PrintJobAttributeSet.java Sat Sep 09 14:36:45 2017 +0200
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2000, 2014, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2000, 2017, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
@@ -23,85 +23,69 @@
* questions.
*/
-
package javax.print.attribute;
/**
- * Interface PrintJobAttributeSet specifies the interface for a set of print
- * job attributes, i.e. printing attributes that implement interface {@link
- * PrintJobAttribute PrintJobAttribute}. In the Print Service API, a
- * service uses a PrintJobAttributeSet to report the status of a print job.
- * "CxF U"
,
- * where C is the cross feed direction resolution, F is the
- * feed direction resolution, and U is the units name. The values are
+ * The string takes the form "CxF U"
,
+ * where C is the cross feed direction resolution, F is the
+ * feed direction resolution, and U is the units name. The values are
* rounded to the nearest integer.
*
- * @param units
- * Unit conversion factor, e.g. {@link #DPI CODE>DPI} or {@link
- * #DPCM DPCM}.
- * @param unitsName
- * Units name string, e.g. {@code "dpi"} or {@code "dpcm"}. If
- * null, no units name is appended to the result.
- *
- * @return String version of this resolution attribute.
- *
- * @exception IllegalArgumentException
- * (unchecked exception) Thrown if {@code units < 1}.
+ * @param units unit conversion factor, e.g. {@link #DPI CODE>DPI} or
+ * {@link #DPCM DPCM}
+ * @param unitsName units name string, e.g. {@code "dpi"} or
+ * {@code "dpcm"}. If {@code null}, no units name is appended to the
+ * result.
+ * @return string version of this resolution attribute
+ * @throws IllegalArgumentException if {@code units < 1}
*/
public String toString(int units, String unitsName) {
StringBuilder result = new StringBuilder();
@@ -251,54 +226,43 @@
return result.toString();
}
-
/**
- * Determine whether this resolution attribute's value is less than or
- * equal to the given resolution attribute's value. This is true if all
- * of the following conditions are true:
- *
- *
+ * Determine whether this resolution attribute's value is less than or equal
+ * to the given resolution attribute's value. This is true if all of the
+ * following conditions are true:
+ *
+ *
*
- * @param other Resolution attribute to compare with.
- *
- * @return True if this resolution attribute is less than or equal to the
- * {@code other} resolution attribute, false otherwise.
- *
- * @exception NullPointerException
- * (unchecked exception) Thrown if {@code other} is null.
+ * @param other resolution attribute to compare with
+ * @return {@code true} if this resolution attribute is less than or equal
+ * to the {@code other} resolution attribute, {@code false}
+ * otherwise
+ * @throws NullPointerException if {@code other} is {@code null}
*/
public boolean lessThanOrEquals(ResolutionSyntax other) {
return (this.crossFeedResolution <= other.crossFeedResolution &&
this.feedResolution <= other.feedResolution);
}
-
/**
* Returns whether this resolution attribute is equivalent to the passed in
* object. To be equivalent, all of the following conditions must be true:
- *
- *
+ *
+ *
*
- * @param object Object to compare to.
- *
- * @return True if {@code object} is equivalent to this resolution
- * attribute, false otherwise.
+ * @param object {@code Object} to compare to
+ * @return {@code true} if {@code object} is equivalent to this resolution
+ * attribute, {@code false} otherwise
*/
public boolean equals(Object object) {
@@ -320,8 +284,8 @@
/**
* Returns a string version of this resolution attribute. The string takes
- * the form "CxF dphi"
, where C is the
- * cross feed direction resolution and F is the feed direction
+ * the form "CxF dphi"
, where C is the
+ * cross feed direction resolution and F is the feed direction
* resolution. The values are reported in the internal units of dphi.
*/
public String toString() {
@@ -333,25 +297,23 @@
return result.toString();
}
-
/**
* Returns this resolution attribute's cross feed direction resolution in
* units of dphi. (For use in a subclass.)
*
- * @return Cross feed direction resolution.
+ * @return cross feed direction resolution
*/
protected int getCrossFeedResolutionDphi() {
return crossFeedResolution;
}
/**
- * Returns this resolution attribute's feed direction resolution in units
- * of dphi. (For use in a subclass.)
+ * Returns this resolution attribute's feed direction resolution in units of
+ * dphi. (For use in a subclass.)
*
- * @return Feed direction resolution.
+ * @return feed direction resolution
*/
protected int getFeedResolutionDphi() {
return feedResolution;
}
-
}
diff -r 000f4e4ddd39 -r 57173ad5c534 jdk/src/java.desktop/share/classes/javax/print/attribute/SetOfIntegerSyntax.java
--- a/jdk/src/java.desktop/share/classes/javax/print/attribute/SetOfIntegerSyntax.java Fri Sep 01 14:13:40 2017 +0000
+++ b/jdk/src/java.desktop/share/classes/javax/print/attribute/SetOfIntegerSyntax.java Sat Sep 09 14:36:45 2017 +0200
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2000, 2014, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2000, 2017, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
@@ -23,82 +23,82 @@
* questions.
*/
-
package javax.print.attribute;
import java.io.Serializable;
import java.util.Vector;
/**
- * Class SetOfIntegerSyntax is an abstract base class providing the common
- * implementation of all attributes whose value is a set of nonnegative
+ * Class {@code SetOfIntegerSyntax} is an abstract base class providing the
+ * common implementation of all attributes whose value is a set of nonnegative
* integers. This includes attributes whose value is a single range of integers
* and attributes whose value is a set of ranges of integers.
- *
+ *
*
- * @return The smallest integer in this set-of-integer attribute that is
- * greater than {@code x}, or {@code -1} if no integer in
- * this set-of-integer attribute is greater than {@code x}.
+ * @param x the Integer value
+ * @return the smallest integer in this set-of-integer attribute that is
+ * greater than {@code x}, or {@code -1} if no integer in this
+ * set-of-integer attribute is greater than {@code x}.
*/
public int next(int x) {
// Do a linear search to find the range that contains x, if any.
@@ -478,20 +469,16 @@
* Returns whether this set-of-integer attribute is equivalent to the passed
* in object. To be equivalent, all of the following conditions must be
* true:
- *
* SetOfIntegerSyntax attribute = . . .;
* int i = -1;
* while ((i = attribute.next (i)) != -1)
* {
* foo (i);
* }
- *
- *
- * @param x Integer value.
+ *
- *
+ *
+ *
*
- * @param object Object to compare to.
- *
- * @return True if {@code object} is equivalent to this
- * set-of-integer attribute, false otherwise.
+ * @param object {@code Object} to compare to
+ * @return {@code true} if {@code object} is equivalent to this
+ * set-of-integer attribute, {@code false} otherwise
*/
public boolean equals(Object object) {
if (object != null && object instanceof SetOfIntegerSyntax) {
@@ -533,9 +520,9 @@
* Returns a string value corresponding to this set-of-integer attribute.
* The string value is a zero-length string if this set is empty. Otherwise,
* the string value is a comma-separated list of the ranges in the canonical
- * array form, where each range is represented as "i"
if
+ * array form, where each range is represented as "i"
if
* the lower bound equals the upper bound or
- * "i-j"
otherwise.
+ * "i-j"
otherwise.
*/
public String toString() {
StringBuilder result = new StringBuilder();
@@ -552,5 +539,4 @@
}
return result.toString();
}
-
}
diff -r 000f4e4ddd39 -r 57173ad5c534 jdk/src/java.desktop/share/classes/javax/print/attribute/Size2DSyntax.java
--- a/jdk/src/java.desktop/share/classes/javax/print/attribute/Size2DSyntax.java Fri Sep 01 14:13:40 2017 +0000
+++ b/jdk/src/java.desktop/share/classes/javax/print/attribute/Size2DSyntax.java Sat Sep 09 14:36:45 2017 +0200
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2000, 2014, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2000, 2017, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
@@ -23,75 +23,78 @@
* questions.
*/
-
package javax.print.attribute;
import java.io.Serializable;
/**
- * Class Size2DSyntax is an abstract base class providing the common
+ * Class {@code Size2DSyntax} is an abstract base class providing the common
* implementation of all attributes denoting a size in two dimensions.
- * "XxY
- * U"
, where X is the X dimension, Y is the Y
- * dimension, and U is the units name. The values are displayed in
- * floating point.
- *
- * @param units
- * Unit conversion factor, e.g. {@link #INCH INCH} or {@link #MM MM}.
+ * given units. The string takes the form "XxY
+ * U"
, where X is the {@code X} dimension, Y is
+ * the {@code Y} dimension, and U is the units name. The values are
+ * displayed in floating point.
*
- * @param unitsName
- * Units name string, e.g. {@code in} or {@code mm}. If
- * null, no units name is appended to the result.
- *
- * @return String version of this two-dimensional size attribute.
- *
- * @exception IllegalArgumentException
- * (unchecked exception) Thrown if {@code units < 1}.
+ * @param units unit conversion factor, e.g. {@link #INCH INCH} or
+ * {@link #MM MM}
+ * @param unitsName units name string, e.g. {@code in} or {@code mm}. If
+ * {@code null}, no units name is appended to the result
+ * @return {@code String} version of this two-dimensional size attribute
+ * @throws IllegalArgumentException if {@code units < 1}
*/
public String toString(int units, String unitsName) {
StringBuilder result = new StringBuilder();
@@ -271,23 +248,18 @@
* Returns whether this two-dimensional size attribute is equivalent to the
* passed in object. To be equivalent, all of the following conditions must
* be true:
- *
- *
+ *
+ *
*
- * @param object Object to compare to.
- *
- * @return True if {@code object} is equivalent to this
- * two-dimensional size attribute, false otherwise.
+ * @param object {@code Object} to compare to
+ * @return {@code true} if {@code object} is equivalent to this
+ * two-dimensional size attribute, {@code false} otherwise
*/
public boolean equals(Object object) {
return(object != null &&
@@ -306,9 +278,9 @@
/**
* Returns a string version of this two-dimensional size attribute. The
- * string takes the form "XxY um"
, where
- * X is the X dimension and Y is the Y dimension.
- * The values are reported in the internal units of micrometers.
+ * string takes the form "XxY um"
, where X
+ * is the {@code X} dimension and Y is the {@code Y} dimension. The
+ * values are reported in the internal units of micrometers.
*/
public String toString() {
StringBuilder result = new StringBuilder();
@@ -320,23 +292,22 @@
}
/**
- * Returns this two-dimensional size attribute's X dimension in units of
- * micrometers (µm). (For use in a subclass.)
+ * Returns this two-dimensional size attribute's {@code X} dimension in
+ * units of micrometers (µm). (For use in a subclass.)
*
- * @return X dimension (µm).
+ * @return {@code X} dimension (µm)
*/
protected int getXMicrometers(){
return x;
}
/**
- * Returns this two-dimensional size attribute's Y dimension in units of
- * micrometers (µm). (For use in a subclass.)
+ * Returns this two-dimensional size attribute's {@code Y} dimension in
+ * units of micrometers (µm). (For use in a subclass.)
*
- * @return Y dimension (µm).
+ * @return {@code Y} dimension (µm)
*/
protected int getYMicrometers() {
return y;
}
-
}
diff -r 000f4e4ddd39 -r 57173ad5c534 jdk/src/java.desktop/share/classes/javax/print/attribute/SupportedValuesAttribute.java
--- a/jdk/src/java.desktop/share/classes/javax/print/attribute/SupportedValuesAttribute.java Fri Sep 01 14:13:40 2017 +0000
+++ b/jdk/src/java.desktop/share/classes/javax/print/attribute/SupportedValuesAttribute.java Sat Sep 09 14:36:45 2017 +0200
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2000, 2014, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2000, 2017, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
@@ -23,21 +23,20 @@
* questions.
*/
-
package javax.print.attribute;
/**
- * Interface SupportedValuesAttribute is a tagging interface which a printing
- * attribute class implements to indicate the attribute describes the supported
- * values for another attribute. For example, if a Print Service instance
- * supports the {@link javax.print.attribute.standard.Copies Copies}
- * attribute, the Print Service instance will have a {@link
- * javax.print.attribute.standard.CopiesSupported CopiesSupported} attribute,
- * which is a SupportedValuesAttribute giving the legal values a client may
- * specify for the {@link javax.print.attribute.standard.Copies Copies}
- * attribute.
+ * Interface {@code SupportedValuesAttribute} is a tagging interface which a
+ * printing attribute class implements to indicate the attribute describes the
+ * supported values for another attribute. For example, if a Print Service
+ * instance supports the {@link javax.print.attribute.standard.Copies Copies}
+ * attribute, the Print Service instance will have a
+ * {@link javax.print.attribute.standard.CopiesSupported CopiesSupported}
+ * attribute, which is a {@code SupportedValuesAttribute} giving the legal
+ * values a client may specify for the
+ * {@link javax.print.attribute.standard.Copies Copies} attribute.
*
- * @author Alan Kaminsky
+ * @author Alan Kaminsky
*/
public interface SupportedValuesAttribute extends Attribute {
}
diff -r 000f4e4ddd39 -r 57173ad5c534 jdk/src/java.desktop/share/classes/javax/print/attribute/TextSyntax.java
--- a/jdk/src/java.desktop/share/classes/javax/print/attribute/TextSyntax.java Fri Sep 01 14:13:40 2017 +0000
+++ b/jdk/src/java.desktop/share/classes/javax/print/attribute/TextSyntax.java Sat Sep 09 14:36:45 2017 +0200
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2000, 2014, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2000, 2017, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
@@ -23,48 +23,50 @@
* questions.
*/
-
package javax.print.attribute;
import java.io.Serializable;
import java.util.Locale;
/**
- * Class TextSyntax is an abstract base class providing the common
+ * Class {@code TextSyntax} is an abstract base class providing the common
* implementation of all attributes whose value is a string. The text attribute
* includes a locale to indicate the natural language. Thus, a text attribute
* always represents a localized string. Once constructed, a text attribute's
* value is immutable.
*
- * @author David Mendenhall
- * @author Alan Kaminsky
+ * @author David Mendenhall
+ * @author Alan Kaminsky
*/
public abstract class TextSyntax implements Serializable, Cloneable {
+ /**
+ * Use serialVersionUID from JDK 1.4 for interoperability.
+ */
private static final long serialVersionUID = -8130648736378144102L;
/**
* String value of this text attribute.
+ *
* @serial
*/
private String value;
/**
* Locale of this text attribute.
+ *
* @serial
*/
private Locale locale;
/**
- * Constructs a TextAttribute with the specified string and locale.
+ * Constructs a {@code TextAttribute} with the specified string and locale.
*
- * @param value Text string.
- * @param locale Natural language of the text string. null
- * is interpreted to mean the default locale for as returned
- * by {@code Locale.getDefault()}
- *
- * @exception NullPointerException
- * (unchecked exception) Thrown if {@code value} is null.
+ * @param value text string
+ * @param locale natural language of the text string. {@code null} is
+ * interpreted to mean the default locale for as returned by
+ * {@code Locale.getDefault()}
+ * @throws NullPointerException if {@code value} is {@code null}
*/
protected TextSyntax(String value, Locale locale) {
this.value = verify (value);
@@ -87,7 +89,8 @@
/**
* Returns this text attribute's text string.
- * @return the text string.
+ *
+ * @return the text string
*/
public String getValue() {
return value;
@@ -95,6 +98,7 @@
/**
* Returns this text attribute's text string's natural language (locale).
+ *
* @return the locale
*/
public Locale getLocale() {
@@ -104,7 +108,7 @@
/**
* Returns a hashcode for this text attribute.
*
- * @return A hashcode value for this object.
+ * @return a hashcode value for this object
*/
public int hashCode() {
return value.hashCode() ^ locale.hashCode();
@@ -113,23 +117,17 @@
/**
* Returns whether this text attribute is equivalent to the passed in
* object. To be equivalent, all of the following conditions must be true:
- *
- *
+ *
+ *
*
- * @param object Object to compare to.
- *
- * @return True if {@code object} is equivalent to this text
- * attribute, false otherwise.
+ * @param object {@code Object} to compare to
+ * @return {@code true} if {@code object} is equivalent to this text
+ * attribute, {@code false} otherwise
*/
public boolean equals(Object object) {
return(object != null &&
@@ -139,13 +137,12 @@
}
/**
- * Returns a String identifying this text attribute. The String is
- * the attribute's underlying text string.
+ * Returns a {@code String} identifying this text attribute. The
+ * {@code String} is the attribute's underlying text string.
*
- * @return A String identifying this object.
+ * @return a {@code String} identifying this object
*/
public String toString(){
return value;
}
-
}
diff -r 000f4e4ddd39 -r 57173ad5c534 jdk/src/java.desktop/share/classes/javax/print/attribute/URISyntax.java
--- a/jdk/src/java.desktop/share/classes/javax/print/attribute/URISyntax.java Fri Sep 01 14:13:40 2017 +0000
+++ b/jdk/src/java.desktop/share/classes/javax/print/attribute/URISyntax.java Sat Sep 09 14:36:45 2017 +0200
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2000, 2014, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2000, 2017, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
@@ -23,36 +23,37 @@
* questions.
*/
-
package javax.print.attribute;
import java.io.Serializable;
import java.net.URI;
/**
- * Class URISyntax is an abstract base class providing the common
- * implementation of all attributes whose value is a Uniform Resource
- * Identifier (URI). Once constructed, a URI attribute's value is immutable.
+ * Class {@code URISyntax} is an abstract base class providing the common
+ * implementation of all attributes whose value is a Uniform Resource Identifier
+ * (URI). Once constructed, a {@code URI} attribute's value is immutable.
*
- * @author Alan Kaminsky
+ * @author Alan Kaminsky
*/
public abstract class URISyntax implements Serializable, Cloneable {
+ /**
+ * Use serialVersionUID from JDK 1.4 for interoperability.
+ */
private static final long serialVersionUID = -7842661210486401678L;
/**
- * URI value of this URI attribute.
+ * {@code URI} value of this {@code URI} attribute.
+ *
* @serial
*/
private URI uri;
/**
- * Constructs a URI attribute with the specified URI.
+ * Constructs a {@code URI} attribute with the specified {@code URI}.
*
- * @param uri URI.
- *
- * @exception NullPointerException
- * (unchecked exception) Thrown if {@code uri} is null.
+ * @param uri the {@code URI}
+ * @throws NullPointerException if {@code uri} is {@code null}
*/
protected URISyntax(URI uri) {
this.uri = verify (uri);
@@ -66,40 +67,36 @@
}
/**
- * Returns this URI attribute's URI value.
- * @return the URI.
+ * Returns this {@code URI} attribute's {@code URI} value.
+ *
+ * @return the {@code URI}
*/
public URI getURI() {
return uri;
}
/**
- * Returns a hashcode for this URI attribute.
+ * Returns a hashcode for this {@code URI} attribute.
*
- * @return A hashcode value for this object.
+ * @return a hashcode value for this object
*/
public int hashCode() {
return uri.hashCode();
}
/**
- * Returns whether this URI attribute is equivalent to the passed in
- * object.
- * To be equivalent, all of the following conditions must be true:
- *
- *
+ * Returns whether this {@code URI} attribute is equivalent to the passed in
+ * object. To be equivalent, all of the following conditions must be true:
+ *
+ *
*
- * @param object Object to compare to.
- *
- * @return True if {@code object} is equivalent to this URI
- * attribute, false otherwise.
+ * @param object {@code Object} to compare to
+ * @return {@code true} if {@code object} is equivalent to this {@code URI}
+ * attribute, {@code false} otherwise
*/
public boolean equals(Object object) {
return(object != null &&
@@ -108,13 +105,13 @@
}
/**
- * Returns a String identifying this URI attribute. The String is the
- * string representation of the attribute's underlying URI.
+ * Returns a {@code String} identifying this {@code URI} attribute. The
+ * {@code String} is the string representation of the attribute's underlying
+ * {@code URI}.
*
- * @return A String identifying this object.
+ * @return a {@code String} identifying this object
*/
public String toString() {
return uri.toString();
}
-
}
diff -r 000f4e4ddd39 -r 57173ad5c534 jdk/src/java.desktop/share/classes/javax/print/attribute/UnmodifiableSetException.java
--- a/jdk/src/java.desktop/share/classes/javax/print/attribute/UnmodifiableSetException.java Fri Sep 01 14:13:40 2017 +0000
+++ b/jdk/src/java.desktop/share/classes/javax/print/attribute/UnmodifiableSetException.java Sat Sep 09 14:36:45 2017 +0200
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2001, 2014, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2001, 2017, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
@@ -26,26 +26,31 @@
package javax.print.attribute;
/**
- * Thrown to indicate that the requested operation cannot be performed
- * because the set is unmodifiable.
+ * Thrown to indicate that the requested operation cannot be performed because
+ * the set is unmodifiable.
*
- * @author Phil Race
- * @since 1.4
+ * @author Phil Race
+ * @since 1.4
*/
public class UnmodifiableSetException extends RuntimeException {
+
+ /**
+ * Use serialVersionUID from JDK 1.4 for interoperability.
+ */
private static final long serialVersionUID = 2255250308571511731L;
/**
- * Constructs an UnsupportedOperationException with no detail message.
+ * Constructs an {@code UnsupportedOperationException} with no detail
+ * message.
*/
public UnmodifiableSetException() {
}
/**
- * Constructs an UnmodifiableSetException with the specified
- * detail message.
+ * Constructs an {@code UnmodifiableSetException} with the specified detail
+ * message.
*
- * @param message the detail message
+ * @param message the detail message
*/
public UnmodifiableSetException(String message) {
super(message);
diff -r 000f4e4ddd39 -r 57173ad5c534 jdk/src/java.desktop/share/classes/javax/print/attribute/package-info.java
--- a/jdk/src/java.desktop/share/classes/javax/print/attribute/package-info.java Fri Sep 01 14:13:40 2017 +0000
+++ b/jdk/src/java.desktop/share/classes/javax/print/attribute/package-info.java Sat Sep 09 14:36:45 2017 +0200
@@ -39,19 +39,20 @@
* The print data and the processing instructions are separate entities. This
* means that:
*
- *
- *
For example, you can print a slide
- * presentation on US letter-sized white paper, double-sided, stapled, 20
- * copies to make handouts for a talk; and you could print the same slide
- * presentation on US letter-sized transparencies, single-sided, one copy to
- * make the actual slides for the talk.
+ * For example, you can print a slide presentation on US letter-sized white
+ * paper, double-sided, stapled, 20 copies to make handouts for a talk; and
+ * you could print the same slide presentation on US letter-sized
+ * transparencies, single-sided, one copy to make the actual slides for the
+ * talk.
+ *
- *
* Each attribute class implements one or more of these tagging subinterfaces to
* indicate where the attribute can be used in the API. If an attribute class
@@ -123,40 +124,39 @@
* The Java Print Service API defines a group of standard attribute classes
* modeled upon the attributes in the Internet Printing Protocol (IPP) version
* 1.1. The standard attribute classes are in the subpackage
- * javax.print.attribute.standard to keep the actual attribute classes
+ * {@code javax.print.attribute.standard} to keep the actual attribute classes
* conceptually separate from the generic apparatus defined in package
- * javax.print.attribute.
+ * {@code javax.print.attribute}.
*
* Attribute Sets
* A client usually needs to provide more than one processing instruction when
- * submitting a print job. For example, the client might need to specify a
- * media size of A4 and a landscape orientation. To send more than one
- * processing instruction, the client collects the attributes into an attribute
- * set, which the Java Print Service API represents with the
+ * submitting a print job. For example, the client might need to specify a media
+ * size of A4 and a landscape orientation. To send more than one processing
+ * instruction, the client collects the attributes into an attribute set, which
+ * the Java Print Service API represents with the
* AttributeSet interface.
*
- *
- *
- *
* Notice that only four kinds of attribute sets are listed here, but there are
* five kinds of attributes. Interface
- * SupportedValuesAttribute
- * denotes an attribute that gives the supported values for another attribute.
+ * SupportedValuesAttribute denotes
+ * an attribute that gives the supported values for another attribute.
* Supported-values attributes are never aggregated into attribute sets, so
* there is no attribute set subinterface defined for them.
*
- *
* All of these classes extend
* HashAttributeSet and enforce the
@@ -211,12 +206,11 @@
* enumerated value. The Java Print Service API does not use primitive data
* types, such as int, to represent attribute values for these reasons:
*
- *
* For type-safety and to represent all attributes uniformly, the Java Print
* Service API defines each attribute category as a class, such as class
@@ -240,27 +234,27 @@
* represent each abstract syntax, and these classes are used as the parent of
* standard attributes whenever possible. The abstract syntax classes are:
*
- *
* The abstract syntax classes are independent of the attributes that use them.
* In fact, applications that have nothing to do with printing can use the
@@ -304,12 +298,10 @@
* Attribute Vendors
* The Java Print Service API is designed so that vendors can:
*
- *
* To define a new value for an attribute, a client can construct instances of
* such attributes with arbitrary values at runtime. However, an enumerated
@@ -364,12 +356,12 @@
* }
*
*
- *
- *
- *
+ *
- * Chromaticity
- *
Attribute
- *
- * Effect on
- *
Monochrome Document
- *
- * Effect on
- *
Color Document
- *
+ *
*
- * Chromaticity
Attribute
+ * Effect on
Monochrome Document
+ * Effect on
Color Document
*
- *
- *
- * {@link #MONOCHROME MONOCHROME}
- *
- *
- * Printed as is, in monochrome
- *
- *
- * Printed in monochrome, with colors converted to shades of gray
- *
- *
- *
+ *
- * {@link #COLOR COLOR}
- *
- *
- * Printed as is, in monochrome
- *
- *
- * Printed as is, in color
- *
- *
+ * {@link #MONOCHROME MONOCHROME}
+ * Printed as is, in monochrome
+ * Printed in monochrome, with colors converted to shades of gray
+ *
+ *
- * {@link #COLOR COLOR}
+ * Printed as is, in monochrome
+ * Printed as is, in color
*
+ * IPP Compatibility: Chromaticity is not an IPP attribute at present. * - * @author Alan Kaminsky + * @author Alan Kaminsky */ public final class Chromaticity extends EnumSyntax implements DocAttribute, PrintRequestAttribute, PrintJobAttribute { + /** + * Use serialVersionUID from JDK 1.4 for interoperability. + */ private static final long serialVersionUID = 4660543931355214012L; /** @@ -103,32 +85,37 @@ */ public static final Chromaticity COLOR = new Chromaticity(1); - /** * Construct a new chromaticity enumeration value with the given integer * value. * - * @param value Integer value. + * @param value Integer value */ protected Chromaticity(int value) { super(value); } + /** + * The string table for class {@code Chromaticity}. + */ private static final String[] myStringTable = {"monochrome", "color"}; + /** + * The enumeration value table for class {@code Chromaticity}. + */ private static final Chromaticity[] myEnumValueTable = {MONOCHROME, COLOR}; /** - * Returns the string table for class Chromaticity. + * Returns the string table for class {@code Chromaticity}. */ protected String[] getStringTable() { return myStringTable; } /** - * Returns the enumeration value table for class Chromaticity. + * Returns the enumeration value table for class {@code Chromaticity}. */ protected EnumSyntax[] getEnumValueTable() { return myEnumValueTable; @@ -137,11 +124,12 @@ /** * Get the printing attribute class which is to be used as the "category" * for this printing attribute value. - *
- * For class Chromaticity, the category is the class Chromaticity itself. + *
+ * For class {@code Chromaticity}, the category is the class + * {@code Chromaticity} itself. * - * @return Printing attribute class (category), an instance of class - * {@link java.lang.Class java.lang.Class}. + * @return printing attribute class (category), an instance of class + * {@link Class java.lang.Class} */ public final Class extends Attribute> getCategory() { return Chromaticity.class; @@ -150,13 +138,13 @@ /** * Get the name of the category of which this attribute value is an * instance. - *
- * For class Chromaticity, the category name is {@code "chromaticity"}. + *
+ * For class {@code Chromaticity}, the category name is + * {@code "chromaticity"}. * - * @return Attribute category name. + * @return attribute category name */ - public final String getName() { - return "chromaticity"; - } - - } + public final String getName() { + return "chromaticity"; + } +} diff -r 000f4e4ddd39 -r 57173ad5c534 jdk/src/java.desktop/share/classes/javax/print/attribute/standard/ColorSupported.java --- a/jdk/src/java.desktop/share/classes/javax/print/attribute/standard/ColorSupported.java Fri Sep 01 14:13:40 2017 +0000 +++ b/jdk/src/java.desktop/share/classes/javax/print/attribute/standard/ColorSupported.java Sat Sep 09 14:36:45 2017 +0200 @@ -1,5 +1,5 @@ /* - * Copyright (c) 2000, 2014, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2000, 2017, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -22,6 +22,7 @@ * or visit www.oracle.com if you need additional information or have any * questions. */ + package javax.print.attribute.standard; import javax.print.attribute.Attribute; @@ -29,35 +30,39 @@ import javax.print.attribute.PrintServiceAttribute; /** - * Class ColorSupported is a printing attribute class, an enumeration, that - * identifies whether the device is capable of any type of color printing at - * all, including highlight color as well as full process color. All document + * Class {@code ColorSupported} is a printing attribute class, an enumeration, + * that identifies whether the device is capable of any type of color printing + * at all, including highlight color as well as full process color. All document * instructions having to do with color are embedded within the print data (none * are attributes attached to the job outside the print data). - *
+ *
* Note: End users are able to determine the nature and details of the color - * support by querying the {@link PrinterMoreInfoManufacturer - * PrinterMoreInfoManufacturer} attribute. - *
- * Don't confuse the ColorSupported attribute with the {@link Chromaticity - * Chromaticity} attribute. {@link Chromaticity Chromaticity} is an attribute - * the client can specify for a job to tell the printer whether to print a - * document in monochrome or color, possibly causing the printer to print a - * color document in monochrome. ColorSupported is a printer description - * attribute that tells whether the printer can print in color regardless of how - * the client specifies to print any particular document. - *
- * IPP Compatibility: The IPP boolean value is "true" for SUPPORTED and - * "false" for NOT_SUPPORTED. The category name returned by - * {@code getName()} is the IPP attribute name. The enumeration's - * integer value is the IPP enum value. The {@code toString()} method - * returns the IPP string representation of the attribute value. + * support by querying the + * {@link PrinterMoreInfoManufacturer PrinterMoreInfoManufacturer} attribute. + *
+ * Don't confuse the {@code ColorSupported} attribute with the + * {@link Chromaticity Chromaticity} attribute. + * {@link Chromaticity Chromaticity} is an attribute the client can specify for + * a job to tell the printer whether to print a document in monochrome or color, + * possibly causing the printer to print a color document in monochrome. + * {@code ColorSupported} is a printer description attribute that tells whether + * the printer can print in color regardless of how the client specifies to + * print any particular document. + *
+ * IPP Compatibility: The IPP boolean value is "true" for SUPPORTED and + * "false" for NOT_SUPPORTED. The category name returned by {@code getName()} is + * the IPP attribute name. The enumeration's integer value is the IPP enum + * value. The {@code toString()} method returns the IPP string representation of + * the attribute value. * - * @author Alan Kaminsky + * @author Alan Kaminsky */ public final class ColorSupported extends EnumSyntax implements PrintServiceAttribute { + /** + * Use serialVersionUID from JDK 1.4 for interoperability. + */ private static final long serialVersionUID = -2700555589688535545L; /** @@ -66,36 +71,42 @@ public static final ColorSupported NOT_SUPPORTED = new ColorSupported(0); /** - * The printer is capable of some type of color printing, such as - * highlight color or full process color. + * The printer is capable of some type of color printing, such as highlight + * color or full process color. */ public static final ColorSupported SUPPORTED = new ColorSupported(1); /** - * Construct a new color supported enumeration value with the given - * integer value. + * Construct a new color supported enumeration value with the given integer + * value. * - * @param value Integer value. + * @param value Integer value */ protected ColorSupported(int value) { super (value); } + /** + * The string table for class {@code ColorSupported}. + */ private static final String[] myStringTable = {"not-supported", "supported"}; + /** + * The enumeration value table for class {@code ColorSupported}. + */ private static final ColorSupported[] myEnumValueTable = {NOT_SUPPORTED, SUPPORTED}; /** - * Returns the string table for class ColorSupported. + * Returns the string table for class {@code ColorSupported}. */ protected String[] getStringTable() { return myStringTable; } /** - * Returns the enumeration value table for class ColorSupported. + * Returns the enumeration value table for class {@code ColorSupported}. */ protected EnumSyntax[] getEnumValueTable() { return myEnumValueTable; @@ -104,11 +115,12 @@ /** * Get the printing attribute class which is to be used as the "category" * for this printing attribute value. - *
- * For class ColorSupported, the category is class ColorSupported itself. + *
+ * For class {@code ColorSupported}, the category is class + * {@code ColorSupported} itself. * - * @return Printing attribute class (category), an instance of class - * {@link java.lang.Class java.lang.Class}. + * @return printing attribute class (category), an instance of class + * {@link Class java.lang.Class} */ public final Class extends Attribute> getCategory() { return ColorSupported.class; @@ -117,13 +129,13 @@ /** * Get the name of the category of which this attribute value is an * instance. - *
- * For class ColorSupported, the category name is {@code "color-supported"}. + *
+ * For class {@code ColorSupported}, the category name is + * {@code "color-supported"} * - * @return Attribute category name. + * @return attribute category name */ public final String getName() { return "color-supported"; } - } diff -r 000f4e4ddd39 -r 57173ad5c534 jdk/src/java.desktop/share/classes/javax/print/attribute/standard/Compression.java --- a/jdk/src/java.desktop/share/classes/javax/print/attribute/standard/Compression.java Fri Sep 01 14:13:40 2017 +0000 +++ b/jdk/src/java.desktop/share/classes/javax/print/attribute/standard/Compression.java Sat Sep 09 14:36:45 2017 +0200 @@ -1,5 +1,5 @@ /* - * Copyright (c) 2000, 2014, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2000, 2017, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -22,29 +22,33 @@ * or visit www.oracle.com if you need additional information or have any * questions. */ + package javax.print.attribute.standard; import javax.print.attribute.Attribute; +import javax.print.attribute.DocAttribute; import javax.print.attribute.EnumSyntax; -import javax.print.attribute.DocAttribute; /** - * Class Compression is a printing attribute class, an enumeration, that - * specifies how print data is compressed. Compression is an attribute of the - * print data (the doc), not of the Print Job. If a Compression attribute is not - * specified for a doc, the printer assumes the doc's print data is uncompressed - * (i.e., the default Compression value is always {@link #NONE - * NONE}). - *
- * IPP Compatibility: The category name returned by - * {@code getName()} is the IPP attribute name. The enumeration's - * integer value is the IPP enum value. The {@code toString()} method - * returns the IPP string representation of the attribute value. + * Class {@code Compression} is a printing attribute class, an enumeration, that + * specifies how print data is compressed. {@code Compression} is an attribute + * of the print data (the doc), not of the Print Job. If a {@code Compression} + * attribute is not specified for a doc, the printer assumes the doc's print + * data is uncompressed (i.e., the default Compression value is always + * {@link #NONE NONE}). + *
+ * IPP Compatibility: The category name returned by {@code getName()} is + * the IPP attribute name. The enumeration's integer value is the IPP enum + * value. The {@code toString()} method returns the IPP string representation of + * the attribute value. * - * @author Alan Kaminsky + * @author Alan Kaminsky */ public class Compression extends EnumSyntax implements DocAttribute { + /** + * Use serialVersionUID from JDK 1.4 for interoperability. + */ private static final long serialVersionUID = -5716748913324997674L; /** @@ -59,7 +63,7 @@ /** * GNU zip compression technology described in - * RFC 1952. + * RFC 1952. */ public static final Compression GZIP = new Compression(2); @@ -72,32 +76,37 @@ * Construct a new compression enumeration value with the given integer * value. * - * @param value Integer value. + * @param value Integer value */ protected Compression(int value) { super(value); } - + /** + * The string table for class {@code Compression}. + */ private static final String[] myStringTable = {"none", "deflate", "gzip", "compress"}; + /** + * The enumeration value table for class {@code Compression}. + */ private static final Compression[] myEnumValueTable = {NONE, DEFLATE, GZIP, COMPRESS}; /** - * Returns the string table for class Compression. + * Returns the string table for class {@code Compression}. */ protected String[] getStringTable() { return myStringTable.clone(); } /** - * Returns the enumeration value table for class Compression. + * Returns the enumeration value table for class {@code Compression}. */ protected EnumSyntax[] getEnumValueTable() { return (EnumSyntax[])myEnumValueTable.clone(); @@ -106,12 +115,12 @@ /** * Get the printing attribute class which is to be used as the "category" * for this printing attribute value. - *
- * For class Compression and any vendor-defined subclasses, the category is - * class Compression itself. + *
+ * For class {@code Compression} and any vendor-defined subclasses, the + * category is class {@code Compression} itself. * - * @return Printing attribute class (category), an instance of class - * {@link java.lang.Class java.lang.Class}. + * @return printing attribute class (category), an instance of class + * {@link Class java.lang.Class} */ public final Class extends Attribute> getCategory() { return Compression.class; @@ -120,14 +129,13 @@ /** * Get the name of the category of which this attribute value is an * instance. - *
- * For class Compression and any vendor-defined subclasses, the category - * name is {@code "compression"}. + *
+ * For class {@code Compression} and any vendor-defined subclasses, the + * category name is {@code "compression"}. * - * @return Attribute category name. + * @return attribute category name */ public final String getName() { return "compression"; } - } diff -r 000f4e4ddd39 -r 57173ad5c534 jdk/src/java.desktop/share/classes/javax/print/attribute/standard/Copies.java --- a/jdk/src/java.desktop/share/classes/javax/print/attribute/standard/Copies.java Fri Sep 01 14:13:40 2017 +0000 +++ b/jdk/src/java.desktop/share/classes/javax/print/attribute/standard/Copies.java Sat Sep 09 14:36:45 2017 +0200 @@ -1,5 +1,5 @@ /* - * Copyright (c) 2000, 2013, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2000, 2017, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -22,64 +22,60 @@ * or visit www.oracle.com if you need additional information or have any * questions. */ + package javax.print.attribute.standard; import javax.print.attribute.Attribute; import javax.print.attribute.IntegerSyntax; +import javax.print.attribute.PrintJobAttribute; import javax.print.attribute.PrintRequestAttribute; -import javax.print.attribute.PrintJobAttribute; /** - * Class Copies is an integer valued printing attribute class that specifies the - * number of copies to be printed. - *
+ * Class {@code Copies} is an integer valued printing attribute class that + * specifies the number of copies to be printed. + *
* On many devices the supported number of collated copies will be limited by * the number of physical output bins on the device, and may be different from * the number of uncollated copies which can be supported. - *
- * The effect of a Copies attribute with a value of n on a multidoc print - * job (a job with multiple documents) depends on the (perhaps defaulted) value - * of the {@link MultipleDocumentHandling MultipleDocumentHandling} attribute: - *
+ * The effect of a {@code Copies} attribute with a value of n on a + * multidoc print job (a job with multiple documents) depends on the (perhaps + * defaulted) value of the + * {@link MultipleDocumentHandling MultipleDocumentHandling} attribute: + *
+ * IPP Compatibility: The integer value gives the IPP integer value. The + * category name returned by {@code getName()} gives the IPP attribute name. * - *
- * IPP Compatibility: The integer value gives the IPP integer value. The - * category name returned by {@code getName()} gives the IPP attribute - * name. - * - * @author David Mendenhall - * @author Alan Kamihensky + * @author David Mendenhall + * @author Alan Kamihensky */ public final class Copies extends IntegerSyntax implements PrintRequestAttribute, PrintJobAttribute { + /** + * Use serialVersionUID from JDK 1.4 for interoperability. + */ private static final long serialVersionUID = -6426631521680023833L; /** * Construct a new copies attribute with the given integer value. * - * @param value Integer value. - * - * @exception IllegalArgumentException - * (Unchecked exception) Thrown if {@code value} is less than 1. + * @param value Integer value + * @throws IllegalArgumentException if {@code value < 1} */ public Copies(int value) { super (value, 1, Integer.MAX_VALUE); @@ -88,20 +84,15 @@ /** * Returns whether this copies attribute is equivalent to the passed in * object. To be equivalent, all of the following conditions must be true: - *
- * For class Copies, the category is class Copies itself. + *
+ * For class {@code Copies}, the category is class {@code Copies} itself. * - * @return Printing attribute class (category), an instance of class - * {@link java.lang.Class java.lang.Class}. + * @return printing attribute class (category), an instance of class + * {@link Class java.lang.Class} */ public final Class extends Attribute> getCategory() { return Copies.class; @@ -123,13 +114,12 @@ /** * Get the name of the category of which this attribute value is an * instance. - *
- * For class Copies, the category name is {@code "copies"}. + *
+ * For class {@code Copies}, the category name is {@code "copies"}. * - * @return Attribute category name. + * @return attribute category name */ public final String getName() { return "copies"; } - } diff -r 000f4e4ddd39 -r 57173ad5c534 jdk/src/java.desktop/share/classes/javax/print/attribute/standard/CopiesSupported.java --- a/jdk/src/java.desktop/share/classes/javax/print/attribute/standard/CopiesSupported.java Fri Sep 01 14:13:40 2017 +0000 +++ b/jdk/src/java.desktop/share/classes/javax/print/attribute/standard/CopiesSupported.java Sat Sep 09 14:36:45 2017 +0200 @@ -1,5 +1,5 @@ /* - * Copyright (c) 2000, 2014, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2000, 2017, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -22,6 +22,7 @@ * or visit www.oracle.com if you need additional information or have any * questions. */ + package javax.print.attribute.standard; import javax.print.attribute.Attribute; @@ -29,33 +30,34 @@ import javax.print.attribute.SupportedValuesAttribute; /** - * Class CopiesSupported is a printing attribute class, a set of integers, that - * gives the supported values for a {@link Copies Copies} attribute. It is - * restricted to a single contiguous range of integers; multiple non-overlapping - * ranges are not allowed. - *
- * IPP Compatibility: The CopiesSupported attribute's canonical array + * Class {@code CopiesSupported} is a printing attribute class, a set of + * integers, that gives the supported values for a {@link Copies Copies} + * attribute. It is restricted to a single contiguous range of integers; + * multiple non-overlapping ranges are not allowed. + *
+ * IPP Compatibility: The CopiesSupported attribute's canonical array * form gives the lower and upper bound for the range of copies to be included - * in an IPP "copies-supported" attribute. See class {@link - * javax.print.attribute.SetOfIntegerSyntax SetOfIntegerSyntax} for an - * explanation of canonical array form. The category name returned by - * {@code getName()} gives the IPP attribute name. + * in an IPP "copies-supported" attribute. See class + * {@link SetOfIntegerSyntax SetOfIntegerSyntax} for an explanation of canonical + * array form. The category name returned by {@code getName()} gives the IPP + * attribute name. * - * @author Alan Kaminsky + * @author Alan Kaminsky */ public final class CopiesSupported extends SetOfIntegerSyntax implements SupportedValuesAttribute { + /** + * Use serialVersionUID from JDK 1.4 for interoperability. + */ private static final long serialVersionUID = 6927711687034846001L; /** * Construct a new copies supported attribute containing a single integer. - * That is, only the one value of Copies is supported. + * That is, only the one value of {@code Copies} is supported. * - * @param member Set member. - * - * @exception IllegalArgumentException - * (Unchecked exception) Thrown if {@code member} is less than 1. + * @param member set member + * @throws IllegalArgumentException if {@code member < 1} */ public CopiesSupported(int member) { super (member); @@ -66,16 +68,14 @@ /** * Construct a new copies supported attribute containing a single range of - * integers. That is, only those values of Copies in the one range are - * supported. + * integers. That is, only those values of {@code Copies} in the one range + * are supported. * - * @param lowerBound Lower bound of the range. - * @param upperBound Upper bound of the range. - * - * @exception IllegalArgumentException - * (Unchecked exception) Thrown if a null range is specified or if a - * non-null range is specified with {@code lowerBound} less than - * 1. + * @param lowerBound Lower bound of the range + * @param upperBound Upper bound of the range + * @throws IllegalArgumentException if a {@code null} range is specified or + * if a {@code non-null} range is specified with {@code lowerBound} + * less than 1 */ public CopiesSupported(int lowerBound, int upperBound) { super(lowerBound, upperBound); @@ -91,20 +91,16 @@ * Returns whether this copies supported attribute is equivalent to the * passed in object. To be equivalent, all of the following conditions must * be true: - *
- * For class CopiesSupported, the category - * is class CopiesSupported itself. + *
+ * For class {@code CopiesSupported}, the category is class + * {@code CopiesSupported} itself. * - * @return Printing attribute class (category), an instance of class - * {@link java.lang.Class java.lang.Class}. + * @return printing attribute class (category), an instance of class + * {@link Class java.lang.Class} */ public final Class extends Attribute> getCategory() { return CopiesSupported.class; @@ -127,14 +123,13 @@ /** * Get the name of the category of which this attribute value is an * instance. - *
- * For class CopiesSupported, the category - * name is {@code "copies-supported"}. + *
+ * For class {@code CopiesSupported}, the category name is + * {@code "copies-supported"}. * - * @return Attribute category name. + * @return attribute category name */ public final String getName() { return "copies-supported"; } - } diff -r 000f4e4ddd39 -r 57173ad5c534 jdk/src/java.desktop/share/classes/javax/print/attribute/standard/DateTimeAtCompleted.java --- a/jdk/src/java.desktop/share/classes/javax/print/attribute/standard/DateTimeAtCompleted.java Fri Sep 01 14:13:40 2017 +0000 +++ b/jdk/src/java.desktop/share/classes/javax/print/attribute/standard/DateTimeAtCompleted.java Sat Sep 09 14:36:45 2017 +0200 @@ -1,5 +1,5 @@ /* - * Copyright (c) 2000, 2014, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2000, 2017, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -22,47 +22,50 @@ * or visit www.oracle.com if you need additional information or have any * questions. */ + package javax.print.attribute.standard; +import java.util.Calendar; import java.util.Date; + import javax.print.attribute.Attribute; import javax.print.attribute.DateTimeSyntax; import javax.print.attribute.PrintJobAttribute; /** - * Class DateTimeAtCompleted is a printing attribute class, a date-time + * Class {@code DateTimeAtCompleted} is a printing attribute class, a date-time * attribute, that indicates the date and time at which the Print Job completed * (or was canceled or aborted). - *
- * To construct a DateTimeAtCompleted attribute from separate values of the - * year, month, day, hour, minute, and so on, use a {@link java.util.Calendar - * Calendar} object to construct a {@link java.util.Date Date} object, then use - * the {@link java.util.Date Date} object to construct the DateTimeAtCompleted - * attribute. To convert a DateTimeAtCompleted attribute to separate values of - * the year, month, day, hour, minute, and so on, create a {@link - * java.util.Calendar Calendar} object and set it to the {@link java.util.Date - * Date} from the DateTimeAtCompleted attribute. - *
- * IPP Compatibility: The information needed to construct an IPP + *
+ * To construct a {@code DateTimeAtCompleted} attribute from separate values of + * the year, month, day, hour, minute, and so on, use a + * {@link Calendar Calendar} object to construct a {@link Date Date} object, + * then use the {@link Date Date} object to construct the DateTimeAtCompleted + * attribute. To convert a {@code DateTimeAtCompleted} attribute to separate + * values of the year, month, day, hour, minute, and so on, create a + * {@link Calendar Calendar} object and set it to the {@link Date Date} from the + * {@code DateTimeAtCompleted} attribute. + *
+ * IPP Compatibility: The information needed to construct an IPP * "date-time-at-completed" attribute can be obtained as described above. The - * category name returned by {@code getName()} gives the IPP attribute - * name. + * category name returned by {@code getName()} gives the IPP attribute name. * - * @author Alan Kaminsky + * @author Alan Kaminsky */ public final class DateTimeAtCompleted extends DateTimeSyntax implements PrintJobAttribute { + /** + * Use serialVersionUID from JDK 1.4 for interoperability. + */ private static final long serialVersionUID = 6497399708058490000L; /** - * Construct a new date-time at completed attribute with the given {@link - * java.util.Date Date} value. + * Construct a new date-time at completed attribute with the given + * {@link Date Date} value. * - * @param dateTime {@link java.util.Date Date} value. - * - * @exception NullPointerException - * (unchecked exception) Thrown if {@code dateTime} is null. + * @param dateTime {@link Date Date} value + * @throws NullPointerException if {@code dateTime} is {@code null} */ public DateTimeAtCompleted(Date dateTime) { super (dateTime); @@ -72,38 +75,34 @@ * Returns whether this date-time at completed attribute is equivalent to * the passed in object. To be equivalent, all of the following conditions * must be true: - *
- * For class DateTimeAtCompleted, the category is class - * DateTimeAtCompleted itself. - * - * @return Printing attribute class (category), an instance of class - * {@link java.lang.Class java.lang.Class}. - */ + *
+ * For class {@code DateTimeAtCompleted}, the category is class + * {@code DateTimeAtCompleted} itself. + * + * @return printing attribute class (category), an instance of class + * {@link Class java.lang.Class} + */ public final Class extends Attribute> getCategory() { return DateTimeAtCompleted.class; } @@ -111,14 +110,13 @@ /** * Get the name of the category of which this attribute value is an * instance. - *
- * For class DateTimeAtCompleted, the category name is + *
+ * For class {@code DateTimeAtCompleted}, the category name is * {@code "date-time-at-completed"}. * - * @return Attribute category name. + * @return attribute category name */ public final String getName() { return "date-time-at-completed"; } - } diff -r 000f4e4ddd39 -r 57173ad5c534 jdk/src/java.desktop/share/classes/javax/print/attribute/standard/DateTimeAtCreation.java --- a/jdk/src/java.desktop/share/classes/javax/print/attribute/standard/DateTimeAtCreation.java Fri Sep 01 14:13:40 2017 +0000 +++ b/jdk/src/java.desktop/share/classes/javax/print/attribute/standard/DateTimeAtCreation.java Sat Sep 09 14:36:45 2017 +0200 @@ -1,5 +1,5 @@ /* - * Copyright (c) 2000, 2014, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2000, 2017, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -22,70 +22,69 @@ * or visit www.oracle.com if you need additional information or have any * questions. */ + package javax.print.attribute.standard; +import java.util.Calendar; import java.util.Date; + import javax.print.attribute.Attribute; import javax.print.attribute.DateTimeSyntax; import javax.print.attribute.PrintJobAttribute; /** - * Class DateTimeAtCreation is a printing attribute class, a date-time + * Class {@code DateTimeAtCreation} is a printing attribute class, a date-time * attribute, that indicates the date and time at which the Print Job was * created. - *
- * To construct a DateTimeAtCreation attribute from separate values of the year, - * month, day, hour, minute, and so on, use a {@link java.util.Calendar - * Calendar} object to construct a {@link java.util.Date Date} object, then use - * the {@link java.util.Date Date} object to construct the DateTimeAtCreation - * attribute. To convert a DateTimeAtCreation attribute to separate values of - * the year, month, day, hour, minute, and so on, create a {@link - * java.util.Calendar Calendar} object and set it to the {@link java.util.Date - * Date} from the DateTimeAtCreation attribute. - *
- * IPP Compatibility: The information needed to construct an IPP + *
+ * To construct a {@code DateTimeAtCreation} attribute from separate values of + * the year, month, day, hour, minute, and so on, use a + * {@link Calendar Calendar} object to construct a {@link Date Date} object, + * then use the {@link Date Date} object to construct the DateTimeAtCreation + * attribute. To convert a {@code DateTimeAtCreation} attribute to separate + * values of the year, month, day, hour, minute, and so on, create a + * {@link Calendar Calendar} object and set it to the {@link Date Date} from the + * {@code DateTimeAtCreation} attribute. + *
+ * IPP Compatibility: The information needed to construct an IPP * "date-time-at-creation" attribute can be obtained as described above. The - * category name returned by {@code getName()} gives the IPP attribute - * name. + * category name returned by {@code getName()} gives the IPP attribute name. * - * @author Alan Kaminsky + * @author Alan Kaminsky */ public final class DateTimeAtCreation extends DateTimeSyntax implements PrintJobAttribute { + /** + * Use serialVersionUID from JDK 1.4 for interoperability. + */ private static final long serialVersionUID = -2923732231056647903L; /** - * Construct a new date-time at creation attribute with the given {@link - * java.util.Date Date} value. + * Construct a new date-time at creation attribute with the given + * {@link Date Date} value. * - * @param dateTime {@link java.util.Date Date} value. - * - * @exception NullPointerException - * (unchecked exception) Thrown if {@code dateTime} is null. + * @param dateTime {@link Date Date} value + * @throws NullPointerException if {@code dateTime} is {@code null} */ public DateTimeAtCreation(Date dateTime) { super (dateTime); } /** - * Returns whether this date-time at creation attribute is equivalent to - * the passed in object. To be equivalent, all of the following conditions - * must be true: - *
- * For class DateTimeAtCreation, the category is class - * DateTimeAtCreation itself. + *
+ * For class {@code DateTimeAtCreation}, the category is class + * {@code DateTimeAtCreation} itself. * - * @return Printing attribute class (category), an instance of class - * {@link java.lang.Class java.lang.Class}. + * @return printing attribute class (category), an instance of class + * {@link Class java.lang.Class} */ public final Class extends Attribute> getCategory() { return DateTimeAtCreation.class; @@ -109,14 +108,13 @@ /** * Get the name of the category of which this attribute value is an * instance. - *
- * For class DateTimeAtCreation, the category name is + *
+ * For class {@code DateTimeAtCreation}, the category name is * {@code "date-time-at-creation"}. * - * @return Attribute category name. + * @return attribute category name */ public final String getName() { return "date-time-at-creation"; } - } diff -r 000f4e4ddd39 -r 57173ad5c534 jdk/src/java.desktop/share/classes/javax/print/attribute/standard/DateTimeAtProcessing.java --- a/jdk/src/java.desktop/share/classes/javax/print/attribute/standard/DateTimeAtProcessing.java Fri Sep 01 14:13:40 2017 +0000 +++ b/jdk/src/java.desktop/share/classes/javax/print/attribute/standard/DateTimeAtProcessing.java Sat Sep 09 14:36:45 2017 +0200 @@ -1,5 +1,5 @@ /* - * Copyright (c) 2000, 2014, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2000, 2017, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -22,47 +22,50 @@ * or visit www.oracle.com if you need additional information or have any * questions. */ + package javax.print.attribute.standard; +import java.util.Calendar; import java.util.Date; + import javax.print.attribute.Attribute; import javax.print.attribute.DateTimeSyntax; import javax.print.attribute.PrintJobAttribute; /** - * Class DateTimeAtProcessing is a printing attribute class, a date-time + * Class {@code DateTimeAtProcessing} is a printing attribute class, a date-time * attribute, that indicates the date and time at which the Print Job first * began processing. - *
- * To construct a DateTimeAtProcessing attribute from separate values of the - * year, month, day, hour, minute, and so on, use a {@link java.util.Calendar - * Calendar} object to construct a {@link java.util.Date Date} object, then use - * the {@link java.util.Date Date} object to construct the DateTimeAtProcessing - * attribute. To convert a DateTimeAtProcessing attribute to separate values of - * the year, month, day, hour, minute, and so on, create a {@link - * java.util.Calendar Calendar} object and set it to the {@link java.util.Date - * Date} from the DateTimeAtProcessing attribute. - *
- * IPP Compatibility: The information needed to construct an IPP + *
+ * To construct a {@code DateTimeAtProcessing} attribute from separate values of + * the year, month, day, hour, minute, and so on, use a + * {@link Calendar Calendar} object to construct a {@link Date Date} object, + * then use the {@link Date Date} object to construct the DateTimeAtProcessing + * attribute. To convert a {@code DateTimeAtProcessing} attribute to separate + * values of the year, month, day, hour, minute, and so on, create a + * {@link Calendar Calendar} object and set it to the {@link Date Date} from the + * {@code DateTimeAtProcessing} attribute. + *
+ * IPP Compatibility: The information needed to construct an IPP * "date-time-at-processing" attribute can be obtained as described above. The - * category name returned by {@code getName()} gives the IPP attribute - * name. + * category name returned by {@code getName()} gives the IPP attribute name. * - * @author Alan Kaminsky + * @author Alan Kaminsky */ public final class DateTimeAtProcessing extends DateTimeSyntax implements PrintJobAttribute { + /** + * Use serialVersionUID from JDK 1.4 for interoperability. + */ private static final long serialVersionUID = -3710068197278263244L; /** - * Construct a new date-time at processing attribute with the given {@link - * java.util.Date Date} value. + * Construct a new date-time at processing attribute with the given + * {@link Date Date} value. * - * @param dateTime {@link java.util.Date Date} value. - * - * @exception NullPointerException - * (unchecked exception) Thrown if {@code dateTime} is null. + * @param dateTime {@link Date Date} value + * @throws NullPointerException if {@code dateTime} is {@code null} */ public DateTimeAtProcessing(Date dateTime) { super (dateTime); @@ -72,21 +75,17 @@ * Returns whether this date-time at processing attribute is equivalent to * the passed in object. To be equivalent, all of the following conditions * must be true: - *
- * For class DateTimeAtProcessing, the category is class - * DateTimeAtProcessing itself. + *
+ * For class {@code DateTimeAtProcessing}, the category is class + * {@code DateTimeAtProcessing} itself. * - * @return Printing attribute class (category), an instance of class - * {@link java.lang.Class java.lang.Class}. + * @return printing attribute class (category), an instance of class + * {@link Class java.lang.Class} */ public final Class extends Attribute> getCategory() { return DateTimeAtProcessing.class; @@ -110,14 +109,13 @@ /** * Get the name of the category of which this attribute value is an * instance. - *
- * For class DateTimeAtProcessing, the category name is + *
+ * For class {@code DateTimeAtProcessing}, the category name is * {@code "date-time-at-processing"}. * - * @return Attribute category name. + * @return attribute category name */ public final String getName() { return "date-time-at-processing"; } - } diff -r 000f4e4ddd39 -r 57173ad5c534 jdk/src/java.desktop/share/classes/javax/print/attribute/standard/Destination.java --- a/jdk/src/java.desktop/share/classes/javax/print/attribute/standard/Destination.java Fri Sep 01 14:13:40 2017 +0000 +++ b/jdk/src/java.desktop/share/classes/javax/print/attribute/standard/Destination.java Sat Sep 09 14:36:45 2017 +0200 @@ -1,5 +1,5 @@ /* - * Copyright (c) 2000, 2014, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2000, 2017, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -22,72 +22,70 @@ * or visit www.oracle.com if you need additional information or have any * questions. */ + package javax.print.attribute.standard; +import java.io.File; import java.net.URI; import javax.print.attribute.Attribute; -import javax.print.attribute.URISyntax; +import javax.print.attribute.PrintJobAttribute; import javax.print.attribute.PrintRequestAttribute; -import javax.print.attribute.PrintJobAttribute; +import javax.print.attribute.URISyntax; /** - * Class Destination is a printing attribute class, a URI, that is used to - * indicate an alternate destination for the spooled printer formatted - * data. Many PrintServices will not support the notion of a destination - * other than the printer device, and so will not support this attribute. + * Class {@code Destination} is a printing attribute class, a {@code URI}, that + * is used to indicate an alternate destination for the spooled printer + * formatted data. Many {@code PrintServices} will not support the notion of a + * destination other than the printer device, and so will not support this + * attribute. *
- * A common use for this attribute will be applications which want - * to redirect output to a local disk file : eg."file:out.prn". - * Note that proper construction of "file:" scheme URI instances should - * be performed using the {@code toURI()} method of class - * {@link java.io.File File}. - * See the documentation on that class for more information. + * A common use for this attribute will be applications which want to redirect + * output to a local disk file : eg."file:out.prn". Note that proper + * construction of "file:" scheme {@code URI} instances should be performed + * using the {@code toURI()} method of class {@link File File}. See the + * documentation on that class for more information. *
- * If a destination URI is specified in a PrintRequest and it is not - * accessible for output by the PrintService, a PrintException will be thrown. - * The PrintException may implement URIException to provide a more specific - * cause. - *
- * IPP Compatibility: Destination is not an IPP attribute. + * If a destination {@code URI} is specified in a PrintRequest and it is not + * accessible for output by the {@code PrintService}, a {@code PrintException} + * will be thrown. The {@code PrintException} may implement {@code URIException} + * to provide a more specific cause. + *
+ * IPP Compatibility: Destination is not an IPP attribute. * - * @author Phil Race. + * @author Phil Race */ public final class Destination extends URISyntax implements PrintJobAttribute, PrintRequestAttribute { + /** + * Use serialVersionUID from JDK 1.4 for interoperability. + */ private static final long serialVersionUID = 6776739171700415321L; /** - * Constructs a new destination attribute with the specified URI. + * Constructs a new destination attribute with the specified {@code URI}. * - * @param uri URI. - * - * @exception NullPointerException - * (unchecked exception) Thrown if {@code uri} is null. + * @param uri {@code URI} + * @throws NullPointerException if {@code uri} is {@code null} */ public Destination(URI uri) { super (uri); } /** - * Returns whether this destination attribute is equivalent to the - * passed in object. To be equivalent, all of the following conditions - * must be true: - *
- * For class Destination, the category is class Destination itself. + *
+ * For class {@code Destination}, the category is class {@code Destination} + * itself. * - * @return Printing attribute class (category), an instance of class - * {@link java.lang.Class java.lang.Class}. + * @return printing attribute class (category), an instance of class + * {@link Class java.lang.Class} */ public final Class extends Attribute> getCategory() { return Destination.class; @@ -110,13 +109,13 @@ /** * Get the name of the category of which this attribute value is an * instance. - *
- * For class Destination, the category name is {@code "spool-data-destination"}. + *
+ * For class {@code Destination}, the category name is + * {@code "spool-data-destination"}. * - * @return Attribute category name. + * @return attribute category name */ public final String getName() { return "spool-data-destination"; } - } diff -r 000f4e4ddd39 -r 57173ad5c534 jdk/src/java.desktop/share/classes/javax/print/attribute/standard/DialogTypeSelection.java --- a/jdk/src/java.desktop/share/classes/javax/print/attribute/standard/DialogTypeSelection.java Fri Sep 01 14:13:40 2017 +0000 +++ b/jdk/src/java.desktop/share/classes/javax/print/attribute/standard/DialogTypeSelection.java Sat Sep 09 14:36:45 2017 +0200 @@ -1,5 +1,5 @@ /* - * Copyright (c) 2003, 2014, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2003, 2017, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -25,107 +25,112 @@ package javax.print.attribute.standard; +import javax.print.attribute.Attribute; import javax.print.attribute.EnumSyntax; -import javax.print.attribute.Attribute; import javax.print.attribute.PrintRequestAttribute; /** - * Class DialogTypeSelection is a printing attribute class, an enumeration, - * that indicates the user dialog type to be used for specifying - * printing options. - * If {@code NATIVE} is specified, then where available, a native - * platform dialog is displayed. - * If {@code COMMON} is specified, a cross-platform print dialog is displayed. - * - * This option to specify a native dialog for use with an IPP attribute - * set provides a standard way to reflect back of the setting and option - * changes made by a user to the calling application, and integrates - * the native dialog into the Java printing APIs. - * But note that some options and settings in a native dialog may not - * necessarily map to IPP attributes as they may be non-standard platform, - * or even printer specific options. - *
- * IPP Compatibility: This is not an IPP attribute. + * Class {@code DialogTypeSelection} is a printing attribute class, an + * enumeration, that indicates the user dialog type to be used for specifying + * printing options. If {@code NATIVE} is specified, then where available, a + * native platform dialog is displayed. If {@code COMMON} is specified, a + * cross-platform print dialog is displayed. + *
+ * This option to specify a native dialog for use with an IPP attribute set + * provides a standard way to reflect back of the setting and option changes + * made by a user to the calling application, and integrates the native dialog + * into the Java printing APIs. But note that some options and settings in a + * native dialog may not necessarily map to IPP attributes as they may be + * non-standard platform, or even printer specific options. + *
+ * IPP Compatibility: This is not an IPP attribute. * * @since 1.7 */ public final class DialogTypeSelection extends EnumSyntax implements PrintRequestAttribute { + /** + * Use serialVersionUID from JDK 1.7 for interoperability. + */ private static final long serialVersionUID = 7518682952133256029L; /** - * + * The native platform print dialog should be used. */ public static final DialogTypeSelection NATIVE = new DialogTypeSelection(0); /** - * + * The cross-platform print dialog should be used. */ public static final DialogTypeSelection COMMON = new DialogTypeSelection(1); /** - * Constructs a new dialog type selection enumeration value with the - * given integer value. + * Constructs a new dialog type selection enumeration value with the given + * integer value. * - * @param value Integer value. + * @param value Integer value */ protected DialogTypeSelection(int value) { super(value); } + /** + * The string table for class {@code DialogTypeSelection}. + */ private static final String[] myStringTable = { "native", "common"}; - + /** + * The enumeration value table for class + * {@code DialogTypeSelection}. + */ private static final DialogTypeSelection[] myEnumValueTable = { NATIVE, COMMON }; /** - * Returns the string table for class DialogTypeSelection. + * Returns the string table for class {@code DialogTypeSelection}. */ protected String[] getStringTable() { return myStringTable; } /** - * Returns the enumeration value table for class DialogTypeSelection. + * Returns the enumeration value table for class + * {@code DialogTypeSelection}. */ protected EnumSyntax[] getEnumValueTable() { return myEnumValueTable; } - - /** + /** * Gets the printing attribute class which is to be used as the "category" * for this printing attribute value. - *
- * For class DialogTypeSelection the category is class - * DialogTypeSelection itself. + *
+ * For class {@code DialogTypeSelection} the category is class + * {@code DialogTypeSelection} itself. * - * @return Printing attribute class (category), an instance of class - * {@link java.lang.Class java.lang.Class}. + * @return printing attribute class (category), an instance of class + * {@link Class java.lang.Class} */ public final Class extends Attribute> getCategory() { return DialogTypeSelection.class; } - /** * Gets the name of the category of which this attribute value is an * instance. - *
- * For class DialogTypeSelection the category name is + *
+ * For class {@code DialogTypeSelection} the category name is * {@code "dialog-type-selection"}. * - * @return Attribute category name. + * @return attribute category name */ public final String getName() { return "dialog-type-selection"; } - } diff -r 000f4e4ddd39 -r 57173ad5c534 jdk/src/java.desktop/share/classes/javax/print/attribute/standard/DocumentName.java --- a/jdk/src/java.desktop/share/classes/javax/print/attribute/standard/DocumentName.java Fri Sep 01 14:13:40 2017 +0000 +++ b/jdk/src/java.desktop/share/classes/javax/print/attribute/standard/DocumentName.java Sat Sep 09 14:36:45 2017 +0200 @@ -1,5 +1,5 @@ /* - * Copyright (c) 2000, 2014, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2000, 2017, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -22,71 +22,67 @@ * or visit www.oracle.com if you need additional information or have any * questions. */ + package javax.print.attribute.standard; import java.util.Locale; import javax.print.attribute.Attribute; +import javax.print.attribute.DocAttribute; import javax.print.attribute.TextSyntax; -import javax.print.attribute.DocAttribute; /** - * Class DocumentName is a printing attribute class, a text attribute, that - * specifies the name of a document. DocumentName is an attribute of the print - * data (the doc), not of the Print Job. A document's name is an arbitrary - * string defined by the client. - * However if a JobName is not specified, the DocumentName should be used - * instead, which implies that supporting specification of DocumentName - * requires reporting of JobName and vice versa. - * See {@link JobName JobName} for more information. - *
- * IPP Compatibility: The string value gives the IPP name value. The + * Class {@code DocumentName} is a printing attribute class, a text attribute, + * that specifies the name of a document. {@code DocumentName} is an attribute + * of the print data (the doc), not of the Print Job. A document's name is an + * arbitrary string defined by the client. However if a JobName is not + * specified, the {@code DocumentName} should be used instead, which implies + * that supporting specification of {@code DocumentName} requires reporting of + * JobName and vice versa. See {@link JobName JobName} for more information. + *
+ * IPP Compatibility: The string value gives the IPP name value. The * locale gives the IPP natural language. The category name returned by * {@code getName()} gives the IPP attribute name. * - * @author Alan Kaminsky + * @author Alan Kaminsky */ public final class DocumentName extends TextSyntax implements DocAttribute { + /** + * Use serialVersionUID from JDK 1.4 for interoperability. + */ private static final long serialVersionUID = 7883105848533280430L; /** - * Constructs a new document name attribute with the given document name - * and locale. + * Constructs a new document name attribute with the given document name and + * locale. * - * @param documentName Document name. - * @param locale Natural language of the text string. null - * is interpreted to mean the default locale as returned - * by {@code Locale.getDefault()} - * - * @exception NullPointerException - * (unchecked exception) Thrown if {@code documentName} is null. + * @param documentName document name + * @param locale natural language of the text string. {@code null} is + * interpreted to mean the default locale as returned by + * {@code Locale.getDefault()} + * @throws NullPointerException if {@code documentName} is {@code null} */ public DocumentName(String documentName, Locale locale) { super (documentName, locale); } /** - * Returns whether this document name attribute is equivalent to the - * passed in object. - * To be equivalent, all of the following conditions must be true: - *
- * For class DocumentName, the category is class DocumentName itself. + *
+ * For class {@code DocumentName}, the category is class + * {@code DocumentName} itself. * - * @return Printing attribute class (category), an instance of class - * {@link java.lang.Class java.lang.Class}. + * @return printing attribute class (category), an instance of class + * {@link Class java.lang.Class} */ public final Class extends Attribute> getCategory() { return DocumentName.class; @@ -108,13 +105,13 @@ /** * Get the name of the category of which this attribute value is an * instance. - *
- * For class DocumentName, the category name is {@code "document-name"}. + *
+ * For class {@code DocumentName}, the category name is + * {@code "document-name"}. * - * @return Attribute category name. + * @return attribute category name */ public final String getName() { return "document-name"; } - } diff -r 000f4e4ddd39 -r 57173ad5c534 jdk/src/java.desktop/share/classes/javax/print/attribute/standard/Fidelity.java --- a/jdk/src/java.desktop/share/classes/javax/print/attribute/standard/Fidelity.java Fri Sep 01 14:13:40 2017 +0000 +++ b/jdk/src/java.desktop/share/classes/javax/print/attribute/standard/Fidelity.java Sat Sep 09 14:36:45 2017 +0200 @@ -1,5 +1,5 @@ /* - * Copyright (c) 2000, 2013, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2000, 2017, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -22,6 +22,7 @@ * or visit www.oracle.com if you need additional information or have any * questions. */ + package javax.print.attribute.standard; import javax.print.attribute.Attribute; @@ -30,27 +31,27 @@ import javax.print.attribute.PrintRequestAttribute; /** - * Class Fidelity is a printing attribute class, an enumeration, - * that indicates whether total fidelity to client supplied print request - * attributes is required. - * If FIDELITY_TRUE is specified and a service cannot print the job exactly - * as specified it must reject the job. - * If FIDELITY_FALSE is specified a reasonable attempt to print the job is - * acceptable. If not supplied the default is FIDELITY_FALSE. - * - *
- * IPP Compatibility: The IPP boolean value is "true" for FIDELITY_TRUE - * and "false" for FIDELITY_FALSE. The category name returned by - * {@code getName()} is the IPP attribute name. The enumeration's - * integer value is the IPP enum value. The {@code toString()} method - * returns the IPP string representation of the attribute value. - * See RFC 2911 Section 15.1 for - * a fuller description of the IPP fidelity attribute. - * + * Class {@code Fidelity} is a printing attribute class, an enumeration, that + * indicates whether total fidelity to client supplied print request attributes + * is required. If {@code FIDELITY_TRUE} is specified and a service cannot print + * the job exactly as specified it must reject the job. If + * {@code FIDELITY_FALSE} is specified a reasonable attempt to print the job is + * acceptable. If not supplied the default is {@code FIDELITY_FALSE}. + *
+ * IPP Compatibility: The IPP boolean value is "true" for + * {@code FIDELITY_TRUE} and "false" for {@code FIDELITY_FALSE}. The category + * name returned by {@code getName()} is the IPP attribute name. The + * enumeration's integer value is the IPP enum value. The {@code toString()} + * method returns the IPP string representation of the attribute value. See + * RFC 2911 Section 15.1 for a + * fuller description of the IPP fidelity attribute. */ public final class Fidelity extends EnumSyntax implements PrintJobAttribute, PrintRequestAttribute { + /** + * Use serialVersionUID from JDK 1.4 for interoperability. + */ private static final long serialVersionUID = 6320827847329172308L; /** @@ -60,53 +61,60 @@ FIDELITY_TRUE = new Fidelity(0); /** - * The printer should make reasonable attempts to print the job, - * even if it cannot print it exactly as specified. + * The printer should make reasonable attempts to print the job, even if it + * cannot print it exactly as specified. */ public static final Fidelity FIDELITY_FALSE = new Fidelity(1); /** - * Construct a new fidelity enumeration value with the - * given integer value. + * Construct a new fidelity enumeration value with the given integer value. * - * @param value Integer value. + * @param value Integer value */ protected Fidelity(int value) { super (value); } + /** + * The string table for class {@code Fidelity}. + */ private static final String[] myStringTable = { "true", "false" }; - + /** + * The enumeration value table for class {@code Fidelity}. + */ private static final Fidelity[] myEnumValueTable = { FIDELITY_TRUE, FIDELITY_FALSE }; /** - * Returns the string table for class Fidelity. + * Returns the string table for class {@code Fidelity}. */ protected String[] getStringTable() { return myStringTable; } /** - * Returns the enumeration value table for class Fidelity. + * Returns the enumeration value table for class {@code Fidelity}. */ protected EnumSyntax[] getEnumValueTable() { return myEnumValueTable; - } /** + } + + /** * Get the printing attribute class which is to be used as the "category" * for this printing attribute value. - *
- * For class Fidelity the category is class Fidelity itself. + *
+ * For class {@code Fidelity} the category is class + * {@code Fidelity} itself. * - * @return Printing attribute class (category), an instance of class - * {@link java.lang.Class java.lang.Class}. + * @return printing attribute class (category), an instance of class + * {@link Class java.lang.Class} */ public final Class extends Attribute> getCategory() { return Fidelity.class; @@ -115,14 +123,13 @@ /** * Get the name of the category of which this attribute value is an * instance. - *
- * For class Fidelity the category name is + *
+ * For class {@code Fidelity} the category name is * {@code "ipp-attribute-fidelity"}. * - * @return Attribute category name. + * @return attribute category name */ public final String getName() { return "ipp-attribute-fidelity"; } - } diff -r 000f4e4ddd39 -r 57173ad5c534 jdk/src/java.desktop/share/classes/javax/print/attribute/standard/Finishings.java --- a/jdk/src/java.desktop/share/classes/javax/print/attribute/standard/Finishings.java Fri Sep 01 14:13:40 2017 +0000 +++ b/jdk/src/java.desktop/share/classes/javax/print/attribute/standard/Finishings.java Sat Sep 09 14:36:45 2017 +0200 @@ -22,209 +22,134 @@ * or visit www.oracle.com if you need additional information or have any * questions. */ + package javax.print.attribute.standard; import javax.print.attribute.Attribute; +import javax.print.attribute.DocAttribute; import javax.print.attribute.EnumSyntax; -import javax.print.attribute.DocAttribute; +import javax.print.attribute.PrintJobAttribute; import javax.print.attribute.PrintRequestAttribute; -import javax.print.attribute.PrintJobAttribute; /** - * Class Finishings is a printing attribute class, an enumeration, that - * identifies whether the printer applies a finishing operation of some kind - * of binding to each copy of each printed document in the job. For multidoc - * print jobs (jobs with multiple documents), the - * {@link MultipleDocumentHandling - * MultipleDocumentHandling} attribute determines what constitutes a "copy" - * for purposes of finishing. - *
+ * Class {@code Finishings} is a printing attribute class, an enumeration, that + * identifies whether the printer applies a finishing operation of some kind of + * binding to each copy of each printed document in the job. For multidoc print + * jobs (jobs with multiple documents), the + * {@link MultipleDocumentHandling MultipleDocumentHandling} attribute + * determines what constitutes a "copy" for purposes of finishing. + *
* Standard Finishings values are: *
- * - * | - *- * {@link #NONE NONE} - * | - *- * {@link #STAPLE STAPLE} - * | - *- * {@link #EDGE_STITCH EDGE_STITCH} - * | - *|
- * - * | - *- * {@link #BIND BIND} - * | - *- * {@link #SADDLE_STITCH SADDLE_STITCH} - * | - *- * {@link #COVER COVER} - * | - *- * - * | - *
- * The following Finishings values are more specific; they indicate a + *
+ * The following {@code Finishings} values are more specific; they indicate a * corner or an edge as if the document were a portrait document: *
- * - * | - *- * {@link #STAPLE_TOP_LEFT STAPLE_TOP_LEFT} - * | - *- * {@link #EDGE_STITCH_LEFT EDGE_STITCH_LEFT} - * | - *- * {@link #STAPLE_DUAL_LEFT STAPLE_DUAL_LEFT} - * | - *- * - * | - *
- * - * | - *- * {@link #STAPLE_BOTTOM_LEFT STAPLE_BOTTOM_LEFT} - * | - *- * {@link #EDGE_STITCH_TOP EDGE_STITCH_TOP} - * | - *- * {@link #STAPLE_DUAL_TOP STAPLE_DUAL_TOP} - * | - *- * - * | - *
- * - * | - *- * {@link #STAPLE_TOP_RIGHT STAPLE_TOP_RIGHT} - * | - *- * {@link #EDGE_STITCH_RIGHT EDGE_STITCH_RIGHT} - * | - *- * {@link #STAPLE_DUAL_RIGHT STAPLE_DUAL_RIGHT} - * | - *- * - * | - *
- * - * | - *- * {@link #STAPLE_BOTTOM_RIGHT STAPLE_BOTTOM_RIGHT} - * | - *- * {@link #EDGE_STITCH_BOTTOM EDGE_STITCH_BOTTOM} - * | - *- * {@link #STAPLE_DUAL_BOTTOM STAPLE_DUAL_BOTTOM} - * | - *- * - * | - *
- * The STAPLE_XXX values are specified with respect to the - * document as if the document were a portrait document. If the document is - * actually a landscape or a reverse-landscape document, the client supplies the + *
+ * The STAPLE_XXX values are specified with respect to the document as if + * the document were a portrait document. If the document is actually a + * landscape or a reverse-landscape document, the client supplies the * appropriate transformed value. For example, to position a staple in the upper * left hand corner of a landscape document when held for reading, the client - * supplies the STAPLE_BOTTOM_LEFT value (since landscape is - * defined as a +90 degree rotation from portrait, i.e., anti-clockwise). On the - * other hand, to position a staple in the upper left hand corner of a + * supplies the {@code STAPLE_BOTTOM_LEFT} value (since landscape is defined as + * a +90 degree rotation from portrait, i.e., anti-clockwise). On the other + * hand, to position a staple in the upper left hand corner of a * reverse-landscape document when held for reading, the client supplies the - * STAPLE_TOP_RIGHT value (since reverse-landscape is defined as a - * -90 degree rotation from portrait, i.e., clockwise). - *
+ * {@code STAPLE_TOP_RIGHT} value (since reverse-landscape is defined as a -90 + * degree rotation from portrait, i.e., clockwise). + *
* The angle (vertical, horizontal, angled) of each staple with respect to the * document depends on the implementation which may in turn depend on the value * of the attribute. - *
- * The effect of a Finishings attribute on a multidoc print job (a job + *
+ * The effect of a {@code Finishings} attribute on a multidoc print job (a job * with multiple documents) depends on whether all the docs have the same * binding specified or whether different docs have different bindings - * specified, and on the (perhaps defaulted) value of the {@link - * MultipleDocumentHandling MultipleDocumentHandling} attribute. - *
+ * IPP Compatibility: Class Finishings encapsulates some of the IPP enum + * values that can be included in an IPP "finishings" attribute, which is a set + * of enums. The category name returned by {@code getName()} is the IPP + * attribute name. The enumeration's integer value is the IPP enum value. The + * {@code toString()} method returns the IPP string representation of the + * attribute value. In IPP Finishings is a multi-value attribute, this API + * currently allows only one binding to be specified. * - *
- * IPP Compatibility: Class Finishings encapsulates some of the - * IPP enum values that can be included in an IPP "finishings" attribute, which - * is a set of enums. The category name returned by - * {@code getName()} is the IPP attribute name. The enumeration's - * integer value is the IPP enum value. The {@code toString()} method - * returns the IPP string representation of the attribute value. - * In IPP Finishings is a multi-value attribute, this API currently allows - * only one binding to be specified. - * - * @author Alan Kaminsky + * @author Alan Kaminsky */ public class Finishings extends EnumSyntax implements DocAttribute, PrintRequestAttribute, PrintJobAttribute { + /** + * Use serialVersionUID from JDK 1.4 for interoperability. + */ private static final long serialVersionUID = -627840419548391754L; /** @@ -241,21 +166,21 @@ /** * This value is specified when it is desired to select a non-printed (or * pre-printed) cover for the document. This does not supplant the - * specification of a printed cover (on cover stock medium) by the - * document itself. + * specification of a printed cover (on cover stock medium) by the document + * itself. */ public static final Finishings COVER = new Finishings(6); /** - * This value indicates that a binding is to be applied to the document; - * the type and placement of the binding is site-defined. + * This value indicates that a binding is to be applied to the document; the + * type and placement of the binding is site-defined. */ public static final Finishings BIND = new Finishings(7); /** * Bind the document(s) with one or more staples (wire stitches) along the - * middle fold. The exact number and placement of the staples and the - * middle fold is implementation- and/or site-defined. + * middle fold. The exact number and placement of the staples and the middle + * fold is implementation- and/or site-defined. */ public static final Finishings SADDLE_STITCH = new Finishings(8); @@ -275,8 +200,7 @@ new Finishings(20); /** - * Bind the document(s) with one or more staples in the bottom left - * corner. + * Bind the document(s) with one or more staples in the bottom left corner. */ public static final Finishings STAPLE_BOTTOM_LEFT = new Finishings(21); @@ -288,8 +212,7 @@ new Finishings(22); /** - * Bind the document(s) with one or more staples in the bottom right - * corner. + * Bind the document(s) with one or more staples in the bottom right corner. */ public static final Finishings STAPLE_BOTTOM_RIGHT = new Finishings(23); @@ -327,15 +250,15 @@ new Finishings(27); /** - * Bind the document(s) with two staples (wire stitches) along the left - * edge assuming a portrait document (see above). + * Bind the document(s) with two staples (wire stitches) along the left edge + * assuming a portrait document (see above). */ public static final Finishings STAPLE_DUAL_LEFT = new Finishings(28); /** - * Bind the document(s) with two staples (wire stitches) along the top - * edge assuming a portrait document (see above). + * Bind the document(s) with two staples (wire stitches) along the top edge + * assuming a portrait document (see above). */ public static final Finishings STAPLE_DUAL_TOP = new Finishings(29); @@ -358,12 +281,15 @@ * Construct a new finishings binding enumeration value with the given * integer value. * - * @param value Integer value. + * @param value Integer value */ protected Finishings(int value) { super(value); } + /** + * The string table for class {@code Finishings}. + */ private static final String[] myStringTable = {"none", "staple", @@ -396,6 +322,9 @@ "staple-dual-bottom" }; + /** + * The enumeration value table for class {@code Finishings}. + */ private static final Finishings[] myEnumValueTable = {NONE, STAPLE, @@ -429,21 +358,21 @@ }; /** - * Returns the string table for class Finishings. + * Returns the string table for class {@code Finishings}. */ protected String[] getStringTable() { return myStringTable.clone(); } /** - * Returns the enumeration value table for class Finishings. + * Returns the enumeration value table for class {@code Finishings}. */ protected EnumSyntax[] getEnumValueTable() { return (EnumSyntax[])myEnumValueTable.clone(); } /** - * Returns the lowest integer value used by class Finishings. + * Returns the lowest integer value used by class {@code Finishings}. */ protected int getOffset() { return 3; @@ -452,12 +381,12 @@ /** * Get the printing attribute class which is to be used as the "category" * for this printing attribute value. - *
- * For class Finishings and any vendor-defined subclasses, the - * category is class Finishings itself. + *
+ * For class {@code Finishings} and any vendor-defined subclasses, the + * category is class {@code Finishings} itself. * - * @return Printing attribute class (category), an instance of class - * {@link java.lang.Class java.lang.Class}. + * @return printing attribute class (category), an instance of class + * {@link Class java.lang.Class} */ public final Class extends Attribute> getCategory() { return Finishings.class; @@ -466,14 +395,13 @@ /** * Get the name of the category of which this attribute value is an * instance. - *
- * For class Finishings and any vendor-defined subclasses, the + *
+ * For class {@code Finishings} and any vendor-defined subclasses, the * category name is {@code "finishings"}. * - * @return Attribute category name. + * @return attribute category name */ public final String getName() { return "finishings"; } - } diff -r 000f4e4ddd39 -r 57173ad5c534 jdk/src/java.desktop/share/classes/javax/print/attribute/standard/JobHoldUntil.java --- a/jdk/src/java.desktop/share/classes/javax/print/attribute/standard/JobHoldUntil.java Fri Sep 01 14:13:40 2017 +0000 +++ b/jdk/src/java.desktop/share/classes/javax/print/attribute/standard/JobHoldUntil.java Sat Sep 09 14:36:45 2017 +0200 @@ -1,5 +1,5 @@ /* - * Copyright (c) 2000, 2014, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2000, 2017, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -22,116 +22,118 @@ * or visit www.oracle.com if you need additional information or have any * questions. */ + package javax.print.attribute.standard; +import java.util.Calendar; import java.util.Date; + import javax.print.attribute.Attribute; import javax.print.attribute.DateTimeSyntax; +import javax.print.attribute.PrintJobAttribute; import javax.print.attribute.PrintRequestAttribute; -import javax.print.attribute.PrintJobAttribute; /** - * Class JobHoldUntil is a printing attribute class, a date-time attribute, that - * specifies the exact date and time at which the job must become a candidate - * for printing. - *
+ * Class {@code JobHoldUntil} is a printing attribute class, a date-time + * attribute, that specifies the exact date and time at which the job must + * become a candidate for printing. + *
* If the value of this attribute specifies a date-time that is in the future, * the printer should add the {@link JobStateReason JobStateReason} value of - * JOB_HOLD_UNTIL_SPECIFIED to the job's {@link JobStateReasons JobStateReasons} - * attribute, must move the job to the PENDING_HELD state, and must not schedule - * the job for printing until the specified date-time arrives. - *
- * When the specified date-time arrives, the printer must remove the {@link - * JobStateReason JobStateReason} value of JOB_HOLD_UNTIL_SPECIFIED from the - * job's {@link JobStateReasons JobStateReasons} attribute, if present. If there - * are no other job state reasons that keep the job in the PENDING_HELD state, - * the printer must consider the job as a candidate for processing by moving the - * job to the PENDING state. - *
+ * {@code JOB_HOLD_UNTIL_SPECIFIED} to the job's + * {@link JobStateReasons JobStateReasons} attribute, must move the job to the + * {@code PENDING_HELD} state, and must not schedule the job for printing until + * the specified date-time arrives. + *
+ * When the specified date-time arrives, the printer must remove the + * {@link JobStateReason JobStateReason} value of + * {@code JOB_HOLD_UNTIL_SPECIFIED} from the job's + * {@link JobStateReasons JobStateReasons} attribute, if present. If there are + * no other job state reasons that keep the job in the {@code PENDING_HELD} + * state, the printer must consider the job as a candidate for processing by + * moving the job to the PENDING state. + *
* If the specified date-time has already passed, the job must be a candidate * for processing immediately. Thus, one way to make the job immediately become - * a candidate for processing is to specify a JobHoldUntil attribute constructed - * like this (denoting a date-time of January 1, 1970, 00:00:00 GMT): - *
+ * a candidate for processing is to specify a {@code JobHoldUntil} attribute + * constructed like this + * (denoting a date-time of January 1, 1970, 00:00:00 GMT): + *+ ** JobHoldUntil immediately = new JobHoldUntil (new Date (0L)); - *- *+ *
* If the client does not supply this attribute in a Print Request and the * printer supports this attribute, the printer must use its - * (implementation-dependent) default JobHoldUntil value at job submission time - * (unlike most job template attributes that are used if necessary at job - * processing time). - *
- * To construct a JobHoldUntil attribute from separate values of the year, - * month, day, hour, minute, and so on, use a {@link java.util.Calendar - * Calendar} object to construct a {@link java.util.Date Date} object, then use - * the {@link java.util.Date Date} object to construct the JobHoldUntil - * attribute. To convert a JobHoldUntil attribute to separate values of the - * year, month, day, hour, minute, and so on, create a {@link java.util.Calendar - * Calendar} object and set it to the {@link java.util.Date Date} from the - * JobHoldUntil attribute. - *
- * IPP Compatibility: Although IPP supports a "job-hold-until" attribute + * (implementation-dependent) default {@code JobHoldUntil} value at job + * submission time (unlike most job template attributes that are used if + * necessary at job processing time). + *
+ * To construct a {@code JobHoldUntil} attribute from separate values of the + * year, month, day, hour, minute, and so on, use a {@link Calendar Calendar} + * object to construct a {@link Date Date} object, then use the + * {@link Date Date} object to construct the {@code JobHoldUntil} attribute. To + * convert a {@code JobHoldUntil} attribute to separate values of the year, + * month, day, hour, minute, and so on, create a {@link Calendar Calendar} + * object and set it to the {@link Date Date} from the {@code JobHoldUntil} + * attribute. + *
+ * IPP Compatibility: Although IPP supports a "job-hold-until" attribute * specified as a keyword, IPP does not at this time support a "job-hold-until" * attribute specified as a date and time. However, the date and time can be * converted to one of the standard IPP keywords with some loss of precision; - * for example, a JobHoldUntil value with today's date and 9:00pm local time - * might be converted to the standard IPP keyword "night". The category name - * returned by {@code getName()} gives the IPP attribute name. + * for example, a {@code JobHoldUntil} value with today's date and 9:00pm local + * time might be converted to the standard IPP keyword "night". The category + * name returned by {@code getName()} gives the IPP attribute name. * - * @author Alan Kaminsky + * @author Alan Kaminsky */ public final class JobHoldUntil extends DateTimeSyntax implements PrintRequestAttribute, PrintJobAttribute { + /** + * Use serialVersionUID from JDK 1.4 for interoperability. + */ private static final long serialVersionUID = -1664471048860415024L; - /** * Construct a new job hold until date-time attribute with the given - * {@link java.util.Date Date} value. + * {@link Date Date} value. * - * @param dateTime {@link java.util.Date Date} value. - * - * @exception NullPointerException - * (unchecked exception) Thrown if {@code dateTime} is null. + * @param dateTime {@link Date Date} value + * @throws NullPointerException if {@code dateTime} is {@code null} */ public JobHoldUntil(Date dateTime) { super (dateTime); } /** - * Returns whether this job hold until attribute is equivalent to the - * passed in object. To be equivalent, all of the following conditions - * must be true: - *
- * For class JobHoldUntil, the category is class JobHoldUntil itself. + *
+ * For class {@code JobHoldUntil}, the category is class + * {@code JobHoldUntil} itself. * - * @return Printing attribute class (category), an instance of class - * {@link java.lang.Class java.lang.Class}. + * @return printing attribute class (category), an instance of class + * {@link Class java.lang.Class} */ public final Class extends Attribute> getCategory() { return JobHoldUntil.class; @@ -140,13 +142,13 @@ /** * Get the name of the category of which this attribute value is an * instance. - *
- * For class JobHoldUntil, the category name is {@code "job-hold-until"}. + *
+ * For class {@code JobHoldUntil}, the category name is + * {@code "job-hold-until"}. * - * @return Attribute category name. + * @return attribute category name */ public final String getName() { return "job-hold-until"; } - } diff -r 000f4e4ddd39 -r 57173ad5c534 jdk/src/java.desktop/share/classes/javax/print/attribute/standard/JobImpressions.java --- a/jdk/src/java.desktop/share/classes/javax/print/attribute/standard/JobImpressions.java Fri Sep 01 14:13:40 2017 +0000 +++ b/jdk/src/java.desktop/share/classes/javax/print/attribute/standard/JobImpressions.java Sat Sep 09 14:36:45 2017 +0200 @@ -1,5 +1,5 @@ /* - * Copyright (c) 2000, 2014, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2000, 2017, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -22,70 +22,71 @@ * or visit www.oracle.com if you need additional information or have any * questions. */ + package javax.print.attribute.standard; import javax.print.attribute.Attribute; import javax.print.attribute.IntegerSyntax; +import javax.print.attribute.PrintJobAttribute; import javax.print.attribute.PrintRequestAttribute; -import javax.print.attribute.PrintJobAttribute; /** - * Class JobImpressions is an integer valued printing attribute class that - * specifies the total size in number of impressions of the document(s) being - * submitted. An "impression" is the image (possibly many print-stream pages in - * different configurations) imposed onto a single media page. - *
- * The JobImpressions attribute describes the size of the job. This attribute is - * not intended to be a counter; it is intended to be useful routing and - * scheduling information if known. The printer may try to compute the - * JobImpressions attribute's value if it is not supplied in the Print Request. - * Even if the client does supply a value for the JobImpressions attribute in - * the Print Request, the printer may choose to change the value if the printer - * is able to compute a value which is more accurate than the client supplied - * value. The printer may be able to determine the correct value for the - * JobImpressions attribute either right at job submission time or at any later - * point in time. - *
- * As with {@link JobKOctets JobKOctets}, the JobImpressions value must not - * include the multiplicative factors contributed by the number of copies + * Class {@code JobImpressions} is an integer valued printing attribute class + * that specifies the total size in number of impressions of the document(s) + * being submitted. An "impression" is the image (possibly many print-stream + * pages in different configurations) imposed onto a single media page. + *
+ * The {@code JobImpressions} attribute describes the size of the job. This + * attribute is not intended to be a counter; it is intended to be useful + * routing and scheduling information if known. The printer may try to compute + * the {@code JobImpressions} attribute's value if it is not supplied in the + * Print Request. Even if the client does supply a value for the + * {@code JobImpressions} attribute in the Print Request, the printer may choose + * to change the value if the printer is able to compute a value which is more + * accurate than the client supplied value. The printer may be able to determine + * the correct value for the {@code JobImpressions} attribute either right at + * job submission time or at any later point in time. + *
+ * As with {@link JobKOctets JobKOctets}, the {@code JobImpressions} value must + * not include the multiplicative factors contributed by the number of copies * specified by the {@link Copies Copies} attribute, independent of whether the * device can process multiple copies without making multiple passes over the * job or document data and independent of whether the output is collated or * not. Thus the value is independent of the implementation and reflects the * size of the document(s) measured in impressions independent of the number of * copies. - *
- * As with {@link JobKOctets JobKOctets}, the JobImpressions value must also not - * include the multiplicative factor due to a copies instruction embedded in the - * document data. If the document data actually includes replications of the - * document data, this value will include such replication. In other words, this - * value is always the number of impressions in the source document data, rather - * than a measure of the number of impressions to be produced by the job. - *
- * IPP Compatibility: The integer value gives the IPP integer value. The - * category name returned by {@code getName()} gives the IPP attribute - * name. + *
+ * As with {@link JobKOctets JobKOctets}, the {@code JobImpressions} value must + * also not include the multiplicative factor due to a copies instruction + * embedded in the document data. If the document data actually includes + * replications of the document data, this value will include such replication. + * In other words, this value is always the number of impressions in the source + * document data, rather than a measure of the number of impressions to be + * produced by the job. + *
+ * IPP Compatibility: The integer value gives the IPP integer value. The + * category name returned by {@code getName()} gives the IPP attribute name. * + * @author Alan Kaminsky * @see JobImpressionsSupported * @see JobImpressionsCompleted * @see JobKOctets * @see JobMediaSheets - * - * @author Alan Kaminsky */ public final class JobImpressions extends IntegerSyntax implements PrintRequestAttribute, PrintJobAttribute { + /** + * Use serialVersionUID from JDK 1.4 for interoperability. + */ private static final long serialVersionUID = 8225537206784322464L; - /** * Construct a new job impressions attribute with the given integer value. * - * @param value Integer value. + * @param value Integer value + * @throws IllegalArgumentException if {@code value} is negative * - * @exception IllegalArgumentException - * (Unchecked exception) Thrown if {@code value} is less than 0. */ public JobImpressions(int value) { super(value, 0, Integer.MAX_VALUE); @@ -95,20 +96,16 @@ * Returns whether this job impressions attribute is equivalent to the * passed in object. To be equivalent, all of the following conditions must * be true: - *
- * For class JobImpressions, the category is class JobImpressions itself. + *
+ * For class {@code JobImpressions}, the category is class + * {@code JobImpressions} itself. * - * @return Printing attribute class (category), an instance of class - * {@link java.lang.Class java.lang.Class}. + * @return printing attribute class (category), an instance of class + * {@link Class java.lang.Class} */ public final Class extends Attribute> getCategory() { return JobImpressions.class; @@ -130,14 +128,13 @@ /** * Get the name of the category of which this attribute value is an * instance. - *
- * For class JobImpressions, the category name is + *
+ * For class {@code JobImpressions}, the category name is * {@code "job-impressions"}. * - * @return Attribute category name. + * @return attribute category name */ public final String getName() { return "job-impressions"; } - } diff -r 000f4e4ddd39 -r 57173ad5c534 jdk/src/java.desktop/share/classes/javax/print/attribute/standard/JobImpressionsCompleted.java --- a/jdk/src/java.desktop/share/classes/javax/print/attribute/standard/JobImpressionsCompleted.java Fri Sep 01 14:13:40 2017 +0000 +++ b/jdk/src/java.desktop/share/classes/javax/print/attribute/standard/JobImpressionsCompleted.java Sat Sep 09 14:36:45 2017 +0200 @@ -1,5 +1,5 @@ /* - * Copyright (c) 2000, 2014, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2000, 2017, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -22,6 +22,7 @@ * or visit www.oracle.com if you need additional information or have any * questions. */ + package javax.print.attribute.standard; import javax.print.attribute.Attribute; @@ -29,68 +30,66 @@ import javax.print.attribute.PrintJobAttribute; /** - * Class JobImpressionsCompleted is an integer valued printing attribute class - * that specifies the number of impressions completed for the job so far. For - * printing devices, the impressions completed includes interpreting, marking, - * and stacking the output. - *
- * The JobImpressionsCompleted attribute describes the progress of the job. This - * attribute is intended to be a counter. That is, the JobImpressionsCompleted - * value for a job that has not started processing must be 0. When the job's - * {@link JobState JobState} is PROCESSING or PROCESSING_STOPPED, the - * JobImpressionsCompleted value is intended to increase as the job is + * Class {@code JobImpressionsCompleted} is an integer valued printing attribute + * class that specifies the number of impressions completed for the job so far. + * For printing devices, the impressions completed includes interpreting, + * marking, and stacking the output. + *
+ * The {@code JobImpressionsCompleted} attribute describes the progress of the + * job. This attribute is intended to be a counter. That is, the + * {@code JobImpressionsCompleted} value for a job that has not started + * processing must be 0. When the job's {@link JobState JobState} is + * {@code PROCESSING} or {@code PROCESSING_STOPPED}, the + * {@code JobImpressionsCompleted} value is intended to increase as the job is * processed; it indicates the amount of the job that has been processed at the * time the Print Job's attribute set is queried or at the time a print job - * event is reported. When the job enters the COMPLETED, CANCELED, or ABORTED - * states, the JobImpressionsCompleted value is the final value for the job. - *
- * IPP Compatibility: The integer value gives the IPP integer value. The - * category name returned by {@code getName()} gives the IPP attribute - * name. + * event is reported. When the job enters the {@code COMPLETED}, + * {@code CANCELED}, or {@code ABORTED} states, the + * {@code JobImpressionsCompleted} value is the final value for the job. + *
+ * IPP Compatibility: The integer value gives the IPP integer value. The + * category name returned by {@code getName()} gives the IPP attribute name. * + * @author Alan Kaminsky * @see JobImpressions * @see JobImpressionsSupported * @see JobKOctetsProcessed * @see JobMediaSheetsCompleted - * - * @author Alan Kaminsky */ public final class JobImpressionsCompleted extends IntegerSyntax implements PrintJobAttribute { + /** + * Use serialVersionUID from JDK 1.4 for interoperability. + */ private static final long serialVersionUID = 6722648442432393294L; /** * Construct a new job impressions completed attribute with the given * integer value. * - * @param value Integer value. - * - * @exception IllegalArgumentException - * (Unchecked exception) Thrown if {@code value} is less than 0. + * @param value Integer value + * @throws IllegalArgumentException if {@code value} is negative */ public JobImpressionsCompleted(int value) { super (value, 0, Integer.MAX_VALUE); } /** - * Returns whether this job impressions completed attribute is equivalent - * tp the passed in object. To be equivalent, all of the following - * conditions must be true: - *
- * For class JobImpressionsCompleted, the category is class - * JobImpressionsCompleted itself. + *
+ * For class {@code JobImpressionsCompleted}, the category is class + * {@code JobImpressionsCompleted} itself. * - * @return Printing attribute class (category), an instance of class - * {@link java.lang.Class java.lang.Class}. + * @return printing attribute class (category), an instance of class + * {@link Class java.lang.Class} */ public final Class extends Attribute> getCategory() { return JobImpressionsCompleted.class; @@ -114,14 +113,13 @@ /** * Get the name of the category of which this attribute value is an * instance. - *
- * For class JobImpressionsCompleted, the category name is + *
+ * For class {@code JobImpressionsCompleted}, the category name is * {@code "job-impressions-completed"}. * - * @return Attribute category name. + * @return attribute category name */ public final String getName() { return "job-impressions-completed"; } - } diff -r 000f4e4ddd39 -r 57173ad5c534 jdk/src/java.desktop/share/classes/javax/print/attribute/standard/JobImpressionsSupported.java --- a/jdk/src/java.desktop/share/classes/javax/print/attribute/standard/JobImpressionsSupported.java Fri Sep 01 14:13:40 2017 +0000 +++ b/jdk/src/java.desktop/share/classes/javax/print/attribute/standard/JobImpressionsSupported.java Sat Sep 09 14:36:45 2017 +0200 @@ -1,5 +1,5 @@ /* - * Copyright (c) 2000, 2014, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2000, 2017, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -22,6 +22,7 @@ * or visit www.oracle.com if you need additional information or have any * questions. */ + package javax.print.attribute.standard; import javax.print.attribute.Attribute; @@ -29,40 +30,40 @@ import javax.print.attribute.SupportedValuesAttribute; /** - * Class JobImpressionsSupported is a printing attribute class, a set of - * integers, that gives the supported values for a {@link JobImpressions - * JobImpressions} attribute. It is restricted to a single contiguous range of - * integers; multiple non-overlapping ranges are not allowed. This gives the - * lower and upper bounds of the total sizes of print jobs in number of - * impressions that the printer will accept. - *
- * IPP Compatibility: The JobImpressionsSupported attribute's canonical - * array form gives the lower and upper bound for the range of values to be - * included in an IPP "job-impressions-supported" attribute. See class {@link - * javax.print.attribute.SetOfIntegerSyntax SetOfIntegerSyntax} for an - * explanation of canonical array form. The category name returned by - * {@code getName()} gives the IPP attribute name. + * Class {@code JobImpressionsSupported} is a printing attribute class, a set of + * integers, that gives the supported values for a + * {@link JobImpressions JobImpressions} attribute. It is restricted to a single + * contiguous range of integers; multiple non-overlapping ranges are not + * allowed. This gives the lower and upper bounds of the total sizes of print + * jobs in number of impressions that the printer will accept. + *
+ * IPP Compatibility: The {@code JobImpressionsSupported} attribute's + * canonical array form gives the lower and upper bound for the range of values + * to be included in an IPP "job-impressions-supported" attribute. See class + * {@link SetOfIntegerSyntax SetOfIntegerSyntax} for an explanation of canonical + * array form. The category name returned by {@code getName()} gives the IPP + * attribute name. * - * @author Alan Kaminsky + * @author Alan Kaminsky */ public final class JobImpressionsSupported extends SetOfIntegerSyntax implements SupportedValuesAttribute { + /** + * Use serialVersionUID from JDK 1.4 for interoperability. + */ private static final long serialVersionUID = -4887354803843173692L; - /** * Construct a new job impressions supported attribute containing a single - * range of integers. That is, only those values of JobImpressions in the - * one range are supported. + * range of integers. That is, only those values of {@code JobImpressions} + * in the one range are supported. * - * @param lowerBound Lower bound of the range. - * @param upperBound Upper bound of the range. - * - * @exception IllegalArgumentException - * (Unchecked exception) Thrown if a null range is specified or if a - * non-null range is specified with {@code lowerBound} less than - * 0. + * @param lowerBound lower bound of the range + * @param upperBound upper bound of the range + * @throws IllegalArgumentException if a {@code null} range is specified or + * if a {@code non-null} range is specified with {@code lowerBound} + * less than zero */ public JobImpressionsSupported(int lowerBound, int upperBound) { super (lowerBound, upperBound); @@ -74,25 +75,21 @@ } } - /** - * Returns whether this job impressions supported attribute is equivalent - * to the passed in object. To be equivalent, all of the following - * conditions must be true: - *
- * For class JobImpressionsSupported, the category is class - * JobImpressionsSupported itself. + *
+ * For class {@code JobImpressionsSupported}, the category is class + * {@code JobImpressionsSupported} itself. * - * @return Printing attribute class (category), an instance of class - * {@link java.lang.Class java.lang.Class}. + * @return printing attribute class (category), an instance of class + * {@link Class java.lang.Class} */ public final Class extends Attribute> getCategory() { return JobImpressionsSupported.class; @@ -116,14 +113,13 @@ /** * Get the name of the category of which this attribute value is an * instance. - *
- * For class JobImpressionsSupported, the category name is + *
+ * For class {@code JobImpressionsSupported}, the category name is * {@code "job-impressions-supported"}. * - * @return Attribute category name. + * @return attribute category name */ public final String getName() { return "job-impressions-supported"; } - } diff -r 000f4e4ddd39 -r 57173ad5c534 jdk/src/java.desktop/share/classes/javax/print/attribute/standard/JobKOctets.java --- a/jdk/src/java.desktop/share/classes/javax/print/attribute/standard/JobKOctets.java Fri Sep 01 14:13:40 2017 +0000 +++ b/jdk/src/java.desktop/share/classes/javax/print/attribute/standard/JobKOctets.java Sat Sep 09 14:36:45 2017 +0200 @@ -22,126 +22,119 @@ * or visit www.oracle.com if you need additional information or have any * questions. */ + package javax.print.attribute.standard; import javax.print.attribute.Attribute; import javax.print.attribute.IntegerSyntax; +import javax.print.attribute.PrintJobAttribute; import javax.print.attribute.PrintRequestAttribute; -import javax.print.attribute.PrintJobAttribute; /** - * Class JobKOctets is an integer valued printing attribute class that specifies - * the total size of the document(s) in K octets, i.e., in units of 1024 octets - * requested to be processed in the job. The value must be rounded up, so that a - * job between 1 and 1024 octets must be indicated as being 1K octets, 1025 to - * 2048 must be 2K octets, etc. For a multidoc print job (a job with multiple - * documents), the JobKOctets value is computed by adding up the individual - * documents' sizes in octets, then rounding up to the next K octets value. - *
- * The JobKOctets attribute describes the size of the job. This attribute is not - * intended to be a counter; it is intended to be useful routing and scheduling - * information if known. The printer may try to compute the JobKOctets - * attribute's value if it is not supplied in the Print Request. Even if the - * client does supply a value for the JobKOctets attribute in the Print Request, - * the printer may choose to change the value if the printer is able to compute - * a value which is more accurate than the client supplied value. The printer - * may be able to determine the correct value for the JobKOctets attribute - * either right at job submission time or at any later point in time. - *
- * The JobKOctets value must not include the multiplicative factors contributed - * by the number of copies specified by the {@link Copies Copies} attribute, - * independent of whether the device can process multiple copies without making - * multiple passes over the job or document data and independent of whether the - * output is collated or not. Thus the value is independent of the - * implementation and indicates the size of the document(s) measured in K octets - * independent of the number of copies. - *
- * The JobKOctets value must also not include the multiplicative factor due to a - * copies instruction embedded in the document data. If the document data - * actually includes replications of the document data, this value will include - * such replication. In other words, this value is always the size of the source - * document data, rather than a measure of the hardcopy output to be produced. - *
+ * Class {@code JobKOctets} is an integer valued printing attribute class that + * specifies the total size of the document(s) in K octets, i.e., in units of + * 1024 octets requested to be processed in the job. The value must be rounded + * up, so that a job between 1 and 1024 octets must be indicated as being 1K + * octets, 1025 to 2048 must be 2K octets, etc. For a multidoc print job (a job + * with multiple documents), the {@code JobKOctets} value is computed by adding + * up the individual documents' sizes in octets, then rounding up to the next K + * octets value. + *
+ * The {@code JobKOctets} attribute describes the size of the job. This + * attribute is not intended to be a counter; it is intended to be useful + * routing and scheduling information if known. The printer may try to compute + * the {@code JobKOctets} attribute's value if it is not supplied in the Print + * Request. Even if the client does supply a value for the {@code JobKOctets} + * attribute in the Print Request, the printer may choose to change the value if + * the printer is able to compute a value which is more accurate than the client + * supplied value. The printer may be able to determine the correct value for + * the {@code JobKOctets} attribute either right at job submission time or at + * any later point in time. + *
+ * The {@code JobKOctets} value must not include the multiplicative factors + * contributed by the number of copies specified by the {@link Copies Copies} + * attribute, independent of whether the device can process multiple copies + * without making multiple passes over the job or document data and independent + * of whether the output is collated or not. Thus the value is independent of + * the implementation and indicates the size of the document(s) measured in K + * octets independent of the number of copies. + *
+ * The {@code JobKOctets} value must also not include the multiplicative factor + * due to a copies instruction embedded in the document data. If the document + * data actually includes replications of the document data, this value will + * include such replication. In other words, this value is always the size of + * the source document data, rather than a measure of the hardcopy output to be + * produced. + *
* The size of a doc is computed based on the print data representation class as - * specified by the doc's {@link javax.print.DocFlavor DocFlavor}, as - * shown in the table below. - * + * specified by the doc's {@link javax.print.DocFlavor DocFlavor}, as shown in + * the table below. *
Representation Class | - *Document Size | - *
---|---|
Representation Class + * | Document Size * |
byte[] | - *Length of the byte array | - *
java.io.InputStream | - *Number of bytes read from the stream | - *
char[] | - *Length of the character array x 2 | - *
java.lang.String | - *Length of the string x 2 | - *
java.io.Reader | - *Number of characters read from the stream x 2 | - *
java.net.URL | - *Number of bytes read from the file at the given URL address | - *
java.awt.image.renderable.RenderableImage | - *Implementation dependent* | - *
java.awt.print.Printable | - *Implementation dependent* | - *
java.awt.print.Pageable | - *Implementation dependent* | - *
{@code byte[]} + * | Length of the byte array + * |
{@code java.io.InputStream} + * | Number of bytes read from the stream + * |
{@code char[]} + * | Length of the character array x 2 + * |
{@code java.lang.String} + * | Length of the string x 2 + * |
{@code java.io.Reader} + * | Number of characters read from the stream x 2 + * |
{@code java.net.URL} + * | Number of bytes read from the file at the given {@code URL} address + * |
{@code java.awt.image.renderable.RenderableImage} + * | Implementation dependent* + * |
{@code java.awt.print.Printable} + * | Implementation dependent* + * |
{@code java.awt.print.Pageable} + * | Implementation dependent* * |
+ *
* * In these cases the Print Service itself generates the print data sent - * to the printer. If the Print Service supports the JobKOctets attribute, for - * these cases the Print Service itself must calculate the size of the print - * data, replacing any JobKOctets value the client specified. - *
- * IPP Compatibility: The integer value gives the IPP integer value. The - * category name returned by {@code getName()} gives the IPP attribute - * name. + * to the printer. If the Print Service supports the {@code JobKOctets} + * attribute, for these cases the Print Service itself must calculate the size + * of the print data, replacing any {@code JobKOctets} value the client + * specified. + *
+ * IPP Compatibility: The integer value gives the IPP integer value. The + * category name returned by {@code getName()} gives the IPP attribute name. * + * @author Alan Kaminsky * @see JobKOctetsSupported * @see JobKOctetsProcessed * @see JobImpressions * @see JobMediaSheets - * - * @author Alan Kaminsky */ public final class JobKOctets extends IntegerSyntax implements PrintRequestAttribute, PrintJobAttribute { + /** + * Use serialVersionUID from JDK 1.4 for interoperability. + */ private static final long serialVersionUID = -8959710146498202869L; /** * Construct a new job K octets attribute with the given integer value. * - * @param value Integer value. - * - * @exception IllegalArgumentException - * (Unchecked exception) Thrown if {@code value} is less than 0. + * @param value Integer value + * @throws IllegalArgumentException if {@code value} is negative */ public JobKOctets(int value) { super (value, 0, Integer.MAX_VALUE); @@ -151,20 +144,16 @@ * Returns whether this job K octets attribute is equivalent to the passed * in object. To be equivalent, all of the following conditions must be * true: - *
- * For class JobKOctets, the category is class JobKOctets itself. + *
+ * For class {@code JobKOctets}, the category is class + * {@code JobKOctets} itself. * - * @return Printing attribute class (category), an instance of class - * {@link java.lang.Class java.lang.Class}. + * @return printing attribute class (category), an instance of class + * {@link Class java.lang.Class} */ public final Class extends Attribute> getCategory() { return JobKOctets.class; @@ -186,13 +176,13 @@ /** * Get the name of the category of which this attribute value is an * instance. - *
- * For class JobKOctets, the category name is {@code "job-k-octets"}. + *
+ * For class {@code JobKOctets}, the category name is + * {@code "job-k-octets"}. * - * @return Attribute category name. + * @return attribute category name */ public final String getName() { return "job-k-octets"; } - } diff -r 000f4e4ddd39 -r 57173ad5c534 jdk/src/java.desktop/share/classes/javax/print/attribute/standard/JobKOctetsProcessed.java --- a/jdk/src/java.desktop/share/classes/javax/print/attribute/standard/JobKOctetsProcessed.java Fri Sep 01 14:13:40 2017 +0000 +++ b/jdk/src/java.desktop/share/classes/javax/print/attribute/standard/JobKOctetsProcessed.java Sat Sep 09 14:36:45 2017 +0200 @@ -1,5 +1,5 @@ /* - * Copyright (c) 2000, 2014, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2000, 2017, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -22,6 +22,7 @@ * or visit www.oracle.com if you need additional information or have any * questions. */ + package javax.print.attribute.standard; import javax.print.attribute.Attribute; @@ -29,57 +30,57 @@ import javax.print.attribute.PrintJobAttribute; /** - * Class JobKOctetsProcessed is an integer valued printing attribute class that - * specifies the total number of print data octets processed so far in K octets, - * i.e., in units of 1024 octets. The value must be rounded up, so that a job - * between 1 and 1024 octets inclusive must be indicated as being 1K octets, - * 1025 to 2048 inclusive must be 2K, etc. For a multidoc print job (a job with - * multiple documents), the JobKOctetsProcessed value is computed by adding up - * the individual documents' number of octets processed so far, then rounding up - * to the next K octets value. - *
- * The JobKOctetsProcessed attribute describes the progress of the job. This - * attribute is intended to be a counter. That is, the JobKOctetsProcessed value - * for a job that has not started processing must be 0. When the job's {@link - * JobState JobState} is PROCESSING or PROCESSING_STOPPED, the - * JobKOctetsProcessed value is intended to increase as the job is processed; it - * indicates the amount of the job that has been processed at the time the Print - * Job's attribute set is queried or at the time a print job event is reported. - * When the job enters the COMPLETED, CANCELED, or ABORTED states, the - * JobKOctetsProcessed value is the final value for the job. - *
+ * Class {@code JobKOctetsProcessed} is an integer valued printing attribute + * class that specifies the total number of print data octets processed so far + * in K octets, i.e., in units of 1024 octets. The value must be rounded up, so + * that a job between 1 and 1024 octets inclusive must be indicated as being 1K + * octets, 1025 to 2048 inclusive must be 2K, etc. For a multidoc print job (a + * job with multiple documents), the JobKOctetsProcessed value is computed by + * adding up the individual documents' number of octets processed so far, then + * rounding up to the next K octets value. + *
+ * The {@code JobKOctetsProcessed} attribute describes the progress of the job. + * This attribute is intended to be a counter. That is, the JobKOctetsProcessed + * value for a job that has not started processing must be 0. When the job's + * {@link JobState JobState} is {@code PROCESSING} or + * {@code PROCESSING_STOPPED}, the {@code JobKOctetsProcessed} value is intended + * to increase as the job is processed; it indicates the amount of the job that + * has been processed at the time the Print Job's attribute set is queried or at + * the time a print job event is reported. When the job enters the + * {@code COMPLETED}, {@code CANCELED}, or {@code ABORTED} states, the + * {@code JobKOctetsProcessed} value is the final value for the job. + *
* For implementations where multiple copies are produced by the interpreter * with only a single pass over the data, the final value of the - * JobKOctetsProcessed attribute must be equal to the value of the {@link - * JobKOctets JobKOctets} attribute. For implementations where multiple copies - * are produced by the interpreter by processing the data for each copy, the - * final value must be a multiple of the value of the {@link JobKOctets - * JobKOctets} attribute. - *
- * IPP Compatibility: The integer value gives the IPP integer value. The - * category name returned by {@code getName()} gives the IPP attribute - * name. + * JobKOctetsProcessed attribute must be equal to the value of the + * {@link JobKOctets JobKOctets} attribute. For implementations where multiple + * copies are produced by the interpreter by processing the data for each copy, + * the final value must be a multiple of the value of the + * {@link JobKOctets JobKOctets} attribute. + *
+ * IPP Compatibility: The integer value gives the IPP integer value. The + * category name returned by {@code getName()} gives the IPP attribute name. * + * @author Alan Kaminsky * @see JobKOctets * @see JobKOctetsSupported * @see JobImpressionsCompleted * @see JobMediaSheetsCompleted - * - * @author Alan Kaminsky */ public final class JobKOctetsProcessed extends IntegerSyntax implements PrintJobAttribute { + /** + * Use serialVersionUID from JDK 1.4 for interoperability. + */ private static final long serialVersionUID = -6265238509657881806L; /** * Construct a new job K octets processed attribute with the given integer * value. * - * @param value Integer value. - * - * @exception IllegalArgumentException - * (Unchecked exception) Thrown if {@code value} is less than 0. + * @param value Integer value + * @throws IllegalArgumentException if {@code value} is negative */ public JobKOctetsProcessed(int value) { super (value, 0, Integer.MAX_VALUE); @@ -89,20 +90,16 @@ * Returns whether this job K octets processed attribute is equivalent to * the passed in object. To be equivalent, all of the following conditions * must be true: - *
- * For class JobKOctetsProcessed, the category is class - * JobKOctetsProcessed itself. + *
+ * For class {@code JobKOctetsProcessed}, the category is class + * {@code JobKOctetsProcessed} itself. * - * @return Printing attribute class (category), an instance of class - * {@link java.lang.Class java.lang.Class}. + * @return printing attribute class (category), an instance of class + * {@link Class java.lang.Class} */ public final Class extends Attribute> getCategory() { return JobKOctetsProcessed.class; @@ -126,14 +123,13 @@ /** * Get the name of the category of which this attribute value is an * instance. - *
- * For class JobKOctetsProcessed, the category name is + *
+ * For class {@code JobKOctetsProcessed}, the category name is * {@code "job-k-octets-processed"}. * - * @return Attribute category name. + * @return attribute category name */ public final String getName() { return "job-k-octets-processed"; } - } diff -r 000f4e4ddd39 -r 57173ad5c534 jdk/src/java.desktop/share/classes/javax/print/attribute/standard/JobKOctetsSupported.java --- a/jdk/src/java.desktop/share/classes/javax/print/attribute/standard/JobKOctetsSupported.java Fri Sep 01 14:13:40 2017 +0000 +++ b/jdk/src/java.desktop/share/classes/javax/print/attribute/standard/JobKOctetsSupported.java Sat Sep 09 14:36:45 2017 +0200 @@ -1,5 +1,5 @@ /* - * Copyright (c) 2000, 2014, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2000, 2017, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -22,6 +22,7 @@ * or visit www.oracle.com if you need additional information or have any * questions. */ + package javax.print.attribute.standard; import javax.print.attribute.Attribute; @@ -29,25 +30,28 @@ import javax.print.attribute.SupportedValuesAttribute; /** - * Class JobKOctetsSupported is a printing attribute class, a set of integers, - * that gives the supported values for a {@link JobKOctets JobKOctets} + * Class {@code JobKOctetsSupported} is a printing attribute class, a set of + * integers, that gives the supported values for a {@link JobKOctets JobKOctets} * attribute. It is restricted to a single contiguous range of integers; * multiple non-overlapping ranges are not allowed. This gives the lower and * upper bounds of the total sizes of print jobs in units of K octets (1024 * octets) that the printer will accept. - *
- * IPP Compatibility: The JobKOctetsSupported attribute's canonical array - * form gives the lower and upper bound for the range of values to be included - * in an IPP "job-k-octets-supported" attribute. See class {@link - * javax.print.attribute.SetOfIntegerSyntax SetOfIntegerSyntax} for an - * explanation of canonical array form. The category name returned by - * {@code getName()} gives the IPP attribute name. + *
+ * IPP Compatibility: The {@code JobKOctetsSupported} attribute's + * canonical array form gives the lower and upper bound for the range of values + * to be included in an IPP "job-k-octets-supported" attribute. See class + * {@link SetOfIntegerSyntax SetOfIntegerSyntax} for an explanation of canonical + * array form. The category name returned by {@code getName()} gives the IPP + * attribute name. * - * @author Alan Kaminsky + * @author Alan Kaminsky */ public final class JobKOctetsSupported extends SetOfIntegerSyntax implements SupportedValuesAttribute { + /** + * Use serialVersionUID from JDK 1.4 for interoperability. + */ private static final long serialVersionUID = -2867871140549897443L; /** @@ -55,13 +59,11 @@ * range of integers. That is, only those values of JobKOctets in the one * range are supported. * - * @param lowerBound Lower bound of the range. - * @param upperBound Upper bound of the range. - * - * @exception IllegalArgumentException - * (Unchecked exception) Thrown if a null range is specified or if a - * non-null range is specified with {@code lowerBound} less than - * 0. + * @param lowerBound Lower bound of the range + * @param upperBound Upper bound of the range + * @throws IllegalArgumentException if a {@code null} range is specified or + * if a {@code non-null} range is specified with {@code lowerBound} + * less than zero */ public JobKOctetsSupported(int lowerBound, int upperBound) { super (lowerBound, upperBound); @@ -77,20 +79,16 @@ * Returns whether this job K octets supported attribute is equivalent to * the passed in object. To be equivalent, all of the following conditions * must be true: - *
- * For class JobKOctetsSupported, the category is class - * JobKOctetsSupported itself. + *
+ * For class {@code JobKOctetsSupported}, the category is class + * {@code JobKOctetsSupported} itself. * - * @return Printing attribute class (category), an instance of class - * {@link java.lang.Class java.lang.Class}. + * @return printing attribute class (category), an instance of class + * {@link Class java.lang.Class} */ public final Class extends Attribute> getCategory() { return JobKOctetsSupported.class; @@ -114,14 +112,13 @@ /** * Get the name of the category of which this attribute value is an * instance. - *
- * For class JobKOctetsSupported, the category name is + *
+ * For class {@code JobKOctetsSupported}, the category name is * {@code "job-k-octets-supported"}. * - * @return Attribute category name. + * @return attribute category name */ public final String getName() { return "job-k-octets-supported"; } - } diff -r 000f4e4ddd39 -r 57173ad5c534 jdk/src/java.desktop/share/classes/javax/print/attribute/standard/JobMediaSheets.java --- a/jdk/src/java.desktop/share/classes/javax/print/attribute/standard/JobMediaSheets.java Fri Sep 01 14:13:40 2017 +0000 +++ b/jdk/src/java.desktop/share/classes/javax/print/attribute/standard/JobMediaSheets.java Sat Sep 09 14:36:45 2017 +0200 @@ -1,5 +1,5 @@ /* - * Copyright (c) 2000, 2014, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2000, 2017, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -22,63 +22,62 @@ * or visit www.oracle.com if you need additional information or have any * questions. */ + package javax.print.attribute.standard; import javax.print.attribute.Attribute; import javax.print.attribute.IntegerSyntax; +import javax.print.attribute.PrintJobAttribute; import javax.print.attribute.PrintRequestAttribute; -import javax.print.attribute.PrintJobAttribute; /** - * Class JobMediaSheets is an integer valued printing attribute class that - * specifies the total number of media sheets to be produced for this job. - *
- * The JobMediaSheets attribute describes the size of the job. This attribute is - * not intended to be a counter; it is intended to be useful routing and - * scheduling information if known. The printer may try to compute the - * JobMediaSheets attribute's value if it is not supplied in the Print Request. - * Even if the client does supply a value for the JobMediaSheets attribute in - * the Print Request, the printer may choose to change the value if the printer - * is able to compute a value which is more accurate than the client supplied - * value. The printer may be able to determine the correct value for the - * JobMediaSheets attribute either right at job submission time or at any later - * point in time. - *
- * Unlike the {@link JobKOctets JobKOctets} and {@link JobImpressions - * JobImpressions} attributes, the JobMediaSheets value must include the - * multiplicative factors contributed by the number of copies specified by the - * {@link Copies Copies} attribute and a "number of copies" instruction embedded - * in the document data, if any. This difference allows the system administrator - * to control the lower and upper bounds of both (1) the size of the document(s) - * with {@link JobKOctetsSupported JobKOctetsSupported} and {@link - * JobImpressionsSupported JobImpressionsSupported} and (2) the size of the job - * with {@link JobMediaSheetsSupported JobMediaSheetsSupported}. - *
- * IPP Compatibility: The integer value gives the IPP integer value. The - * category name returned by {@code getName()} gives the IPP attribute - * name. + * Class {@code JobMediaSheets} is an integer valued printing attribute class + * that specifies the total number of media sheets to be produced for this job. + *
+ * The {@code JobMediaSheets} attribute describes the size of the job. This + * attribute is not intended to be a counter; it is intended to be useful + * routing and scheduling information if known. The printer may try to compute + * the {@code JobMediaSheets} attribute's value if it is not supplied in the + * Print Request. Even if the client does supply a value for the + * {@code JobMediaSheets} attribute in the Print Request, the printer may choose + * to change the value if the printer is able to compute a value which is more + * accurate than the client supplied value. The printer may be able to determine + * the correct value for the {@code JobMediaSheets} attribute either right at + * job submission time or at any later point in time. + *
+ * Unlike the {@link JobKOctets JobKOctets} and + * {@link JobImpressions JobImpressions} attributes, the {@code JobMediaSheets} + * value must include the multiplicative factors contributed by the number of + * copies specified by the {@link Copies Copies} attribute and a "number of + * copies" instruction embedded in the document data, if any. This difference + * allows the system administrator to control the lower and upper bounds of both + * (1) the size of the document(s) with + * {@link JobKOctetsSupported JobKOctetsSupported} and + * {@link JobImpressionsSupported JobImpressionsSupported} and (2) the size of + * the job with {@link JobMediaSheetsSupported JobMediaSheetsSupported}. + *
+ * IPP Compatibility: The integer value gives the IPP integer value. The + * category name returned by {@code getName()} gives the IPP attribute name. * + * @author Alan Kaminsky * @see JobMediaSheetsSupported * @see JobMediaSheetsCompleted * @see JobKOctets * @see JobImpressions - * - * @author Alan Kaminsky */ public class JobMediaSheets extends IntegerSyntax implements PrintRequestAttribute, PrintJobAttribute { - + /** + * Use serialVersionUID from JDK 1.4 for interoperability. + */ private static final long serialVersionUID = 408871131531979741L; /** - * Construct a new job media sheets attribute with the given integer - * value. + * Construct a new job media sheets attribute with the given integer value. * - * @param value Integer value. - * - * @exception IllegalArgumentException - * (Unchecked exception) Thrown if {@code value} is less than 0. + * @param value Integer value + * @throws IllegalArgumentException if {@code value} is negative */ public JobMediaSheets(int value) { super (value, 0, Integer.MAX_VALUE); @@ -88,20 +87,16 @@ * Returns whether this job media sheets attribute is equivalent to the * passed in object. To be equivalent, all of the following conditions must * be true: - *
- * For class JobMediaSheets and any vendor-defined subclasses, the category - * is class JobMediaSheets itself. + *
+ * For class {@code JobMediaSheets} and any vendor-defined subclasses, the + * category is class {@code JobMediaSheets} itself. * - * @return Printing attribute class (category), an instance of class - * {@link java.lang.Class java.lang.Class}. + * @return printing attribute class (category), an instance of class + * {@link Class java.lang.Class} */ public final Class extends Attribute> getCategory() { return JobMediaSheets.class; @@ -124,14 +119,13 @@ /** * Get the name of the category of which this attribute value is an * instance. - *
- * For class JobMediaSheets and any vendor-defined subclasses, the + *
+ * For class {@code JobMediaSheets} and any vendor-defined subclasses, the * category name is {@code "job-media-sheets"}. * - * @return Attribute category name. + * @return attribute category name */ public final String getName() { return "job-media-sheets"; } - } diff -r 000f4e4ddd39 -r 57173ad5c534 jdk/src/java.desktop/share/classes/javax/print/attribute/standard/JobMediaSheetsCompleted.java --- a/jdk/src/java.desktop/share/classes/javax/print/attribute/standard/JobMediaSheetsCompleted.java Fri Sep 01 14:13:40 2017 +0000 +++ b/jdk/src/java.desktop/share/classes/javax/print/attribute/standard/JobMediaSheetsCompleted.java Sat Sep 09 14:36:45 2017 +0200 @@ -1,5 +1,5 @@ /* - * Copyright (c) 2000, 2014, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2000, 2017, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -22,6 +22,7 @@ * or visit www.oracle.com if you need additional information or have any * questions. */ + package javax.print.attribute.standard; import javax.print.attribute.Attribute; @@ -29,46 +30,46 @@ import javax.print.attribute.PrintJobAttribute; /** - * Class JobMediaSheetsCompleted is an integer valued printing attribute class - * that specifies the number of media sheets which have completed marking and - * stacking for the entire job so far, whether those sheets have been processed - * on one side or on both. - *
- * The JobMediaSheetsCompleted attribute describes the progress of the job. This - * attribute is intended to be a counter. That is, the JobMediaSheetsCompleted - * value for a job that has not started processing must be 0. When the job's - * {@link JobState JobState} is PROCESSING or PROCESSING_STOPPED, the - * JobMediaSheetsCompleted value is intended to increase as the job is + * Class {@code JobMediaSheetsCompleted} is an integer valued printing attribute + * class that specifies the number of media sheets which have completed marking + * and stacking for the entire job so far, whether those sheets have been + * processed on one side or on both. + *
+ * The {@code JobMediaSheetsCompleted} attribute describes the progress of the + * job. This attribute is intended to be a counter. That is, the + * {@code JobMediaSheetsCompleted} value for a job that has not started + * processing must be 0. When the job's {@link JobState JobState} is + * {@code PROCESSING} or {@code PROCESSING_STOPPED}, the + * {@code JobMediaSheetsCompleted} value is intended to increase as the job is * processed; it indicates the amount of the job that has been processed at the * time the Print Job's attribute set is queried or at the time a print job - * event is reported. When the job enters the COMPLETED, CANCELED, or ABORTED - * states, the JobMediaSheetsCompleted value is the final value for the job. - *
- * IPP Compatibility: The integer value gives the IPP integer value. The - * category name returned by {@code getName()} gives the IPP attribute - * name. + * event is reported. When the job enters the {@code COMPLETED}, + * {@code CANCELED}, or {@code ABORTED} states, the + * {@code JobMediaSheetsCompleted} value is the final value for the job. + *
+ * IPP Compatibility: The integer value gives the IPP integer value. The + * category name returned by {@code getName()} gives the IPP attribute name. * + * @author Alan Kaminsky * @see JobMediaSheets * @see JobMediaSheetsSupported * @see JobKOctetsProcessed * @see JobImpressionsCompleted - * - * @author Alan Kaminsky */ public final class JobMediaSheetsCompleted extends IntegerSyntax implements PrintJobAttribute { - + /** + * Use serialVersionUID from JDK 1.4 for interoperability. + */ private static final long serialVersionUID = 1739595973810840475L; /** * Construct a new job media sheets completed attribute with the given * integer value. * - * @param value Integer value. - * - * @exception IllegalArgumentException - * (Unchecked exception) Thrown if {@code value} is less than 0. + * @param value Integer value + * @throws IllegalArgumentException if {@code value} is negative */ public JobMediaSheetsCompleted(int value) { super (value, 0, Integer.MAX_VALUE); @@ -78,20 +79,17 @@ * Returns whether this job media sheets completed attribute is equivalent * to the passed in object. To be equivalent, all of the following * conditions must be true: - *
- * For class JobMediaSheetsCompleted, the category is class - * JobMediaSheetsCompleted itself. + *
+ * For class {@code JobMediaSheetsCompleted}, the category is class + * {@code JobMediaSheetsCompleted} itself. * - * @return Printing attribute class (category), an instance of class - * {@link java.lang.Class java.lang.Class}. + * @return printing attribute class (category), an instance of class + * {@link Class java.lang.Class} */ public final Class extends Attribute> getCategory() { return JobMediaSheetsCompleted.class; @@ -115,11 +113,11 @@ /** * Get the name of the category of which this attribute value is an * instance. - *
- * For class JobMediaSheetsCompleted, the category name is + *
+ * For class {@code JobMediaSheetsCompleted}, the category name is * {@code "job-media-sheets-completed"}. * - * @return Attribute category name. + * @return attribute category name */ public final String getName() { return "job-media-sheets-completed"; diff -r 000f4e4ddd39 -r 57173ad5c534 jdk/src/java.desktop/share/classes/javax/print/attribute/standard/JobMediaSheetsSupported.java --- a/jdk/src/java.desktop/share/classes/javax/print/attribute/standard/JobMediaSheetsSupported.java Fri Sep 01 14:13:40 2017 +0000 +++ b/jdk/src/java.desktop/share/classes/javax/print/attribute/standard/JobMediaSheetsSupported.java Sat Sep 09 14:36:45 2017 +0200 @@ -1,5 +1,5 @@ /* - * Copyright (c) 2000, 2014, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2000, 2017, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -22,6 +22,7 @@ * or visit www.oracle.com if you need additional information or have any * questions. */ + package javax.print.attribute.standard; import javax.print.attribute.Attribute; @@ -29,39 +30,40 @@ import javax.print.attribute.SupportedValuesAttribute; /** - * Class JobMediaSheetsSupported is a printing attribute class, a set of - * integers, that gives the supported values for a {@link JobMediaSheets - * JobMediaSheets} attribute. It is restricted to a single contiguous range of - * integers; multiple non-overlapping ranges are not allowed. This gives the - * lower and upper bounds of the total sizes of print jobs in number of media - * sheets that the printer will accept. - *
- * IPP Compatibility: The JobMediaSheetsSupported attribute's canonical - * array form gives the lower and upper bound for the range of values to be - * included in an IPP "job-media-sheets-supported" attribute. See class {@link - * javax.print.attribute.SetOfIntegerSyntax SetOfIntegerSyntax} for an - * explanation of canonical array form. The category name returned by - * {@code getName()} gives the IPP attribute name. + * Class {@code JobMediaSheetsSupported} is a printing attribute class, a set of + * integers, that gives the supported values for a + * {@link JobMediaSheets JobMediaSheets} attribute. It is restricted to a single + * contiguous range of integers; multiple non-overlapping ranges are not + * allowed. This gives the lower and upper bounds of the total sizes of print + * jobs in number of media sheets that the printer will accept. + *
+ * IPP Compatibility: The {@code JobMediaSheetsSupported} attribute's + * canonical array form gives the lower and upper bound for the range of values + * to be included in an IPP "job-media-sheets-supported" attribute. See class + * {@link SetOfIntegerSyntax SetOfIntegerSyntax} for an explanation of canonical + * array form. The category name returned by {@code getName()} gives the IPP + * attribute name. * - * @author Alan Kaminsky + * @author Alan Kaminsky */ public final class JobMediaSheetsSupported extends SetOfIntegerSyntax implements SupportedValuesAttribute { + /** + * Use serialVersionUID from JDK 1.4 for interoperability. + */ private static final long serialVersionUID = 2953685470388672940L; /** * Construct a new job media sheets supported attribute containing a single - * range of integers. That is, only those values of JobMediaSheets in the - * one range are supported. + * range of integers. That is, only those values of {@code JobMediaSheets} + * in the one range are supported. * - * @param lowerBound Lower bound of the range. - * @param upperBound Upper bound of the range. - * - * @exception IllegalArgumentException - * (Unchecked exception) Thrown if a null range is specified or if a - * non-null range is specified with {@code lowerBound} less than - * 0. + * @param lowerBound lower bound of the range + * @param upperBound upper bound of the range + * @throws IllegalArgumentException if a {@code null} range is specified or + * if a {@code non-null} range is specified with {@code lowerBound} + * less than zero */ public JobMediaSheetsSupported(int lowerBound, int upperBound) { super (lowerBound, upperBound); @@ -77,20 +79,17 @@ * Returns whether this job media sheets supported attribute is equivalent * to the passed in object. To be equivalent, all of the following * conditions must be true: - *
- * For class JobMediaSheetsSupported, the - * category is class JobMediaSheetsSupported itself. + *
+ * For class {@code JobMediaSheetsSupported}, the category is class + * {@code JobMediaSheetsSupported} itself. * - * @return Printing attribute class (category), an instance of class - * {@link java.lang.Class java.lang.Class}. + * @return printing attribute class (category), an instance of class + * {@link Class java.lang.Class} */ public final Class extends Attribute> getCategory() { return JobMediaSheetsSupported.class; @@ -114,14 +113,13 @@ /** * Get the name of the category of which this attribute value is an * instance. - *
- * For class JobMediaSheetsSupported, the - * category name is {@code "job-media-sheets-supported"}. + *
+ * For class {@code JobMediaSheetsSupported}, the category name is + * {@code "job-media-sheets-supported"}. * - * @return Attribute category name. + * @return attribute category name */ public final String getName() { return "job-media-sheets-supported"; } - } diff -r 000f4e4ddd39 -r 57173ad5c534 jdk/src/java.desktop/share/classes/javax/print/attribute/standard/JobMessageFromOperator.java --- a/jdk/src/java.desktop/share/classes/javax/print/attribute/standard/JobMessageFromOperator.java Fri Sep 01 14:13:40 2017 +0000 +++ b/jdk/src/java.desktop/share/classes/javax/print/attribute/standard/JobMessageFromOperator.java Sat Sep 09 14:36:45 2017 +0200 @@ -1,5 +1,5 @@ /* - * Copyright (c) 2000, 2014, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2000, 2017, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -22,50 +22,53 @@ * or visit www.oracle.com if you need additional information or have any * questions. */ + package javax.print.attribute.standard; import java.util.Locale; import javax.print.attribute.Attribute; +import javax.print.attribute.PrintJobAttribute; import javax.print.attribute.TextSyntax; -import javax.print.attribute.PrintJobAttribute; /** - * Class JobMessageFromOperator is a printing attribute class, a text attribute, - * that provides a message from an operator, system administrator, or + * Class {@code JobMessageFromOperator} is a printing attribute class, a text + * attribute, that provides a message from an operator, system administrator, or * "intelligent" process to indicate to the end user the reasons for * modification or other management action taken on a job. - *
+ *
* A Print Job's attribute set includes zero instances or one instance of a - * JobMessageFromOperator attribute, not more than one instance. A new - * JobMessageFromOperator attribute replaces an existing JobMessageFromOperator - * attribute, if any. In other words, JobMessageFromOperator is not intended to - * be a history log. If it wishes, the client can detect changes to a Print - * Job's JobMessageFromOperator attribute and maintain the client's own history - * log of the JobMessageFromOperator attribute values. - *
- * IPP Compatibility: The string value gives the IPP name value. The + * {@code JobMessageFromOperator} attribute, not more than one instance. A new + * {@code JobMessageFromOperator} attribute replaces an existing + * {@code JobMessageFromOperator} attribute, if any. In other words, + * {@code JobMessageFromOperator} is not intended to be a history log. If it + * wishes, the client can detect changes to a Print Job's + * {@code JobMessageFromOperator} attribute and maintain the client's own + * history log of the {@code JobMessageFromOperator} attribute values. + *
+ * IPP Compatibility: The string value gives the IPP name value. The * locale gives the IPP natural language. The category name returned by * {@code getName()} gives the IPP attribute name. * - * @author Alan Kaminsky + * @author Alan Kaminsky */ public final class JobMessageFromOperator extends TextSyntax implements PrintJobAttribute { + /** + * Use serialVersionUID from JDK 1.4 for interoperability. + */ private static final long serialVersionUID = -4620751846003142047L; /** * Constructs a new job message from operator attribute with the given * message and locale. * - * @param message Message. - * @param locale Natural language of the text string. null - * is interpreted to mean the default locale as returned - * by {@code Locale.getDefault()} - * - * @exception NullPointerException - * (unchecked exception) Thrown if {@code message} is null. + * @param message the message + * @param locale Natural language of the text string. {@code null} is + * interpreted to mean the default locale as returned by + * {@code Locale.getDefault()} + * @throws NullPointerException if {@code message} is {@code null} */ public JobMessageFromOperator(String message, Locale locale) { super (message, locale); @@ -75,23 +78,19 @@ * Returns whether this job message from operator attribute is equivalent to * the passed in object. To be equivalent, all of the following conditions * must be true: - *
- * For class JobMessageFromOperator, the - * category is class JobMessageFromOperator itself. + *
+ * For class {@code JobMessageFromOperator}, the category is class + * {@code JobMessageFromOperator} itself. * - * @return Printing attribute class (category), an instance of class - * {@link java.lang.Class java.lang.Class}. + * @return printing attribute class (category), an instance of class + * {@link Class java.lang.Class} */ public final Class extends Attribute> getCategory() { return JobMessageFromOperator.class; @@ -115,14 +114,13 @@ /** * Get the name of the category of which this attribute value is an * instance. - *
- * For class JobMessageFromOperator, the - * category name is {@code "job-message-from-operator"}. + *
+ * For class {@code JobMessageFromOperator}, the category name is + * {@code "job-message-from-operator"}. * - * @return Attribute category name. + * @return attribute category name */ public final String getName() { return "job-message-from-operator"; } - } diff -r 000f4e4ddd39 -r 57173ad5c534 jdk/src/java.desktop/share/classes/javax/print/attribute/standard/JobName.java --- a/jdk/src/java.desktop/share/classes/javax/print/attribute/standard/JobName.java Fri Sep 01 14:13:40 2017 +0000 +++ b/jdk/src/java.desktop/share/classes/javax/print/attribute/standard/JobName.java Sat Sep 09 14:36:45 2017 +0200 @@ -1,5 +1,5 @@ /* - * Copyright (c) 2000, 2014, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2000, 2017, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -22,50 +22,53 @@ * or visit www.oracle.com if you need additional information or have any * questions. */ + package javax.print.attribute.standard; import java.util.Locale; import javax.print.attribute.Attribute; -import javax.print.attribute.TextSyntax; +import javax.print.attribute.PrintJobAttribute; import javax.print.attribute.PrintRequestAttribute; -import javax.print.attribute.PrintJobAttribute; +import javax.print.attribute.TextSyntax; /** - * Class JobName is a printing attribute class, a text attribute, that specifies - * the name of a print job. A job's name is an arbitrary string defined by the - * client. It does not need to be unique between different jobs. A Print Job's - * JobName attribute is set to the value supplied by the client in the Print - * Request's attribute set. If, however, the client does not supply a JobName - * attribute in the Print Request, the printer, when it creates the Print Job, - * must generate a JobName. The printer should generate the value of the Print - * Job's JobName attribute from the first of the following sources that produces - * a value: (1) the {@link DocumentName DocumentName} attribute of the first (or - * only) doc in the job, (2) the URL of the first (or only) doc in the job, if - * the doc's print data representation object is a URL, or (3) any other piece - * of Print Job specific and/or document content information. - *
- * IPP Compatibility: The string value gives the IPP name value. The + * Class {@code JobName} is a printing attribute class, a text attribute, that + * specifies the name of a print job. A job's name is an arbitrary string + * defined by the client. It does not need to be unique between different jobs. + * A Print Job's {@code JobName} attribute is set to the value supplied by the + * client in the Print Request's attribute set. If, however, the client does not + * supply a {@code JobName} attribute in the Print Request, the printer, when it + * creates the Print Job, must generate a {@code JobName}. The printer should + * generate the value of the Print Job's {@code JobName} attribute from the + * first of the following sources that produces a value: (1) the + * {@link DocumentName DocumentName} attribute of the first (or only) doc in the + * job, (2) the {@code URL} of the first (or only) doc in the job, if the doc's + * print data representation object is a {@code URL}, or (3) any other piece of + * Print Job specific and/or document content information. + *
+ * IPP Compatibility: The string value gives the IPP name value. The * locale gives the IPP natural language. The category name returned by * {@code getName()} gives the IPP attribute name. * - * @author Alan Kaminsky + * @author Alan Kaminsky */ public final class JobName extends TextSyntax implements PrintRequestAttribute, PrintJobAttribute { + /** + * Use serialVersionUID from JDK 1.4 for interoperability. + */ private static final long serialVersionUID = 4660359192078689545L; /** * Constructs a new job name attribute with the given job name and locale. * - * @param jobName Job name. - * @param locale Natural language of the text string. null - * is interpreted to mean the default locale as returned - * by {@code Locale.getDefault()} - * - * @exception NullPointerException - * (unchecked exception) Thrown if {@code jobName} is null. + * @param jobName job name + * @param locale natural language of the text string. {@code null} is + * interpreted to mean the default locale as returned by + * {@code Locale.getDefault()} + * @throws NullPointerException if {@code jobName} is {@code null} */ public JobName(String jobName, Locale locale) { super (jobName, locale); @@ -74,23 +77,18 @@ /** * Returns whether this job name attribute is equivalent to the passed in * object. To be equivalent, all of the following conditions must be true: - *
- * For class JobName, the category is class JobName itself. + *
+ * For class {@code JobName}, the category is class {@code JobName} itself. * - * @return Printing attribute class (category), an instance of class - * {@link java.lang.Class java.lang.Class}. + * @return printing attribute class (category), an instance of class + * {@link Class java.lang.Class} */ public final Class extends Attribute> getCategory() { return JobName.class; @@ -112,13 +110,12 @@ /** * Get the name of the category of which this attribute value is an * instance. - *
- * For class JobName, the category name is {@code "job-name"}. + *
+ * For class {@code JobName}, the category name is {@code "job-name"}. * - * @return Attribute category name. + * @return attribute category name */ public final String getName() { return "job-name"; } - } diff -r 000f4e4ddd39 -r 57173ad5c534 jdk/src/java.desktop/share/classes/javax/print/attribute/standard/JobOriginatingUserName.java --- a/jdk/src/java.desktop/share/classes/javax/print/attribute/standard/JobOriginatingUserName.java Fri Sep 01 14:13:40 2017 +0000 +++ b/jdk/src/java.desktop/share/classes/javax/print/attribute/standard/JobOriginatingUserName.java Sat Sep 09 14:36:45 2017 +0200 @@ -1,5 +1,5 @@ /* - * Copyright (c) 2000, 2014, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2000, 2017, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -22,50 +22,50 @@ * or visit www.oracle.com if you need additional information or have any * questions. */ + package javax.print.attribute.standard; import java.util.Locale; import javax.print.attribute.Attribute; +import javax.print.attribute.PrintJobAttribute; import javax.print.attribute.TextSyntax; -import javax.print.attribute.PrintJobAttribute; /** - * Class JobOriginatingUserName is a printing attribute class, a text - * attribute, that contains the name of the end user that submitted the - * print job. If possible, the printer sets this attribute to the most - * authenticated printable user name that it can obtain from the - * authentication service that authenticated the submitted Print Request. - * If such is not available, the printer uses the value of the - * {@link RequestingUserName RequestingUserName} - * attribute supplied by the client in the Print Request's attribute set. - * If no authentication service is available, and the client did not supply - * a {@link RequestingUserName RequestingUserName} attribute, - * the printer sets the JobOriginatingUserName attribute to an empty - * (zero-length) string. - *
- * IPP Compatibility: The string value gives the IPP name value. The + * Class {@code JobOriginatingUserName} is a printing attribute class, a text + * attribute, that contains the name of the end user that submitted the print + * job. If possible, the printer sets this attribute to the most authenticated + * printable user name that it can obtain from the authentication service that + * authenticated the submitted Print Request. If such is not available, the + * printer uses the value of the {@link RequestingUserName RequestingUserName} + * attribute supplied by the client in the Print Request's attribute set. If no + * authentication service is available, and the client did not supply a + * {@link RequestingUserName RequestingUserName} attribute, the printer sets the + * JobOriginatingUserName attribute to an empty (zero-length) string. + *
+ * IPP Compatibility: The string value gives the IPP name value. The * locale gives the IPP natural language. The category name returned by * {@code getName()} gives the IPP attribute name. * - * @author Alan Kaminsky + * @author Alan Kaminsky */ public final class JobOriginatingUserName extends TextSyntax implements PrintJobAttribute { + /** + * Use serialVersionUID from JDK 1.4 for interoperability. + */ private static final long serialVersionUID = -8052537926362933477L; /** - * Constructs a new job originating user name attribute with the given - * user name and locale. + * Constructs a new job originating user name attribute with the given user + * name and locale. * - * @param userName User name. - * @param locale Natural language of the text string. null - * is interpreted to mean the default locale as returned - * by {@code Locale.getDefault()} - * - * @exception NullPointerException - * (unchecked exception) Thrown if {@code userName} is null. + * @param userName user name + * @param locale natural language of the text string. {@code null} is + * interpreted to mean the default locale as returned by + * {@code Locale.getDefault()} + * @throws NullPointerException if {@code userName} is {@code null} */ public JobOriginatingUserName(String userName, Locale locale) { super (userName, locale); @@ -75,23 +75,19 @@ * Returns whether this job originating user name attribute is equivalent to * the passed in object. To be equivalent, all of the following conditions * must be true: - *
- * For class JobOriginatingUserName, the - * category is class JobOriginatingUserName itself. + *
+ * For class {@code JobOriginatingUserName}, the category is class + * {@code JobOriginatingUserName} itself. * - * @return Printing attribute class (category), an instance of class - * {@link java.lang.Class java.lang.Class}. + * @return printing attribute class (category), an instance of class + * {@link Class java.lang.Class} */ public final Class extends Attribute> getCategory() { return JobOriginatingUserName.class; @@ -115,14 +111,13 @@ /** * Get the name of the category of which this attribute value is an * instance. - *
- * For class JobOriginatingUserName, the - * category name is {@code "job-originating-user-name"}. + *
+ * For class {@code JobOriginatingUserName}, the category name is + * {@code "job-originating-user-name"}. * - * @return Attribute category name. + * @return attribute category name */ public final String getName() { return "job-originating-user-name"; } - } diff -r 000f4e4ddd39 -r 57173ad5c534 jdk/src/java.desktop/share/classes/javax/print/attribute/standard/JobPriority.java --- a/jdk/src/java.desktop/share/classes/javax/print/attribute/standard/JobPriority.java Fri Sep 01 14:13:40 2017 +0000 +++ b/jdk/src/java.desktop/share/classes/javax/print/attribute/standard/JobPriority.java Sat Sep 09 14:36:45 2017 +0200 @@ -1,5 +1,5 @@ /* - * Copyright (c) 2000, 2014, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2000, 2017, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -22,54 +22,55 @@ * or visit www.oracle.com if you need additional information or have any * questions. */ + package javax.print.attribute.standard; import javax.print.attribute.Attribute; import javax.print.attribute.IntegerSyntax; +import javax.print.attribute.PrintJobAttribute; import javax.print.attribute.PrintRequestAttribute; -import javax.print.attribute.PrintJobAttribute; /** - * Class JobPriority is an integer valued printing attribute class that + * Class {@code JobPriority} is an integer valued printing attribute class that * specifies a print job's priority. - *
- * If a JobPriority attribute is specified for a Print Job, it specifies a - * priority for scheduling the job. A higher value specifies a higher priority. - * The value 1 indicates the lowest possible priority. The value 100 indicates - * the highest possible priority. Among those jobs that are ready to print, a - * printer must print all jobs with a priority value of n before printing - * those with a priority value of n-1 for all n. - *
- * If the client does not specify a JobPriority attribute for a Print Job and - * the printer does support the JobPriority attribute, the printer must use an - * implementation-defined default JobPriority value. - *
+ *
+ * If a {@code JobPriority} attribute is specified for a Print Job, it specifies + * a priority for scheduling the job. A higher value specifies a higher + * priority. The value 1 indicates the lowest possible priority. The value 100 + * indicates the highest possible priority. Among those jobs that are ready to + * print, a printer must print all jobs with a priority value of n before + * printing those with a priority value of n-1 for all n. + *
+ * If the client does not specify a {@code JobPriority} attribute for a Print + * Job and the printer does support the JobPriority attribute, the printer must + * use an implementation-defined default JobPriority value. + *
* The client can always specify any job priority value from 1 to 100 for a job. - * However, a Print Service instance may support fewer than 100 different - * job priority levels. If this is the case, the Print Service instance + * However, a Print Service instance may support fewer than 100 different job + * priority levels. If this is the case, the Print Service instance * automatically maps the client-specified job priority value to one of the * supported job priority levels, dividing the 100 job priority values equally * among the available job priority levels. - *
- * IPP Compatibility: The integer value gives the IPP integer value. The - * category name returned by {@code getName()} gives the IPP attribute - * name. + *
+ * IPP Compatibility: The integer value gives the IPP integer value. The + * category name returned by {@code getName()} gives the IPP attribute name. * - * @author Alan Kaminsky + * @author Alan Kaminsky */ public final class JobPriority extends IntegerSyntax implements PrintRequestAttribute, PrintJobAttribute { + /** + * Use serialVersionUID from JDK 1.4 for interoperability. + */ private static final long serialVersionUID = -4599900369040602769L; /** * Construct a new job priority attribute with the given integer value. * - * @param value Integer value. - * - * @exception IllegalArgumentException - * (Unchecked exception) Thrown if {@code value} is less than 1 - * or greater than 100. + * @param value Integer value + * @throws IllegalArgumentException if {@code value} is less than 1 or + * greater than 100 */ public JobPriority(int value) { super (value, 1, 100); @@ -79,20 +80,16 @@ * Returns whether this job priority attribute is equivalent to the passed * in object. To be equivalent, all of the following conditions must be * true: - *
- * For class JobPriority, the category is class JobPriority itself. + *
+ * For class {@code JobPriority}, the category is class + * {@code JobPriority} itself. * - * @return Printing attribute class (category), an instance of class - * {@link java.lang.Class java.lang.Class}. + * @return printing attribute class (category), an instance of class + * {@link Class java.lang.Class} */ public final Class extends Attribute> getCategory() { return JobPriority.class; @@ -114,13 +112,13 @@ /** * Get the name of the category of which this attribute value is an * instance. - *
- * For class JobPriority, the category name is {@code "job-priority"}. + *
+ * For class {@code JobPriority}, the category name is + * {@code "job-priority"}. * - * @return Attribute category name. + * @return attribute category name */ public final String getName() { return "job-priority"; } - } diff -r 000f4e4ddd39 -r 57173ad5c534 jdk/src/java.desktop/share/classes/javax/print/attribute/standard/JobPrioritySupported.java --- a/jdk/src/java.desktop/share/classes/javax/print/attribute/standard/JobPrioritySupported.java Fri Sep 01 14:13:40 2017 +0000 +++ b/jdk/src/java.desktop/share/classes/javax/print/attribute/standard/JobPrioritySupported.java Sat Sep 09 14:36:45 2017 +0200 @@ -1,5 +1,5 @@ /* - * Copyright (c) 2000, 2014, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2000, 2017, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -22,6 +22,7 @@ * or visit www.oracle.com if you need additional information or have any * questions. */ + package javax.print.attribute.standard; import javax.print.attribute.Attribute; @@ -29,39 +30,38 @@ import javax.print.attribute.SupportedValuesAttribute; /** - * Class JobPrioritySupported is an integer valued printing attribute class - * that specifies whether a Print Service instance supports the {@link - * JobPriority JobPriority} attribute and the number of different job priority - * levels supported. - *
- * The client can always specify any {@link JobPriority JobPriority} value - * from 1 to 100 for a job. However, the Print Service instance may support - * fewer than 100 different job priority levels. If this is the case, the - * Print Service instance automatically maps the client-specified job priority - * value to one of the supported job priority levels, dividing the 100 job - * priority values equally among the available job priority levels. - *
- * IPP Compatibility: The integer value gives the IPP integer value. - * The category name returned by {@code getName()} gives the IPP - * attribute name. + * Class {@code JobPrioritySupported} is an integer valued printing attribute + * class that specifies whether a Print Service instance supports the + * {@link JobPriority JobPriority} attribute and the number of different job + * priority levels supported. + *
+ * The client can always specify any {@link JobPriority JobPriority} value from + * 1 to 100 for a job. However, the Print Service instance may support fewer + * than 100 different job priority levels. If this is the case, the Print + * Service instance automatically maps the client-specified job priority value + * to one of the supported job priority levels, dividing the 100 job priority + * values equally among the available job priority levels. + *
+ * IPP Compatibility: The integer value gives the IPP integer value. The + * category name returned by {@code getName()} gives the IPP attribute name. * - * @author Alan Kaminsky + * @author Alan Kaminsky */ public final class JobPrioritySupported extends IntegerSyntax implements SupportedValuesAttribute { + /** + * Use serialVersionUID from JDK 1.4 for interoperability. + */ private static final long serialVersionUID = 2564840378013555894L; - /** * Construct a new job priority supported attribute with the given integer * value. * - * @param value Number of different job priority levels supported. - * - * @exception IllegalArgumentException - * (Unchecked exception) Thrown if {@code value} is less than 1 - * or greater than 100. + * @param value number of different job priority levels supported + * @throws IllegalArgumentException if {@code value} is less than 1 or + * greater than 100 */ public JobPrioritySupported(int value) { super (value, 1, 100); @@ -71,20 +71,17 @@ * Returns whether this job priority supported attribute is equivalent to * the passed in object. To be equivalent, all of the following conditions * must be true: - *
- * For class JobPrioritySupported, the - * category is class JobPrioritySupported itself. + *
+ * For class {@code JobPrioritySupported}, the category is class + * {@code JobPrioritySupported} itself. * - * @return Printing attribute class (category), an instance of class - * {@link java.lang.Class java.lang.Class}. + * @return printing attribute class (category), an instance of class + * {@link Class java.lang.Class} */ public final Class extends Attribute> getCategory() { return JobPrioritySupported.class; @@ -110,14 +106,13 @@ /** * Get the name of the category of which this attribute value is an * instance. - *
- * For class JobPrioritySupported, the - * category name is {@code "job-priority-supported"}. + *
+ * For class {@code JobPrioritySupported}, the category name is + * {@code "job-priority-supported"}. * - * @return Attribute category name. + * @return attribute category name */ public final String getName() { return "job-priority-supported"; } - } diff -r 000f4e4ddd39 -r 57173ad5c534 jdk/src/java.desktop/share/classes/javax/print/attribute/standard/JobSheets.java --- a/jdk/src/java.desktop/share/classes/javax/print/attribute/standard/JobSheets.java Fri Sep 01 14:13:40 2017 +0000 +++ b/jdk/src/java.desktop/share/classes/javax/print/attribute/standard/JobSheets.java Sat Sep 09 14:36:45 2017 +0200 @@ -1,5 +1,5 @@ /* - * Copyright (c) 2000, 2014, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2000, 2017, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -22,39 +22,40 @@ * or visit www.oracle.com if you need additional information or have any * questions. */ + package javax.print.attribute.standard; -import java.util.Locale; - import javax.print.attribute.Attribute; import javax.print.attribute.EnumSyntax; +import javax.print.attribute.PrintJobAttribute; import javax.print.attribute.PrintRequestAttribute; -import javax.print.attribute.PrintJobAttribute; /** - * Class JobSheets is a printing attribute class, an enumeration, that + * Class {@code JobSheets} is a printing attribute class, an enumeration, that * determines which job start and end sheets, if any, must be printed with a - * job. Class JobSheets declares keywords for standard job sheets values. - * Implementation- or site-defined names for a job sheets attribute may also be - * created by defining a subclass of class JobSheets. - *
- * The effect of a JobSheets attribute on multidoc print jobs (jobs with - * multiple documents) may be affected by the {@link MultipleDocumentHandling - * MultipleDocumentHandling} job attribute, depending on the meaning of the - * particular JobSheets value. - *
- * IPP Compatibility: The category name returned by - * {@code getName()} is the IPP attribute name. The - * enumeration's integer value is the IPP enum value. The - * {@code toString()} method returns the IPP string representation of - * the attribute value. For a subclass, the attribute value must be - * localized to give the IPP name and natural language values. + * job. Class {@code JobSheets} declares keywords for standard job sheets + * values. Implementation- or site-defined names for a job sheets attribute may + * also be created by defining a subclass of class {@code JobSheets}. + *
+ * The effect of a {@code JobSheets} attribute on multidoc print jobs (jobs with + * multiple documents) may be affected by the + * {@link MultipleDocumentHandling MultipleDocumentHandling} job attribute, + * depending on the meaning of the particular {@code JobSheets} value. + *
+ * IPP Compatibility: The category name returned by {@code getName()} is + * the IPP attribute name. The enumeration's integer value is the IPP enum + * value. The {@code toString()} method returns the IPP string representation of + * the attribute value. For a subclass, the attribute value must be localized to + * give the IPP name and natural language values. * - * @author Alan Kaminsky + * @author Alan Kaminsky */ public class JobSheets extends EnumSyntax implements PrintRequestAttribute, PrintJobAttribute { + /** + * Use serialVersionUID from JDK 1.4 for interoperability. + */ private static final long serialVersionUID = -4735258056132519759L; /** @@ -63,9 +64,8 @@ public static final JobSheets NONE = new JobSheets(0); /** - * One or more site specific standard job sheets are printed. e.g. a - * single start sheet is printed, or both start and end sheets are - * printed. + * One or more site specific standard job sheets are printed. e.g. a single + * start sheet is printed, or both start and end sheets are printed. */ public static final JobSheets STANDARD = new JobSheets(1); @@ -73,31 +73,37 @@ * Construct a new job sheets enumeration value with the given integer * value. * - * @param value Integer value. + * @param value Integer value */ protected JobSheets(int value) { super (value); } + /** + * The string table for class {@code JobSheets}. + */ private static final String[] myStringTable = { "none", "standard" }; + /** + * The enumeration value table for class {@code JobSheets}. + */ private static final JobSheets[] myEnumValueTable = { NONE, STANDARD }; /** - * Returns the string table for class JobSheets. + * Returns the string table for class {@code JobSheets}. */ protected String[] getStringTable() { return myStringTable.clone(); } /** - * Returns the enumeration value table for class JobSheets. + * Returns the enumeration value table for class {@code JobSheets}. */ protected EnumSyntax[] getEnumValueTable() { return (EnumSyntax[])myEnumValueTable.clone(); @@ -106,12 +112,12 @@ /** * Get the printing attribute class which is to be used as the "category" * for this printing attribute value. - *
- * For class JobSheets and any vendor-defined subclasses, the category is - * class JobSheets itself. + *
+ * For class {@code JobSheets} and any vendor-defined subclasses, the + * category is class {@code JobSheets} itself. * - * @return Printing attribute class (category), an instance of class - * {@link java.lang.Class java.lang.Class}. + * @return printing attribute class (category), an instance of class + * {@link Class java.lang.Class} */ public final Class extends Attribute> getCategory() { return JobSheets.class; @@ -120,14 +126,13 @@ /** * Get the name of the category of which this attribute value is an * instance. - *
- * For class JobSheets and any vendor-defined subclasses, the category - * name is {@code "job-sheets"}. + *
+ * For class {@code JobSheets} and any vendor-defined subclasses, the + * category name is {@code "job-sheets"}. * - * @return Attribute category name. + * @return attribute category name */ public final String getName() { return "job-sheets"; } - } diff -r 000f4e4ddd39 -r 57173ad5c534 jdk/src/java.desktop/share/classes/javax/print/attribute/standard/JobState.java --- a/jdk/src/java.desktop/share/classes/javax/print/attribute/standard/JobState.java Fri Sep 01 14:13:40 2017 +0000 +++ b/jdk/src/java.desktop/share/classes/javax/print/attribute/standard/JobState.java Sat Sep 09 14:36:45 2017 +0200 @@ -1,5 +1,5 @@ /* - * Copyright (c) 2000, 2014, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2000, 2017, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -30,24 +30,27 @@ import javax.print.attribute.PrintJobAttribute; /** - * JobState is a printing attribute class, an enumeration, that identifies - * the current state of a print job. Class JobState defines standard job state - * values. A Print Service implementation only needs to report those job - * states which are appropriate for the particular implementation; it does not - * have to report every defined job state. The {@link JobStateReasons - * JobStateReasons} attribute augments the JobState attribute to give more - * detailed information about the job in the given job state. - *
- * IPP Compatibility: The category name returned by - * {@code getName()} is the IPP attribute name. The enumeration's - * integer value is the IPP enum value. The {@code toString()} method - * returns the IPP string representation of the attribute value. + * {@code JobState} is a printing attribute class, an enumeration, that + * identifies the current state of a print job. Class {@code JobState} defines + * standard job state values. A Print Service implementation only needs to + * report those job states which are appropriate for the particular + * implementation; it does not have to report every defined job state. The + * {@link JobStateReasons JobStateReasons} attribute augments the + * {@code JobState} attribute to give more detailed information about the job in + * the given job state. + *
+ * IPP Compatibility: The category name returned by {@code getName()} is + * the IPP attribute name. The enumeration's integer value is the IPP enum + * value. The {@code toString()} method returns the IPP string representation of + * the attribute value. * - * @author Alan Kaminsky + * @author Alan Kaminsky */ - public class JobState extends EnumSyntax implements PrintJobAttribute { + /** + * Use serialVersionUID from JDK 1.4 for interoperability. + */ private static final long serialVersionUID = 400465010094018920L; /** @@ -62,61 +65,57 @@ /** * The job is not a candidate for processing for any number of reasons but - * will return to the PENDING state as soon as the reasons are no longer - * present. The job's {@link JobStateReasons JobStateReasons} attribute must - * indicate why the job is no longer a candidate for processing. + * will return to the {@code PENDING} state as soon as the reasons are no + * longer present. The job's {@link JobStateReasons JobStateReasons} + * attribute must indicate why the job is no longer a candidate for + * processing. */ public static final JobState PENDING_HELD = new JobState(4); /** * The job is processing. One or more of the following activities is * occurring: - *
- * When the job is in the PROCESSING state, the entire job state includes - * the detailed status represented in the printer's {@link PrinterState - * PrinterState} and {@link PrinterStateReasons PrinterStateReasons} - * attributes. - *
+ *
* Implementations may, though they need not, include additional values in * the job's {@link JobStateReasons JobStateReasons} attribute to indicate - * the progress of the job, such as adding the JOB_PRINTING value to + * the progress of the job, such as adding the {@code JOB_PRINTING} value to * indicate when the output device is actually making marks on paper and/or - * the PROCESSING_TO_STOP_POINT value to indicate that the printer is in the - * process of canceling or aborting the job. + * the {@code PROCESSING_TO_STOP_POINT} value to indicate that the printer + * is in the process of canceling or aborting the job. */ public static final JobState PROCESSING = new JobState (5); /** * The job has stopped while processing for any number of reasons and will - * return to the PROCESSING state as soon as the reasons are no longer - * present. - *
+ * return to the {@code PROCESSING} state as soon as the reasons are no + * longer present. + *
* The job's {@link JobStateReasons JobStateReasons} attribute may indicate * why the job has stopped processing. For example, if the output device is - * stopped, the PRINTER_STOPPED value may be included in the job's {@link - * JobStateReasons JobStateReasons} attribute. - *
- * Note: When an output device is stopped, the device usually + * stopped, the {@code PRINTER_STOPPED} value may be included in the job's + * {@link JobStateReasons JobStateReasons} attribute. + *
+ * Note: When an output device is stopped, the device usually * indicates its condition in human readable form locally at the device. A * client can obtain more complete device status remotely by querying the - * printer's {@link PrinterState PrinterState} and {@link - * PrinterStateReasons PrinterStateReasons} attributes. + * printer's {@link PrinterState PrinterState} and + * {@link PrinterStateReasons PrinterStateReasons} attributes. */ public static final JobState PROCESSING_STOPPED = new JobState (6); @@ -125,24 +124,27 @@ * canceling the job, and all job status attributes have reached their final * values for the job. While the printer is canceling the job, the job * remains in its current state, but the job's {@link JobStateReasons - * JobStateReasons} attribute should contain the PROCESSING_TO_STOP_POINT - * value and one of the CANCELED_BY_USER, CANCELED_BY_OPERATOR, or - * CANCELED_AT_DEVICE values. When the job moves to the CANCELED state, the - * PROCESSING_TO_STOP_POINT value, if present, must be removed, but the - * CANCELED_BY_xxx value, if present, must remain. + * JobStateReasons} attribute should contain the + * {@code PROCESSING_TO_STOP_POINT} value and one of the + * {@code CANCELED_BY_USER}, {@code CANCELED_BY_OPERATOR}, or + * {@code CANCELED_AT_DEVICE} values. When the job moves to the + * {@code CANCELED} state, the {@code PROCESSING_TO_STOP_POINT} value, if + * present, must be removed, but the CANCELED_BY_xxx value, if + * present, must remain. */ public static final JobState CANCELED = new JobState (7); /** * The job has been aborted by the system (usually while the job was in the - * PROCESSING or PROCESSING_STOPPED state), the printer has completed - * aborting the job, and all job status attributes have reached their final - * values for the job. While the printer is aborting the job, the job - * remains in its current state, but the job's {@link JobStateReasons - * JobStateReasons} attribute should contain the PROCESSING_TO_STOP_POINT - * and ABORTED_BY_SYSTEM values. When the job moves to the ABORTED state, - * the PROCESSING_TO_STOP_POINT value, if present, must be removed, but the - * ABORTED_BY_SYSTEM value, if present, must remain. + * {@code PROCESSING} or {@code PROCESSING_STOPPED} state), the printer has + * completed aborting the job, and all job status attributes have reached + * their final values for the job. While the printer is aborting the job, + * the job remains in its current state, but the job's + * {@link JobStateReasons JobStateReasons} attribute should contain the + * {@code PROCESSING_TO_STOP_POINT} and {@code ABORTED_BY_SYSTEM} values. + * When the job moves to the {@code ABORTED} state, the + * {@code PROCESSING_TO_STOP_POINT} value, if present, must be removed, but + * the {@code ABORTED_BY_SYSTEM} value, if present, must remain. */ public static final JobState ABORTED = new JobState (8); @@ -150,10 +152,10 @@ * The job has completed successfully or with warnings or errors after * processing, all of the job media sheets have been successfully stacked in * the appropriate output bin(s), and all job status attributes have reached - * their final values for the job. The job's {@link JobStateReasons - * JobStateReasons} attribute should contain one of these values: - * COMPLETED_SUCCESSFULLY, COMPLETED_WITH_WARNINGS, or - * COMPLETED_WITH_ERRORS. + * their final values for the job. The job's + * {@link JobStateReasons JobStateReasons} attribute should contain one of + * these values: {@code COMPLETED_SUCCESSFULLY}, + * {@code COMPLETED_WITH_WARNINGS}, or {@code COMPLETED_WITH_ERRORS}. */ public static final JobState COMPLETED = new JobState (9); @@ -162,12 +164,15 @@ /** * Construct a new job state enumeration value with the given integer value. * - * @param value Integer value. + * @param value Integer value */ protected JobState(int value) { super (value); } + /** + * The string table for class {@code JobState}. + */ private static final String[] myStringTable = {"unknown", null, @@ -180,6 +185,9 @@ "aborted", "completed"}; + /** + * The enumeration value table for class {@code JobState}. + */ private static final JobState[] myEnumValueTable = {UNKNOWN, null, @@ -193,14 +201,14 @@ COMPLETED}; /** - * Returns the string table for class JobState. + * Returns the string table for class {@code JobState}. */ protected String[] getStringTable() { return myStringTable; } /** - * Returns the enumeration value table for class JobState. + * Returns the enumeration value table for class {@code JobState}. */ protected EnumSyntax[] getEnumValueTable() { return myEnumValueTable; @@ -209,12 +217,12 @@ /** * Get the printing attribute class which is to be used as the "category" * for this printing attribute value. - *
- * For class JobState and any vendor-defined subclasses, the category is - * class JobState itself. + *
+ * For class {@code JobState} and any vendor-defined subclasses, the + * category is class {@code JobState} itself. * - * @return Printing attribute class (category), an instance of class - * {@link java.lang.Class java.lang.Class}. + * @return printing attribute class (category), an instance of class + * {@link Class java.lang.Class} */ public final Class extends Attribute> getCategory() { return JobState.class; @@ -223,14 +231,13 @@ /** * Get the name of the category of which this attribute value is an * instance. - *
- * For class JobState and any vendor-defined subclasses, the category - * name is {@code "job-state"}. + *
+ * For class {@code JobState} and any vendor-defined subclasses, the + * category name is {@code "job-state"}. * - * @return Attribute category name. + * @return attribute category name */ public final String getName() { return "job-state"; } - } diff -r 000f4e4ddd39 -r 57173ad5c534 jdk/src/java.desktop/share/classes/javax/print/attribute/standard/JobStateReason.java --- a/jdk/src/java.desktop/share/classes/javax/print/attribute/standard/JobStateReason.java Fri Sep 01 14:13:40 2017 +0000 +++ b/jdk/src/java.desktop/share/classes/javax/print/attribute/standard/JobStateReason.java Sat Sep 09 14:36:45 2017 +0200 @@ -1,5 +1,5 @@ /* - * Copyright (c) 2000, 2014, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2000, 2017, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -22,40 +22,45 @@ * or visit www.oracle.com if you need additional information or have any * questions. */ + package javax.print.attribute.standard; +import javax.print.attribute.Attribute; import javax.print.attribute.EnumSyntax; -import javax.print.attribute.Attribute; /** - * Class JobStateReason is a printing attribute class, an enumeration, that - * provides additional information about the job's current state, i.e., + * Class {@code JobStateReason} is a printing attribute class, an enumeration, + * that provides additional information about the job's current state, i.e., * information that augments the value of the job's {@link JobState JobState} - * attribute. Class JobStateReason defines standard job state reason values. A - * Print Service implementation only needs to report those job state + * attribute. Class {@code JobStateReason} defines standard job state reason + * values. A Print Service implementation only needs to report those job state * reasons which are appropriate for the particular implementation; it does not * have to report every defined job state reason. - *
- * Instances of JobStateReason do not appear in a Print Job's attribute set - * directly. Rather, a {@link JobStateReasons JobStateReasons} attribute appears - * in the Print Job's attribute set. The {@link JobStateReasons JobStateReasons} - * attribute contains zero, one, or more than one JobStateReason objects which - * pertain to the Print Job's status. The printer adds a JobStateReason object - * to the Print Job's {@link JobStateReasons JobStateReasons} attribute when the - * corresponding condition becomes true of the Print Job, and the printer - * removes the JobStateReason object again when the corresponding condition - * becomes false, regardless of whether the Print Job's overall {@link JobState - * JobState} also changed. - *
- * IPP Compatibility: The category name returned by - * {@code getName()} is the IPP attribute name. The enumeration's - * integer value is the IPP enum value. The {@code toString()} method - * returns the IPP string representation of the attribute value. + *
+ * Instances of {@code JobStateReason} do not appear in a Print Job's attribute + * set directly. Rather, a {@link JobStateReasons JobStateReasons} attribute + * appears in the Print Job's attribute set. The + * {@link JobStateReasons JobStateReasons} attribute contains zero, one, or more + * than one {@code JobStateReason} objects which pertain to the Print Job's + * status. The printer adds a JobStateReason object to the Print Job's + * {@link JobStateReasons JobStateReasons} attribute when the corresponding + * condition becomes true of the Print Job, and the printer removes the + * {@code JobStateReason} object again when the corresponding condition becomes + * false, regardless of whether the Print Job's overall + * {@link JobState JobState} also changed. + *
+ * IPP Compatibility: The category name returned by {@code getName()} is + * the IPP attribute name. The enumeration's integer value is the IPP enum + * value. The {@code toString()} method returns the IPP string representation of + * the attribute value. * - * @author Alan Kaminsky + * @author Alan Kaminsky */ public class JobStateReason extends EnumSyntax implements Attribute { + /** + * Use serialVersionUID from JDK 1.4 for interoperability. + */ private static final long serialVersionUID = -8765894420449009168L; /** @@ -67,27 +72,29 @@ /** * The printer has created the Print Job, but the printer is expecting - * additional print data before it can move the job into the PROCESSING - * state. If a printer starts processing before it has received all data, - * the printer removes the JOB_DATA_INSUFFICIENT reason, but the - * JOB_INCOMING reason remains. If a printer starts processing after it - * has received all data, the printer removes the JOB_DATA_INSUFFICIENT - * and JOB_INCOMING reasons at the same time. + * additional print data before it can move the job into the + * {@code PROCESSING} state. If a printer starts processing before it has + * received all data, the printer removes the {@code JOB_DATA_INSUFFICIENT} + * reason, but the {@code JOB_INCOMING} reason remains. If a printer starts + * processing after it has received all data, the printer removes the + * {@code JOB_DATA_INSUFFICIENT} and {@code JOB_INCOMING} reasons at the + * same time. */ public static final JobStateReason JOB_DATA_INSUFFICIENT = new JobStateReason(1); /** - * The Printer could not access one or more documents passed by reference - * (i.e., the print data representation object is a URL). This reason is - * intended to cover any file access problem,including file does not exist - * and access denied because of an access control problem. Whether the - * printer aborts the job and moves the job to the ABORTED job state or - * prints all documents that are accessible and moves the job to the - * COMPLETED job state and adds the COMPLETED_WITH_ERRORS reason to the - * job's {@link JobStateReasons JobStateReasons} attribute depends on - * implementation and/or site policy. This value should be supported if - * the printer supports doc flavors with URL print data representation + * The printer could not access one or more documents passed by reference + * (i.e., the print data representation object is a {@code URL}). This + * reason is intended to cover any file access problem,including file does + * not exist and access denied because of an access control problem. Whether + * the printer aborts the job and moves the job to the {@code ABORTED} job + * state or prints all documents that are accessible and moves the job to + * the {@code COMPLETED} job state and adds the + * {@code COMPLETED_WITH_ERRORS} reason to the job's + * {@link JobStateReasons JobStateReasons} attribute depends on + * implementation and/or site policy. This value should be supported if the + * printer supports doc flavors with {@code URL} print data representation * objects. */ public static final JobStateReason @@ -112,9 +119,8 @@ /** * The value of the job's {@link JobHoldUntil JobHoldUntil} attribute was - * specified with a date-time that is still in the future. The job must - * not be a candidate for processing until this reason is removed and - * there are + * specified with a date-time that is still in the future. The job must not + * be a candidate for processing until this reason is removed and there are * no other reasons to hold the job. This value should be supported if the * {@link JobHoldUntil JobHoldUntil} job template attribute is supported. */ @@ -123,63 +129,64 @@ /** * At least one of the resources needed by the job, such as media, fonts, - * resource objects, etc., is not ready on any of the physical printers - * for which the job is a candidate. This condition may be detected - * when the job is accepted, or subsequently while the job is pending - * or processing, depending on implementation. - * The job may remain in its current state or - * be moved to the PENDING_HELD state, depending on implementation and/or - * job scheduling policy. + * resource objects, etc., is not ready on any of the physical printers for + * which the job is a candidate. This condition may be detected when the job + * is accepted, or subsequently while the job is pending or processing, + * depending on implementation. The job may remain in its current state or + * be moved to the {@code PENDING_HELD} state, depending on implementation + * and/or job scheduling policy. */ public static final JobStateReason RESOURCES_ARE_NOT_READY = new JobStateReason(6); /** * The value of the printer's {@link PrinterStateReasons - * PrinterStateReasons} attribute contains a {@link PrinterStateReason - * PrinterStateReason} value of STOPPED_PARTLY. + * PrinterStateReasons} attribute contains a + * {@link PrinterStateReason PrinterStateReason} value of + * {@code STOPPED_PARTLY}. */ public static final JobStateReason PRINTER_STOPPED_PARTLY = new JobStateReason(7); /** - * The value of the printer's {@link PrinterState PrinterState} attribute - * ia STOPPED. + * The value of the printer's {@link PrinterState PrinterState} attribute ia + * {@code STOPPED}. */ public static final JobStateReason PRINTER_STOPPED = new JobStateReason(8); /** - * The job is in the PROCESSING state, but more specifically, the printer - * ia interpreting the document data. + * The job is in the {@code PROCESSING} state, but more specifically, the + * printer ia interpreting the document data. */ public static final JobStateReason JOB_INTERPRETING = new JobStateReason(9); /** - * The job is in the PROCESSING state, but more specifically, the printer - * has queued the document data. + * The job is in the {@code PROCESSING} state, but more specifically, the + * printer has queued the document data. */ public static final JobStateReason JOB_QUEUED = new JobStateReason(10); /** - * The job is in the PROCESSING state, but more specifically, the printer - * is interpreting document data and producing another electronic + * The job is in the {@code PROCESSING} state, but more specifically, the + * printer is interpreting document data and producing another electronic * representation. */ public static final JobStateReason JOB_TRANSFORMING = new JobStateReason(11); /** - * The job is in the PENDING_HELD, PENDING, or PROCESSING state, but more - * specifically, the printer has completed enough processing of the document - * to be able to start marking and the job is waiting for the marker. - * Systems that require human intervention to release jobs put the job into - * the PENDING_HELD job state. Systems that automatically select a job to - * use the marker put the job into the PENDING job state or keep the job - * in the PROCESSING job state while waiting for the marker, depending on + * The job is in the {@code PENDING_HELD}, {@code PENDING}, or + * {@code PROCESSING} state, but more specifically, the printer has + * completed enough processing of the document to be able to start marking + * and the job is waiting for the marker. Systems that require human + * intervention to release jobs put the job into the {@code PENDING_HELD} + * job state. Systems that automatically select a job to use the marker put + * the job into the {@code PENDING} job state or keep the job in the + * {@code PROCESSING} job state while waiting for the marker, depending on * implementation. All implementations put the job into (or back into) the - * PROCESSING state when marking does begin. + * {@code PROCESSING} state when marking does begin. */ public static final JobStateReason JOB_QUEUED_FOR_MARKER = new JobStateReason(12); @@ -189,8 +196,9 @@ * which spend a great deal of time processing (1) when no marking is * happening and then want to show that marking is now happening or (2) when * the job is in the process of being canceled or aborted while the job - * remains in the PROCESSING state, but the marking has not yet stopped so - * that impression or sheet counts are still increasing for the job. + * remains in the {@code PROCESSING} state, but the marking has not yet + * stopped so that impression or sheet counts are still increasing for the + * job. */ public static final JobStateReason JOB_PRINTING = new JobStateReason(13); @@ -229,9 +237,9 @@ /** * The job was aborted by the system. Either the job (1) is in the process * of being aborted, (2) has been aborted by the system and placed in the - * ABORTED state, or (3) has been aborted by the system and placed in the - * PENDING_HELD state, so that a user or operator can manually try the job - * again. This value should be supported. + * {@code ABORTED} state, or (3) has been aborted by the system and placed + * in the {@code PENDING_HELD} state, so that a user or operator can + * manually try the job again. This value should be supported. */ public static final JobStateReason ABORTED_BY_SYSTEM = new JobStateReason(17); @@ -250,7 +258,7 @@ * The job was aborted by the system because the printer encountered an * error in the document data while decompressing it. If the printer posts * this reason, the document data has already passed any tests that would - * have led to the UNSUPPORTED_COMPRESSION job state reason. + * have led to the {@code UNSUPPORTED_COMPRESSION} job state reason. */ public static final JobStateReason COMPRESSION_ERROR = new JobStateReason(19); @@ -259,8 +267,8 @@ * The job was aborted by the system because the document data's document * format (doc flavor) is not among those supported by the printer. If the * client specifies a doc flavor with a MIME type of - * {@code "application/octet-stream"}, the printer may abort the job if - * the printer cannot determine the document data's actual format through + * {@code "application/octet-stream"}, the printer may abort the job if the + * printer cannot determine the document data's actual format through * auto-sensing (even if the printer supports the document format if * specified explicitly). This value must be supported, since a doc flavor * is required to be specified for each doc. @@ -272,7 +280,7 @@ * The job was aborted by the system because the printer encountered an * error in the document data while processing it. If the printer posts this * reason, the document data has already passed any tests that would have - * led to the UNSUPPORTED_DOCUMENT_FORMAT job state reason. + * led to the {@code UNSUPPORTED_DOCUMENT_FORMAT} job state reason. */ public static final JobStateReason DOCUMENT_FORMAT_ERROR = new JobStateReason(21); @@ -281,22 +289,23 @@ * The requester has canceled the job or the printer has aborted the job, * but the printer is still performing some actions on the job until a * specified stop point occurs or job termination/cleanup is completed. - *
+ *
* If the implementation requires some measurable time to cancel the job in - * the PROCESSING or PROCESSING_STOPPED job states, the printer must use - * this reason to indicate that the printer is still performing some actions - * on the job while the job remains in the PROCESSING or PROCESSING_STOPPED - * state. After all the job's job description attributes have stopped - * incrementing, the printer moves the job from the PROCESSING state to the - * CANCELED or ABORTED job states. + * the {@code PROCESSING} or {@code PROCESSING_STOPPED} job states, the + * printer must use this reason to indicate that the printer is still + * performing some actions on the job while the job remains in the + * {@code PROCESSING} or {@code PROCESSING_STOPPED} state. After all the + * job's job description attributes have stopped incrementing, the printer + * moves the job from the PROCESSING state to the {@code CANCELED} or + * {@code ABORTED} job states. */ public static final JobStateReason PROCESSING_TO_STOP_POINT = new JobStateReason(22); /** - * The printer is off-line and accepting no jobs. All PENDING jobs are put - * into the PENDING_HELD state. This situation could be true if the - * service's or document transform's input is impaired or broken. + * The printer is off-line and accepting no jobs. All {@code PENDING} jobs + * are put into the {@code PENDING_HELD} state. This situation could be true + * if the service's or document transform's input is impaired or broken. */ public static final JobStateReason SERVICE_OFF_LINE = new JobStateReason(23); @@ -323,11 +332,11 @@ /** * This job is retained and is currently able to be restarted. If - * JOB_RESTARTABLE is contained in the job's {@link JobStateReasons - * JobStateReasons} attribute, then the printer must accept a request to - * restart that job. This value should be supported if restarting jobs is - * supported. [The capability for restarting jobs is not in the Java - * Print Service API at present.] + * {@code JOB_RESTARTABLE} is contained in the job's + * {@link JobStateReasons JobStateReasons} attribute, then the printer must + * accept a request to restart that job. This value should be supported if + * restarting jobs is supported. [The capability for restarting jobs is + * not in the Java Print Service API at present.] */ public static final JobStateReason JOB_RESTARTABLE = new JobStateReason(27); @@ -335,24 +344,27 @@ /** * The job has been forwarded to a device or print system that is unable to * send back status. The printer sets the job's {@link JobState JobState} - * attribute to COMPLETED and adds the QUEUED_IN_DEVICE reason to the job's - * {@link JobStateReasons JobStateReasons} attribute to indicate that the - * printer has no additional information about the job and never will have - * any better information. + * attribute to {@code COMPLETED} and adds the {@code QUEUED_IN_DEVICE} + * reason to the job's {@link JobStateReasons JobStateReasons} attribute to + * indicate that the printer has no additional information about the job and + * never will have any better information. */ public static final JobStateReason QUEUED_IN_DEVICE = new JobStateReason(28); /** - * Construct a new job state reason enumeration value with the given - * integer value. + * Construct a new job state reason enumeration value with the given integer + * value. * - * @param value Integer value. + * @param value Integer value */ protected JobStateReason(int value) { super (value); } + /** + * The string table for class {@code JobStateReason}. + */ private static final String[] myStringTable = { "job-incoming", "job-data-insufficient", @@ -384,6 +396,9 @@ "job-restartable", "queued-in-device"}; + /** + * The enumeration value table for class {@code JobStateReason}. + */ private static final JobStateReason[] myEnumValueTable = { JOB_INCOMING, JOB_DATA_INSUFFICIENT, @@ -416,29 +431,28 @@ QUEUED_IN_DEVICE}; /** - * Returns the string table for class JobStateReason. + * Returns the string table for class {@code JobStateReason}. */ protected String[] getStringTable() { return myStringTable.clone(); } /** - * Returns the enumeration value table for class JobStateReason. + * Returns the enumeration value table for class {@code JobStateReason}. */ protected EnumSyntax[] getEnumValueTable() { return (EnumSyntax[])myEnumValueTable.clone(); } - /** * Get the printing attribute class which is to be used as the "category" * for this printing attribute value. - *
- * For class JobStateReason and any vendor-defined subclasses, the - * category is class JobStateReason itself. + *
+ * For class {@code JobStateReason} and any vendor-defined subclasses, the + * category is class {@code JobStateReason} itself. * - * @return Printing attribute class (category), an instance of class - * {@link java.lang.Class java.lang.Class}. + * @return printing attribute class (category), an instance of class + * {@link Class java.lang.Class} */ public final Class extends Attribute> getCategory() { return JobStateReason.class; @@ -447,14 +461,13 @@ /** * Get the name of the category of which this attribute value is an * instance. - *
- * For class JobStateReason and any vendor-defined subclasses, the + *
+ * For class {@code JobStateReason} and any vendor-defined subclasses, the * category name is {@code "job-state-reason"}. * - * @return Attribute category name. + * @return attribute category name */ public final String getName() { return "job-state-reason"; } - } diff -r 000f4e4ddd39 -r 57173ad5c534 jdk/src/java.desktop/share/classes/javax/print/attribute/standard/JobStateReasons.java --- a/jdk/src/java.desktop/share/classes/javax/print/attribute/standard/JobStateReasons.java Fri Sep 01 14:13:40 2017 +0000 +++ b/jdk/src/java.desktop/share/classes/javax/print/attribute/standard/JobStateReasons.java Sat Sep 09 14:36:45 2017 +0200 @@ -1,5 +1,5 @@ /* - * Copyright (c) 2000, 2014, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2000, 2017, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -22,6 +22,7 @@ * or visit www.oracle.com if you need additional information or have any * questions. */ + package javax.print.attribute.standard; import java.util.Collection; @@ -31,43 +32,47 @@ import javax.print.attribute.PrintJobAttribute; /** - * Class JobStateReasons is a printing attribute class, a set of enumeration - * values, that provides additional information about the job's current state, - * i.e., information that augments the value of the job's {@link JobState - * JobState} attribute. - *
+ * Class {@code JobStateReasons} is a printing attribute class, a set of + * enumeration values, that provides additional information about the job's + * current state, i.e., information that augments the value of the job's + * {@link JobState JobState} attribute. + *
* Instances of {@link JobStateReason JobStateReason} do not appear in a Print - * Job's attribute set directly. Rather, a JobStateReasons attribute appears in - * the Print Job's attribute set. The JobStateReasons attribute contains zero, - * one, or more than one {@link JobStateReason JobStateReason} objects which - * pertain to the Print Job's status. The printer adds a {@link JobStateReason - * JobStateReason} object to the Print Job's JobStateReasons attribute when the - * corresponding condition becomes true of the Print Job, and the printer - * removes the {@link JobStateReason JobStateReason} object again when the - * corresponding condition becomes false, regardless of whether the Print Job's - * overall {@link JobState JobState} also changed. - *
- * Class JobStateReasons inherits its implementation from class {@link - * java.util.HashSet java.util.HashSet}. Unlike most printing attributes which - * are immutable once constructed, class JobStateReasons is designed to be - * mutable; you can add {@link JobStateReason JobStateReason} objects to an - * existing JobStateReasons object and remove them again. However, like class - * {@link java.util.HashSet java.util.HashSet}, class JobStateReasons is not - * multiple thread safe. If a JobStateReasons object will be used by multiple - * threads, be sure to synchronize its operations (e.g., using a synchronized - * set view obtained from class {@link java.util.Collections - * java.util.Collections}). - *
- * IPP Compatibility: The string value returned by each individual {@link - * JobStateReason JobStateReason} object's {@code toString()} method gives - * the IPP keyword value. The category name returned by {@code getName()} + * Job's attribute set directly. Rather, a {@code JobStateReasons} attribute + * appears in the Print Job's attribute set. The {@code JobStateReasons} + * attribute contains zero, one, or more than one + * {@link JobStateReason JobStateReason} objects which pertain to the Print + * Job's status. The printer adds a {@link JobStateReason JobStateReason} object + * to the Print Job's JobStateReasons attribute when the corresponding condition + * becomes true of the Print Job, and the printer removes the + * {@link JobStateReason JobStateReason} object again when the corresponding + * condition becomes false, regardless of whether the Print Job's overall + * {@link JobState JobState} also changed. + *
+ * Class {@code JobStateReasons} inherits its implementation from class + * {@link HashSet java.util.HashSet}. Unlike most printing attributes + * which are immutable once constructed, class {@code JobStateReasons} is + * designed to be mutable; you can add {@link JobStateReason JobStateReason} + * objects to an existing {@code JobStateReasons} object and remove them again. + * However, like class {@link HashSet java.util.HashSet}, class + * {@code JobStateReasons} is not multiple thread safe. If a + * {@code JobStateReasons} object will be used by multiple threads, be sure to + * synchronize its operations (e.g., using a synchronized set view obtained + * from class {@link java.util.Collections java.util.Collections}). + *
+ * IPP Compatibility: The string value returned by each individual
+ * {@link JobStateReason JobStateReason} object's {@code toString()} method
+ * gives the IPP keyword value. The category name returned by {@code getName()}
* gives the IPP attribute name.
*
- * @author Alan Kaminsky
+ * @author Alan Kaminsky
*/
public final class JobStateReasons
extends HashSet
- * For class JobStateReasons, the category is class JobStateReasons itself.
+ *
+ * For class {@code JobStateReasons}, the category is class
+ * JobStateReasons itself.
*
- * @return Printing attribute class (category), an instance of class
- * {@link java.lang.Class java.lang.Class}.
+ * @return printing attribute class (category), an instance of class
+ * {@link Class java.lang.Class}
*/
public final Class extends Attribute> getCategory() {
return JobStateReasons.class;
@@ -167,14 +162,13 @@
/**
* Get the name of the category of which this attribute value is an
* instance.
- *
- * For class JobStateReasons, the category
- * name is {@code "job-state-reasons"}.
+ *
+ * For class JobStateReasons, the category name is
+ * {@code "job-state-reasons"}.
*
- * @return Attribute category name.
+ * @return attribute category name
*/
public final String getName() {
return "job-state-reasons";
}
-
}
diff -r 000f4e4ddd39 -r 57173ad5c534 jdk/src/java.desktop/share/classes/javax/print/attribute/standard/Media.java
--- a/jdk/src/java.desktop/share/classes/javax/print/attribute/standard/Media.java Fri Sep 01 14:13:40 2017 +0000
+++ b/jdk/src/java.desktop/share/classes/javax/print/attribute/standard/Media.java Sat Sep 09 14:36:45 2017 +0200
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2000, 2014, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2000, 2017, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
@@ -22,48 +22,51 @@
* or visit www.oracle.com if you need additional information or have any
* questions.
*/
+
package javax.print.attribute.standard;
import javax.print.attribute.Attribute;
import javax.print.attribute.DocAttribute;
import javax.print.attribute.EnumSyntax;
+import javax.print.attribute.PrintJobAttribute;
import javax.print.attribute.PrintRequestAttribute;
-import javax.print.attribute.PrintJobAttribute;
/**
- * Class Media is a printing attribute class that specifies the
- * medium on which to print.
+ * Class {@code Media} is a printing attribute class that specifies the medium
+ * on which to print.
*
* Media may be specified in different ways.
*
- * A Media object is constructed with a value which represents
- * one of the ways in which the Media attribute can be specified.
+ * A {@code Media} object is constructed with a value which represents one of
+ * the ways in which the Media attribute can be specified.
*
- * IPP Compatibility: The category name returned by
- * {@code getName()} is the IPP attribute name. The enumeration's
- * integer value is the IPP enum value. The {@code toString()} method
- * returns the IPP string representation of the attribute value.
+ * IPP Compatibility: The category name returned by {@code getName()} is
+ * the IPP attribute name. The enumeration's integer value is the IPP enum
+ * value. The {@code toString()} method returns the IPP string representation of
+ * the attribute value.
*
* @author Phil Race
*/
public abstract class Media extends EnumSyntax
implements DocAttribute, PrintRequestAttribute, PrintJobAttribute {
+ /**
+ * Use serialVersionUID from JDK 1.4 for interoperability.
+ */
private static final long serialVersionUID = -2823970704630722439L;
/**
* Constructs a new media attribute specified by name.
*
- * @param value a value
+ * @param value a value
*/
protected Media(int value) {
super (value);
@@ -72,19 +75,16 @@
/**
* Returns whether this media attribute is equivalent to the passed in
* object. To be equivalent, all of the following conditions must be true:
- *
- * For class Media and any vendor-defined subclasses, the category is
- * class Media itself.
+ *
+ * For class {@code Media} and any vendor-defined subclasses, the category
+ * is class {@code Media} itself.
*
- * @return Printing attribute class (category), an instance of class
- * {@link java.lang.Class java.lang.Class}.
+ * @return printing attribute class (category), an instance of class
+ * {@link Class java.lang.Class}
*/
public final Class extends Attribute> getCategory() {
return Media.class;
@@ -109,14 +109,13 @@
/**
* Get the name of the category of which this attribute value is an
* instance.
- *
- * For class Media and any vendor-defined subclasses, the category name is
- * {@code "media"}.
+ *
+ * For class {@code Media} and any vendor-defined subclasses, the category
+ * name is {@code "media"}.
*
- * @return Attribute category name.
+ * @return attribute category name
*/
public final String getName() {
return "media";
}
-
}
diff -r 000f4e4ddd39 -r 57173ad5c534 jdk/src/java.desktop/share/classes/javax/print/attribute/standard/MediaName.java
--- a/jdk/src/java.desktop/share/classes/javax/print/attribute/standard/MediaName.java Fri Sep 01 14:13:40 2017 +0000
+++ b/jdk/src/java.desktop/share/classes/javax/print/attribute/standard/MediaName.java Sat Sep 09 14:36:45 2017 +0200
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2000, 2014, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2000, 2017, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
@@ -22,37 +22,40 @@
* or visit www.oracle.com if you need additional information or have any
* questions.
*/
+
package javax.print.attribute.standard;
-import java.util.Locale;
import javax.print.attribute.Attribute;
import javax.print.attribute.EnumSyntax;
/**
- * Class MediaName is a subclass of Media, a printing attribute class (an
- * enumeration) that specifies the media for a print job as a name.
- *
- * This attribute can be used instead of specifying MediaSize or MediaTray.
+ * Class {@code MediaName} is a subclass of {@code Media}, a printing attribute
+ * class (an enumeration) that specifies the media for a print job as a name.
+ *
+ * This attribute can be used instead of specifying {@code MediaSize} or
+ * {@code MediaTray}.
*
- * Class MediaName currently declares a few standard media names.
- * Implementation- or site-defined names for a media name attribute may also
- * be created by defining a subclass of class MediaName.
- *
- * IPP Compatibility: MediaName is a representation class for
+ * Class {@code MediaName} currently declares a few standard media names.
+ * Implementation- or site-defined names for a media name attribute may also be
+ * created by defining a subclass of class {@code MediaName}.
+ *
+ * IPP Compatibility: {@code MediaName} is a representation class for
* values of the IPP "media" attribute which names media.
- *
*/
public class MediaName extends Media implements Attribute {
+ /**
+ * Use serialVersionUID from JDK 1.4 for interoperability.
+ */
private static final long serialVersionUID = 4653117714524155448L;
/**
- * white letter paper.
+ * white letter paper.
*/
public static final MediaName NA_LETTER_WHITE = new MediaName(0);
/**
- * letter transparency.
+ * letter transparency.
*/
public static final MediaName NA_LETTER_TRANSPARENT = new MediaName(1);
@@ -61,23 +64,24 @@
*/
public static final MediaName ISO_A4_WHITE = new MediaName(2);
-
/**
- * A4 transparency.
+ * A4 transparency.
*/
public static final MediaName ISO_A4_TRANSPARENT= new MediaName(3);
-
/**
* Constructs a new media name enumeration value with the given integer
* value.
*
- * @param value Integer value.
+ * @param value Integer value
*/
protected MediaName(int value) {
super (value);
}
+ /**
+ * The string table for class {@code MediaTray}.
+ */
private static final String[] myStringTable = {
"na-letter-white",
"na-letter-transparent",
@@ -85,6 +89,9 @@
"iso-a4-transparent"
};
+ /**
+ * The enumeration value table for class {@code MediaTray}.
+ */
private static final MediaName[] myEnumValueTable = {
NA_LETTER_WHITE,
NA_LETTER_TRANSPARENT,
@@ -93,8 +100,9 @@
};
/**
- * Returns the string table for class MediaTray.
- * @return the String table.
+ * Returns the string table for class {@code MediaTray}.
+ *
+ * @return the string table
*/
protected String[] getStringTable()
{
@@ -102,11 +110,11 @@
}
/**
- * Returns the enumeration value table for class MediaTray.
- * @return the enumeration value table.
+ * Returns the enumeration value table for class {@code MediaTray}.
+ *
+ * @return the enumeration value table
*/
protected EnumSyntax[] getEnumValueTable() {
return (EnumSyntax[])myEnumValueTable.clone();
}
-
}
diff -r 000f4e4ddd39 -r 57173ad5c534 jdk/src/java.desktop/share/classes/javax/print/attribute/standard/MediaPrintableArea.java
--- a/jdk/src/java.desktop/share/classes/javax/print/attribute/standard/MediaPrintableArea.java Fri Sep 01 14:13:40 2017 +0000
+++ b/jdk/src/java.desktop/share/classes/javax/print/attribute/standard/MediaPrintableArea.java Sat Sep 09 14:36:45 2017 +0200
@@ -22,9 +22,11 @@
* or visit www.oracle.com if you need additional information or have any
* questions.
*/
+
package javax.print.attribute.standard;
import javax.print.DocFlavor;
+import javax.print.PrintService;
import javax.print.attribute.Attribute;
import javax.print.attribute.AttributeSet;
import javax.print.attribute.DocAttribute;
@@ -32,60 +34,67 @@
import javax.print.attribute.PrintRequestAttribute;
/**
- * Class MediaPrintableArea is a printing attribute used to distinguish
+ * Class {@code MediaPrintableArea} is a printing attribute used to distinguish
* the printable and non-printable areas of media.
*
* The printable area is specified to be a rectangle, within the overall
* dimensions of a media.
*
- * Most printers cannot print on the entire surface of the media, due
- * to printer hardware limitations. This class can be used to query
- * the acceptable values for a supposed print job, and to request an area
- * within the constraints of the printable area to be used in a print job.
+ * Most printers cannot print on the entire surface of the media, due to printer
+ * hardware limitations. This class can be used to query the acceptable values
+ * for a supposed print job, and to request an area within the constraints of
+ * the printable area to be used in a print job.
*
* To query for the printable area, a client must supply a suitable context.
- * Without specifying at the very least the size of the media being used
- * no meaningful value for printable area can be obtained.
+ * Without specifying at the very least the size of the media being used no
+ * meaningful value for printable area can be obtained.
*
- * The attribute is not described in terms of the distance from the edge
- * of the paper, in part to emphasise that this attribute is not independent
- * of a particular media, but must be described within the context of a
- * choice of other attributes. Additionally it is usually more convenient
- * for a client to use the printable area.
+ * The attribute is not described in terms of the distance from the edge of the
+ * paper, in part to emphasise that this attribute is not independent of a
+ * particular media, but must be described within the context of a choice of
+ * other attributes. Additionally it is usually more convenient for a client to
+ * use the printable area.
*
- * The hardware's minimum margins is not just a property of the printer,
- * but may be a function of the media size, orientation, media type, and
- * any specified finishings.
- * {@code PrintService} provides the method to query the supported
- * values of an attribute in a suitable context :
- * See {@link javax.print.PrintService#getSupportedAttributeValues(Class,DocFlavor, AttributeSet) PrintService.getSupportedAttributeValues()}
+ * The hardware's minimum margins is not just a property of the printer, but may
+ * be a function of the media size, orientation, media type, and any specified
+ * finishings. {@code PrintService} provides the method to query the supported
+ * values of an attribute in a suitable context : See
+ * {@link PrintService#getSupportedAttributeValues(Class, DocFlavor, AttributeSet)
+ * PrintService.getSupportedAttributeValues()}
*
- * The rectangular printable area is defined thus:
- * The (x,y) origin is positioned at the top-left of the paper in portrait
- * mode regardless of the orientation specified in the requesting context.
- * For example a printable area for A4 paper in portrait or landscape
- * orientation will have height {@literal >} width.
+ * The rectangular printable area is defined thus: The (x,y) origin is
+ * positioned at the top-left of the paper in portrait mode regardless of the
+ * orientation specified in the requesting context. For example a printable area
+ * for A4 paper in portrait or landscape orientation will have height
+ * {@literal >} width.
*
- * A printable area attribute's values are stored
- * internally as integers in units of micrometers (µm), where 1 micrometer
- * = 10-6 meter = 1/1000 millimeter = 1/25400 inch. This permits
- * dimensions to be represented exactly to a precision of 1/1000 mm (= 1
- * µm) or 1/100 inch (= 254 µm). If fractional inches are expressed in
-
- * negative powers of two, this permits dimensions to be represented exactly to
- * a precision of 1/8 inch (= 3175 µm) but not 1/16 inch (because 1/16 inch
-
- * does not equal an integral number of µm).
+ * A printable area attribute's values are stored internally as integers in
+ * units of micrometers (µm), where 1 micrometer = 10-6 meter =
+ * 1/1000 millimeter = 1/25400 inch. This permits dimensions to be represented
+ * exactly to a precision of 1/1000 mm (= 1 µm) or 1/100 inch (= 254
+ * µm). If fractional inches are expressed in negative powers of two, this
+ * permits dimensions to be represented exactly to a precision of 1/8 inch
+ * (= 3175 µm) but not 1/16 inch (because 1/16 inch does not equal an
+ * integral number of µm).
*
- * IPP Compatibility: MediaPrintableArea is not an IPP attribute.
+ * IPP Compatibility: MediaPrintableArea is not an IPP attribute.
*/
-
public final class MediaPrintableArea
implements DocAttribute, PrintRequestAttribute, PrintJobAttribute {
+ /**
+ * Printable {@code x}, {@code y}, {@code width} and {@code height}.
+ */
private int x, y, w, h;
+
+ /**
+ * The units in which the values are expressed.
+ */
private int units;
+ /**
+ * Use serialVersionUID from JDK 1.4 for interoperability.
+ */
private static final long serialVersionUID = -1597171464050795793L;
/**
@@ -101,18 +110,17 @@
public static final int MM = 1000;
/**
- * Constructs a MediaPrintableArea object from floating point values.
- * @param x printable x
- * @param y printable y
- * @param w printable width
- * @param h printable height
- * @param units in which the values are expressed.
- *
- * @exception IllegalArgumentException
- * Thrown if {@code x < 0} or {@code y < 0}
- * or {@code w <= 0} or {@code h <= 0} or
- * {@code units < 1}.
- */
+ * Constructs a {@code MediaPrintableArea} object from floating point
+ * values.
+ *
+ * @param x printable x
+ * @param y printable y
+ * @param w printable width
+ * @param h printable height
+ * @param units in which the values are expressed
+ * @throws IllegalArgumentException if {@code x < 0} or {@code y < 0} or
+ * {@code w <= 0} or {@code h <= 0} or {@code units < 1}
+ */
public MediaPrintableArea(float x, float y, float w, float h, int units) {
if ((x < 0.0) || (y < 0.0) || (w <= 0.0) || (h <= 0.0) ||
(units < 1)) {
@@ -127,18 +135,16 @@
}
/**
- * Constructs a MediaPrintableArea object from integer values.
- * @param x printable x
- * @param y printable y
- * @param w printable width
- * @param h printable height
- * @param units in which the values are expressed.
- *
- * @exception IllegalArgumentException
- * Thrown if {@code x < 0} or {@code y < 0}
- * or {@code w <= 0} or {@code h <= 0} or
- * {@code units < 1}.
- */
+ * Constructs a {@code MediaPrintableArea} object from integer values.
+ *
+ * @param x printable x
+ * @param y printable y
+ * @param w printable width
+ * @param h printable height
+ * @param units in which the values are expressed
+ * @throws IllegalArgumentException if {@code x < 0} or {@code y < 0} or
+ * {@code w <= 0} or {@code h <= 0} or {@code units < 1}
+ */
public MediaPrintableArea(int x, int y, int w, int h, int units) {
if ((x < 0) || (y < 0) || (w <= 0) || (h <= 0) ||
(units < 1)) {
@@ -153,15 +159,13 @@
/**
* Get the printable area as an array of 4 values in the order
- * x, y, w, h. The values returned are in the given units.
- * @param units
- * Unit conversion factor, e.g. {@link #INCH INCH} or
- * {@link #MM MM}.
+ * {@code x, y, w, h}. The values returned are in the given units.
*
- * @return printable area as array of x, y, w, h in the specified units.
- *
- * @exception IllegalArgumentException
- * (unchecked exception) Thrown if {@code units < 1}.
+ * @param units unit conversion factor, e.g. {@link #INCH INCH} or
+ * {@link #MM MM}
+ * @return printable area as array of {@code x, y, w, h} in the specified
+ * units
+ * @throws IllegalArgumentException if {@code units < 1}
*/
public float[] getPrintableArea(int units) {
return new float[] { getX(units), getY(units),
@@ -169,86 +173,70 @@
}
/**
- * Get the x location of the origin of the printable area in the
- * specified units.
- * @param units
- * Unit conversion factor, e.g. {@link #INCH INCH} or
- * {@link #MM MM}.
- *
- * @return x location of the origin of the printable area in the
+ * Get the {@code x} location of the origin of the printable area in the
* specified units.
*
- * @exception IllegalArgumentException
- * (unchecked exception) Thrown if {@code units < 1}.
+ * @param units unit conversion factor, e.g. {@link #INCH INCH} or
+ * {@link #MM MM}
+ * @return {@code x} location of the origin of the printable area in the
+ * specified units
+ * @throws IllegalArgumentException if {@code units < 1}
*/
- public float getX(int units) {
+ public float getX(int units) {
return convertFromMicrometers(x, units);
- }
+ }
/**
- * Get the y location of the origin of the printable area in the
- * specified units.
- * @param units
- * Unit conversion factor, e.g. {@link #INCH INCH} or
- * {@link #MM MM}.
- *
- * @return y location of the origin of the printable area in the
+ * Get the {@code y} location of the origin of the printable area in the
* specified units.
*
- * @exception IllegalArgumentException
- * (unchecked exception) Thrown if {@code units < 1}.
+ * @param units unit conversion factor, e.g. {@link #INCH INCH} or
+ * {@link #MM MM}
+ * @return {@code y} location of the origin of the printable area in the
+ * specified units
+ * @throws IllegalArgumentException if {@code units < 1}
*/
- public float getY(int units) {
+ public float getY(int units) {
return convertFromMicrometers(y, units);
- }
+ }
/**
- * Get the width of the printable area in the specified units.
- * @param units
- * Unit conversion factor, e.g. {@link #INCH INCH} or
- * {@link #MM MM}.
- *
- * @return width of the printable area in the specified units.
+ * Get the {@code width} of the printable area in the specified units.
*
- * @exception IllegalArgumentException
- * (unchecked exception) Thrown if {@code units < 1}.
+ * @param units unit conversion factor, e.g. {@link #INCH INCH} or
+ * {@link #MM MM}
+ * @return {@code width} of the printable area in the specified units
+ * @throws IllegalArgumentException if {@code units < 1}
*/
- public float getWidth(int units) {
+ public float getWidth(int units) {
return convertFromMicrometers(w, units);
- }
+ }
/**
- * Get the height of the printable area in the specified units.
- * @param units
- * Unit conversion factor, e.g. {@link #INCH INCH} or
- * {@link #MM MM}.
- *
- * @return height of the printable area in the specified units.
+ * Get the {@code height} of the printable area in the specified units.
*
- * @exception IllegalArgumentException
- * (unchecked exception) Thrown if {@code units < 1}.
+ * @param units unit conversion factor, e.g. {@link #INCH INCH} or
+ * {@link #MM MM}
+ * @return {@code height} of the printable area in the specified units
+ * @throws IllegalArgumentException if {@code units < 1}
*/
- public float getHeight(int units) {
+ public float getHeight(int units) {
return convertFromMicrometers(h, units);
- }
+ }
/**
* Returns whether this media margins attribute is equivalent to the passed
- * in object.
- * To be equivalent, all of the following conditions must be true:
- *
- * For class MediaPrintableArea, the category is
- * class MediaPrintableArea itself.
+ *
+ * For class {@code MediaPrintableArea}, the category is class
+ * {@code MediaPrintableArea} itself.
*
- * @return Printing attribute class (category), an instance of class
- * {@link java.lang.Class java.lang.Class}.
+ * @return printing attribute class (category), an instance of class
+ * {@link Class java.lang.Class}
*/
public final Class extends Attribute> getCategory() {
return MediaPrintableArea.class;
@@ -278,32 +266,28 @@
/**
* Get the name of the category of which this attribute value is an
* instance.
- *
- * For class MediaPrintableArea,
- * the category name is {@code "media-printable-area"}.
- * This is not an IPP V1.1 attribute.
+ *
+ * For class {@code MediaPrintableArea}, the category name is
+ * {@code "media-printable-area"}.
+ *
+ * This is not an IPP V1.1 attribute.
*
- * @return Attribute category name.
+ * @return attribute category name
*/
public final String getName() {
return "media-printable-area";
}
/**
- * Returns a string version of this rectangular size attribute in the
- * given units.
+ * Returns a string version of this rectangular size attribute in the given
+ * units.
*
- * @param units
- * Unit conversion factor, e.g. {@link #INCH INCH} or
- * {@link #MM MM}.
- * @param unitsName
- * Units name string, e.g. {@code "in"} or {@code "mm"}. If
- * null, no units name is appended to the result.
- *
- * @return String version of this two-dimensional size attribute.
- *
- * @exception IllegalArgumentException
- * (unchecked exception) Thrown if {@code units < 1}.
+ * @param units unit conversion factor, e.g. {@link #INCH INCH} or
+ * {@link #MM MM}
+ * @param unitsName units name string, e.g. {@code "in"} or {@code "mm"}.
+ * If {@code null}, no units name is appended to the result
+ * @return string version of this two-dimensional size attribute
+ * @throws IllegalArgumentException if {@code units < 1}
*/
public String toString(int units, String unitsName) {
if (unitsName == null) {
@@ -328,6 +312,14 @@
return x + 37*y + 43*w + 47*h;
}
+ /**
+ * Converts the {@code x} from micrometers to {@code units}.
+ *
+ * @param x the value
+ * @param units unit conversion factor, e.g. {@link #INCH INCH} or
+ * {@link #MM MM}
+ * @return the value of {@code x} in the specified units
+ */
private static float convertFromMicrometers(int x, int units) {
if (units < 1) {
throw new IllegalArgumentException("units is < 1");
diff -r 000f4e4ddd39 -r 57173ad5c534 jdk/src/java.desktop/share/classes/javax/print/attribute/standard/MediaSize.java
--- a/jdk/src/java.desktop/share/classes/javax/print/attribute/standard/MediaSize.java Fri Sep 01 14:13:40 2017 +0000
+++ b/jdk/src/java.desktop/share/classes/javax/print/attribute/standard/MediaSize.java Sat Sep 09 14:36:45 2017 +0200
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2000, 2014, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2000, 2017, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
@@ -22,37 +22,44 @@
* or visit www.oracle.com if you need additional information or have any
* questions.
*/
+
package javax.print.attribute.standard;
import java.util.HashMap;
import java.util.Vector;
+import javax.print.attribute.Attribute;
import javax.print.attribute.Size2DSyntax;
-import javax.print.attribute.Attribute;
/**
- * Class MediaSize is a two-dimensional size valued printing attribute class
- * that indicates the dimensions of the medium in a portrait orientation, with
- * the X dimension running along the bottom edge and the Y dimension running
- * along the left edge. Thus, the Y dimension must be greater than or equal to
- * the X dimension. Class MediaSize declares many standard media size
- * values, organized into nested classes for ISO, JIS, North American,
- * engineering, and other media.
- *
- * MediaSize is not yet used to specify media. Its current role is
- * as a mapping for named media (see {@link MediaSizeName MediaSizeName}).
- * Clients can use the mapping method
- * {@code MediaSize.getMediaSizeForName(MediaSizeName)}
- * to find the physical dimensions of the MediaSizeName instances
- * enumerated in this API. This is useful for clients which need this
- * information to format {@literal &} paginate printing.
+ * Class {@code MediaSize} is a two-dimensional size valued printing attribute
+ * class that indicates the dimensions of the medium in a portrait orientation,
+ * with the {@code X} dimension running along the bottom edge and the {@code Y}
+ * dimension running along the left edge. Thus, the {@code Y} dimension must be
+ * greater than or equal to the {@code X} dimension. Class {@code MediaSize}
+ * declares many standard media size values, organized into nested classes for
+ * ISO, JIS, North American, engineering, and other media.
+ *
+ * {@code MediaSize} is not yet used to specify media. Its current role is as a
+ * mapping for named media (see {@link MediaSizeName MediaSizeName}). Clients
+ * can use the mapping method
+ * {@code MediaSize.getMediaSizeForName(MediaSizeName)} to find the physical
+ * dimensions of the {@code MediaSizeName} instances enumerated in this API.
+ * This is useful for clients which need this information to format {@literal &}
+ * paginate printing.
*
- * @author Phil Race, Alan Kaminsky
+ * @author Phil Race, Alan Kaminsky
*/
public class MediaSize extends Size2DSyntax implements Attribute {
+ /**
+ * Use serialVersionUID from JDK 1.4 for interoperability.
+ */
private static final long serialVersionUID = -1967958664615414771L;
+ /**
+ * The media name.
+ */
private MediaSizeName mediaName;
private static HashMap
- * The MediaSize is in turn used to locate the MediaSizeName object.
- * This method may return null if the closest matching MediaSize
- * has no corresponding Media instance.
+ * The {@code MediaSize} is in turn used to locate the {@code MediaSizeName}
+ * object. This method may return {@code null} if the closest matching
+ * {@code MediaSize} has no corresponding {@code Media} instance.
*
- * This method is useful for clients which have only dimensions and
- * want to find a Media which corresponds to the dimensions.
- * @param x X dimension
- * @param y Y dimension.
- * @param units
- * Unit conversion factor, e.g. {@code Size2DSyntax.INCH} or
- * {@code Size2DSyntax.MM}
- * @return MediaSizeName matching these dimensions, or null.
- * @exception IllegalArgumentException if {@code x <= 0},
- * {@code y <= 0}, or {@code units < 1}.
+ * This method is useful for clients which have only dimensions and want to
+ * find a {@code Media} which corresponds to the dimensions.
*
+ * @param x {@code X} dimension
+ * @param y {@code Y} dimension
+ * @param units unit conversion factor, e.g. {@code Size2DSyntax.INCH} or
+ * {@code Size2DSyntax.MM}
+ * @return {@code MediaSizeName} matching these dimensions, or {@code null}
+ * @throws IllegalArgumentException if {@code x <= 0}, {@code y <= 0}, or
+ * {@code units < 1}
*/
public static MediaSizeName findMedia(float x, float y, int units) {
@@ -232,26 +226,20 @@
}
/**
- * Returns whether this media size attribute is equivalent to the passed
- * in object.
- * To be equivalent, all of the following conditions must be true:
- *
- * For class MediaSize and any vendor-defined subclasses, the category is
- * class MediaSize itself.
+ *
+ * For class {@code MediaSize} and any vendor-defined subclasses, the
+ * category is class {@code MediaSize} itself.
*
- * @return Printing attribute class (category), an instance of class
- * {@link java.lang.Class java.lang.Class}.
+ * @return printing attribute class (category), an instance of class
+ * {@link Class java.lang.Class}
*/
public final Class extends Attribute> getCategory() {
return MediaSize.class;
@@ -274,151 +262,178 @@
/**
* Get the name of the category of which this attribute value is an
* instance.
- *
- * For class MediaSize and any vendor-defined subclasses, the category
- * name is {@code "media-size"}.
+ *
+ * For class {@code MediaSize} and any vendor-defined subclasses, the
+ * category name is {@code "media-size"}.
*
- * @return Attribute category name.
+ * @return attribute category name
*/
public final String getName() {
return "media-size";
}
/**
- * Class MediaSize.ISO includes {@link MediaSize MediaSize} values for ISO
- * media.
+ * Class {@code MediaSize.ISO} includes {@link MediaSize MediaSize} values
+ * for ISO media.
*/
public static final class ISO {
+
/**
* Specifies the ISO A0 size, 841 mm by 1189 mm.
*/
public static final MediaSize
A0 = new MediaSize(841, 1189, Size2DSyntax.MM, MediaSizeName.ISO_A0);
+
/**
* Specifies the ISO A1 size, 594 mm by 841 mm.
*/
public static final MediaSize
A1 = new MediaSize(594, 841, Size2DSyntax.MM, MediaSizeName.ISO_A1);
+
/**
* Specifies the ISO A2 size, 420 mm by 594 mm.
*/
public static final MediaSize
A2 = new MediaSize(420, 594, Size2DSyntax.MM, MediaSizeName.ISO_A2);
+
/**
* Specifies the ISO A3 size, 297 mm by 420 mm.
*/
public static final MediaSize
A3 = new MediaSize(297, 420, Size2DSyntax.MM, MediaSizeName.ISO_A3);
+
/**
* Specifies the ISO A4 size, 210 mm by 297 mm.
*/
public static final MediaSize
A4 = new MediaSize(210, 297, Size2DSyntax.MM, MediaSizeName.ISO_A4);
+
/**
* Specifies the ISO A5 size, 148 mm by 210 mm.
*/
public static final MediaSize
A5 = new MediaSize(148, 210, Size2DSyntax.MM, MediaSizeName.ISO_A5);
+
/**
* Specifies the ISO A6 size, 105 mm by 148 mm.
*/
public static final MediaSize
A6 = new MediaSize(105, 148, Size2DSyntax.MM, MediaSizeName.ISO_A6);
+
/**
* Specifies the ISO A7 size, 74 mm by 105 mm.
*/
public static final MediaSize
A7 = new MediaSize(74, 105, Size2DSyntax.MM, MediaSizeName.ISO_A7);
+
/**
* Specifies the ISO A8 size, 52 mm by 74 mm.
*/
public static final MediaSize
A8 = new MediaSize(52, 74, Size2DSyntax.MM, MediaSizeName.ISO_A8);
+
/**
* Specifies the ISO A9 size, 37 mm by 52 mm.
*/
public static final MediaSize
A9 = new MediaSize(37, 52, Size2DSyntax.MM, MediaSizeName.ISO_A9);
+
/**
* Specifies the ISO A10 size, 26 mm by 37 mm.
*/
public static final MediaSize
A10 = new MediaSize(26, 37, Size2DSyntax.MM, MediaSizeName.ISO_A10);
+
/**
* Specifies the ISO B0 size, 1000 mm by 1414 mm.
*/
public static final MediaSize
B0 = new MediaSize(1000, 1414, Size2DSyntax.MM, MediaSizeName.ISO_B0);
+
/**
* Specifies the ISO B1 size, 707 mm by 1000 mm.
*/
public static final MediaSize
B1 = new MediaSize(707, 1000, Size2DSyntax.MM, MediaSizeName.ISO_B1);
+
/**
* Specifies the ISO B2 size, 500 mm by 707 mm.
*/
public static final MediaSize
B2 = new MediaSize(500, 707, Size2DSyntax.MM, MediaSizeName.ISO_B2);
+
/**
* Specifies the ISO B3 size, 353 mm by 500 mm.
*/
public static final MediaSize
B3 = new MediaSize(353, 500, Size2DSyntax.MM, MediaSizeName.ISO_B3);
+
/**
* Specifies the ISO B4 size, 250 mm by 353 mm.
*/
public static final MediaSize
B4 = new MediaSize(250, 353, Size2DSyntax.MM, MediaSizeName.ISO_B4);
+
/**
* Specifies the ISO B5 size, 176 mm by 250 mm.
*/
public static final MediaSize
B5 = new MediaSize(176, 250, Size2DSyntax.MM, MediaSizeName.ISO_B5);
+
/**
* Specifies the ISO B6 size, 125 mm by 176 mm.
*/
public static final MediaSize
B6 = new MediaSize(125, 176, Size2DSyntax.MM, MediaSizeName.ISO_B6);
+
/**
* Specifies the ISO B7 size, 88 mm by 125 mm.
*/
public static final MediaSize
B7 = new MediaSize(88, 125, Size2DSyntax.MM, MediaSizeName.ISO_B7);
+
/**
* Specifies the ISO B8 size, 62 mm by 88 mm.
*/
public static final MediaSize
B8 = new MediaSize(62, 88, Size2DSyntax.MM, MediaSizeName.ISO_B8);
+
/**
* Specifies the ISO B9 size, 44 mm by 62 mm.
*/
public static final MediaSize
B9 = new MediaSize(44, 62, Size2DSyntax.MM, MediaSizeName.ISO_B9);
+
/**
* Specifies the ISO B10 size, 31 mm by 44 mm.
*/
public static final MediaSize
B10 = new MediaSize(31, 44, Size2DSyntax.MM, MediaSizeName.ISO_B10);
+
/**
* Specifies the ISO C3 size, 324 mm by 458 mm.
*/
public static final MediaSize
C3 = new MediaSize(324, 458, Size2DSyntax.MM, MediaSizeName.ISO_C3);
+
/**
* Specifies the ISO C4 size, 229 mm by 324 mm.
*/
public static final MediaSize
C4 = new MediaSize(229, 324, Size2DSyntax.MM, MediaSizeName.ISO_C4);
+
/**
* Specifies the ISO C5 size, 162 mm by 229 mm.
*/
public static final MediaSize
C5 = new MediaSize(162, 229, Size2DSyntax.MM, MediaSizeName.ISO_C5);
+
/**
* Specifies the ISO C6 size, 114 mm by 162 mm.
*/
public static final MediaSize
C6 = new MediaSize(114, 162, Size2DSyntax.MM, MediaSizeName.ISO_C6);
+
/**
* Specifies the ISO Designated Long size, 110 mm by 220 mm.
*/
@@ -434,8 +449,8 @@
}
/**
- * Class MediaSize.JIS includes {@link MediaSize MediaSize} values for JIS
- * (Japanese) media. *
+ * Class {@code MediaSize.JIS} includes {@link MediaSize MediaSize} values
+ * for JIS (Japanese) media.
*/
public static final class JIS {
@@ -444,152 +459,188 @@
*/
public static final MediaSize
B0 = new MediaSize(1030, 1456, Size2DSyntax.MM, MediaSizeName.JIS_B0);
+
/**
* Specifies the JIS B1 size, 728 mm by 1030 mm.
*/
public static final MediaSize
B1 = new MediaSize(728, 1030, Size2DSyntax.MM, MediaSizeName.JIS_B1);
+
/**
* Specifies the JIS B2 size, 515 mm by 728 mm.
*/
public static final MediaSize
B2 = new MediaSize(515, 728, Size2DSyntax.MM, MediaSizeName.JIS_B2);
+
/**
* Specifies the JIS B3 size, 364 mm by 515 mm.
*/
public static final MediaSize
B3 = new MediaSize(364, 515, Size2DSyntax.MM, MediaSizeName.JIS_B3);
+
/**
* Specifies the JIS B4 size, 257 mm by 364 mm.
*/
public static final MediaSize
B4 = new MediaSize(257, 364, Size2DSyntax.MM, MediaSizeName.JIS_B4);
+
/**
* Specifies the JIS B5 size, 182 mm by 257 mm.
*/
public static final MediaSize
B5 = new MediaSize(182, 257, Size2DSyntax.MM, MediaSizeName.JIS_B5);
+
/**
* Specifies the JIS B6 size, 128 mm by 182 mm.
*/
public static final MediaSize
B6 = new MediaSize(128, 182, Size2DSyntax.MM, MediaSizeName.JIS_B6);
+
/**
* Specifies the JIS B7 size, 91 mm by 128 mm.
*/
public static final MediaSize
B7 = new MediaSize(91, 128, Size2DSyntax.MM, MediaSizeName.JIS_B7);
+
/**
* Specifies the JIS B8 size, 64 mm by 91 mm.
*/
public static final MediaSize
B8 = new MediaSize(64, 91, Size2DSyntax.MM, MediaSizeName.JIS_B8);
+
/**
* Specifies the JIS B9 size, 45 mm by 64 mm.
*/
public static final MediaSize
B9 = new MediaSize(45, 64, Size2DSyntax.MM, MediaSizeName.JIS_B9);
+
/**
* Specifies the JIS B10 size, 32 mm by 45 mm.
*/
public static final MediaSize
B10 = new MediaSize(32, 45, Size2DSyntax.MM, MediaSizeName.JIS_B10);
+
/**
* Specifies the JIS Chou ("long") #1 envelope size, 142 mm by 332 mm.
*/
public static final MediaSize CHOU_1 = new MediaSize(142, 332, Size2DSyntax.MM);
+
/**
* Specifies the JIS Chou ("long") #2 envelope size, 119 mm by 277 mm.
*/
public static final MediaSize CHOU_2 = new MediaSize(119, 277, Size2DSyntax.MM);
+
/**
* Specifies the JIS Chou ("long") #3 envelope size, 120 mm by 235 mm.
*/
public static final MediaSize CHOU_3 = new MediaSize(120, 235, Size2DSyntax.MM);
+
/**
* Specifies the JIS Chou ("long") #4 envelope size, 90 mm by 205 mm.
*/
public static final MediaSize CHOU_4 = new MediaSize(90, 205, Size2DSyntax.MM);
+
/**
* Specifies the JIS Chou ("long") #30 envelope size, 92 mm by 235 mm.
*/
public static final MediaSize CHOU_30 = new MediaSize(92, 235, Size2DSyntax.MM);
+
/**
* Specifies the JIS Chou ("long") #40 envelope size, 90 mm by 225 mm.
*/
public static final MediaSize CHOU_40 = new MediaSize(90, 225, Size2DSyntax.MM);
+
/**
* Specifies the JIS Kaku ("square") #0 envelope size, 287 mm by 382 mm.
*/
public static final MediaSize KAKU_0 = new MediaSize(287, 382, Size2DSyntax.MM);
+
/**
* Specifies the JIS Kaku ("square") #1 envelope size, 270 mm by 382 mm.
*/
public static final MediaSize KAKU_1 = new MediaSize(270, 382, Size2DSyntax.MM);
+
/**
* Specifies the JIS Kaku ("square") #2 envelope size, 240 mm by 332 mm.
*/
public static final MediaSize KAKU_2 = new MediaSize(240, 332, Size2DSyntax.MM);
+
/**
* Specifies the JIS Kaku ("square") #3 envelope size, 216 mm by 277 mm.
*/
public static final MediaSize KAKU_3 = new MediaSize(216, 277, Size2DSyntax.MM);
+
/**
* Specifies the JIS Kaku ("square") #4 envelope size, 197 mm by 267 mm.
*/
public static final MediaSize KAKU_4 = new MediaSize(197, 267, Size2DSyntax.MM);
+
/**
* Specifies the JIS Kaku ("square") #5 envelope size, 190 mm by 240 mm.
*/
public static final MediaSize KAKU_5 = new MediaSize(190, 240, Size2DSyntax.MM);
+
/**
* Specifies the JIS Kaku ("square") #6 envelope size, 162 mm by 229 mm.
*/
public static final MediaSize KAKU_6 = new MediaSize(162, 229, Size2DSyntax.MM);
+
/**
* Specifies the JIS Kaku ("square") #7 envelope size, 142 mm by 205 mm.
*/
public static final MediaSize KAKU_7 = new MediaSize(142, 205, Size2DSyntax.MM);
+
/**
* Specifies the JIS Kaku ("square") #8 envelope size, 119 mm by 197 mm.
*/
public static final MediaSize KAKU_8 = new MediaSize(119, 197, Size2DSyntax.MM);
+
/**
- * Specifies the JIS Kaku ("square") #20 envelope size, 229 mm by 324 mm.
+ * Specifies the JIS Kaku ("square") #20 envelope size, 229 mm by 324
+ * mm.
*/
public static final MediaSize KAKU_20 = new MediaSize(229, 324, Size2DSyntax.MM);
+
/**
* Specifies the JIS Kaku ("square") A4 envelope size, 228 mm by 312 mm.
*/
public static final MediaSize KAKU_A4 = new MediaSize(228, 312, Size2DSyntax.MM);
+
/**
* Specifies the JIS You ("Western") #1 envelope size, 120 mm by 176 mm.
*/
public static final MediaSize YOU_1 = new MediaSize(120, 176, Size2DSyntax.MM);
+
/**
* Specifies the JIS You ("Western") #2 envelope size, 114 mm by 162 mm.
*/
public static final MediaSize YOU_2 = new MediaSize(114, 162, Size2DSyntax.MM);
+
/**
* Specifies the JIS You ("Western") #3 envelope size, 98 mm by 148 mm.
*/
public static final MediaSize YOU_3 = new MediaSize(98, 148, Size2DSyntax.MM);
+
/**
* Specifies the JIS You ("Western") #4 envelope size, 105 mm by 235 mm.
*/
public static final MediaSize YOU_4 = new MediaSize(105, 235, Size2DSyntax.MM);
+
/**
* Specifies the JIS You ("Western") #5 envelope size, 95 mm by 217 mm.
*/
public static final MediaSize YOU_5 = new MediaSize(95, 217, Size2DSyntax.MM);
+
/**
* Specifies the JIS You ("Western") #6 envelope size, 98 mm by 190 mm.
*/
public static final MediaSize YOU_6 = new MediaSize(98, 190, Size2DSyntax.MM);
+
/**
* Specifies the JIS You ("Western") #7 envelope size, 92 mm by 165 mm.
*/
public static final MediaSize YOU_7 = new MediaSize(92, 165, Size2DSyntax.MM);
+
/**
* Hide all constructors.
*/
@@ -598,8 +649,8 @@
}
/**
- * Class MediaSize.NA includes {@link MediaSize MediaSize} values for North
- * American media.
+ * Class {@code MediaSize.NA} includes {@link MediaSize MediaSize} values
+ * for North American media.
*/
public static final class NA {
@@ -609,59 +660,67 @@
public static final MediaSize
LETTER = new MediaSize(8.5f, 11.0f, Size2DSyntax.INCH,
MediaSizeName.NA_LETTER);
+
/**
* Specifies the North American legal size, 8.5 inches by 14 inches.
*/
public static final MediaSize
LEGAL = new MediaSize(8.5f, 14.0f, Size2DSyntax.INCH,
MediaSizeName.NA_LEGAL);
+
/**
* Specifies the North American 5 inch by 7 inch paper.
*/
public static final MediaSize
NA_5X7 = new MediaSize(5, 7, Size2DSyntax.INCH,
MediaSizeName.NA_5X7);
+
/**
* Specifies the North American 8 inch by 10 inch paper.
*/
public static final MediaSize
NA_8X10 = new MediaSize(8, 10, Size2DSyntax.INCH,
MediaSizeName.NA_8X10);
+
/**
- * Specifies the North American Number 9 business envelope size,
- * 3.875 inches by 8.875 inches.
+ * Specifies the North American Number 9 business envelope size, 3.875
+ * inches by 8.875 inches.
*/
public static final MediaSize
NA_NUMBER_9_ENVELOPE =
new MediaSize(3.875f, 8.875f, Size2DSyntax.INCH,
MediaSizeName.NA_NUMBER_9_ENVELOPE);
+
/**
- * Specifies the North American Number 10 business envelope size,
- * 4.125 inches by 9.5 inches.
+ * Specifies the North American Number 10 business envelope size, 4.125
+ * inches by 9.5 inches.
*/
public static final MediaSize
NA_NUMBER_10_ENVELOPE =
new MediaSize(4.125f, 9.5f, Size2DSyntax.INCH,
MediaSizeName.NA_NUMBER_10_ENVELOPE);
+
/**
- * Specifies the North American Number 11 business envelope size,
- * 4.5 inches by 10.375 inches.
+ * Specifies the North American Number 11 business envelope size, 4.5
+ * inches by 10.375 inches.
*/
public static final MediaSize
NA_NUMBER_11_ENVELOPE =
new MediaSize(4.5f, 10.375f, Size2DSyntax.INCH,
MediaSizeName.NA_NUMBER_11_ENVELOPE);
+
/**
- * Specifies the North American Number 12 business envelope size,
- * 4.75 inches by 11 inches.
+ * Specifies the North American Number 12 business envelope size, 4.75
+ * inches by 11 inches.
*/
public static final MediaSize
NA_NUMBER_12_ENVELOPE =
new MediaSize(4.75f, 11.0f, Size2DSyntax.INCH,
MediaSizeName.NA_NUMBER_12_ENVELOPE);
+
/**
- * Specifies the North American Number 14 business envelope size,
- * 5 inches by 11.5 inches.
+ * Specifies the North American Number 14 business envelope size, 5
+ * inches by 11.5 inches.
*/
public static final MediaSize
NA_NUMBER_14_ENVELOPE =
@@ -674,42 +733,49 @@
public static final MediaSize
NA_6X9_ENVELOPE = new MediaSize(6.0f, 9.0f, Size2DSyntax.INCH,
MediaSizeName.NA_6X9_ENVELOPE);
+
/**
* Specifies the North American 7 inch by 9 inch envelope size.
*/
public static final MediaSize
NA_7X9_ENVELOPE = new MediaSize(7.0f, 9.0f, Size2DSyntax.INCH,
MediaSizeName.NA_7X9_ENVELOPE);
+
/**
* Specifies the North American 9 inch by 11 inch envelope size.
*/
public static final MediaSize
NA_9x11_ENVELOPE = new MediaSize(9.0f, 11.0f, Size2DSyntax.INCH,
MediaSizeName.NA_9X11_ENVELOPE);
+
/**
* Specifies the North American 9 inch by 12 inch envelope size.
*/
public static final MediaSize
NA_9x12_ENVELOPE = new MediaSize(9.0f, 12.0f, Size2DSyntax.INCH,
MediaSizeName.NA_9X12_ENVELOPE);
+
/**
* Specifies the North American 10 inch by 13 inch envelope size.
*/
public static final MediaSize
NA_10x13_ENVELOPE = new MediaSize(10.0f, 13.0f, Size2DSyntax.INCH,
MediaSizeName.NA_10X13_ENVELOPE);
+
/**
* Specifies the North American 10 inch by 14 inch envelope size.
*/
public static final MediaSize
NA_10x14_ENVELOPE = new MediaSize(10.0f, 14.0f, Size2DSyntax.INCH,
MediaSizeName.NA_10X14_ENVELOPE);
+
/**
* Specifies the North American 10 inch by 15 inch envelope size.
*/
public static final MediaSize
NA_10X15_ENVELOPE = new MediaSize(10.0f, 15.0f, Size2DSyntax.INCH,
MediaSizeName.NA_10X15_ENVELOPE);
+
/**
* Hide all constructors.
*/
@@ -718,8 +784,8 @@
}
/**
- * Class MediaSize.Engineering includes {@link MediaSize MediaSize} values
- * for engineering media.
+ * Class {@code MediaSize.Engineering} includes {@link MediaSize MediaSize}
+ * values for engineering media.
*/
public static final class Engineering {
@@ -729,30 +795,35 @@
public static final MediaSize
A = new MediaSize(8.5f, 11.0f, Size2DSyntax.INCH,
MediaSizeName.A);
+
/**
* Specifies the engineering B size, 11 inch by 17 inch.
*/
public static final MediaSize
B = new MediaSize(11.0f, 17.0f, Size2DSyntax.INCH,
MediaSizeName.B);
+
/**
* Specifies the engineering C size, 17 inch by 22 inch.
*/
public static final MediaSize
C = new MediaSize(17.0f, 22.0f, Size2DSyntax.INCH,
MediaSizeName.C);
+
/**
* Specifies the engineering D size, 22 inch by 34 inch.
*/
public static final MediaSize
D = new MediaSize(22.0f, 34.0f, Size2DSyntax.INCH,
MediaSizeName.D);
+
/**
* Specifies the engineering E size, 34 inch by 44 inch.
*/
public static final MediaSize
E = new MediaSize(34.0f, 44.0f, Size2DSyntax.INCH,
MediaSizeName.E);
+
/**
* Hide all constructors.
*/
@@ -761,16 +832,18 @@
}
/**
- * Class MediaSize.Other includes {@link MediaSize MediaSize} values for
- * miscellaneous media.
+ * Class {@code MediaSize.Other} includes {@link MediaSize MediaSize} values
+ * for miscellaneous media.
*/
public static final class Other {
+
/**
* Specifies the executive size, 7.25 inches by 10.5 inches.
*/
public static final MediaSize
EXECUTIVE = new MediaSize(7.25f, 10.5f, Size2DSyntax.INCH,
MediaSizeName.EXECUTIVE);
+
/**
* Specifies the ledger size, 11 inches by 17 inches.
*/
@@ -780,6 +853,7 @@
/**
* Specifies the tabloid size, 11 inches by 17 inches.
+ *
* @since 1.5
*/
public static final MediaSize
@@ -792,48 +866,56 @@
public static final MediaSize
INVOICE = new MediaSize(5.5f, 8.5f, Size2DSyntax.INCH,
MediaSizeName.INVOICE);
+
/**
* Specifies the folio size, 8.5 inches by 13 inches.
*/
public static final MediaSize
FOLIO = new MediaSize(8.5f, 13.0f, Size2DSyntax.INCH,
MediaSizeName.FOLIO);
+
/**
* Specifies the quarto size, 8.5 inches by 10.83 inches.
*/
public static final MediaSize
QUARTO = new MediaSize(8.5f, 10.83f, Size2DSyntax.INCH,
MediaSizeName.QUARTO);
+
/**
* Specifies the Italy envelope size, 110 mm by 230 mm.
*/
public static final MediaSize
ITALY_ENVELOPE = new MediaSize(110, 230, Size2DSyntax.MM,
MediaSizeName.ITALY_ENVELOPE);
+
/**
* Specifies the Monarch envelope size, 3.87 inch by 7.5 inch.
*/
public static final MediaSize
MONARCH_ENVELOPE = new MediaSize(3.87f, 7.5f, Size2DSyntax.INCH,
MediaSizeName.MONARCH_ENVELOPE);
+
/**
* Specifies the Personal envelope size, 3.625 inch by 6.5 inch.
*/
public static final MediaSize
PERSONAL_ENVELOPE = new MediaSize(3.625f, 6.5f, Size2DSyntax.INCH,
MediaSizeName.PERSONAL_ENVELOPE);
+
/**
* Specifies the Japanese postcard size, 100 mm by 148 mm.
*/
public static final MediaSize
JAPANESE_POSTCARD = new MediaSize(100, 148, Size2DSyntax.MM,
MediaSizeName.JAPANESE_POSTCARD);
+
/**
* Specifies the Japanese Double postcard size, 148 mm by 200 mm.
*/
public static final MediaSize
JAPANESE_DOUBLE_POSTCARD = new MediaSize(148, 200, Size2DSyntax.MM,
MediaSizeName.JAPANESE_DOUBLE_POSTCARD);
+
/**
* Hide all constructors.
*/
@@ -841,8 +923,9 @@
}
}
- /* force loading of all the subclasses so that the instances
- * are created and inserted into the hashmap.
+ /*
+ * force loading of all the subclasses so that the instances are created and
+ * inserted into the hashmap.
*/
static {
MediaSize ISOA4 = ISO.A4;
diff -r 000f4e4ddd39 -r 57173ad5c534 jdk/src/java.desktop/share/classes/javax/print/attribute/standard/MediaSizeName.java
--- a/jdk/src/java.desktop/share/classes/javax/print/attribute/standard/MediaSizeName.java Fri Sep 01 14:13:40 2017 +0000
+++ b/jdk/src/java.desktop/share/classes/javax/print/attribute/standard/MediaSizeName.java Sat Sep 09 14:36:45 2017 +0200
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2000, 2014, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2000, 2017, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
@@ -22,161 +22,192 @@
* or visit www.oracle.com if you need additional information or have any
* questions.
*/
+
package javax.print.attribute.standard;
-import java.util.Locale;
-
import javax.print.attribute.EnumSyntax;
-import javax.print.attribute.Attribute;
/**
- * Class MediaSizeName is a subclass of Media.
- *
- * This attribute can be used instead of specifying MediaName or MediaTray.
+ * Class {@code MediaSizeName} is a subclass of {@code Media}.
+ *
+ * This attribute can be used instead of specifying {@code MediaName} or
+ * {@code MediaTray}.
*
- * Class MediaSizeName currently declares a few standard media
- * name values.
- *
- * IPP Compatibility: MediaSizeName is a representation class for
- * values of the IPP "media" attribute which names media sizes.
- * The names of the media sizes correspond to those in the IPP 1.1 RFC
- * RFC 2911
- *
+ * Class {@code MediaSizeName} currently declares a few standard media name
+ * values.
+ *
+ * IPP Compatibility: {@code MediaSizeName} is a representation class for
+ * values of the IPP "media" attribute which names media sizes. The names of the
+ * media sizes correspond to those in the IPP 1.1 RFC
+ * RFC 2911
*/
public class MediaSizeName extends Media {
+ /**
+ * Use serialVersionUID from JDK 1.4 for interoperability.
+ */
private static final long serialVersionUID = 2778798329756942747L;
/**
* A0 size.
*/
public static final MediaSizeName ISO_A0 = new MediaSizeName(0);
+
/**
* A1 size.
*/
public static final MediaSizeName ISO_A1 = new MediaSizeName(1);
+
/**
* A2 size.
*/
public static final MediaSizeName ISO_A2 = new MediaSizeName(2);
+
/**
* A3 size.
*/
public static final MediaSizeName ISO_A3 = new MediaSizeName(3);
+
/**
* A4 size.
*/
public static final MediaSizeName ISO_A4 = new MediaSizeName(4);
+
/**
* A5 size.
*/
public static final MediaSizeName ISO_A5 = new MediaSizeName(5);
+
/**
* A6 size.
*/
public static final MediaSizeName ISO_A6 = new MediaSizeName(6);
+
/**
* A7 size.
*/
public static final MediaSizeName ISO_A7 = new MediaSizeName(7);
+
/**
* A8 size.
*/
public static final MediaSizeName ISO_A8 = new MediaSizeName(8);
+
/**
* A9 size.
*/
public static final MediaSizeName ISO_A9 = new MediaSizeName(9);
+
/**
* A10 size.
*/
public static final MediaSizeName ISO_A10 = new MediaSizeName(10);
- /**
+ /**
* ISO B0 size.
*/
public static final MediaSizeName ISO_B0 = new MediaSizeName(11);
+
/**
* ISO B1 size.
*/
public static final MediaSizeName ISO_B1 = new MediaSizeName(12);
+
/**
* ISO B2 size.
*/
public static final MediaSizeName ISO_B2 = new MediaSizeName(13);
+
/**
* ISO B3 size.
*/
public static final MediaSizeName ISO_B3 = new MediaSizeName(14);
+
/**
* ISO B4 size.
*/
public static final MediaSizeName ISO_B4 = new MediaSizeName(15);
+
/**
* ISO B5 size.
*/
public static final MediaSizeName ISO_B5 = new MediaSizeName(16);
+
/**
* ISO B6 size.
*/
public static final MediaSizeName ISO_B6 = new MediaSizeName(17);
+
/**
* ISO B7 size.
*/
public static final MediaSizeName ISO_B7 = new MediaSizeName(18);
+
/**
* ISO B8 size.
*/
public static final MediaSizeName ISO_B8 = new MediaSizeName(19);
+
/**
* ISO B9 size.
*/
public static final MediaSizeName ISO_B9 = new MediaSizeName(20);
+
/**
* ISO B10 size.
*/
public static final MediaSizeName ISO_B10 = new MediaSizeName(21);
- /**
+ /**
* JIS B0 size.
*/
public static final MediaSizeName JIS_B0 = new MediaSizeName(22);
+
/**
* JIS B1 size.
*/
public static final MediaSizeName JIS_B1 = new MediaSizeName(23);
+
/**
* JIS B2 size.
*/
public static final MediaSizeName JIS_B2 = new MediaSizeName(24);
+
/**
* JIS B3 size.
*/
public static final MediaSizeName JIS_B3 = new MediaSizeName(25);
+
/**
* JIS B4 size.
*/
public static final MediaSizeName JIS_B4 = new MediaSizeName(26);
+
/**
* JIS B5 size.
*/
public static final MediaSizeName JIS_B5 = new MediaSizeName(27);
+
/**
* JIS B6 size.
*/
public static final MediaSizeName JIS_B6 = new MediaSizeName(28);
+
/**
* JIS B7 size.
*/
public static final MediaSizeName JIS_B7 = new MediaSizeName(29);
+
/**
* JIS B8 size.
*/
public static final MediaSizeName JIS_B8 = new MediaSizeName(30);
+
/**
* JIS B9 size.
*/
public static final MediaSizeName JIS_B9 = new MediaSizeName(31);
+
/**
* JIS B10 size.
*/
@@ -186,198 +217,216 @@
* ISO C0 size.
*/
public static final MediaSizeName ISO_C0 = new MediaSizeName(33);
+
/**
* ISO C1 size.
*/
public static final MediaSizeName ISO_C1 = new MediaSizeName(34);
+
/**
* ISO C2 size.
*/
public static final MediaSizeName ISO_C2 = new MediaSizeName(35);
+
/**
* ISO C3 size.
*/
public static final MediaSizeName ISO_C3 = new MediaSizeName(36);
+
/**
* ISO C4 size.
*/
public static final MediaSizeName ISO_C4 = new MediaSizeName(37);
+
/**
* ISO C5 size.
*/
public static final MediaSizeName ISO_C5 = new MediaSizeName(38);
+
/**
- * letter size.
+ * letter size.
*/
public static final MediaSizeName ISO_C6 = new MediaSizeName(39);
+
/**
- * letter size.
+ * letter size.
*/
public static final MediaSizeName NA_LETTER = new MediaSizeName(40);
/**
- * legal size .
+ * legal size.
*/
public static final MediaSizeName NA_LEGAL = new MediaSizeName(41);
/**
- * executive size .
+ * executive size.
*/
public static final MediaSizeName EXECUTIVE = new MediaSizeName(42);
/**
- * ledger size .
+ * ledger size.
*/
public static final MediaSizeName LEDGER = new MediaSizeName(43);
/**
- * tabloid size .
+ * tabloid size.
*/
public static final MediaSizeName TABLOID = new MediaSizeName(44);
/**
- * invoice size .
+ * invoice size.
*/
public static final MediaSizeName INVOICE = new MediaSizeName(45);
/**
- * folio size .
+ * folio size.
*/
public static final MediaSizeName FOLIO = new MediaSizeName(46);
/**
- * quarto size .
+ * quarto size.
*/
public static final MediaSizeName QUARTO = new MediaSizeName(47);
/**
- * Japanese Postcard size.
+ * Japanese Postcard size.
*/
public static final MediaSizeName
JAPANESE_POSTCARD = new MediaSizeName(48);
- /**
- * Japanese Double Postcard size.
+
+ /**
+ * Japanese Double Postcard size.
*/
public static final MediaSizeName
JAPANESE_DOUBLE_POSTCARD = new MediaSizeName(49);
/**
- * A size .
+ * A size.
*/
public static final MediaSizeName A = new MediaSizeName(50);
/**
- * B size .
+ * B size.
*/
public static final MediaSizeName B = new MediaSizeName(51);
/**
- * C size .
+ * C size.
*/
public static final MediaSizeName C = new MediaSizeName(52);
/**
- * D size .
+ * D size.
*/
public static final MediaSizeName D = new MediaSizeName(53);
/**
- * E size .
+ * E size.
*/
public static final MediaSizeName E = new MediaSizeName(54);
/**
- * ISO designated long size .
+ * ISO designated long size.
*/
public static final MediaSizeName
ISO_DESIGNATED_LONG = new MediaSizeName(55);
/**
- * Italy envelope size .
+ * Italy envelope size.
*/
public static final MediaSizeName
ITALY_ENVELOPE = new MediaSizeName(56); // DESIGNATED_LONG?
/**
- * monarch envelope size .
+ * monarch envelope size.
*/
public static final MediaSizeName
MONARCH_ENVELOPE = new MediaSizeName(57);
+
/**
- * personal envelope size .
+ * personal envelope size.
*/
public static final MediaSizeName
PERSONAL_ENVELOPE = new MediaSizeName(58);
+
/**
- * number 9 envelope size .
+ * number 9 envelope size.
*/
public static final MediaSizeName
NA_NUMBER_9_ENVELOPE = new MediaSizeName(59);
+
/**
- * number 10 envelope size .
+ * number 10 envelope size.
*/
public static final MediaSizeName
NA_NUMBER_10_ENVELOPE = new MediaSizeName(60);
+
/**
- * number 11 envelope size .
+ * number 11 envelope size.
*/
public static final MediaSizeName
NA_NUMBER_11_ENVELOPE = new MediaSizeName(61);
+
/**
- * number 12 envelope size .
+ * number 12 envelope size.
*/
public static final MediaSizeName
NA_NUMBER_12_ENVELOPE = new MediaSizeName(62);
+
/**
- * number 14 envelope size .
+ * number 14 envelope size.
*/
public static final MediaSizeName
NA_NUMBER_14_ENVELOPE = new MediaSizeName(63);
- /**
- * 6x9 North American envelope size.
+
+ /**
+ * 6x9 North American envelope size.
*/
public static final MediaSizeName
NA_6X9_ENVELOPE = new MediaSizeName(64);
- /**
- * 7x9 North American envelope size.
+
+ /**
+ * 7x9 North American envelope size.
*/
public static final MediaSizeName
NA_7X9_ENVELOPE = new MediaSizeName(65);
- /**
- * 9x11 North American envelope size.
+
+ /**
+ * 9x11 North American envelope size.
*/
public static final MediaSizeName
NA_9X11_ENVELOPE = new MediaSizeName(66);
+
/**
- * 9x12 North American envelope size.
+ * 9x12 North American envelope size.
*/
public static final MediaSizeName
NA_9X12_ENVELOPE = new MediaSizeName(67);
/**
- * 10x13 North American envelope size .
+ * 10x13 North American envelope size.
*/
public static final MediaSizeName
NA_10X13_ENVELOPE = new MediaSizeName(68);
/**
- * 10x14North American envelope size .
+ * 10x14North American envelope size.
*/
public static final MediaSizeName
NA_10X14_ENVELOPE = new MediaSizeName(69);
/**
- * 10x15 North American envelope size.
+ * 10x15 North American envelope size.
*/
public static final MediaSizeName
NA_10X15_ENVELOPE = new MediaSizeName(70);
/**
- * 5x7 North American paper.
+ * 5x7 North American paper.
*/
public static final MediaSizeName
NA_5X7 = new MediaSizeName(71);
/**
- * 8x10 North American paper.
+ * 8x10 North American paper.
*/
public static final MediaSizeName
NA_8X10 = new MediaSizeName(72);
@@ -386,12 +435,15 @@
* Construct a new media size enumeration value with the given integer
* value.
*
- * @param value Integer value.
+ * @param value Integer value
*/
protected MediaSizeName(int value) {
super (value);
}
+ /**
+ * The string table for class {@code MediaSizeName}.
+ */
private static final String[] myStringTable = {
"iso-a0",
"iso-a1",
@@ -468,6 +520,9 @@
"na-8x10",
};
+ /**
+ * The enumeration value table for class {@code MediaSizeName}.
+ */
private static final MediaSizeName[] myEnumValueTable = {
ISO_A0,
ISO_A1,
@@ -544,9 +599,8 @@
NA_8X10,
};
-
/**
- * Returns the string table for class MediaSizeName.
+ * Returns the string table for class {@code MediaSizeName}.
*/
protected String[] getStringTable()
{
@@ -554,11 +608,9 @@
}
/**
- * Returns the enumeration value table for class MediaSizeName.
+ * Returns the enumeration value table for class {@code MediaSizeName}.
*/
protected EnumSyntax[] getEnumValueTable() {
return (EnumSyntax[])myEnumValueTable.clone();
}
-
-
}
diff -r 000f4e4ddd39 -r 57173ad5c534 jdk/src/java.desktop/share/classes/javax/print/attribute/standard/MediaTray.java
--- a/jdk/src/java.desktop/share/classes/javax/print/attribute/standard/MediaTray.java Fri Sep 01 14:13:40 2017 +0000
+++ b/jdk/src/java.desktop/share/classes/javax/print/attribute/standard/MediaTray.java Sat Sep 09 14:36:45 2017 +0200
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2000, 2014, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2000, 2017, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
@@ -22,29 +22,30 @@
* or visit www.oracle.com if you need additional information or have any
* questions.
*/
+
package javax.print.attribute.standard;
-import java.util.Locale;
-
import javax.print.attribute.Attribute;
import javax.print.attribute.EnumSyntax;
-
/**
- * Class MediaTray is a subclass of Media.
- * Class MediaTray is a printing attribute class, an enumeration, that
- * specifies the media tray or bin for the job.
- * This attribute can be used instead of specifying MediaSize or MediaName.
+ * Class {@code MediaTray} is a subclass of {@code Media}. Class
+ * {@code MediaTray} is a printing attribute class, an enumeration, that
+ * specifies the media tray or bin for the job. This attribute can be used
+ * instead of specifying {@code MediaSize} or {@code MediaName}.
*
- * Class MediaTray declares keywords for standard media kind values.
- * Implementation- or site-defined names for a media kind attribute may also
- * be created by defining a subclass of class MediaTray.
- *
- * IPP Compatibility: MediaTray is a representation class for
+ * Class {@code MediaTray} declares keywords for standard media kind values.
+ * Implementation- or site-defined names for a media kind attribute may also be
+ * created by defining a subclass of class {@code MediaTray}.
+ *
+ * IPP Compatibility: {@code MediaTray} is a representation class for
* values of the IPP "media" attribute which name paper trays.
*/
public class MediaTray extends Media implements Attribute {
+ /**
+ * Use serialVersionUID from JDK 1.4 for interoperability.
+ */
private static final long serialVersionUID = -982503611095214703L;
/**
@@ -91,12 +92,15 @@
* Construct a new media tray enumeration value with the given integer
* value.
*
- * @param value Integer value.
+ * @param value Integer value
*/
protected MediaTray(int value) {
super (value);
}
+ /**
+ * The string table for class {@code MediaTray}.
+ */
private static final String[] myStringTable ={
"top",
"middle",
@@ -108,6 +112,9 @@
"side"
};
+ /**
+ * The enumeration value table for class {@code MediaTray}.
+ */
private static final MediaTray[] myEnumValueTable = {
TOP,
MIDDLE,
@@ -120,7 +127,7 @@
};
/**
- * Returns the string table for class MediaTray.
+ * Returns the string table for class {@code MediaTray}.
*/
protected String[] getStringTable()
{
@@ -128,11 +135,9 @@
}
/**
- * Returns the enumeration value table for class MediaTray.
+ * Returns the enumeration value table for class {@code MediaTray}.
*/
protected EnumSyntax[] getEnumValueTable() {
return (EnumSyntax[])myEnumValueTable.clone();
}
-
-
}
diff -r 000f4e4ddd39 -r 57173ad5c534 jdk/src/java.desktop/share/classes/javax/print/attribute/standard/MultipleDocumentHandling.java
--- a/jdk/src/java.desktop/share/classes/javax/print/attribute/standard/MultipleDocumentHandling.java Fri Sep 01 14:13:40 2017 +0000
+++ b/jdk/src/java.desktop/share/classes/javax/print/attribute/standard/MultipleDocumentHandling.java Sat Sep 09 14:36:45 2017 +0200
@@ -22,178 +22,162 @@
* or visit www.oracle.com if you need additional information or have any
* questions.
*/
+
package javax.print.attribute.standard;
import javax.print.attribute.Attribute;
import javax.print.attribute.EnumSyntax;
+import javax.print.attribute.PrintJobAttribute;
import javax.print.attribute.PrintRequestAttribute;
-import javax.print.attribute.PrintJobAttribute;
/**
- * Class MultipleDocumentHandling is a printing attribute class, an enumeration,
- * that controls finishing operations and the placement of one or more
- * print-stream pages into impressions and onto media sheets. When the value of
- * the {@link Copies Copies} attribute exceeds 1, MultipleDocumentHandling also
- * controls the order in which the copies that result from processing the
- * documents are produced. This attribute is relevant only for a multidoc print
- * job consisting of two or more individual docs.
- *
- * Briefly, MultipleDocumentHandling determines the relationship between the
- * multiple input (electronic) documents fed into a multidoc print job and the
- * output (physical) document or documents produced by the multidoc print job.
+ * Class {@code MultipleDocumentHandling} is a printing attribute class, an
+ * enumeration, that controls finishing operations and the placement of one or
+ * more print-stream pages into impressions and onto media sheets. When the
+ * value of the {@link Copies Copies} attribute exceeds 1,
+ * {@code MultipleDocumentHandling} also controls the order in which the copies
+ * that result from processing the documents are produced. This attribute is
+ * relevant only for a multidoc print job consisting of two or more individual
+ * docs.
+ *
+ * Briefly, {@code MultipleDocumentHandling} determines the relationship between
+ * the multiple input (electronic) documents fed into a multidoc print job and
+ * the output (physical) document or documents produced by the multidoc print
+ * job.
* There are two possibilities:
- *
- * In the detailed explanations below, if "{@code a}" represents an
- * instance of document data, then the result of processing the data in
- * document "{@code a}" is a sequence of media sheets represented by
- * "{@code a(*)}".
- *
- * The standard MultipleDocumentHandling values are:
- *
- * SINGLE_DOCUMENT is the same as SEPARATE_DOCUMENTS_COLLATED_COPIES with
- * respect to ordering of print-stream pages, but not media sheet generation,
- * since SINGLE_DOCUMENT will put the first page of the next document on the
- * back side of a sheet if an odd number of pages have been produced so far
- * for the job, while SEPARATE_DOCUMENTS_COLLATED_COPIES always forces the
+ *
+ * The standard {@code MultipleDocumentHandling} values are:
+ *
+ * {@code SINGLE_DOCUMENT} is the same as
+ * {@code SEPARATE_DOCUMENTS_COLLATED_COPIES} with respect to ordering of
+ * print-stream pages, but not media sheet generation, since
+ * {@code SINGLE_DOCUMENT} will put the first page of the next document on the
+ * back side of a sheet if an odd number of pages have been produced so far for
+ * the job, while {@code SEPARATE_DOCUMENTS_COLLATED_COPIES} always forces the
* next document or document copy on to a new sheet.
- *
+ *
* In addition, if a {@link Finishings Finishings} attribute of
* {@link Finishings#STAPLE STAPLE} is specified, then:
- *
+ * IPP Compatibility: The category name returned by {@code getName()} is
+ * the IPP attribute name. The enumeration's integer value is the IPP enum
+ * value. The {@code toString()} method returns the IPP string representation of
+ * the attribute value.
*
- *
- * Note: None of these values provide means to produce uncollated
- * sheets within a document, i.e., where multiple copies of sheet n
- * are produced before sheet n+1 of the same document.
- * To specify that, see the {@link SheetCollate SheetCollate} attribute.
- *
- * IPP Compatibility: The category name returned by
- * {@code getName()} is the IPP attribute name. The enumeration's
- * integer value is the IPP enum value. The {@code toString()} method
- * returns the IPP string representation of the attribute value.
- *
- * @see Copies
- * @see Finishings
- * @see NumberUp
- * @see PageRanges
- * @see SheetCollate
- * @see Sides
- *
- * @author David Mendenhall
- * @author Alan Kaminsky
+ * @author David Mendenhall
+ * @author Alan Kaminsky
+ * @see Copies
+ * @see Finishings
+ * @see NumberUp
+ * @see PageRanges
+ * @see SheetCollate
+ * @see Sides
*/
public class MultipleDocumentHandling extends EnumSyntax
implements PrintRequestAttribute, PrintJobAttribute {
+ /**
+ * Use serialVersionUID from JDK 1.4 for interoperability.
+ */
private static final long serialVersionUID = 8098326460746413466L;
-
/**
- * Single document -- see above for further
- * information.
+ * Single document -- see above for further information.
*/
public static final MultipleDocumentHandling
SINGLE_DOCUMENT = new MultipleDocumentHandling (0);
/**
* Separate documents uncollated copies -- see above for
- * further information.
+ * further information.
*/
public static final MultipleDocumentHandling
SEPARATE_DOCUMENTS_UNCOLLATED_COPIES = new MultipleDocumentHandling (1);
/**
* Separate documents collated copies -- see above for
- * further information.
+ * further information.
*/
public static final MultipleDocumentHandling
SEPARATE_DOCUMENTS_COLLATED_COPIES = new MultipleDocumentHandling (2);
/**
- * Single document new sheet -- see above for
- * further information.
+ * Single document new sheet -- see above for further
+ * information.
*/
public static final MultipleDocumentHandling
SINGLE_DOCUMENT_NEW_SHEET = new MultipleDocumentHandling (3);
@@ -203,12 +187,15 @@
* Construct a new multiple document handling enumeration value with the
* given integer value.
*
- * @param value Integer value.
+ * @param value Integer value
*/
protected MultipleDocumentHandling(int value) {
super (value);
}
+ /**
+ * The string table for class {@code MultipleDocumentHandling}.
+ */
private static final String[] myStringTable = {
"single-document",
"separate-documents-uncollated-copies",
@@ -216,6 +203,9 @@
"single-document-new-sheet"
};
+ /**
+ * The enumeration value table for class {@code MultipleDocumentHandling}.
+ */
private static final MultipleDocumentHandling[] myEnumValueTable = {
SINGLE_DOCUMENT,
SEPARATE_DOCUMENTS_UNCOLLATED_COPIES,
@@ -224,14 +214,15 @@
};
/**
- * Returns the string table for class MultipleDocumentHandling.
+ * Returns the string table for class {@code MultipleDocumentHandling}.
*/
protected String[] getStringTable() {
return myStringTable.clone();
}
/**
- * Returns the enumeration value table for class MultipleDocumentHandling.
+ * Returns the enumeration value table for class
+ * {@code MultipleDocumentHandling}.
*/
protected EnumSyntax[] getEnumValueTable() {
return (EnumSyntax[])myEnumValueTable.clone();
@@ -240,12 +231,13 @@
/**
* Get the printing attribute class which is to be used as the "category"
* for this printing attribute value.
- *
- * For class MultipleDocumentHandling and any vendor-defined subclasses,
- * the category is class MultipleDocumentHandling itself.
+ *
+ * For class {@code MultipleDocumentHandling} and any vendor-defined
+ * subclasses, the category is class {@code MultipleDocumentHandling}
+ * itself.
*
- * @return Printing attribute class (category), an instance of class
- * {@link java.lang.Class java.lang.Class}.
+ * @return printing attribute class (category), an instance of class
+ * {@link Class java.lang.Class}
*/
public final Class extends Attribute> getCategory() {
return MultipleDocumentHandling.class;
@@ -254,14 +246,13 @@
/**
* Get the name of the category of which this attribute value is an
* instance.
- *
- * For class MultipleDocumentHandling and any vendor-defined subclasses,
- * the category name is {@code "multiple-document-handling"}.
+ *
+ * For class {@code MultipleDocumentHandling} and any vendor-defined
+ * subclasses, the category name is {@code "multiple-document-handling"}.
*
- * @return Attribute category name.
+ * @return attribute category name
*/
public final String getName() {
return "multiple-document-handling";
}
-
}
diff -r 000f4e4ddd39 -r 57173ad5c534 jdk/src/java.desktop/share/classes/javax/print/attribute/standard/NumberOfDocuments.java
--- a/jdk/src/java.desktop/share/classes/javax/print/attribute/standard/NumberOfDocuments.java Fri Sep 01 14:13:40 2017 +0000
+++ b/jdk/src/java.desktop/share/classes/javax/print/attribute/standard/NumberOfDocuments.java Sat Sep 09 14:36:45 2017 +0200
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2000, 2014, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2000, 2017, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
@@ -22,6 +22,7 @@
* or visit www.oracle.com if you need additional information or have any
* questions.
*/
+
package javax.print.attribute.standard;
import javax.print.attribute.Attribute;
@@ -29,31 +30,30 @@
import javax.print.attribute.PrintJobAttribute;
/**
- * Class NumberOfDocuments is an integer valued printing attribute that
+ * Class {@code NumberOfDocuments} is an integer valued printing attribute that
* indicates the number of individual docs the printer has accepted for this
* job, regardless of whether the docs' print data has reached the printer or
* not.
- *
- * IPP Compatibility: The integer value gives the IPP integer value. The
- * category name returned by {@code getName()} gives the IPP attribute
- * name.
+ *
+ * IPP Compatibility: The integer value gives the IPP integer value. The
+ * category name returned by {@code getName()} gives the IPP attribute name.
*
- * @author Alan Kaminsky
+ * @author Alan Kaminsky
*/
public final class NumberOfDocuments extends IntegerSyntax
implements PrintJobAttribute {
+ /**
+ * Use serialVersionUID from JDK 1.4 for interoperability.
+ */
private static final long serialVersionUID = 7891881310684461097L;
-
/**
* Construct a new number of documents attribute with the given integer
* value.
*
- * @param value Integer value.
- *
- * @exception IllegalArgumentException
- * (Unchecked exception) Thrown if {@code value} is less than 0.
+ * @param value Integer value
+ * @throws IllegalArgumentException if {@code value} is negative
*/
public NumberOfDocuments(int value) {
super (value, 0, Integer.MAX_VALUE);
@@ -61,22 +61,18 @@
/**
* Returns whether this number of documents attribute is equivalent to the
- * passed in object. To be equivalent, all of the following conditions
- * must be true:
- *
- * For class NumberOfDocuments, the
- * category is class NumberOfDocuments itself.
+ *
+ * For class {@code NumberOfDocuments}, the category is class
+ * {@code NumberOfDocuments} itself.
*
- * @return Printing attribute class (category), an instance of class
- * {@link java.lang.Class java.lang.Class}.
+ * @return printing attribute class (category), an instance of class
+ * {@link Class java.lang.Class}
*/
public final Class extends Attribute> getCategory() {
return NumberOfDocuments.class;
@@ -100,14 +96,13 @@
/**
* Get the name of the category of which this attribute value is an
* instance.
- *
- * For class NumberOfDocuments, the
- * category name is {@code "number-of-documents"}.
+ *
+ * For class {@code NumberOfDocuments}, the category name is
+ * {@code "number-of-documents"}.
*
- * @return Attribute category name.
+ * @return attribute category name
*/
public final String getName() {
return "number-of-documents";
}
-
}
diff -r 000f4e4ddd39 -r 57173ad5c534 jdk/src/java.desktop/share/classes/javax/print/attribute/standard/NumberOfInterveningJobs.java
--- a/jdk/src/java.desktop/share/classes/javax/print/attribute/standard/NumberOfInterveningJobs.java Fri Sep 01 14:13:40 2017 +0000
+++ b/jdk/src/java.desktop/share/classes/javax/print/attribute/standard/NumberOfInterveningJobs.java Sat Sep 09 14:36:45 2017 +0200
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2000, 2014, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2000, 2017, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
@@ -22,6 +22,7 @@
* or visit www.oracle.com if you need additional information or have any
* questions.
*/
+
package javax.print.attribute.standard;
import javax.print.attribute.Attribute;
@@ -29,30 +30,30 @@
import javax.print.attribute.PrintJobAttribute;
/**
- * Class NumberOfInterveningJobs is an integer valued printing attribute that
- * indicates the number of jobs that are ahead of this job in the relative
- * chronological order of expected time to complete (i.e., the current
- * scheduled order).
- *
- * IPP Compatibility: The integer value gives the IPP integer value.
- * The category name returned by {@code getName()} gives the IPP
- * attribute name.
+ * Class {@code NumberOfInterveningJobs} is an integer valued printing attribute
+ * that indicates the number of jobs that are ahead of this job in the relative
+ * chronological order of expected time to complete (i.e., the current scheduled
+ * order).
+ *
+ * IPP Compatibility: The integer value gives the IPP integer value. The
+ * category name returned by {@code getName()} gives the IPP attribute name.
*
- * @author Alan Kaminsky
+ * @author Alan Kaminsky
*/
public final class NumberOfInterveningJobs extends IntegerSyntax
implements PrintJobAttribute {
+ /**
+ * Use serialVersionUID from JDK 1.4 for interoperability.
+ */
private static final long serialVersionUID = 2568141124844982746L;
/**
* Construct a new number of intervening jobs attribute with the given
* integer value.
*
- * @param value Integer value.
- *
- * @exception IllegalArgumentException
- * (Unchecked exception) Thrown if {@code value} is less than 0.
+ * @param value Integer value
+ * @throws IllegalArgumentException if {@code value} is negative
*/
public NumberOfInterveningJobs(int value) {
super(value, 0, Integer.MAX_VALUE);
@@ -62,20 +63,17 @@
* Returns whether this number of intervening jobs attribute is equivalent
* to the passed in object. To be equivalent, all of the following
* conditions must be true:
- *
- * For class NumberOfInterveningJobs, the
- * category is class NumberOfInterveningJobs itself.
+ *
+ * For class {@code NumberOfInterveningJobs}, the category is class
+ * {@code NumberOfInterveningJobs} itself.
*
- * @return Printing attribute class (category), an instance of class
- * {@link java.lang.Class java.lang.Class}.
+ * @return printing attribute class (category), an instance of class
+ * {@link Class java.lang.Class}
*/
public final Class extends Attribute> getCategory() {
return NumberOfInterveningJobs.class;
@@ -99,14 +97,13 @@
/**
* Get the name of the category of which this attribute value is an
* instance.
- *
- * For class NumberOfInterveningJobs, the
- * category name is {@code "number-of-intervening-jobs"}.
+ *
+ * For class {@code NumberOfInterveningJobs}, the category name is
+ * {@code "number-of-intervening-jobs"}.
*
- * @return Attribute category name.
+ * @return attribute category name
*/
public final String getName() {
return "number-of-intervening-jobs";
}
-
}
diff -r 000f4e4ddd39 -r 57173ad5c534 jdk/src/java.desktop/share/classes/javax/print/attribute/standard/NumberUp.java
--- a/jdk/src/java.desktop/share/classes/javax/print/attribute/standard/NumberUp.java Fri Sep 01 14:13:40 2017 +0000
+++ b/jdk/src/java.desktop/share/classes/javax/print/attribute/standard/NumberUp.java Sat Sep 09 14:36:45 2017 +0200
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2000, 2013, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2000, 2017, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
@@ -22,120 +22,107 @@
* or visit www.oracle.com if you need additional information or have any
* questions.
*/
+
package javax.print.attribute.standard;
import javax.print.attribute.Attribute;
+import javax.print.attribute.DocAttribute;
import javax.print.attribute.IntegerSyntax;
-import javax.print.attribute.DocAttribute;
+import javax.print.attribute.PrintJobAttribute;
import javax.print.attribute.PrintRequestAttribute;
-import javax.print.attribute.PrintJobAttribute;
/**
- * Class NumberUp is an integer valued printing attribute class that specifies
- * the number of print-stream pages to impose upon a single side of an
- * instance of a selected medium. That is, if the NumberUp value is n,
- * the printer must place n print-stream pages on a single side of
- * an instance of the
- * selected medium. To accomplish this, the printer may add some sort of
- * translation, scaling, or rotation. This attribute primarily controls the
- * translation, scaling and rotation of print-stream pages.
- *
- * The effect of a NumberUp attribute on a multidoc print job (a job with
- * multiple documents) depends on whether all the docs have the same number up
- * values specified or whether different docs have different number up values
- * specified, and on the (perhaps defaulted) value of the {@link
- * MultipleDocumentHandling MultipleDocumentHandling} attribute.
- *
+ * The effect of a {@code NumberUp} attribute on a multidoc print job (a job
+ * with multiple documents) depends on whether all the docs have the same number
+ * up values specified or whether different docs have different number up values
+ * specified, and on the (perhaps defaulted) value of the
+ * {@link MultipleDocumentHandling MultipleDocumentHandling} attribute.
+ *
- * For class NumberUp, the category is class NumberUp itself.
+ *
+ * For class {@code NumberUp}, the category is class {@code NumberUp}
+ * itself.
*
- * @return Printing attribute class (category), an instance of class
- * {@link java.lang.Class java.lang.Class}.
+ * @return printing attribute class (category), an instance of class
+ * {@link Class java.lang.Class}
*/
public final Class extends Attribute> getCategory() {
return NumberUp.class;
@@ -179,13 +163,12 @@
/**
* Get the name of the category of which this attribute value is an
* instance.
- *
- * For class NumberUp, the category name is {@code "number-up"}.
+ *
+ * For class {@code NumberUp}, the category name is {@code "number-up"}.
*
- * @return Attribute category name.
+ * @return attribute category name
*/
public final String getName() {
return "number-up";
}
-
}
diff -r 000f4e4ddd39 -r 57173ad5c534 jdk/src/java.desktop/share/classes/javax/print/attribute/standard/NumberUpSupported.java
--- a/jdk/src/java.desktop/share/classes/javax/print/attribute/standard/NumberUpSupported.java Fri Sep 01 14:13:40 2017 +0000
+++ b/jdk/src/java.desktop/share/classes/javax/print/attribute/standard/NumberUpSupported.java Sat Sep 09 14:36:45 2017 +0200
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2000, 2014, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2000, 2017, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
@@ -22,6 +22,7 @@
* or visit www.oracle.com if you need additional information or have any
* questions.
*/
+
package javax.print.attribute.standard;
import javax.print.attribute.Attribute;
@@ -29,41 +30,39 @@
import javax.print.attribute.SupportedValuesAttribute;
/**
- * Class NumberUpSupported is a printing attribute class, a set of integers,
- * that gives the supported values for a {@link NumberUp NumberUp} attribute.
- *
- * IPP Compatibility: The NumberUpSupported attribute's canonical array
+ * Class {@code NumberUpSupported} is a printing attribute class, a set of
+ * integers, that gives the supported values for a {@link NumberUp NumberUp}
+ * attribute.
+ *
+ * IPP Compatibility: The NumberUpSupported attribute's canonical array
* form gives the lower and upper bound for each range of number-up to be
- * included in an IPP "number-up-supported" attribute. See class {@link
- * javax.print.attribute.SetOfIntegerSyntax SetOfIntegerSyntax} for an
- * explanation of canonical array form. The category name returned by
- * {@code getName()} gives the IPP attribute name.
+ * included in an IPP "number-up-supported" attribute. See class
+ * {@link SetOfIntegerSyntax SetOfIntegerSyntax} for an explanation of canonical
+ * array form. The category name returned by {@code getName()} gives the IPP
+ * attribute name.
*
- * @author Alan Kaminsky
+ * @author Alan Kaminsky
*/
public final class NumberUpSupported extends SetOfIntegerSyntax
implements SupportedValuesAttribute {
- private static final long serialVersionUID = -1041573395759141805L;
-
+ /**
+ * Use serialVersionUID from JDK 1.4 for interoperability.
+ */
+ private static final long serialVersionUID = -1041573395759141805L;
/**
- * Construct a new number up supported attribute with the given members.
- * The supported values for NumberUp are specified in "array form;" see
- * class
- * {@link javax.print.attribute.SetOfIntegerSyntax SetOfIntegerSyntax}
- * for an explanation of array form.
- *
- * @param members Set members in array form.
+ * Construct a new number up supported attribute with the given members. The
+ * supported values for NumberUp are specified in "array form;" see class
+ * {@link SetOfIntegerSyntax SetOfIntegerSyntax} for
+ * an explanation of array form.
*
- * @exception NullPointerException
- * (unchecked exception) Thrown if {@code members} is null or
- * any element of {@code members} is null.
- * @exception IllegalArgumentException
- * (unchecked exception) Thrown if any element of
- * {@code members} is not a length-one or length-two array. Also
- * thrown if {@code members} is a zero-length array or if any
- * member of the set is less than 1.
+ * @param members set members in array form
+ * @throws NullPointerException if {@code members} is {@code null} or any
+ * element of {@code members} is {@code null}
+ * @throws IllegalArgumentException if any element of {@code members} is not
+ * a length-one or length-two array. Also if {@code members} is a
+ * zero-length array or if any member of the set is less than 1.
*/
public NumberUpSupported(int[][] members) {
super (members);
@@ -86,13 +85,10 @@
/**
* Construct a new number up supported attribute containing a single
- * integer. That is, only the one value of NumberUp is supported.
- *
- * @param member Set member.
+ * integer. That is, only the one value of {@code NumberUp} is supported.
*
- * @exception IllegalArgumentException
- * (Unchecked exception) Thrown if {@code member} is less than
- * 1.
+ * @param member set member
+ * @throws IllegalArgumentException if {@code member < 1}
*/
public NumberUpSupported(int member) {
super (member);
@@ -103,16 +99,14 @@
/**
* Construct a new number up supported attribute containing a single range
- * of integers. That is, only those values of NumberUp in the one range are
- * supported.
+ * of integers. That is, only those values of {@code NumberUp} in the one
+ * range are supported.
*
- * @param lowerBound Lower bound of the range.
- * @param upperBound Upper bound of the range.
- *
- * @exception IllegalArgumentException
- * (Unchecked exception) Thrown if a null range is specified or if a
- * non-null range is specified with {@code lowerBound} less than
- * 1.
+ * @param lowerBound lower bound of the range
+ * @param upperBound upper bound of the range
+ * @throws IllegalArgumentException if a {@code null} range is specified or
+ * if a {@code non-null} range is specified with {@code lowerBound}
+ * less than 1
*/
public NumberUpSupported(int lowerBound, int upperBound) {
super (lowerBound, upperBound);
@@ -126,22 +120,18 @@
/**
* Returns whether this number up supported attribute is equivalent to the
- * passed in object. To be equivalent, all of the following conditions
- * must be true:
- *
- * For class NumberUpSupported, the
- * category is class NumberUpSupported itself.
+ *
+ * For class {@code NumberUpSupported}, the category is class
+ * {@code NumberUpSupported} itself.
*
- * @return Printing attribute class (category), an instance of class
- * {@link java.lang.Class java.lang.Class}.
+ * @return printing attribute class (category), an instance of class
+ * {@link Class java.lang.Class}
*/
public final Class extends Attribute> getCategory() {
return NumberUpSupported.class;
@@ -165,14 +155,13 @@
/**
* Get the name of the category of which this attribute value is an
* instance.
- *
- * For class NumberUpSupported, the
- * category name is {@code "number-up-supported"}.
+ *
+ * For class {@code NumberUpSupported}, the category name is
+ * {@code "number-up-supported"}.
*
- * @return Attribute category name.
+ * @return attribute category name
*/
public final String getName() {
return "number-up-supported";
}
-
}
diff -r 000f4e4ddd39 -r 57173ad5c534 jdk/src/java.desktop/share/classes/javax/print/attribute/standard/OrientationRequested.java
--- a/jdk/src/java.desktop/share/classes/javax/print/attribute/standard/OrientationRequested.java Fri Sep 01 14:13:40 2017 +0000
+++ b/jdk/src/java.desktop/share/classes/javax/print/attribute/standard/OrientationRequested.java Sat Sep 09 14:36:45 2017 +0200
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2000, 2014, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2000, 2017, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
@@ -22,48 +22,51 @@
* or visit www.oracle.com if you need additional information or have any
* questions.
*/
+
package javax.print.attribute.standard;
import javax.print.attribute.Attribute;
+import javax.print.attribute.DocAttribute;
import javax.print.attribute.EnumSyntax;
-import javax.print.attribute.DocAttribute;
+import javax.print.attribute.PrintJobAttribute;
import javax.print.attribute.PrintRequestAttribute;
-import javax.print.attribute.PrintJobAttribute;
/**
- * Class OrientationRequested is a printing attribute class, an enumeration,
- * that indicates the desired orientation for printed print-stream pages; it
- * does not describe the orientation of the client-supplied print-stream
- * pages.
- *
- * For some document formats (such as {@code "application/postscript"}),
- * the desired orientation of the print-stream pages is specified within the
- * document data. This information is generated by a device driver prior to
- * the submission of the print job. Other document formats (such as
- * {@code "text/plain"}) do not include the notion of desired orientation
- * within the document data. In the latter case it is possible for the printer
- * to bind the desired orientation to the document data after it has been
- * submitted. It is expected that a printer would only support the
- * OrientationRequested attribute for some document formats (e.g.,
+ * Class {@code OrientationRequested} is a printing attribute class, an
+ * enumeration, that indicates the desired orientation for printed print-stream
+ * pages; it does not describe the orientation of the client-supplied
+ * print-stream pages.
+ *
+ * For some document formats (such as {@code "application/postscript"}), the
+ * desired orientation of the print-stream pages is specified within the
+ * document data. This information is generated by a device driver prior to the
+ * submission of the print job. Other document formats (such as
+ * {@code "text/plain"}) do not include the notion of desired orientation within
+ * the document data. In the latter case it is possible for the printer to bind
+ * the desired orientation to the document data after it has been submitted. It
+ * is expected that a printer would only support the
+ * {@code OrientationRequested} attribute for some document formats (e.g.,
* {@code "text/plain"} or {@code "text/html"}) but not others (e.g.
- * {@code "application/postscript"}). This is no different from any other
- * job template attribute, since a print job can always impose constraints
- * among the values of different job template attributes.
- * However, a special mention
- * is made here since it is very likely that a printer will support the
- * OrientationRequested attribute for only a subset of the supported document
- * formats.
- *
- * IPP Compatibility: The category name returned by
- * {@code getName()} is the IPP attribute name. The enumeration's
- * integer value is the IPP enum value. The {@code toString()} method
- * returns the IPP string representation of the attribute value.
+ * {@code "application/postscript"}). This is no different from any other job
+ * template attribute, since a print job can always impose constraints among the
+ * values of different job template attributes. However, a special mention is
+ * made here since it is very likely that a printer will support the
+ * {@code OrientationRequested} attribute for only a subset of the supported
+ * document formats.
+ *
+ * IPP Compatibility: The category name returned by {@code getName()} is
+ * the IPP attribute name. The enumeration's integer value is the IPP enum
+ * value. The {@code toString()} method returns the IPP string representation of
+ * the attribute value.
*
- * @author Alan Kaminsky
+ * @author Alan Kaminsky
*/
public final class OrientationRequested extends EnumSyntax
implements DocAttribute, PrintRequestAttribute, PrintJobAttribute {
+ /**
+ * Use serialVersionUID from JDK 1.4 for interoperability.
+ */
private static final long serialVersionUID = -4447437289862822276L;
/**
@@ -73,11 +76,10 @@
PORTRAIT = new OrientationRequested(3);
/**
- * The content will be imaged across the long edge of the medium.
- * Landscape is defined to be a rotation of the print-stream page to be
- * imaged by +90 degrees with respect to the medium
- * (i.e. anti-clockwise) from the
- * portrait orientation. Note: The +90 direction was chosen because
+ * The content will be imaged across the long edge of the medium. Landscape
+ * is defined to be a rotation of the print-stream page to be imaged by +90
+ * degrees with respect to the medium (i.e. anti-clockwise) from the
+ * portrait orientation. Note: The +90 direction was chosen because
* simple finishing on the long edge is the same edge whether portrait or
* landscape.
*/
@@ -85,13 +87,13 @@
LANDSCAPE = new OrientationRequested(4);
/**
- * The content will be imaged across the long edge of the medium, but in
- * the opposite manner from landscape. Reverse-landscape is defined to be
- * a rotation of the print-stream page to be imaged by -90 degrees with
+ * The content will be imaged across the long edge of the medium, but in the
+ * opposite manner from landscape. Reverse-landscape is defined to be a
+ * rotation of the print-stream page to be imaged by -90 degrees with
* respect to the medium (i.e. clockwise) from the portrait orientation.
- * Note: The REVERSE_LANDSCAPE value was added because some
- * applications rotate landscape -90 degrees from portrait, rather than
- * +90 degrees.
+ * Note: The REVERSE_LANDSCAPE value was added because some
+ * applications rotate landscape -90 degrees from portrait, rather than +90
+ * degrees.
*/
public static final OrientationRequested
REVERSE_LANDSCAPE = new OrientationRequested(5);
@@ -100,14 +102,14 @@
* The content will be imaged across the short edge of the medium, but in
* the opposite manner from portrait. Reverse-portrait is defined to be a
* rotation of the print-stream page to be imaged by 180 degrees with
- * respect to the medium from the portrait orientation. Note: The
- * REVERSE_PORTRAIT value was added for use with the {@link
- * Finishings Finishings} attribute in cases where the
- * opposite edge is desired for finishing a portrait document on simple
- * finishing devices that have only one finishing position. Thus a
- * {@code "text/plain"} portrait document can be stapled "on the
- * right" by a simple finishing device as is common use with some
- * Middle Eastern languages such as Hebrew.
+ * respect to the medium from the portrait orientation. Note: The
+ * REVERSE_PORTRAIT value was added for use with the
+ * {@link Finishings Finishings} attribute in cases where the opposite edge
+ * is desired for finishing a portrait document on simple finishing devices
+ * that have only one finishing position. Thus a {@code "text/plain"}
+ * portrait document can be stapled "on the right" by a simple finishing
+ * device as is common use with some Middle Eastern languages such as
+ * Hebrew.
*/
public static final OrientationRequested
REVERSE_PORTRAIT = new OrientationRequested(6);
@@ -116,12 +118,15 @@
* Construct a new orientation requested enumeration value with the given
* integer value.
*
- * @param value Integer value.
+ * @param value Integer value
*/
protected OrientationRequested(int value) {
super(value);
}
+ /**
+ * The string table for class {@code OrientationRequested}.
+ */
private static final String[] myStringTable = {
"portrait",
"landscape",
@@ -129,6 +134,9 @@
"reverse-portrait"
};
+ /**
+ * The enumeration value table for class {@code OrientationRequested}.
+ */
private static final OrientationRequested[] myEnumValueTable = {
PORTRAIT,
LANDSCAPE,
@@ -137,21 +145,23 @@
};
/**
- * Returns the string table for class OrientationRequested.
+ * Returns the string table for class {@code OrientationRequested}.
*/
protected String[] getStringTable() {
return myStringTable;
}
/**
- * Returns the enumeration value table for class OrientationRequested.
+ * Returns the enumeration value table for class
+ * {@code OrientationRequested}.
*/
protected EnumSyntax[] getEnumValueTable() {
return myEnumValueTable;
}
/**
- * Returns the lowest integer value used by class OrientationRequested.
+ * Returns the lowest integer value used by class
+ * {@code OrientationRequested}.
*/
protected int getOffset() {
return 3;
@@ -160,12 +170,12 @@
/**
* Get the printing attribute class which is to be used as the "category"
* for this printing attribute value.
- *
- * For class OrientationRequested, the
- * category is class OrientationRequested itself.
+ *
+ * For class {@code OrientationRequested}, the category is class
+ * {@code OrientationRequested} itself.
*
- * @return Printing attribute class (category), an instance of class
- * {@link java.lang.Class java.lang.Class}.
+ * @return printing attribute class (category), an instance of class
+ * {@link Class java.lang.Class}
*/
public final Class extends Attribute> getCategory() {
return OrientationRequested.class;
@@ -174,14 +184,13 @@
/**
* Get the name of the category of which this attribute value is an
* instance.
- *
- * For class OrientationRequested, the
- * category name is {@code "orientation-requested"}.
+ *
+ * For class {@code OrientationRequested}, the category name is
+ * {@code "orientation-requested"}.
*
- * @return Attribute category name.
+ * @return attribute category name
*/
public final String getName() {
return "orientation-requested";
}
-
}
diff -r 000f4e4ddd39 -r 57173ad5c534 jdk/src/java.desktop/share/classes/javax/print/attribute/standard/OutputDeviceAssigned.java
--- a/jdk/src/java.desktop/share/classes/javax/print/attribute/standard/OutputDeviceAssigned.java Fri Sep 01 14:13:40 2017 +0000
+++ b/jdk/src/java.desktop/share/classes/javax/print/attribute/standard/OutputDeviceAssigned.java Sat Sep 09 14:36:45 2017 +0200
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2000, 2014, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2000, 2017, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
@@ -22,46 +22,48 @@
* or visit www.oracle.com if you need additional information or have any
* questions.
*/
+
package javax.print.attribute.standard;
import java.util.Locale;
import javax.print.attribute.Attribute;
+import javax.print.attribute.PrintJobAttribute;
import javax.print.attribute.TextSyntax;
-import javax.print.attribute.PrintJobAttribute;
/**
- * Class OutputDeviceAssigned is a printing attribute class, a text attribute,
- * that identifies the output device to which the service has assigned this
- * job. If an output device implements an embedded Print Service instance, the
- * printer need not set this attribute. If a print server implements a
- * Print Service instance, the value may be empty (zero- length string) or not
- * returned until the service assigns an output device to the job. This
- * attribute is particularly useful when a single service supports multiple
- * devices (so called "fan-out").
- *
- * IPP Compatibility: The string value gives the IPP name value. The
+ * Class {@code OutputDeviceAssigned} is a printing attribute class, a text
+ * attribute, that identifies the output device to which the service has
+ * assigned this job. If an output device implements an embedded Print Service
+ * instance, the printer need not set this attribute. If a print server
+ * implements a Print Service instance, the value may be empty (zero- length
+ * string) or not returned until the service assigns an output device to the
+ * job. This attribute is particularly useful when a single service supports
+ * multiple devices (so called "fan-out").
+ *
+ * IPP Compatibility: The string value gives the IPP name value. The
* locale gives the IPP natural language. The category name returned by
* {@code getName()} gives the IPP attribute name.
*
- * @author Alan Kaminsky
+ * @author Alan Kaminsky
*/
public final class OutputDeviceAssigned extends TextSyntax
implements PrintJobAttribute {
+ /**
+ * Use serialVersionUID from JDK 1.4 for interoperability.
+ */
private static final long serialVersionUID = 5486733778854271081L;
/**
* Constructs a new output device assigned attribute with the given device
* name and locale.
*
- * @param deviceName Device name.
- * @param locale Natural language of the text string. null
- * is interpreted to mean the default locale as returned
- * by {@code Locale.getDefault()}
- *
- * @exception NullPointerException
- * (unchecked exception) Thrown if {@code deviceName} is null.
+ * @param deviceName device name
+ * @param locale natural language of the text string. {@code null} is
+ * interpreted to mean the default locale as returned by
+ * {@code Locale.getDefault()}
+ * @throws NullPointerException if {@code deviceName} is {@code null}
*/
public OutputDeviceAssigned(String deviceName, Locale locale) {
@@ -74,23 +76,19 @@
* Returns whether this output device assigned attribute is equivalent to
* the passed in object. To be equivalent, all of the following conditions
* must be true:
- *
- * For class OutputDeviceAssigned, the
- * category is class OutputDeviceAssigned itself.
+ *
+ * For class {@code OutputDeviceAssigned}, the category is class
+ * {@code OutputDeviceAssigned} itself.
*
- * @return Printing attribute class (category), an instance of class
- * {@link java.lang.Class java.lang.Class}.
+ * @return printing attribute class (category), an instance of class
+ * {@link Class java.lang.Class}
*/
public final Class extends Attribute> getCategory() {
return OutputDeviceAssigned.class;
@@ -114,14 +112,13 @@
/**
* Get the name of the category of which this attribute value is an
* instance.
- *
- * For class OutputDeviceAssigned, the
- * category name is {@code "output-device-assigned"}.
+ *
+ * For class {@code OutputDeviceAssigned}, the category name is
+ * {@code "output-device-assigned"}.
*
- * @return Attribute category name.
+ * @return attribute category name
*/
public final String getName() {
return "output-device-assigned";
}
-
}
diff -r 000f4e4ddd39 -r 57173ad5c534 jdk/src/java.desktop/share/classes/javax/print/attribute/standard/PDLOverrideSupported.java
--- a/jdk/src/java.desktop/share/classes/javax/print/attribute/standard/PDLOverrideSupported.java Fri Sep 01 14:13:40 2017 +0000
+++ b/jdk/src/java.desktop/share/classes/javax/print/attribute/standard/PDLOverrideSupported.java Sat Sep 09 14:36:45 2017 +0200
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2000, 2014, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2000, 2017, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
@@ -22,6 +22,7 @@
* or visit www.oracle.com if you need additional information or have any
* questions.
*/
+
package javax.print.attribute.standard;
import javax.print.attribute.Attribute;
@@ -29,27 +30,29 @@
import javax.print.attribute.PrintServiceAttribute;
/**
- * Class PDLOverrideSupported is a printing attribute class, an enumeration,
- * that expresses the printer's ability to attempt to override processing
- * instructions embedded in documents' print data with processing instructions
- * specified as attributes outside the print data.
- *
- * IPP Compatibility: The category name returned by
- * {@code getName()} is the IPP attribute name. The enumeration's
- * integer value is the IPP enum value. The {@code toString()} method
- * returns the IPP string representation of the attribute value.
+ * Class {@code PDLOverrideSupported} is a printing attribute class, an
+ * enumeration, that expresses the printer's ability to attempt to override
+ * processing instructions embedded in documents' print data with processing
+ * instructions specified as attributes outside the print data.
+ *
+ * IPP Compatibility: The category name returned by {@code getName()} is
+ * the IPP attribute name. The enumeration's integer value is the IPP enum
+ * value. The {@code toString()} method returns the IPP string representation of
+ * the attribute value.
*
- * @author Alan Kaminsky
+ * @author Alan Kaminsky
*/
public class PDLOverrideSupported extends EnumSyntax
implements PrintServiceAttribute {
+ /**
+ * Use serialVersionUID from JDK 1.4 for interoperability.
+ */
private static final long serialVersionUID = -4393264467928463934L;
/**
* The printer makes no attempt to make the external job attribute values
- * take precedence over embedded instructions in the documents' print
- * data.
+ * take precedence over embedded instructions in the documents' print data.
*/
public static final PDLOverrideSupported
NOT_ATTEMPTED = new PDLOverrideSupported(0);
@@ -62,36 +65,42 @@
public static final PDLOverrideSupported
ATTEMPTED = new PDLOverrideSupported(1);
-
/**
* Construct a new PDL override supported enumeration value with the given
* integer value.
*
- * @param value Integer value.
+ * @param value Integer value
*/
protected PDLOverrideSupported(int value) {
super (value);
}
+ /**
+ * The string table for class {@code PDLOverrideSupported}.
+ */
private static final String[] myStringTable = {
"not-attempted",
"attempted"
};
+ /**
+ * The enumeration value table for class {@code PDLOverrideSupported}.
+ */
private static final PDLOverrideSupported[] myEnumValueTable = {
NOT_ATTEMPTED,
ATTEMPTED
};
/**
- * Returns the string table for class PDLOverrideSupported.
+ * Returns the string table for class {@code PDLOverrideSupported}.
*/
protected String[] getStringTable() {
return myStringTable.clone();
}
/**
- * Returns the enumeration value table for class PDLOverrideSupported.
+ * Returns the enumeration value table for class
+ * {@code PDLOverrideSupported}.
*/
protected EnumSyntax[] getEnumValueTable() {
return (EnumSyntax[])myEnumValueTable.clone();
@@ -100,12 +109,12 @@
/**
* Get the printing attribute class which is to be used as the "category"
* for this printing attribute value.
- *
- * For class PDLOverrideSupported and any vendor-defined subclasses, the
- * category is class PDLOverrideSupported itself.
+ *
+ * For class {@code PDLOverrideSupported} and any vendor-defined subclasses,
+ * the category is class {@code PDLOverrideSupported} itself.
*
- * @return Printing attribute class (category), an instance of class
- * {@link java.lang.Class java.lang.Class}.
+ * @return printing attribute class (category), an instance of class
+ * {@link Class java.lang.Class}
*/
public final Class extends Attribute> getCategory() {
return PDLOverrideSupported.class;
@@ -114,14 +123,13 @@
/**
* Get the name of the category of which this attribute value is an
* instance.
- *
- * For class PDLOverrideSupported and any vendor-defined subclasses, the
- * category name is {@code "pdl-override-supported"}.
+ *
+ * For class {@code PDLOverrideSupported} and any vendor-defined subclasses,
+ * the category name is {@code "pdl-override-supported"}.
*
- * @return Attribute category name.
+ * @return attribute category name
*/
public final String getName() {
return "pdl-override-supported";
}
-
}
diff -r 000f4e4ddd39 -r 57173ad5c534 jdk/src/java.desktop/share/classes/javax/print/attribute/standard/PageRanges.java
--- a/jdk/src/java.desktop/share/classes/javax/print/attribute/standard/PageRanges.java Fri Sep 01 14:13:40 2017 +0000
+++ b/jdk/src/java.desktop/share/classes/javax/print/attribute/standard/PageRanges.java Sat Sep 09 14:36:45 2017 +0200
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2000, 2013, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2000, 2017, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
@@ -26,106 +26,93 @@
package javax.print.attribute.standard;
import javax.print.attribute.Attribute;
+import javax.print.attribute.DocAttribute;
+import javax.print.attribute.PrintJobAttribute;
+import javax.print.attribute.PrintRequestAttribute;
import javax.print.attribute.SetOfIntegerSyntax;
-import javax.print.attribute.DocAttribute;
-import javax.print.attribute.PrintRequestAttribute;
-import javax.print.attribute.PrintJobAttribute;
/**
- * Class PageRanges is a printing attribute class, a set of integers, that
- * identifies the range(s) of print-stream pages that the Printer object uses
- * for each copy of each document which are to be printed. Nothing is printed
- * for any pages identified that do not exist in the document(s). The attribute
- * is associated with print-stream pages, not application-numbered pages
- * (for example, the page numbers found in the headers and or footers for
- * certain word processing applications).
- *
+ * Class {@code PageRanges} is a printing attribute class, a set of integers,
+ * that identifies the range(s) of print-stream pages that the Printer object
+ * uses for each copy of each document which are to be printed. Nothing is
+ * printed for any pages identified that do not exist in the document(s). The
+ * attribute is associated with print-stream pages, not
+ * application-numbered pages (for example, the page numbers found in the
+ * headers and or footers for certain word processing applications).
+ *
* In most cases, the exact pages to be printed will be generated by a device
* driver and this attribute would not be required. However, when printing an
* archived document which has already been formatted, the end user may elect to
* print just a subset of the pages contained in the document. In this case, if
- * a page range of
- * If a PageRanges attribute is not specified for a print job, all pages of
- * the document will be printed. In other words, the default value for the
- * PageRanges attribute is always {@code {{1, Integer.MAX_VALUE}}}.
- *
- * The effect of a PageRanges attribute on a multidoc print job (a job with
- * multiple documents) depends on whether all the docs have the same page ranges
- * specified or whether different docs have different page ranges specified, and
- * on the (perhaps defaulted) value of the {@link MultipleDocumentHandling
- * MultipleDocumentHandling} attribute.
- *
+ * If a {@code PageRanges} attribute is not specified for a print job, all pages
+ * of the document will be printed. In other words, the default value for the
+ * {@code PageRanges} attribute is always {@code {{1, Integer.MAX_VALUE}}}.
+ *
+ * The effect of a {@code PageRanges} attribute on a multidoc print job (a job
+ * with multiple documents) depends on whether all the docs have the same page
+ * ranges specified or whether different docs have different page ranges
+ * specified, and on the (perhaps defaulted) value of the
+ * {@link MultipleDocumentHandling MultipleDocumentHandling} attribute.
+ *
+ * IPP Compatibility: The PageRanges attribute's canonical array form
+ * gives the lower and upper bound for each range of pages to be included in and
+ * IPP "page-ranges" attribute. See class
+ * {@link SetOfIntegerSyntax SetOfIntegerSyntax} for an explanation of canonical
+ * array form. The category name returned by {@code getName()} gives the IPP
+ * attribute name.
*
- *
- * IPP Compatibility: The PageRanges attribute's canonical array form
- * gives the lower and upper bound for each range of pages to be included in
- * and IPP "page-ranges" attribute. See class {@link
- * javax.print.attribute.SetOfIntegerSyntax SetOfIntegerSyntax} for an
- * explanation of canonical array form. The category name returned by
- * {@code getName()} gives the IPP attribute name.
- *
- * @author David Mendenhall
- * @author Alan Kaminsky
+ * @author David Mendenhall
+ * @author Alan Kaminsky
*/
public final class PageRanges extends SetOfIntegerSyntax
implements DocAttribute, PrintRequestAttribute, PrintJobAttribute {
+ /**
+ * Use serialVersionUID from JDK 1.4 for interoperability.
+ */
private static final long serialVersionUID = 8639895197656148392L;
-
/**
- * Construct a new page ranges attribute with the given members. The
- * members are specified in "array form;" see class {@link
- * javax.print.attribute.SetOfIntegerSyntax SetOfIntegerSyntax} for an
- * explanation of array form.
- *
- * @param members Set members in array form.
+ * Construct a new page ranges attribute with the given members. The members
+ * are specified in "array form;" see class
+ * {@link SetOfIntegerSyntax SetOfIntegerSyntax} for an explanation of array
+ * form.
*
- * @exception NullPointerException
- * (unchecked exception) Thrown if {@code members} is null or
- * any element of {@code members} is null.
- * @exception IllegalArgumentException
- * (unchecked exception) Thrown if any element of
- * {@code members} is not a length-one or length-two array. Also
- * thrown if {@code members} is a zero-length array or if any
- * member of the set is less than 1.
+ * @param members set members in array form
+ * @throws NullPointerException if {@code members} is {@code null} or any
+ * element of {@code members} is {@code null}
+ * @throws IllegalArgumentException if any element of {@code members} is not
+ * a length-one or length-two array. Also if {@code members} is a
+ * zero-length array or if any member of the set is less than 1.
*/
public PageRanges(int[][] members) {
super (members);
@@ -134,24 +121,18 @@
}
myPageRanges();
}
+
/**
- * Construct a new page ranges attribute with the given members in
- * string form.
- * See class {@link javax.print.attribute.SetOfIntegerSyntax
- * SetOfIntegerSyntax}
- * for explanation of the syntax.
- *
- * @param members Set members in string form.
+ * Construct a new page ranges attribute with the given members in string
+ * form. See class {@link SetOfIntegerSyntax SetOfIntegerSyntax} for
+ * explanation of the syntax.
*
- * @exception NullPointerException
- * (unchecked exception) Thrown if {@code members} is null or
- * any element of {@code members} is null.
- * @exception IllegalArgumentException
- * (Unchecked exception) Thrown if {@code members} does not
- * obey the proper syntax. Also
- * thrown if the constructed set-of-integer is a
- * zero-length array or if any
- * member of the set is less than 1.
+ * @param members set members in string form
+ * @throws NullPointerException if {@code members} is {@code null} or any
+ * element of {@code members} is {@code null}
+ * @throws IllegalArgumentException if {@code members} does not obey the
+ * proper syntax. Also if the constructed set-of-integer is a
+ * zero-length array or if any member of the set is less than 1.
*/
public PageRanges(String members) {
super(members);
@@ -161,6 +142,9 @@
myPageRanges();
}
+ /**
+ * Validates the page ranges.
+ */
private void myPageRanges() {
int[][] myMembers = getMembers();
int n = myMembers.length;
@@ -179,11 +163,8 @@
* Construct a new page ranges attribute containing a single integer. That
* is, only the one page is to be printed.
*
- * @param member Set member.
- *
- * @exception IllegalArgumentException
- * (Unchecked exception) Thrown if {@code member} is less than
- * 1.
+ * @param member set member
+ * @throws IllegalArgumentException if {@code member < 1}
*/
public PageRanges(int member) {
super (member);
@@ -196,13 +177,11 @@
* Construct a new page ranges attribute containing a single range of
* integers. That is, only those pages in the one range are to be printed.
*
- * @param lowerBound Lower bound of the range.
- * @param upperBound Upper bound of the range.
- *
- * @exception IllegalArgumentException
- * (Unchecked exception) Thrown if a null range is specified or if a
- * non-null range is specified with {@code lowerBound} less than
- * 1.
+ * @param lowerBound lower bound of the range
+ * @param upperBound upper bound of the range
+ * @throws IllegalArgumentException if a {@code null} range is specified or
+ * if a {@code non-null} range is specified with {@code lowerBound}
+ * less than 1
*/
public PageRanges(int lowerBound, int upperBound) {
super (lowerBound, upperBound);
@@ -214,23 +193,18 @@
}
/**
- * Returns whether this page ranges attribute is equivalent to the passed
- * in object. To be equivalent, all of the following conditions must be
- * true:
- *
- * For class PageRanges, the category is class PageRanges itself.
+ *
+ * For class {@code PageRanges}, the category is class
+ * {@code PageRanges} itself.
*
- * @return Printing attribute class (category), an instance of class
- * {@link java.lang.Class java.lang.Class}.
+ * @return printing attribute class (category), an instance of class
+ * {@link Class java.lang.Class}
*/
public final Class extends Attribute> getCategory() {
return PageRanges.class;
@@ -252,13 +227,12 @@
/**
* Get the name of the category of which this attribute value is an
* instance.
- *
- * For class PageRanges, the category name is {@code "page-ranges"}.
+ *
+ * For class {@code PageRanges}, the category name is {@code "page-ranges"}.
*
- * @return Attribute category name.
+ * @return attribute category name
*/
public final String getName() {
return "page-ranges";
}
-
}
diff -r 000f4e4ddd39 -r 57173ad5c534 jdk/src/java.desktop/share/classes/javax/print/attribute/standard/PagesPerMinute.java
--- a/jdk/src/java.desktop/share/classes/javax/print/attribute/standard/PagesPerMinute.java Fri Sep 01 14:13:40 2017 +0000
+++ b/jdk/src/java.desktop/share/classes/javax/print/attribute/standard/PagesPerMinute.java Sat Sep 09 14:36:45 2017 +0200
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2000, 2014, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2000, 2017, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
@@ -22,6 +22,7 @@
* or visit www.oracle.com if you need additional information or have any
* questions.
*/
+
package javax.print.attribute.standard;
import javax.print.attribute.Attribute;
@@ -29,32 +30,31 @@
import javax.print.attribute.PrintServiceAttribute;
/**
- * Class PagesPerMinute is an integer valued printing attribute that indicates
- * the nominal number of pages per minute to the nearest whole number which may
- * be generated by this printer (e.g., simplex, black-and-white). This attribute
- * is informative, not a service guarantee. Generally, it is the value used in
- * the marketing literature to describe the device. A value of 0 indicates a
- * device that takes more than two minutes to process a page.
- *
- * IPP Compatibility: The integer value gives the IPP integer value. The
- * category name returned by {@code getName()} gives the IPP attribute
- * name.
+ * Class {@code PagesPerMinute} is an integer valued printing attribute that
+ * indicates the nominal number of pages per minute to the nearest whole number
+ * which may be generated by this printer (e.g., simplex, black-and-white). This
+ * attribute is informative, not a service guarantee. Generally, it is the value
+ * used in the marketing literature to describe the device. A value of 0
+ * indicates a device that takes more than two minutes to process a page.
+ *
+ * IPP Compatibility: The integer value gives the IPP integer value. The
+ * category name returned by {@code getName()} gives the IPP attribute name.
*
- * @author Alan Kaminsky
+ * @author Alan Kaminsky
*/
public final class PagesPerMinute extends IntegerSyntax
implements PrintServiceAttribute {
+ /**
+ * Use serialVersionUID from JDK 1.4 for interoperability.
+ */
private static final long serialVersionUID = -6366403993072862015L;
/**
- * Construct a new pages per minute attribute with the given integer
- * value.
+ * Construct a new pages per minute attribute with the given integer value.
*
- * @param value Integer value.
- *
- * @exception IllegalArgumentException
- * (Unchecked exception) Thrown if {@code value} is less than 0.
+ * @param value Integer value
+ * @throws IllegalArgumentException if {@code value} is negative
*/
public PagesPerMinute(int value) {
super(value, 0, Integer.MAX_VALUE);
@@ -62,22 +62,18 @@
/**
* Returns whether this pages per minute attribute is equivalent to the
- * passed in object. To be equivalent, all of the following conditions
- * must be true:
- *
- * For class PagesPerMinute, the category is class PagesPerMinute itself.
+ *
+ * For class {@code PagesPerMinute}, the category is class
+ * {@code PagesPerMinute} itself.
*
- * @return Printing attribute class (category), an instance of class
- * {@link java.lang.Class java.lang.Class}.
+ * @return printing attribute class (category), an instance of class
+ * {@link Class java.lang.Class}
*/
public final Class extends Attribute> getCategory() {
return PagesPerMinute.class;
@@ -100,14 +97,13 @@
/**
* Get the name of the category of which this attribute value is an
* instance.
- *
- * For class PagesPerMinute, the
- * category name is {@code "pages-per-minute"}.
+ *
+ * For class {@code PagesPerMinute}, the category name is
+ * {@code "pages-per-minute"}.
*
- * @return Attribute category name.
+ * @return attribute category name
*/
public final String getName() {
return "pages-per-minute";
}
-
}
diff -r 000f4e4ddd39 -r 57173ad5c534 jdk/src/java.desktop/share/classes/javax/print/attribute/standard/PagesPerMinuteColor.java
--- a/jdk/src/java.desktop/share/classes/javax/print/attribute/standard/PagesPerMinuteColor.java Fri Sep 01 14:13:40 2017 +0000
+++ b/jdk/src/java.desktop/share/classes/javax/print/attribute/standard/PagesPerMinuteColor.java Sat Sep 09 14:36:45 2017 +0200
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2000, 2014, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2000, 2017, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
@@ -22,6 +22,7 @@
* or visit www.oracle.com if you need additional information or have any
* questions.
*/
+
package javax.print.attribute.standard;
import javax.print.attribute.Attribute;
@@ -29,43 +30,44 @@
import javax.print.attribute.PrintServiceAttribute;
/**
- * Class PagesPerMinuteColor is an integer valued printing attribute that
- * indicates the nominal number of pages per minute to the nearest whole number
- * which may be generated by this printer when printing color (e.g., simplex,
- * color). For purposes of this attribute, "color" means the same as for the
- * {@link ColorSupported ColorSupported} attribute, namely, the device is
- * capable of any type of color printing at all, including highlight color as
+ * Class {@code PagesPerMinuteColor} is an integer valued printing attribute
+ * that indicates the nominal number of pages per minute to the nearest whole
+ * number which may be generated by this printer when printing color (e.g.,
+ * simplex, color). For purposes of this attribute, "color" means the same as
+ * for the {@link ColorSupported ColorSupported} attribute, namely, the device
+ * is capable of any type of color printing at all, including highlight color as
* well as full process color. This attribute is informative, not a service
* guarantee. Generally, it is the value used in the marketing literature to
* describe the color capabilities of this device. A value of 0 indicates a
* device that takes more than two minutes to process a page. If a color device
* has several color modes, it may use the pages-per- minute value for this
* attribute that corresponds to the mode that produces the highest number.
- *
- * A black and white only printer must not include the PagesPerMinuteColor
- * attribute in its attribute set or service registration. If this attribute is
- * present, then the {@link ColorSupported ColorSupported} printer description
- * attribute must also be present and have a value of SUPPORTED.
- *
- * IPP Compatibility: The integer value gives the IPP integer value. The
- * category name returned by {@code getName()} gives the IPP attribute
- * name.
+ *
+ * A black and white only printer must not include the
+ * {@code PagesPerMinuteColor} attribute in its attribute set or service
+ * registration. If this attribute is present, then the
+ * {@link ColorSupported ColorSupported} printer description attribute must also
+ * be present and have a value of {@code SUPPORTED}.
+ *
+ * IPP Compatibility: The integer value gives the IPP integer value. The
+ * category name returned by {@code getName()} gives the IPP attribute name.
*
- * @author Alan Kaminsky
+ * @author Alan Kaminsky
*/
public final class PagesPerMinuteColor extends IntegerSyntax
implements PrintServiceAttribute {
+ /**
+ * Use serialVersionUID from JDK 1.4 for interoperability.
+ */
static final long serialVersionUID = 1684993151687470944L;
/**
* Construct a new pages per minute color attribute with the given integer
* value.
*
- * @param value Integer value.
- *
- * @exception IllegalArgumentException
- * (Unchecked exception) Thrown if {@code value} is less than 0.
+ * @param value Integer value
+ * @throws IllegalArgumentException if {@code value} is negative
*/
public PagesPerMinuteColor(int value) {
super(value, 0, Integer.MAX_VALUE);
@@ -75,20 +77,16 @@
* Returns whether this pages per minute color attribute is equivalent to
* the passed in object. To be equivalent, all of the following conditions
* must be true:
- *
- * For class PagesPerMinuteColor, the
- * category is class PagesPerMinuteColor itself.
+ *
+ * For class {@code PagesPerMinuteColor}, the category is class
+ * {@code PagesPerMinuteColor} itself.
*
- * @return Printing attribute class (category), an instance of class
- * {@link java.lang.Class java.lang.Class}.
+ * @return printing attribute class (category), an instance of class
+ * {@link Class java.lang.Class}
*/
public final Class extends Attribute> getCategory() {
return PagesPerMinuteColor.class;
@@ -112,14 +110,13 @@
/**
* Get the name of the category of which this attribute value is an
* instance.
- *
- * For class PagesPerMinuteColor, the
- * category name is {@code "pages-per-minute-color"}.
+ *
+ * For class {@code PagesPerMinuteColor}, the category name is
+ * {@code "pages-per-minute-color"}.
*
- * @return Attribute category name.
+ * @return attribute category name
*/
public final String getName() {
return "pages-per-minute-color";
}
-
}
diff -r 000f4e4ddd39 -r 57173ad5c534 jdk/src/java.desktop/share/classes/javax/print/attribute/standard/PresentationDirection.java
--- a/jdk/src/java.desktop/share/classes/javax/print/attribute/standard/PresentationDirection.java Fri Sep 01 14:13:40 2017 +0000
+++ b/jdk/src/java.desktop/share/classes/javax/print/attribute/standard/PresentationDirection.java Sat Sep 09 14:36:45 2017 +0200
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2001, 2014, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2001, 2017, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
@@ -22,6 +22,7 @@
* or visit www.oracle.com if you need additional information or have any
* questions.
*/
+
package javax.print.attribute.standard;
import javax.print.attribute.Attribute;
@@ -30,81 +31,84 @@
import javax.print.attribute.PrintRequestAttribute;
/**
- * Class PresentationDirection is a printing attribute class, an enumeration,
- * that is used in conjunction with the {@link NumberUp NumberUp} attribute to
- * indicate the layout of multiple print-stream pages to impose upon a
- * single side of an instance of a selected medium.
- * This is useful to mirror the text layout conventions of different scripts.
- * For example, English is "toright-tobottom", Hebrew is "toleft-tobottom"
- * and Japanese is usually "tobottom-toleft".
- *
- * IPP Compatibility: This attribute is not an IPP 1.1
- * attribute; it is an attribute in the Production Printing Extension
- * (PDF)
- * of IPP 1.1. The category name returned by
- * {@code getName()} is the IPP attribute name. The enumeration's
- * integer value is the IPP enum value. The {@code toString()} method
- * returns the IPP string representation of the attribute value.
+ * Class {@code PresentationDirection} is a printing attribute class, an
+ * enumeration, that is used in conjunction with the {@link NumberUp NumberUp}
+ * attribute to indicate the layout of multiple print-stream pages to impose
+ * upon a single side of an instance of a selected medium. This is useful to
+ * mirror the text layout conventions of different scripts. For example, English
+ * is "toright-tobottom", Hebrew is "toleft-tobottom" and Japanese is usually
+ * "tobottom-toleft".
+ *
+ * IPP Compatibility: This attribute is not an IPP 1.1 attribute; it is
+ * an attribute in the Production Printing Extension
+ * (PDF) of IPP
+ * 1.1. The category name returned by {@code getName()} is the IPP attribute
+ * name. The enumeration's integer value is the IPP enum value. The
+ * {@code toString()} method returns the IPP string representation of the
+ * attribute value.
*
- * @author Phil Race.
+ * @author Phil Race
*/
public final class PresentationDirection extends EnumSyntax
implements PrintJobAttribute, PrintRequestAttribute {
+ /**
+ * Use serialVersionUID from JDK 1.4 for interoperability.
+ */
private static final long serialVersionUID = 8294728067230931780L;
/**
- * Pages are laid out in columns starting at the top left,
- * proceeding towards the bottom {@literal &} right.
+ * Pages are laid out in columns starting at the top left, proceeding
+ * towards the bottom {@literal &} right.
*/
public static final PresentationDirection TOBOTTOM_TORIGHT =
new PresentationDirection(0);
/**
- * Pages are laid out in columns starting at the top right,
- * proceeding towards the bottom {@literal &} left.
+ * Pages are laid out in columns starting at the top right, proceeding
+ * towards the bottom {@literal &} left.
*/
public static final PresentationDirection TOBOTTOM_TOLEFT =
new PresentationDirection(1);
/**
- * Pages are laid out in columns starting at the bottom left,
- * proceeding towards the top {@literal &} right.
+ * Pages are laid out in columns starting at the bottom left, proceeding
+ * towards the top {@literal &} right.
*/
public static final PresentationDirection TOTOP_TORIGHT =
new PresentationDirection(2);
/**
- * Pages are laid out in columns starting at the bottom right,
- * proceeding towards the top {@literal &} left.
+ * Pages are laid out in columns starting at the bottom right, proceeding
+ * towards the top {@literal &} left.
*/
public static final PresentationDirection TOTOP_TOLEFT =
new PresentationDirection(3);
/**
- * Pages are laid out in rows starting at the top left,
- * proceeding towards the right {@literal &} bottom.
+ * Pages are laid out in rows starting at the top left, proceeding towards
+ * the right {@literal &} bottom.
*/
public static final PresentationDirection TORIGHT_TOBOTTOM =
new PresentationDirection(4);
/**
- * Pages are laid out in rows starting at the bottom left,
- * proceeding towards the right {@literal &} top.
+ * Pages are laid out in rows starting at the bottom left, proceeding
+ * towards the right {@literal &} top.
*/
public static final PresentationDirection TORIGHT_TOTOP =
new PresentationDirection(5);
/**
- * Pages are laid out in rows starting at the top right,
- * proceeding towards the left {@literal &} bottom.
+ * Pages are laid out in rows starting at the top right, proceeding towards
+ * the left {@literal &} bottom.
*/
public static final PresentationDirection TOLEFT_TOBOTTOM =
new PresentationDirection(6);
/**
- * Pages are laid out in rows starting at the bottom right,
- * proceeding towards the left {@literal &} top.
+ * Pages are laid out in rows starting at the bottom right, proceeding
+ * towards the left {@literal &} top.
*/
public static final PresentationDirection TOLEFT_TOTOP =
new PresentationDirection(7);
@@ -113,12 +117,15 @@
* Construct a new presentation direction enumeration value with the given
* integer value.
*
- * @param value Integer value.
+ * @param value Integer value
*/
private PresentationDirection(int value) {
super (value);
}
+ /**
+ * The string table for class {@code PresentationDirection}.
+ */
private static final String[] myStringTable = {
"tobottom-toright",
"tobottom-toleft",
@@ -130,6 +137,9 @@
"toleft-totop",
};
+ /**
+ * The enumeration value table for class {@code PresentationDirection}.
+ */
private static final PresentationDirection[] myEnumValueTable = {
TOBOTTOM_TORIGHT,
TOBOTTOM_TOLEFT,
@@ -142,14 +152,15 @@
};
/**
- * Returns the string table for class PresentationDirection.
+ * Returns the string table for class {@code PresentationDirection}.
*/
protected String[] getStringTable() {
return myStringTable;
}
/**
- * Returns the enumeration value table for class PresentationDirection.
+ * Returns the enumeration value table for class
+ * {@code PresentationDirection}.
*/
protected EnumSyntax[] getEnumValueTable() {
return myEnumValueTable;
@@ -158,12 +169,12 @@
/**
* Get the printing attribute class which is to be used as the "category"
* for this printing attribute value.
- *
- * For class PresentationDirection
- * the category is class PresentationDirection itself.
+ *
+ * For class {@code PresentationDirection} the category is class
+ * {@code PresentationDirection} itself.
*
- * @return Printing attribute class (category), an instance of class
- * {@link java.lang.Class java.lang.Class}.
+ * @return printing attribute class (category), an instance of class
+ * {@link Class java.lang.Class}
*/
public final Class extends Attribute> getCategory() {
return PresentationDirection.class;
@@ -172,14 +183,13 @@
/**
* Get the name of the category of which this attribute value is an
* instance.
- *
- * For class PresentationDirection
- * the category name is {@code "presentation-direction"}.
+ *
+ * For class {@code PresentationDirection} the category name is
+ * {@code "presentation-direction"}.
*
- * @return Attribute category name.
+ * @return attribute category name
*/
public final String getName() {
return "presentation-direction";
}
-
}
diff -r 000f4e4ddd39 -r 57173ad5c534 jdk/src/java.desktop/share/classes/javax/print/attribute/standard/PrintQuality.java
--- a/jdk/src/java.desktop/share/classes/javax/print/attribute/standard/PrintQuality.java Fri Sep 01 14:13:40 2017 +0000
+++ b/jdk/src/java.desktop/share/classes/javax/print/attribute/standard/PrintQuality.java Sat Sep 09 14:36:45 2017 +0200
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2000, 2014, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2000, 2017, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
@@ -22,30 +22,35 @@
* or visit www.oracle.com if you need additional information or have any
* questions.
*/
+
package javax.print.attribute.standard;
import javax.print.attribute.Attribute;
+import javax.print.attribute.DocAttribute;
import javax.print.attribute.EnumSyntax;
-import javax.print.attribute.DocAttribute;
+import javax.print.attribute.PrintJobAttribute;
import javax.print.attribute.PrintRequestAttribute;
-import javax.print.attribute.PrintJobAttribute;
/**
- * Class PrintQuality is a printing attribute class, an enumeration,
+ * Class {@code PrintQuality} is a printing attribute class, an enumeration,
* that specifies the print quality that the printer uses for the job.
- *
- * IPP Compatibility: The category name returned by
- * {@code getName()} is the IPP attribute name. The enumeration's
- * integer value is the IPP enum value. The {@code toString()} method
- * returns the IPP string representation of the attribute value.
+ *
+ * IPP Compatibility: The category name returned by {@code getName()} is
+ * the IPP attribute name. The enumeration's integer value is the IPP enum
+ * value. The {@code toString()} method returns the IPP string representation of
+ * the attribute value.
*
- * @author David Mendenhall
- * @author Alan Kaminsky
+ * @author David Mendenhall
+ * @author Alan Kaminsky
*/
public class PrintQuality extends EnumSyntax
implements DocAttribute, PrintRequestAttribute, PrintJobAttribute {
+ /**
+ * Use serialVersionUID from JDK 1.4 for interoperability.
+ */
private static final long serialVersionUID = -3072341285225858365L;
+
/**
* Lowest quality available on the printer.
*/
@@ -65,18 +70,24 @@
* Construct a new print quality enumeration value with the given integer
* value.
*
- * @param value Integer value.
+ * @param value Integer value
*/
protected PrintQuality(int value) {
super (value);
}
+ /**
+ * The string table for class {@code PrintQuality}.
+ */
private static final String[] myStringTable = {
"draft",
"normal",
"high"
};
+ /**
+ * The enumeration value table for class {@code PrintQuality}.
+ */
private static final PrintQuality[] myEnumValueTable = {
DRAFT,
NORMAL,
@@ -84,21 +95,21 @@
};
/**
- * Returns the string table for class PrintQuality.
+ * Returns the string table for class {@code PrintQuality}.
*/
protected String[] getStringTable() {
return myStringTable.clone();
}
/**
- * Returns the enumeration value table for class PrintQuality.
+ * Returns the enumeration value table for class {@code PrintQuality}.
*/
protected EnumSyntax[] getEnumValueTable() {
return (EnumSyntax[])myEnumValueTable.clone();
}
/**
- * Returns the lowest integer value used by class PrintQuality.
+ * Returns the lowest integer value used by class {@code PrintQuality}.
*/
protected int getOffset() {
return 3;
@@ -107,12 +118,12 @@
/**
* Get the printing attribute class which is to be used as the "category"
* for this printing attribute value.
- *
- * For class PrintQuality and any vendor-defined subclasses, the category is
- * class PrintQuality itself.
+ *
+ * For class {@code PrintQuality} and any vendor-defined subclasses, the
+ * category is class {@code PrintQuality} itself.
*
- * @return Printing attribute class (category), an instance of class
- * {@link java.lang.Class java.lang.Class}.
+ * @return printing attribute class (category), an instance of class
+ * {@link Class java.lang.Class}
*/
public final Class extends Attribute> getCategory() {
return PrintQuality.class;
@@ -121,14 +132,13 @@
/**
* Get the name of the category of which this attribute value is an
* instance.
- *
- * For class PrintQuality and any vendor-defined subclasses, the category
- * name is {@code "print-quality"}.
+ *
+ * For class {@code PrintQuality} and any vendor-defined subclasses, the
+ * category name is {@code "print-quality"}.
*
- * @return Attribute category name.
+ * @return attribute category name
*/
public final String getName() {
return "print-quality";
}
-
}
diff -r 000f4e4ddd39 -r 57173ad5c534 jdk/src/java.desktop/share/classes/javax/print/attribute/standard/PrinterInfo.java
--- a/jdk/src/java.desktop/share/classes/javax/print/attribute/standard/PrinterInfo.java Fri Sep 01 14:13:40 2017 +0000
+++ b/jdk/src/java.desktop/share/classes/javax/print/attribute/standard/PrinterInfo.java Sat Sep 09 14:36:45 2017 +0200
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2000, 2014, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2000, 2017, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
@@ -22,45 +22,47 @@
* or visit www.oracle.com if you need additional information or have any
* questions.
*/
+
package javax.print.attribute.standard;
import java.util.Locale;
import javax.print.attribute.Attribute;
+import javax.print.attribute.PrintServiceAttribute;
import javax.print.attribute.TextSyntax;
-import javax.print.attribute.PrintServiceAttribute;
/**
- * Class PrinterInfo is a printing attribute class, a text attribute, that
- * provides descriptive information about a printer. This could include things
- * like: {@code "This printer can be used for printing color transparencies for
- * HR presentations"}, or {@code "Out of courtesy for others, please
- * print only small (1-5 page) jobs at this printer"}, or even
+ * Class {@code PrinterInfo} is a printing attribute class, a text attribute,
+ * that provides descriptive information about a printer. This could include
+ * things like: {@code "This printer can be used for printing color
+ * transparencies for HR presentations"}, or {@code "Out of courtesy for others,
+ * please print only small (1-5 page) jobs at this printer"}, or even
* {@code "This printer is going away on July 1, 1997, please find a new
* printer"}.
- *
- * IPP Compatibility: The string value gives the IPP name value. The
- * locale gives the IPP natural language. The category name returned by
- * {@code getName()} gives the IPP attribute name.
+ *
+ * IPP Compatibility: The string value gives the IPP name value. The
+ * locale gives the IPP natural language. The category name returned by {@code
+ * getName()} gives the IPP attribute name.
*
- * @author Alan Kaminsky
+ * @author Alan Kaminsky
*/
public final class PrinterInfo extends TextSyntax
implements PrintServiceAttribute {
+ /**
+ * Use serialVersionUID from JDK 1.4 for interoperability.
+ */
private static final long serialVersionUID = 7765280618777599727L;
/**
- * Constructs a new printer info attribute with the given information
- * string and locale.
+ * Constructs a new printer info attribute with the given information string
+ * and locale.
*
- * @param info Printer information string.
- * @param locale Natural language of the text string. null
- * is interpreted to mean the default locale as returned
- * by {@code Locale.getDefault()}
- *
- * @exception NullPointerException
- * (unchecked exception) Thrown if {@code info} is null.
+ * @param info printer information string
+ * @param locale natural language of the text string. {@code null} is
+ * interpreted to mean the default locale as returned by
+ * {@code Locale.getDefault()}
+ * @throws NullPointerException if {@code info} is {@code null}
*/
public PrinterInfo(String info, Locale locale) {
super (info, locale);
@@ -70,23 +72,18 @@
* Returns whether this printer info attribute is equivalent to the passed
* in object. To be equivalent, all of the following conditions must be
* true:
- *
- * For class PrinterInfo, the category is class PrinterInfo itself.
+ *
+ * For class {@code PrinterInfo}, the category is class
+ * {@code PrinterInfo} itself.
*
- * @return Printing attribute class (category), an instance of class
- * {@link java.lang.Class java.lang.Class}.
+ * @return printing attribute class (category), an instance of class
+ * {@link Class java.lang.Class}
*/
public final Class extends Attribute> getCategory() {
return PrinterInfo.class;
@@ -108,13 +106,13 @@
/**
* Get the name of the category of which this attribute value is an
* instance.
- *
- * For class PrinterInfo, the category name is {@code "printer-info"}.
+ *
+ * For class {@code PrinterInfo}, the category name is
+ * {@code "printer-info"}.
*
- * @return Attribute category name.
+ * @return attribute category name
*/
public final String getName() {
return "printer-info";
}
-
}
diff -r 000f4e4ddd39 -r 57173ad5c534 jdk/src/java.desktop/share/classes/javax/print/attribute/standard/PrinterIsAcceptingJobs.java
--- a/jdk/src/java.desktop/share/classes/javax/print/attribute/standard/PrinterIsAcceptingJobs.java Fri Sep 01 14:13:40 2017 +0000
+++ b/jdk/src/java.desktop/share/classes/javax/print/attribute/standard/PrinterIsAcceptingJobs.java Sat Sep 09 14:36:45 2017 +0200
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2000, 2014, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2000, 2017, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
@@ -22,6 +22,7 @@
* or visit www.oracle.com if you need additional information or have any
* questions.
*/
+
package javax.print.attribute.standard;
import javax.print.attribute.Attribute;
@@ -29,26 +30,30 @@
import javax.print.attribute.PrintServiceAttribute;
/**
- * Class PrinterIsAcceptingJobs is a printing attribute class, an enumeration,
- * that indicates whether the printer is currently able to accept jobs. This
- * value is independent of the {@link PrinterState PrinterState} and {@link
- * PrinterStateReasons PrinterStateReasons} attributes because its value does
- * not affect the current job; rather it affects future jobs. If the value is
- * NOT_ACCEPTING_JOBS, the printer will reject jobs even when the {@link
- * PrinterState PrinterState} is IDLE. If value is ACCEPTING_JOBS, the Printer
- * will accept jobs even when the {@link PrinterState PrinterState} is STOPPED.
- *
- * IPP Compatibility: The IPP boolean value is "true" for ACCEPTING_JOBS
- * and "false" for NOT_ACCEPTING_JOBS. The category name returned by
- * {@code getName()} is the IPP attribute name. The enumeration's
- * integer value is the IPP enum value. The {@code toString()} method
- * returns the IPP string representation of the attribute value.
+ * Class {@code PrinterIsAcceptingJobs} is a printing attribute class, an
+ * enumeration, that indicates whether the printer is currently able to accept
+ * jobs. This value is independent of the {@link PrinterState PrinterState} and
+ * {@link PrinterStateReasons PrinterStateReasons} attributes because its value
+ * does not affect the current job; rather it affects future jobs. If the value
+ * is {@code NOT_ACCEPTING_JOBS}, the printer will reject jobs even when the
+ * {@link PrinterState PrinterState} is {@code IDLE}. If value is
+ * {@code ACCEPTING_JOBS}, the Printer will accept jobs even when the
+ * {@link PrinterState PrinterState} is {@code STOPPED}.
+ *
+ * IPP Compatibility: The IPP boolean value is "true" for
+ * {@code ACCEPTING_JOBS} and "false" for {@code NOT_ACCEPTING_JOBS}. The
+ * category name returned by {@code getName()} is the IPP attribute name. The
+ * enumeration's integer value is the IPP enum value. The {@code toString()}
+ * method returns the IPP string representation of the attribute value.
*
- * @author Alan Kaminsky
+ * @author Alan Kaminsky
*/
public final class PrinterIsAcceptingJobs extends EnumSyntax
implements PrintServiceAttribute {
+ /**
+ * Use serialVersionUID from JDK 1.4 for interoperability.
+ */
private static final long serialVersionUID = -5052010680537678061L;
/**
@@ -67,31 +72,38 @@
* Construct a new printer is accepting jobs enumeration value with the
* given integer value.
*
- * @param value Integer value.
+ * @param value Integer value
*/
protected PrinterIsAcceptingJobs(int value) {
super (value);
}
+ /**
+ * The string table for class {@code PrinterIsAcceptingJobs}.
+ */
private static final String[] myStringTable = {
"not-accepting-jobs",
"accepting-jobs"
};
+ /**
+ * The enumeration value table for class {@code PrinterIsAcceptingJobs}.
+ */
private static final PrinterIsAcceptingJobs[] myEnumValueTable = {
NOT_ACCEPTING_JOBS,
ACCEPTING_JOBS
};
/**
- * Returns the string table for class PrinterIsAcceptingJobs.
+ * Returns the string table for class {@code PrinterIsAcceptingJobs}.
*/
protected String[] getStringTable() {
return myStringTable;
}
/**
- * Returns the enumeration value table for class PrinterIsAcceptingJobs.
+ * Returns the enumeration value table for class
+ * {@code PrinterIsAcceptingJobs}.
*/
protected EnumSyntax[] getEnumValueTable() {
return myEnumValueTable;
@@ -100,12 +112,12 @@
/**
* Get the printing attribute class which is to be used as the "category"
* for this printing attribute value.
- *
- * For class PrinterIsAcceptingJobs, the
- * category is class PrinterIsAcceptingJobs itself.
+ *
+ * For class {@code PrinterIsAcceptingJobs}, the category is class
+ * {@code PrinterIsAcceptingJobs} itself.
*
- * @return Printing attribute class (category), an instance of class
- * {@link java.lang.Class java.lang.Class}.
+ * @return printing attribute class (category), an instance of class
+ * {@link Class java.lang.Class}
*/
public final Class extends Attribute> getCategory() {
return PrinterIsAcceptingJobs.class;
@@ -114,14 +126,13 @@
/**
* Get the name of the category of which this attribute value is an
* instance.
- *
- * For class PrinterIsAcceptingJobs, the
- * category name is {@code "printer-is-accepting-jobs"}.
+ *
+ * For class {@code PrinterIsAcceptingJobs}, the category name is
+ * {@code "printer-is-accepting-jobs"}.
*
- * @return Attribute category name.
+ * @return attribute category name
*/
public final String getName() {
return "printer-is-accepting-jobs";
}
-
}
diff -r 000f4e4ddd39 -r 57173ad5c534 jdk/src/java.desktop/share/classes/javax/print/attribute/standard/PrinterLocation.java
--- a/jdk/src/java.desktop/share/classes/javax/print/attribute/standard/PrinterLocation.java Fri Sep 01 14:13:40 2017 +0000
+++ b/jdk/src/java.desktop/share/classes/javax/print/attribute/standard/PrinterLocation.java Sat Sep 09 14:36:45 2017 +0200
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2000, 2014, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2000, 2017, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
@@ -22,41 +22,43 @@
* or visit www.oracle.com if you need additional information or have any
* questions.
*/
+
package javax.print.attribute.standard;
import java.util.Locale;
import javax.print.attribute.Attribute;
+import javax.print.attribute.PrintServiceAttribute;
import javax.print.attribute.TextSyntax;
-import javax.print.attribute.PrintServiceAttribute;
/**
- * Class PrinterLocation is a printing attribute class, a text attribute, that
- * identifies the location of the device. This could include things like:
- * {@code "in Room 123A, second floor of building XYZ"}.
- *
- * IPP Compatibility: The string value gives the IPP name value. The
+ * Class {@code PrinterLocation} is a printing attribute class, a text
+ * attribute, that identifies the location of the device. This could include
+ * things like: {@code "in Room 123A, second floor of building XYZ"}.
+ *
+ * IPP Compatibility: The string value gives the IPP name value. The
* locale gives the IPP natural language. The category name returned by
* {@code getName()} gives the IPP attribute name.
*
- * @author Alan Kaminsky
+ * @author Alan Kaminsky
*/
public final class PrinterLocation extends TextSyntax
implements PrintServiceAttribute {
+ /**
+ * Use serialVersionUID from JDK 1.4 for interoperability.
+ */
private static final long serialVersionUID = -1598610039865566337L;
/**
* Constructs a new printer location attribute with the given location and
* locale.
*
- * @param location Printer location.
- * @param locale Natural language of the text string. null
- * is interpreted to mean the default locale as returned
- * by {@code Locale.getDefault()}
- *
- * @exception NullPointerException
- * (unchecked exception) Thrown if {@code location} is null.
+ * @param location printer location
+ * @param locale natural language of the text string. {@code null} is
+ * interpreted to mean the default locale as returned by
+ * {@code Locale.getDefault()}
+ * @throws NullPointerException if {@code location} is {@code null}
*/
public PrinterLocation(String location, Locale locale) {
super (location, locale);
@@ -64,25 +66,20 @@
/**
* Returns whether this printer location attribute is equivalent to the
- * passed in object. To be equivalent, all of the following conditions
- * must be true:
- *
- * For class PrinterLocation, the
- * category is class PrinterLocation itself.
+ *
+ * For class {@code PrinterLocation}, the category is class
+ * {@code PrinterLocation} itself.
*
- * @return Printing attribute class (category), an instance of class
- * {@link java.lang.Class java.lang.Class}.
+ * @return printing attribute class (category), an instance of class
+ * {@link Class java.lang.Class}
*/
public final Class extends Attribute> getCategory() {
return PrinterLocation.class;
@@ -105,14 +102,13 @@
/**
* Get the name of the category of which this attribute value is an
* instance.
- *
- * For class PrinterLocation, the
- * category name is {@code "printer-location"}.
+ *
+ * For class {@code PrinterLocation}, the category name is
+ * {@code "printer-location"}.
*
- * @return Attribute category name.
+ * @return attribute category name
*/
public final String getName() {
return "printer-location";
}
-
}
diff -r 000f4e4ddd39 -r 57173ad5c534 jdk/src/java.desktop/share/classes/javax/print/attribute/standard/PrinterMakeAndModel.java
--- a/jdk/src/java.desktop/share/classes/javax/print/attribute/standard/PrinterMakeAndModel.java Fri Sep 01 14:13:40 2017 +0000
+++ b/jdk/src/java.desktop/share/classes/javax/print/attribute/standard/PrinterMakeAndModel.java Sat Sep 09 14:36:45 2017 +0200
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2000, 2014, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2000, 2017, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
@@ -22,39 +22,42 @@
* or visit www.oracle.com if you need additional information or have any
* questions.
*/
+
package javax.print.attribute.standard;
import java.util.Locale;
+
import javax.print.attribute.Attribute;
+import javax.print.attribute.PrintServiceAttribute;
import javax.print.attribute.TextSyntax;
-import javax.print.attribute.PrintServiceAttribute;
/**
- * Class PrinterMakeAndModel is a printing attribute class, a text attribute,
- * that the make and model of the printer.
- *
- * IPP Compatibility: The string value gives the IPP name value. The
+ * Class {@code PrinterMakeAndModel} is a printing attribute class, a text
+ * attribute, that the make and model of the printer.
+ *
+ * IPP Compatibility: The string value gives the IPP name value. The
* locale gives the IPP natural language. The category name returned by
* {@code getName()} gives the IPP attribute name.
*
- * @author Alan Kaminsky
+ * @author Alan Kaminsky
*/
public final class PrinterMakeAndModel extends TextSyntax
implements PrintServiceAttribute {
+ /**
+ * Use serialVersionUID from JDK 1.4 for interoperability.
+ */
private static final long serialVersionUID = 4580461489499351411L;
/**
- * Constructs a new printer make and model attribute with the given make
- * and model string and locale.
+ * Constructs a new printer make and model attribute with the given make and
+ * model string and locale.
*
- * @param makeAndModel Printer make and model string.
- * @param locale Natural language of the text string. null
- * is interpreted to mean the default locale as returned
- * by {@code Locale.getDefault()}
- *
- * @exception NullPointerException
- * (unchecked exception) Thrown if {@code makeAndModel} is null.
+ * @param makeAndModel printer make and model string
+ * @param locale natural language of the text string. {@code null} is
+ * interpreted to mean the default locale as returned by
+ * {@code Locale.getDefault()}
+ * @throws NullPointerException if {@code makeAndModel} is {@code null}
*/
public PrinterMakeAndModel(String makeAndModel, Locale locale) {
super (makeAndModel, locale);
@@ -64,23 +67,18 @@
* Returns whether this printer make and model attribute is equivalent to
* the passed in object. To be equivalent, all of the following conditions
* must be true:
- *
- * For class PrinterMakeAndModel, the
- * category is class PrinterMakeAndModel itself.
+ *
+ * For class {@code PrinterMakeAndModel}, the category is class
+ * {@code PrinterMakeAndModel} itself.
*
- * @return Printing attribute class (category), an instance of class
- * {@link java.lang.Class java.lang.Class}.
+ * @return printing attribute class (category), an instance of class
+ * {@link Class java.lang.Class}
*/
public final Class extends Attribute> getCategory() {
return PrinterMakeAndModel.class;
@@ -104,14 +102,13 @@
/**
* Get the name of the category of which this attribute value is an
* instance.
- *
- * For class PrinterMakeAndModel, the
- * category name is {@code "printer-make-and-model"}.
+ *
+ * For class {@code PrinterMakeAndModel}, the category name is
+ * {@code "printer-make-and-model"}.
*
- * @return Attribute category name.
+ * @return attribute category name
*/
public final String getName() {
return "printer-make-and-model";
}
-
}
diff -r 000f4e4ddd39 -r 57173ad5c534 jdk/src/java.desktop/share/classes/javax/print/attribute/standard/PrinterMessageFromOperator.java
--- a/jdk/src/java.desktop/share/classes/javax/print/attribute/standard/PrinterMessageFromOperator.java Fri Sep 01 14:13:40 2017 +0000
+++ b/jdk/src/java.desktop/share/classes/javax/print/attribute/standard/PrinterMessageFromOperator.java Sat Sep 09 14:36:45 2017 +0200
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2000, 2014, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2000, 2017, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
@@ -22,54 +22,54 @@
* or visit www.oracle.com if you need additional information or have any
* questions.
*/
+
package javax.print.attribute.standard;
import java.util.Locale;
import javax.print.attribute.Attribute;
+import javax.print.attribute.PrintServiceAttribute;
import javax.print.attribute.TextSyntax;
-import javax.print.attribute.PrintServiceAttribute;
/**
- * Class PrinterMessageFromOperator is a printing attribute class, a text
- * attribute, that provides a message from an operator, system administrator,
- * or "intelligent" process to indicate to the end user information about or
- * status of the printer, such as why it is unavailable or when it is
- * expected to be available.
- *
- * A Print Service's attribute set includes zero instances or one instance of
- * a
- * PrinterMessageFromOperator attribute, not more than one instance. A new
- * PrinterMessageFromOperator attribute replaces an existing
- * PrinterMessageFromOperator attribute, if any. In other words,
- * PrinterMessageFromOperator is not intended to be a history log.
- * If it wishes, the client can detect changes to a Print Service's
- * PrinterMessageFromOperator
- * attribute and maintain the client's own history log of the
- * PrinterMessageFromOperator attribute values.
- *
- * IPP Compatibility: The string value gives the IPP name value. The
+ * Class {@code PrinterMessageFromOperator} is a printing attribute class, a
+ * text attribute, that provides a message from an operator, system
+ * administrator, or "intelligent" process to indicate to the end user
+ * information about or status of the printer, such as why it is unavailable or
+ * when it is expected to be available.
+ *
+ * A Print Service's attribute set includes zero instances or one instance of a
+ * {@code PrinterMessageFromOperator} attribute, not more than one instance. A
+ * new {@code PrinterMessageFromOperator} attribute replaces an existing
+ * {@code PrinterMessageFromOperator} attribute, if any. In other words,
+ * {@code PrinterMessageFromOperator} is not intended to be a history log. If it
+ * wishes, the client can detect changes to a Print Service's
+ * {@code PrinterMessageFromOperator} attribute and maintain the client's own
+ * history log of the {@code PrinterMessageFromOperator} attribute values.
+ *
+ * IPP Compatibility: The string value gives the IPP name value. The
* locale gives the IPP natural language. The category name returned by
* {@code getName()} gives the IPP attribute name.
*
- * @author Alan Kaminsky
+ * @author Alan Kaminsky
*/
public final class PrinterMessageFromOperator extends TextSyntax
implements PrintServiceAttribute {
+ /**
+ * Use serialVersionUID from JDK 1.4 for interoperability.
+ */
static final long serialVersionUID = -4486871203218629318L;
/**
- * Constructs a new printer message from operator attribute with the
- * given message and locale.
+ * Constructs a new printer message from operator attribute with the given
+ * message and locale.
*
- * @param message Message.
- * @param locale Natural language of the text string. null
- * is interpreted to mean the default locale as returned
- * by {@code Locale.getDefault()}
- *
- * @exception NullPointerException
- * (unchecked exception) Thrown if {@code message} is null.
+ * @param message the message
+ * @param locale natural language of the text string. {@code null} is
+ * interpreted to mean the default locale as returned by
+ * {@code Locale.getDefault()}
+ * @throws NullPointerException if {@code message} is {@code null}
*/
public PrinterMessageFromOperator(String message, Locale locale) {
super (message, locale);
@@ -79,24 +79,19 @@
* Returns whether this printer message from operator attribute is
* equivalent to the passed in object. To be equivalent, all of the
* following conditions must be true:
- *
- * For class PrinterMessageFromOperator,
- * the category is class PrinterMessageFromOperator itself.
+ *
+ * For class {@code PrinterMessageFromOperator}, the category is class
+ * {@code PrinterMessageFromOperator} itself.
*
- * @return Printing attribute class (category), an instance of class
- * {@link java.lang.Class java.lang.Class}.
+ * @return printing attribute class (category), an instance of class
+ * {@link Class java.lang.Class}
*/
public final Class extends Attribute> getCategory() {
return PrinterMessageFromOperator.class;
@@ -120,14 +115,13 @@
/**
* Get the name of the category of which this attribute value is an
* instance.
- *
- * For class PrinterMessageFromOperator,
- * the category name is {@code "printer-message-from-operator"}.
+ *
+ * For class {@code PrinterMessageFromOperator}, the category name is
+ * {@code "printer-message-from-operator"}.
*
- * @return Attribute category name.
+ * @return attribute category name
*/
public final String getName() {
return "printer-message-from-operator";
}
-
}
diff -r 000f4e4ddd39 -r 57173ad5c534 jdk/src/java.desktop/share/classes/javax/print/attribute/standard/PrinterMoreInfo.java
--- a/jdk/src/java.desktop/share/classes/javax/print/attribute/standard/PrinterMoreInfo.java Fri Sep 01 14:13:40 2017 +0000
+++ b/jdk/src/java.desktop/share/classes/javax/print/attribute/standard/PrinterMoreInfo.java Sat Sep 09 14:36:45 2017 +0200
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2000, 2014, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2000, 2017, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
@@ -22,48 +22,50 @@
* or visit www.oracle.com if you need additional information or have any
* questions.
*/
+
package javax.print.attribute.standard;
import java.net.URI;
import javax.print.attribute.Attribute;
+import javax.print.attribute.PrintServiceAttribute;
import javax.print.attribute.URISyntax;
-import javax.print.attribute.PrintServiceAttribute;
/**
- * Class PrinterMoreInfo is a printing attribute class, a URI, that is used to
- * obtain more information about this specific printer. For example, this
- * could be an HTTP type URI referencing an HTML page accessible to a web
- * browser. The information obtained from this URI is intended for end user
- * consumption. Features outside the scope of the Print Service API can be
- * accessed from this URI.
- * The information is intended to be specific to this printer instance and
- * site specific services (e.g. job pricing, services offered, end user
- * assistance).
- *
- * In contrast, the {@link PrinterMoreInfoManufacturer
- * PrinterMoreInfoManufacturer} attribute is used to find out more information
- * about this general kind of printer rather than this specific printer.
- *
- * IPP Compatibility: The string form returned by
- * {@code toString()} gives the IPP uri value.
- * The category name returned by {@code getName()}
+ * Class {@code PrinterMoreInfo} is a printing attribute class, a {@code URI},
+ * that is used to obtain more information about this specific printer. For
+ * example, this could be an HTTP type {@code URI} referencing an HTML page
+ * accessible to a web browser. The information obtained from this {@code URI}
+ * is intended for end user consumption. Features outside the scope of the Print
+ * Service API can be accessed from this {@code URI}. The information is
+ * intended to be specific to this printer instance and site specific services
+ * (e.g. job pricing, services offered, end user assistance).
+ *
+ * In contrast, the
+ * {@link PrinterMoreInfoManufacturer PrinterMoreInfoManufacturer} attribute is
+ * used to find out more information about this general kind of printer rather
+ * than this specific printer.
+ *
+ * IPP Compatibility: The string form returned by {@code toString()}
+ * gives the IPP uri value. The category name returned by {@code getName()}
* gives the IPP attribute name.
*
- * @author Alan Kaminsky
+ * @author Alan Kaminsky
*/
public final class PrinterMoreInfo extends URISyntax
implements PrintServiceAttribute {
+ /**
+ * Use serialVersionUID from JDK 1.4 for interoperability.
+ */
private static final long serialVersionUID = 4555850007675338574L;
/**
- * Constructs a new printer more info attribute with the specified URI.
+ * Constructs a new printer more info attribute with the specified
+ * {@code URI}.
*
- * @param uri URI.
- *
- * @exception NullPointerException
- * (unchecked exception) Thrown if {@code uri} is null.
+ * @param uri {@code URI}
+ * @throws NullPointerException if {@code uri} is {@code null}
*/
public PrinterMoreInfo(URI uri) {
super (uri);
@@ -71,22 +73,18 @@
/**
* Returns whether this printer more info attribute is equivalent to the
- * passed in object. To be equivalent, all of the following conditions
- * must be true:
- *
- * For class PrinterMoreInfo, the category is class PrinterMoreInfo itself.
+ *
+ * For class {@code PrinterMoreInfo}, the category is class
+ * {@code PrinterMoreInfo} itself.
*
- * @return Printing attribute class (category), an instance of class
- * {@link java.lang.Class java.lang.Class}.
+ * @return printing attribute class (category), an instance of class
+ * {@link Class java.lang.Class}
*/
public final Class extends Attribute> getCategory() {
return PrinterMoreInfo.class;
@@ -109,14 +108,13 @@
/**
* Get the name of the category of which this attribute value is an
* instance.
- *
- * For class PrinterMoreInfo, the
- * category name is {@code "printer-more-info"}.
+ *
+ * For class {@code PrinterMoreInfo}, the category name is
+ * {@code "printer-more-info"}.
*
- * @return Attribute category name.
+ * @return attribute category name
*/
public final String getName() {
return "printer-more-info";
}
-
}
diff -r 000f4e4ddd39 -r 57173ad5c534 jdk/src/java.desktop/share/classes/javax/print/attribute/standard/PrinterMoreInfoManufacturer.java
--- a/jdk/src/java.desktop/share/classes/javax/print/attribute/standard/PrinterMoreInfoManufacturer.java Fri Sep 01 14:13:40 2017 +0000
+++ b/jdk/src/java.desktop/share/classes/javax/print/attribute/standard/PrinterMoreInfoManufacturer.java Sat Sep 09 14:36:45 2017 +0200
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2000, 2014, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2000, 2017, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
@@ -22,49 +22,49 @@
* or visit www.oracle.com if you need additional information or have any
* questions.
*/
+
package javax.print.attribute.standard;
import java.net.URI;
import javax.print.attribute.Attribute;
+import javax.print.attribute.PrintServiceAttribute;
import javax.print.attribute.URISyntax;
-import javax.print.attribute.PrintServiceAttribute;
/**
- * Class PrinterMoreInfoManufacturer is a printing attribute class, a URI,
- * that is used to obtain more information about this type of device.
- * The information obtained from this URI is intended for end user
- * consumption. Features outside the scope of the Print Service API
- * can be accessed from this URI (e.g.,
- * latest firmware, upgrades, service proxies, optional features available,
- * details on color support). The information is intended to be germane to
- * this kind of printer without regard to site specific modifications or
- * services.
- *
- * In contrast, the {@link PrinterMoreInfo PrinterMoreInfo} attribute is used
- * to find out more information about this specific printer rather than this
+ * Class {@code PrinterMoreInfoManufacturer} is a printing attribute class, a
+ * {@code URI}, that is used to obtain more information about this type of
+ * device. The information obtained from this {@code URI} is intended for end
+ * user consumption. Features outside the scope of the Print Service API can be
+ * accessed from this {@code URI} (e.g., latest firmware, upgrades, service
+ * proxies, optional features available, details on color support). The
+ * information is intended to be germane to this kind of printer without regard
+ * to site specific modifications or services.
+ *
+ * In contrast, the {@link PrinterMoreInfo PrinterMoreInfo} attribute is used to
+ * find out more information about this specific printer rather than this
* general kind of printer.
- *
- * IPP Compatibility: The string form returned by
- * {@code toString()} gives the IPP uri value.
- * The category name returned by {@code getName()}
+ *
+ * IPP Compatibility: The string form returned by {@code toString()}
+ * gives the IPP uri value. The category name returned by {@code getName()}
* gives the IPP attribute name.
*
- * @author Alan Kaminsky
+ * @author Alan Kaminsky
*/
public final class PrinterMoreInfoManufacturer extends URISyntax
implements PrintServiceAttribute {
+ /**
+ * Use serialVersionUID from JDK 1.4 for interoperability.
+ */
private static final long serialVersionUID = 3323271346485076608L;
/**
* Constructs a new printer more info manufacturer attribute with the
- * specified URI.
+ * specified {@code URI}.
*
- * @param uri URI.
- *
- * @exception NullPointerException
- * (unchecked exception) Thrown if {@code uri} is null.
+ * @param uri {@code URI}
+ * @throws NullPointerException if {@code uri} is {@code null}
*/
public PrinterMoreInfoManufacturer(URI uri) {
super (uri);
@@ -74,21 +74,17 @@
* Returns whether this printer more info manufacturer attribute is
* equivalent to the passed in object. To be equivalent, all of the
* following conditions must be true:
- *
- * For class PrinterMoreInfoManufacturer, the category is
- * class PrinterMoreInfoManufacturer itself.
+ *
+ * For class {@code PrinterMoreInfoManufacturer}, the category is class
+ * {@code PrinterMoreInfoManufacturer} itself.
*
- * @return Printing attribute class (category), an instance of class
- * {@link java.lang.Class java.lang.Class}.
+ * @return printing attribute class (category), an instance of class
+ * {@link Class java.lang.Class}
*/
public final Class extends Attribute> getCategory() {
return PrinterMoreInfoManufacturer.class;
@@ -112,14 +108,13 @@
/**
* Get the name of the category of which this attribute value is an
* instance.
- *
- * For class PrinterMoreInfoManufacturer, the category name is
+ *
+ * For class {@code PrinterMoreInfoManufacturer}, the category name is
* {@code "printer-more-info-manufacturer"}.
*
- * @return Attribute category name.
+ * @return attribute category name
*/
public final String getName() {
return "printer-more-info-manufacturer";
}
-
}
diff -r 000f4e4ddd39 -r 57173ad5c534 jdk/src/java.desktop/share/classes/javax/print/attribute/standard/PrinterName.java
--- a/jdk/src/java.desktop/share/classes/javax/print/attribute/standard/PrinterName.java Fri Sep 01 14:13:40 2017 +0000
+++ b/jdk/src/java.desktop/share/classes/javax/print/attribute/standard/PrinterName.java Sat Sep 09 14:36:45 2017 +0200
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2000, 2014, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2000, 2017, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
@@ -22,43 +22,45 @@
* or visit www.oracle.com if you need additional information or have any
* questions.
*/
+
package javax.print.attribute.standard;
import java.util.Locale;
import javax.print.attribute.Attribute;
+import javax.print.attribute.PrintServiceAttribute;
import javax.print.attribute.TextSyntax;
-import javax.print.attribute.PrintServiceAttribute;
/**
- * Class PrinterName is a printing attribute class, a text attribute, that
- * specifies the name of a printer. It is a name that is more end-user friendly
- * than a URI. An administrator determines a printer's name and sets this
- * attribute to that name. This name may be the last part of the printer's URI
- * or it may be unrelated. In non-US-English locales, a name may contain
- * characters that are not allowed in a URI.
- *
- * IPP Compatibility: The string value gives the IPP name value. The
+ * Class {@code PrinterName} is a printing attribute class, a text attribute,
+ * that specifies the name of a printer. It is a name that is more end-user
+ * friendly than a {@code URI}. An administrator determines a printer's name and
+ * sets this attribute to that name. This name may be the last part of the
+ * printer's {@code URI} or it may be unrelated. In non-US-English locales, a
+ * name may contain characters that are not allowed in a {@code URI}.
+ *
+ * IPP Compatibility: The string value gives the IPP name value. The
* locale gives the IPP natural language. The category name returned by
* {@code getName()} gives the IPP attribute name.
*
- * @author Alan Kaminsky
+ * @author Alan Kaminsky
*/
public final class PrinterName extends TextSyntax
implements PrintServiceAttribute {
+ /**
+ * Use serialVersionUID from JDK 1.4 for interoperability.
+ */
private static final long serialVersionUID = 299740639137803127L;
/**
* Constructs a new printer name attribute with the given name and locale.
*
- * @param printerName Printer name.
- * @param locale Natural language of the text string. null
- * is interpreted to mean the default locale as returned
- * by {@code Locale.getDefault()}
- *
- * @exception NullPointerException
- * (unchecked exception) Thrown if {@code printerName} is null.
+ * @param printerName printer name
+ * @param locale natural language of the text string. {@code null} is
+ * interpreted to mean the default locale as returned by
+ * {@code Locale.getDefault()}
+ * @throws NullPointerException if {@code printerName} is {@code null}
*/
public PrinterName(String printerName, Locale locale) {
super (printerName, locale);
@@ -68,23 +70,18 @@
* Returns whether this printer name attribute is equivalent to the passed
* in object. To be equivalent, all of the following conditions must be
* true:
- *
- * For class PrinterName, the category is
- * class PrinterName itself.
+ *
+ * For class {@code PrinterName}, the category is class
+ * {@code PrinterName} itself.
*
- * @return Printing attribute class (category), an instance of class
- * {@link java.lang.Class java.lang.Class}.
+ * @return printing attribute class (category), an instance of class
+ * {@link Class java.lang.Class}
*/
public final Class extends Attribute> getCategory() {
return PrinterName.class;
@@ -107,14 +104,13 @@
/**
* Get the name of the category of which this attribute value is an
* instance.
- *
- * For class PrinterName, the category
- * name is {@code "printer-name"}.
+ *
+ * For class {@code PrinterName}, the category name is
+ * {@code "printer-name"}.
*
- * @return Attribute category name.
+ * @return attribute category name
*/
public final String getName() {
return "printer-name";
}
-
}
diff -r 000f4e4ddd39 -r 57173ad5c534 jdk/src/java.desktop/share/classes/javax/print/attribute/standard/PrinterResolution.java
--- a/jdk/src/java.desktop/share/classes/javax/print/attribute/standard/PrinterResolution.java Fri Sep 01 14:13:40 2017 +0000
+++ b/jdk/src/java.desktop/share/classes/javax/print/attribute/standard/PrinterResolution.java Sat Sep 09 14:36:45 2017 +0200
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2000, 2014, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2000, 2017, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
@@ -22,71 +22,66 @@
* or visit www.oracle.com if you need additional information or have any
* questions.
*/
+
package javax.print.attribute.standard;
import javax.print.attribute.Attribute;
+import javax.print.attribute.DocAttribute;
+import javax.print.attribute.PrintJobAttribute;
+import javax.print.attribute.PrintRequestAttribute;
import javax.print.attribute.ResolutionSyntax;
-import javax.print.attribute.DocAttribute;
-import javax.print.attribute.PrintRequestAttribute;
-import javax.print.attribute.PrintJobAttribute;
/**
- * Class PrinterResolution is a printing attribute class that specifies an
- * exact resolution supported by a printer or to be used for a print job.
+ * Class {@code PrinterResolution} is a printing attribute class that specifies
+ * an exact resolution supported by a printer or to be used for a print job.
* This attribute assumes that printers have a small set of device resolutions
* at which they can operate rather than a continuum.
*
- * PrinterResolution is used in multiple ways:
- *
+ * IPP Compatibility: The information needed to construct an IPP
+ * {@code "printer-resolution"} attribute can be obtained by calling methods on
+ * the PrinterResolution object. The category name returned by {@code getName()}
+ * gives the IPP attribute name.
*
- *
- * IPP Compatibility: The information needed to construct an IPP
- * {@code "printer-resolution"} attribute can be obtained by calling
- * methods on the PrinterResolution object. The category name returned by
- * {@code getName()} gives the IPP attribute name.
- *
- * @author David Mendenhall
- * @author Alan Kaminsky
+ * @author David Mendenhall
+ * @author Alan Kaminsky
*/
public final class PrinterResolution extends ResolutionSyntax
implements DocAttribute, PrintRequestAttribute, PrintJobAttribute {
+ /**
+ * Use serialVersionUID from JDK 1.4 for interoperability.
+ */
private static final long serialVersionUID = 13090306561090558L;
/**
* Construct a new printer resolution attribute from the given items.
*
- * @param crossFeedResolution
- * Cross feed direction resolution.
- * @param feedResolution
- * Feed direction resolution.
- * @param units
- * Unit conversion factor, e.g. {@code ResolutionSyntax.DPI}
- * or {@code ResolutionSyntax.DPCM}.
- *
- * @exception IllegalArgumentException
- * (unchecked exception) Thrown if {@code crossFeedResolution < 1} or
- * {@code feedResolution < 1} or {@code units < 1}.
+ * @param crossFeedResolution cross feed direction resolution
+ * @param feedResolution feed direction resolution
+ * @param units unit conversion factor, e.g. {@code ResolutionSyntax.DPI}
+ * or {@code ResolutionSyntax.DPCM}
+ * @throws IllegalArgumentException if {@code crossFeedResolution < 1} or
+ * {@code feedResolution < 1} or {@code units < 1}
*/
public PrinterResolution(int crossFeedResolution, int feedResolution,
int units) {
@@ -95,25 +90,20 @@
/**
* Returns whether this printer resolution attribute is equivalent to the
- * passed in object. To be equivalent, all of the following conditions
- * must be true:
- *
- * For class PrinterResolution, the category is class PrinterResolution itself.
+ *
+ * For class {@code PrinterResolution}, the category is class
+ * {@code PrinterResolution} itself.
*
- * @return Printing attribute class (category), an instance of class
- * {@link java.lang.Class java.lang.Class}.
+ * @return printing attribute class (category), an instance of class
+ * {@link Class java.lang.Class}
*/
public final Class extends Attribute> getCategory() {
return PrinterResolution.class;
- }
+ }
/**
* Get the name of the category of which this attribute value is an
* instance.
- *
- * For class PrinterResolution, the
- * category name is {@code "printer-resolution"}.
+ *
+ * For class {@code PrinterResolution}, the category name is
+ * {@code "printer-resolution"}.
*
- * @return Attribute category name.
+ * @return attribute category name
*/
public final String getName() {
return "printer-resolution";
}
-
}
diff -r 000f4e4ddd39 -r 57173ad5c534 jdk/src/java.desktop/share/classes/javax/print/attribute/standard/PrinterState.java
--- a/jdk/src/java.desktop/share/classes/javax/print/attribute/standard/PrinterState.java Fri Sep 01 14:13:40 2017 +0000
+++ b/jdk/src/java.desktop/share/classes/javax/print/attribute/standard/PrinterState.java Sat Sep 09 14:36:45 2017 +0200
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2000, 2014, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2000, 2017, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
@@ -22,6 +22,7 @@
* or visit www.oracle.com if you need additional information or have any
* questions.
*/
+
package javax.print.attribute.standard;
import javax.print.attribute.Attribute;
@@ -29,25 +30,28 @@
import javax.print.attribute.PrintServiceAttribute;
/**
- * Class PrinterState is a printing attribute class, an enumeration, that
- * identifies the current state of a printer. Class PrinterState defines
- * standard printer state values. A Print Service implementation only needs
- * to report those printer states which are appropriate for the particular
+ * Class {@code PrinterState} is a printing attribute class, an enumeration,
+ * that identifies the current state of a printer. Class {@code PrinterState}
+ * defines standard printer state values. A Print Service implementation only
+ * needs to report those printer states which are appropriate for the particular
* implementation; it does not have to report every defined printer state. The
* {@link PrinterStateReasons PrinterStateReasons} attribute augments the
- * PrinterState attribute to give more detailed information about the printer
- * in given printer state.
- *
- * IPP Compatibility: The category name returned by
- * {@code getName()} is the IPP attribute name. The enumeration's
- * integer value is the IPP enum value. The {@code toString()} method
- * returns the IPP string representation of the attribute value.
+ * {@code PrinterState} attribute to give more detailed information about the
+ * printer in given printer state.
+ *
+ * IPP Compatibility: The category name returned by {@code getName()} is
+ * the IPP attribute name. The enumeration's integer value is the IPP enum
+ * value. The {@code toString()} method returns the IPP string representation of
+ * the attribute value.
*
- * @author Alan Kaminsky
+ * @author Alan Kaminsky
*/
public final class PrinterState extends EnumSyntax
implements PrintServiceAttribute {
+ /**
+ * Use serialVersionUID from JDK 1.4 for interoperability.
+ */
private static final long serialVersionUID = -649578618346507718L;
/**
@@ -61,8 +65,7 @@
public static final PrinterState IDLE = new PrinterState(3);
/**
- * Indicates that jobs are processing;
- * new jobs will wait before processing.
+ * Indicates that jobs are processing; new jobs will wait before processing.
*/
public static final PrinterState PROCESSING = new PrinterState(4);
@@ -75,12 +78,15 @@
* Construct a new printer state enumeration value with the given integer
* value.
*
- * @param value Integer value.
+ * @param value Integer value
*/
protected PrinterState(int value) {
super (value);
}
+ /**
+ * The string table for class {@code PrinterState}.
+ */
private static final String[] myStringTable = {
"unknown",
null,
@@ -90,6 +96,9 @@
"stopped"
};
+ /**
+ * The enumeration value table for class {@code PrinterState}.
+ */
private static final PrinterState[] myEnumValueTable = {
UNKNOWN,
null,
@@ -100,14 +109,14 @@
};
/**
- * Returns the string table for class PrinterState.
+ * Returns the string table for class {@code PrinterState}.
*/
protected String[] getStringTable() {
return myStringTable;
}
/**
- * Returns the enumeration value table for class PrinterState.
+ * Returns the enumeration value table for class {@code PrinterState}.
*/
protected EnumSyntax[] getEnumValueTable() {
return myEnumValueTable;
@@ -116,11 +125,12 @@
/**
* Get the printing attribute class which is to be used as the "category"
* for this printing attribute value.
- *
- * For class PrinterState, the category is class PrinterState itself.
+ *
+ * For class {@code PrinterState}, the category is class
+ * {@code PrinterState} itself.
*
- * @return Printing attribute class (category), an instance of class
- * {@link java.lang.Class java.lang.Class}.
+ * @return printing attribute class (category), an instance of class
+ * {@link Class java.lang.Class}
*/
public final Class extends Attribute> getCategory() {
return PrinterState.class;
@@ -129,13 +139,13 @@
/**
* Get the name of the category of which this attribute value is an
* instance.
- *
- * For class PrinterState, the category name is {@code "printer-state"}.
+ *
+ * For class {@code PrinterState}, the category name is
+ * {@code "printer-state"}.
*
- * @return Attribute category name.
+ * @return attribute category name
*/
public final String getName() {
return "printer-state";
}
-
}
diff -r 000f4e4ddd39 -r 57173ad5c534 jdk/src/java.desktop/share/classes/javax/print/attribute/standard/PrinterStateReason.java
--- a/jdk/src/java.desktop/share/classes/javax/print/attribute/standard/PrinterStateReason.java Fri Sep 01 14:13:40 2017 +0000
+++ b/jdk/src/java.desktop/share/classes/javax/print/attribute/standard/PrinterStateReason.java Sat Sep 09 14:36:45 2017 +0200
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2000, 2014, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2000, 2017, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
@@ -22,50 +22,51 @@
* or visit www.oracle.com if you need additional information or have any
* questions.
*/
+
package javax.print.attribute.standard;
+import javax.print.attribute.Attribute;
import javax.print.attribute.EnumSyntax;
-import javax.print.attribute.Attribute;
/**
- * Class PrinterStateReason is a printing attribute class, an enumeration,
- * that provides additional information about the printer's current state,
- * i.e., information that augments the value of the printer's
- * {@link PrinterState PrinterState} attribute.
- * Class PrinterStateReason defines standard printer
- * state reason values. A Print Service implementation only needs to report
- * those printer state reasons which are appropriate for the particular
- * implementation; it does not have to report every defined printer state
- * reason.
- *
- * Instances of PrinterStateReason do not appear in a Print Service's
- * attribute set directly.
- * Rather, a {@link PrinterStateReasons PrinterStateReasons}
- * attribute appears in the Print Service's attribute set. The {@link
- * PrinterStateReasons PrinterStateReasons} attribute contains zero, one, or
- * more than one PrinterStateReason objects which pertain to the
- * Print Service's status, and each PrinterStateReason object is
- * associated with a {@link Severity Severity} level of REPORT (least severe),
- * WARNING, or ERROR (most severe). The printer adds a PrinterStateReason
- * object to the Print Service's
+ * Class {@code PrinterStateReason} is a printing attribute class, an
+ * enumeration, that provides additional information about the printer's current
+ * state, i.e., information that augments the value of the printer's
+ * {@link PrinterState PrinterState} attribute. Class PrinterStateReason defines
+ * standard printer state reason values. A Print Service implementation only
+ * needs to report those printer state reasons which are appropriate for the
+ * particular implementation; it does not have to report every defined printer
+ * state reason.
+ *
+ * Instances of {@code PrinterStateReason} do not appear in a Print Service's
+ * attribute set directly. Rather, a
+ * {@link PrinterStateReasons PrinterStateReasons} attribute appears in the
+ * Print Service's attribute set. The
+ * {@link PrinterStateReasons PrinterStateReasons} attribute contains zero, one,
+ * or more than one {@code PrinterStateReason} objects which pertain to the
+ * Print Service's status, and each PrinterStateReason object is associated with
+ * a {@link Severity Severity} level of {@code REPORT} (least severe),
+ * {@code WARNING}, or {@code ERROR} (most severe). The printer adds a
+ * {@code PrinterStateReason} object to the Print Service's
* {@link PrinterStateReasons PrinterStateReasons} attribute when the
- * corresponding condition becomes true of the printer, and the printer
- * removes the PrinterStateReason object again when the corresponding
- * condition becomes false, regardless of whether the Print Service's overall
+ * corresponding condition becomes true of the printer, and the printer removes
+ * the {@code PrinterStateReason} object again when the corresponding condition
+ * becomes false, regardless of whether the Print Service's overall
* {@link PrinterState PrinterState} also changed.
- *
- * IPP Compatibility:
- * The string values returned by each individual {@link PrinterStateReason} and
- * associated {@link Severity} object's {@code toString()}
- * methods, concatenated together with a hyphen ({@code "-"}) in
- * between, gives the IPP keyword value for a {@link PrinterStateReasons}.
- * The category name returned by {@code getName()} gives the IPP
- * attribute name.
+ *
+ * IPP Compatibility: The string values returned by each individual
+ * {@link PrinterStateReason} and associated {@link Severity} object's
+ * {@code toString()} methods, concatenated together with a hyphen ({@code "-"})
+ * in between, gives the IPP keyword value for a {@link PrinterStateReasons}.
+ * The category name returned by {@code getName()} gives the IPP attribute name.
*
- * @author Alan Kaminsky
+ * @author Alan Kaminsky
*/
public class PrinterStateReason extends EnumSyntax implements Attribute {
+ /**
+ * Use serialVersionUID from JDK 1.4 for interoperability.
+ */
private static final long serialVersionUID = -1623720656201472593L;
/**
@@ -87,51 +88,48 @@
/**
* Someone has paused the printer, but the device(s) are taking an
- * appreciable time to stop. Later, when all output has stopped,
- * the {@link PrinterState PrinterState} becomes STOPPED,
- * and the PAUSED value replaces
- * the MOVING_TO_PAUSED value in the {@link PrinterStateReasons
- * PrinterStateReasons} attribute. This value must be supported if the
- * printer can be paused and the implementation takes significant time to
- * pause a device in certain circumstances.
+ * appreciable time to stop. Later, when all output has stopped, the
+ * {@link PrinterState PrinterState} becomes {@code STOPPED}, and the
+ * {@code PAUSED} value replaces the {@code MOVING_TO_PAUSED} value in the
+ * {@link PrinterStateReasons PrinterStateReasons} attribute. This value
+ * must be supported if the printer can be paused and the implementation
+ * takes significant time to pause a device in certain circumstances.
*/
public static final PrinterStateReason
MOVING_TO_PAUSED = new PrinterStateReason(3);
/**
- * Someone has paused the printer and the printer's {@link PrinterState
- * PrinterState} is STOPPED. In this state, a printer must not produce
- * printed output, but it must perform other operations requested by a
- * client. If a printer had been printing a job when the printer was
- * paused,
- * the Printer must resume printing that job when the printer is no longer
- * paused and leave no evidence in the printed output of such a pause.
- * This value must be supported if the printer can be paused.
+ * Someone has paused the printer and the printer's
+ * {@link PrinterState PrinterState} is {@code STOPPED}. In this state, a
+ * printer must not produce printed output, but it must perform other
+ * operations requested by a client. If a printer had been printing a job
+ * when the printer was paused, the {@code Printer} must resume printing
+ * that job when the printer is no longer paused and leave no evidence in
+ * the printed output of such a pause. This value must be supported if the
+ * printer can be paused.
*/
public static final PrinterStateReason
PAUSED = new PrinterStateReason(4);
/**
- * Someone has removed a printer from service, and the device may be
- * powered down or physically removed.
- * In this state, a printer must not produce
- * printed output, and unless the printer is realized by a print server
- * that is still active, the printer must perform no other operations
- * requested by a client.
- * If a printer had been printing a job when it was shut down,
+ * Someone has removed a printer from service, and the device may be powered
+ * down or physically removed. In this state, a printer must not produce
+ * printed output, and unless the printer is realized by a print server that
+ * is still active, the printer must perform no other operations requested
+ * by a client. If a printer had been printing a job when it was shut down,
* the printer need not resume printing that job when the printer is no
* longer shut down. If the printer resumes printing such a job, it may
* leave evidence in the printed output of such a shutdown, e.g. the part
* printed before the shutdown may be printed a second time after the
* shutdown.
- */
+ */
public static final PrinterStateReason
SHUTDOWN = new PrinterStateReason(5);
/**
* The printer has scheduled a job on the output device and is in the
- * process of connecting to a shared network output device (and might not
- * be able to actually start printing the job for an arbitrarily long time
+ * process of connecting to a shared network output device (and might not be
+ * able to actually start printing the job for an arbitrarily long time
* depending on the usage of the output device by other servers on the
* network).
*/
@@ -146,14 +144,13 @@
TIMED_OUT = new PrinterStateReason(7);
/**
- * The printer is in the process of stopping the device and will be
- * stopped in a while.
- * When the device is stopped, the printer will change the
- * {@link PrinterState PrinterState} to STOPPED. The STOPPING reason is
- * never an error, even for a printer with a single output device. When an
- * output device ceases accepting jobs, the printer's {@link
- * PrinterStateReasons PrinterStateReasons} will have this reason while
- * the output device completes printing.
+ * The printer is in the process of stopping the device and will be stopped
+ * in a while. When the device is stopped, the printer will change the
+ * {@link PrinterState PrinterState} to {@code STOPPED}. The
+ * {@code STOPPING} reason is never an error, even for a printer with a
+ * single output device. When an output device ceases accepting jobs, the
+ * printer's {@link PrinterStateReasons PrinterStateReasons} will have this
+ * reason while the output device completes printing.
*/
public static final PrinterStateReason
STOPPING = new PrinterStateReason(8);
@@ -161,10 +158,9 @@
/**
* When a printer controls more than one output device, this reason
* indicates that one or more output devices are stopped. If the reason's
- * severity is a report, fewer than half of the output devices are
- * stopped.
- * If the reason's severity is a warning, half or more but fewer than
- * all of the output devices are stopped.
+ * severity is a report, fewer than half of the output devices are stopped.
+ * If the reason's severity is a warning, half or more but fewer than all of
+ * the output devices are stopped.
*/
public static final PrinterStateReason
STOPPED_PARTLY = new PrinterStateReason(9);
@@ -182,12 +178,10 @@
TONER_EMPTY = new PrinterStateReason(11);
/**
- * The limit of persistent storage allocated for spooling has been
- * reached.
+ * The limit of persistent storage allocated for spooling has been reached.
* The printer is temporarily unable to accept more jobs. The printer will
- * remove this reason when it is able to accept more jobs.
- * This value should be used by a non-spooling printer that only
- * accepts one or a small number
+ * remove this reason when it is able to accept more jobs. This value should
+ * be used by a non-spooling printer that only accepts one or a small number
* jobs at a time or a spooling printer that has filled the spool space.
*/
public static final PrinterStateReason
@@ -236,8 +230,7 @@
OUTPUT_TRAY_MISSING = new PrinterStateReason(19);
/**
- * One or more output areas are almost full
- * (e.g. tray, stacker, collator).
+ * One or more output areas are almost full (e.g. tray, stacker, collator).
*/
public static final PrinterStateReason
OUTPUT_AREA_ALMOST_FULL = new PrinterStateReason(20);
@@ -317,15 +310,18 @@
INTERPRETER_RESOURCE_UNAVAILABLE = new PrinterStateReason(32);
/**
- * Construct a new printer state reason enumeration value with
- * the given integer value.
+ * Construct a new printer state reason enumeration value with the given
+ * integer value.
*
- * @param value Integer value.
+ * @param value Integer value
*/
protected PrinterStateReason(int value) {
super (value);
}
+ /**
+ * The string table for class {@code PrinterStateReason}.
+ */
private static final String[] myStringTable = {
"other",
"media-needed",
@@ -362,6 +358,9 @@
"interpreter-resource-unavailable"
};
+ /**
+ * The enumeration value table for class {@code PrinterStateReason}.
+ */
private static final PrinterStateReason[] myEnumValueTable = {
OTHER,
MEDIA_NEEDED,
@@ -399,29 +398,28 @@
};
/**
- * Returns the string table for class PrinterStateReason.
+ * Returns the string table for class {@code PrinterStateReason}.
*/
protected String[] getStringTable() {
return myStringTable.clone();
}
/**
- * Returns the enumeration value table for class PrinterStateReason.
+ * Returns the enumeration value table for class {@code PrinterStateReason}.
*/
protected EnumSyntax[] getEnumValueTable() {
return (EnumSyntax[])myEnumValueTable.clone();
}
-
/**
* Get the printing attribute class which is to be used as the "category"
* for this printing attribute value.
- *
- * For class PrinterStateReason and any vendor-defined subclasses, the
- * category is class PrinterStateReason itself.
+ *
+ * For class {@code PrinterStateReason} and any vendor-defined subclasses,
+ * the category is class {@code PrinterStateReason} itself.
*
- * @return Printing attribute class (category), an instance of class
- * {@link java.lang.Class java.lang.Class}.
+ * @return printing attribute class (category), an instance of class
+ * {@link Class java.lang.Class}
*/
public final Class extends Attribute> getCategory() {
return PrinterStateReason.class;
@@ -430,14 +428,13 @@
/**
* Get the name of the category of which this attribute value is an
* instance.
- *
- * For class PrinterStateReason and any vendor-defined subclasses, the
- * category name is {@code "printer-state-reason"}.
+ *
+ * For class {@code PrinterStateReason} and any vendor-defined subclasses,
+ * the category name is {@code "printer-state-reason"}.
*
- * @return Attribute category name.
+ * @return attribute category name
*/
public final String getName() {
return "printer-state-reason";
}
-
}
diff -r 000f4e4ddd39 -r 57173ad5c534 jdk/src/java.desktop/share/classes/javax/print/attribute/standard/PrinterStateReasons.java
--- a/jdk/src/java.desktop/share/classes/javax/print/attribute/standard/PrinterStateReasons.java Fri Sep 01 14:13:40 2017 +0000
+++ b/jdk/src/java.desktop/share/classes/javax/print/attribute/standard/PrinterStateReasons.java Sat Sep 09 14:36:45 2017 +0200
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2000, 2014, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2000, 2017, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
@@ -22,69 +22,72 @@
* or visit www.oracle.com if you need additional information or have any
* questions.
*/
+
package javax.print.attribute.standard;
import java.util.AbstractSet;
+import java.util.HashMap;
import java.util.Iterator;
import java.util.Map;
import java.util.NoSuchElementException;
-import java.util.HashMap;
import java.util.Set;
import javax.print.attribute.Attribute;
import javax.print.attribute.PrintServiceAttribute;
/**
- * Class PrinterStateReasons is a printing attribute class, a set of
- * enumeration values, that provides additional information about the
- * printer's current state, i.e., information that augments the value of the
- * printer's {@link PrinterState PrinterState} attribute.
- *
- * Instances of {@link PrinterStateReason PrinterStateReason} do not appear in
- * a Print Service's attribute set directly. Rather, a PrinterStateReasons
+ * Class {@code PrinterStateReasons} is a printing attribute class, a set of
+ * enumeration values, that provides additional information about the printer's
+ * current state, i.e., information that augments the value of the printer's
+ * {@link PrinterState PrinterState} attribute.
+ *
+ * Instances of {@link PrinterStateReason PrinterStateReason} do not appear in a
+ * Print Service's attribute set directly. Rather, a {@code PrinterStateReasons}
* attribute appears in the Print Service's attribute set. The
- * PrinterStateReasons attribute contains zero, one, or more than one {@link
- * PrinterStateReason PrinterStateReason} objects which pertain to the Print
- * Service's status, and each {@link PrinterStateReason PrinterStateReason}
- * object is associated with a {@link Severity Severity} level of REPORT
- * (least severe), WARNING, or ERROR (most severe). The printer adds a {@link
- * PrinterStateReason PrinterStateReason} object to the Print Service's
- * PrinterStateReasons attribute when the corresponding condition becomes true
- * of the printer, and the printer removes the {@link PrinterStateReason
- * PrinterStateReason} object again when the corresponding condition becomes
- * false, regardless of whether the Print Service's overall
- * {@link PrinterState PrinterState} also changed.
- *
- * Class PrinterStateReasons inherits its implementation from class {@link
- * java.util.HashMap java.util.HashMap}. Each entry in the map consists of a
+ * {@code PrinterStateReasons} attribute contains zero, one, or more than one
+ * {@link PrinterStateReason PrinterStateReason} objects which pertain to the
+ * Print Service's status, and each
+ * {@link PrinterStateReason PrinterStateReason} object is associated with a
+ * {@link Severity Severity} level of {@code REPORT} (least severe),
+ * {@code WARNING}, or {@code ERROR} (most severe). The printer adds a
+ * {@link PrinterStateReason PrinterStateReason} object to the Print Service's
+ * {@code PrinterStateReasons} attribute when the corresponding condition
+ * becomes true of the printer, and the printer removes the
+ * {@link PrinterStateReason PrinterStateReason} object again when the
+ * corresponding condition becomes false, regardless of whether the Print
+ * Service's overall {@link PrinterState PrinterState} also changed.
+ *
+ * Class PrinterStateReasons inherits its implementation from class
+ * {@link HashMap java.util.HashMap}. Each entry in the map consists of a
* {@link PrinterStateReason PrinterStateReason} object (key) mapping to a
* {@link Severity Severity} object (value):
- *
+ *
* Unlike most printing attributes which are immutable once constructed, class
- * PrinterStateReasons is designed to be mutable; you can add {@link
- * PrinterStateReason PrinterStateReason} objects to an existing
- * PrinterStateReasons object and remove them again. However, like class
- * {@link java.util.HashMap java.util.HashMap}, class PrinterStateReasons is
- * not multiple thread safe. If a PrinterStateReasons object will be used by
+ * {@code PrinterStateReasons} is designed to be mutable; you can add
+ * {@link PrinterStateReason PrinterStateReason} objects to an existing
+ * {@code PrinterStateReasons} object and remove them again. However, like class
+ * {@link HashMap java.util.HashMap}, class {@code PrinterStateReasons} is not
+ * multiple thread safe. If a {@code PrinterStateReasons} object will be used by
* multiple threads, be sure to synchronize its operations (e.g., using a
* synchronized map view obtained from class {@link java.util.Collections
* java.util.Collections}).
- *
- * IPP Compatibility: The string values returned by each individual
+ *
+ * IPP Compatibility: The string values returned by each individual
* {@link PrinterStateReason PrinterStateReason} object's and the associated
- * {@link Severity Severity} object's {@code toString()} methods,
- * concatenated
- * together with a hyphen ({@code "-"}) in between, gives the IPP keyword
- * value. The category name returned by {@code getName()} gives the IPP
- * attribute name.
+ * {@link Severity Severity} object's {@code toString()} methods, concatenated
+ * together with a hyphen ({@code "-"}) in between, gives the IPP keyword value.
+ * The category name returned by {@code getName()} gives the IPP attribute name.
*
- * @author Alan Kaminsky
+ * @author Alan Kaminsky
*/
public final class PrinterStateReasons
extends HashMap
- * For class PrinterStateReasons, the
- * category is class PrinterStateReasons itself.
+ *
+ * For class {@code PrinterStateReasons}, the category is class
+ * {@code PrinterStateReasons} itself.
*
- * @return Printing attribute class (category), an instance of class
- * {@link java.lang.Class java.lang.Class}.
+ * @return printing attribute class (category), an instance of class
+ * {@link Class java.lang.Class}
*/
public final Class extends Attribute> getCategory() {
return PrinterStateReasons.class;
@@ -199,11 +190,11 @@
/**
* Get the name of the category of which this attribute value is an
* instance.
- *
- * For class PrinterStateReasons, the
- * category name is {@code "printer-state-reasons"}.
+ *
+ * For class {@code PrinterStateReasons}, the category name is
+ * {@code "printer-state-reasons"}.
*
- * @return Attribute category name.
+ * @return attribute category name
*/
public final String getName() {
return "printer-state-reasons";
@@ -211,24 +202,21 @@
/**
* Obtain an unmodifiable set view of the individual printer state reason
- * attributes at the given severity level in this PrinterStateReasons
- * attribute. Each element in the set view is a {@link PrinterStateReason
- * PrinterStateReason} object. The only elements in the set view are the
- * {@link PrinterStateReason PrinterStateReason} objects that map to the
- * given severity value. The set view is backed by this
- * PrinterStateReasons attribute, so changes to this PrinterStateReasons
- * attribute are reflected in the set view.
- * The set view does not support element insertion or
- * removal. The set view's iterator does not support element removal.
+ * attributes at the given severity level in this
+ * {@code PrinterStateReasons} attribute. Each element in the set view is a
+ * {@link PrinterStateReason PrinterStateReason} object. The only elements
+ * in the set view are the {@link PrinterStateReason PrinterStateReason}
+ * objects that map to the given severity value. The set view is backed by
+ * this {@code PrinterStateReasons} attribute, so changes to this
+ * {@code PrinterStateReasons} attribute are reflected in the set view. The
+ * set view does not support element insertion or removal. The set view's
+ * iterator does not support element removal.
*
- * @param severity Severity level.
- *
- * @return Set view of the individual {@link PrinterStateReason
- * PrinterStateReason} attributes at the given {@link Severity
- * Severity} level.
- *
- * @exception NullPointerException
- * (unchecked exception) Thrown if {@code severity} is null.
+ * @param severity severity level
+ * @return set view of the individual
+ * {@link PrinterStateReason PrinterStateReason} attributes at the
+ * given {@link Severity Severity} level
+ * @throws NullPointerException if {@code severity} is {@code null}
*/
public Set
- * IPP Compatibility: This implements the
- * IPP printer-uri attribute. The string form returned by
- * {@code toString()} gives the IPP printer-uri value.
- * The category name returned by {@code getName()}
- * gives the IPP attribute name.
+ * Class {@code PrinterURI} is a printing attribute class, a {@code URI}, that
+ * specifies the globally unique name of a printer. If it has such a name, an
+ * administrator determines a printer's {@code URI} and sets this attribute to
+ * that name.
+ *
+ * IPP Compatibility: This implements the IPP printer-uri attribute. The
+ * string form returned by {@code toString()} gives the IPP printer-uri value.
+ * The category name returned by {@code getName()} gives the IPP attribute name.
*
- * @author Robert Herriot
+ * @author Robert Herriot
*/
-
public final class PrinterURI extends URISyntax
implements PrintServiceAttribute {
+ /**
+ * Use serialVersionUID from JDK 1.4 for interoperability.
+ */
private static final long serialVersionUID = 7923912792485606497L;
/**
- * Constructs a new PrinterURI attribute with the specified URI.
+ * Constructs a new {@code PrinterURI} attribute with the specified
+ * {@code URI}.
*
- * @param uri URI of the printer
- *
- * @exception NullPointerException
- * (unchecked exception) Thrown if {@code uri} is null.
+ * @param uri {@code URI} of the printer
+ * @throws NullPointerException if {@code uri} is {@code null}
*/
public PrinterURI(URI uri) {
super (uri);
@@ -66,34 +66,30 @@
* Returns whether this printer name attribute is equivalent to the passed
* in object. To be equivalent, all of the following conditions must be
* true:
- *
- * For class PrinterURI and any vendor-defined subclasses, the category is
- * class PrinterURI itself.
+ *
+ * For class {@code PrinterURI} and any vendor-defined subclasses, the
+ * category is class {@code PrinterURI} itself.
*
- * @return Printing attribute class (category), an instance of class
- * {@link java.lang.Class java.lang.Class}.
+ * @return printing attribute class (category), an instance of class
+ * {@link Class java.lang.Class}
*/
public final Class extends Attribute> getCategory() {
return PrinterURI.class;
@@ -102,14 +98,13 @@
/**
* Get the name of the category of which this attribute value is an
* instance.
- *
- * For class PrinterURI and any vendor-defined subclasses, the category
- * name is {@code "printer-uri"}.
+ *
+ * For class {@code PrinterURI} and any vendor-defined subclasses, the
+ * category name is {@code "printer-uri"}.
*
- * @return Attribute category name.
+ * @return attribute category name
*/
public final String getName() {
return "printer-uri";
}
-
}
diff -r 000f4e4ddd39 -r 57173ad5c534 jdk/src/java.desktop/share/classes/javax/print/attribute/standard/QueuedJobCount.java
--- a/jdk/src/java.desktop/share/classes/javax/print/attribute/standard/QueuedJobCount.java Fri Sep 01 14:13:40 2017 +0000
+++ b/jdk/src/java.desktop/share/classes/javax/print/attribute/standard/QueuedJobCount.java Sat Sep 09 14:36:45 2017 +0200
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2000, 2014, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2000, 2017, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
@@ -22,6 +22,7 @@
* or visit www.oracle.com if you need additional information or have any
* questions.
*/
+
package javax.print.attribute.standard;
import javax.print.attribute.Attribute;
@@ -29,29 +30,29 @@
import javax.print.attribute.PrintServiceAttribute;
/**
- * Class QueuedJobCount is an integer valued printing attribute that indicates
- * the number of jobs in the printer whose {@link JobState JobState} is either
- * PENDING, PENDING_HELD, PROCESSING, or PROCESSING_STOPPED.
- *
- * IPP Compatibility: The integer value gives the IPP integer value.
- * The category name returned by {@code getName()} gives the IPP
- * attribute name.
+ * Class {@code QueuedJobCount} is an integer valued printing attribute that
+ * indicates the number of jobs in the printer whose {@link JobState JobState}
+ * is either {@code PENDING}, {@code PENDING_HELD}, {@code PROCESSING}, or
+ * {@code PROCESSING_STOPPED}.
+ *
+ * IPP Compatibility: The integer value gives the IPP integer value. The
+ * category name returned by {@code getName()} gives the IPP attribute name.
*
- * @author Alan Kaminsky
+ * @author Alan Kaminsky
*/
public final class QueuedJobCount extends IntegerSyntax
implements PrintServiceAttribute {
+ /**
+ * Use serialVersionUID from JDK 1.4 for interoperability.
+ */
private static final long serialVersionUID = 7499723077864047742L;
/**
- * Construct a new queued job count attribute with the given integer
- * value.
+ * Construct a new queued job count attribute with the given integer value.
*
- * @param value Integer value.
- *
- * @exception IllegalArgumentException
- * (Unchecked exception) Thrown if {@code value} is less than 0.
+ * @param value Integer value
+ * @throws IllegalArgumentException if {@code value} is negative
*/
public QueuedJobCount(int value) {
super (value, 0, Integer.MAX_VALUE);
@@ -59,22 +60,18 @@
/**
* Returns whether this queued job count attribute is equivalent to the
- * passed in object. To be equivalent, all of the following conditions
- * mus be true:
- *
- * For class QueuedJobCount, the category is class QueuedJobCount itself.
+ *
+ * For class {@code QueuedJobCount}, the category is class
+ * {@code QueuedJobCount} itself.
*
- * @return Printing attribute class (category), an instance of class
- * {@link java.lang.Class java.lang.Class}.
+ * @return printing attribute class (category), an instance of class
+ * {@link Class java.lang.Class}
*/
public final Class extends Attribute> getCategory() {
return QueuedJobCount.class;
@@ -97,14 +95,13 @@
/**
* Get the name of the category of which this attribute value is an
* instance.
- *
- * For class QueuedJobCount, the
- * category name is {@code "queued-job-count"}.
+ *
+ * For class {@code QueuedJobCount}, the category name is
+ * {@code "queued-job-count"}.
*
- * @return Attribute category name.
+ * @return attribute category name
*/
public final String getName() {
return "queued-job-count";
}
-
}
diff -r 000f4e4ddd39 -r 57173ad5c534 jdk/src/java.desktop/share/classes/javax/print/attribute/standard/ReferenceUriSchemesSupported.java
--- a/jdk/src/java.desktop/share/classes/javax/print/attribute/standard/ReferenceUriSchemesSupported.java Fri Sep 01 14:13:40 2017 +0000
+++ b/jdk/src/java.desktop/share/classes/javax/print/attribute/standard/ReferenceUriSchemesSupported.java Sat Sep 09 14:36:45 2017 +0200
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2000, 2014, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2000, 2017, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
@@ -22,45 +22,50 @@
* or visit www.oracle.com if you need additional information or have any
* questions.
*/
+
package javax.print.attribute.standard;
+import javax.print.attribute.Attribute;
import javax.print.attribute.EnumSyntax;
-import javax.print.attribute.Attribute;
/**
- * Class ReferenceUriSchemesSupported is a printing attribute class
- * an enumeration, that indicates a "URI scheme," such as "http:" or "ftp:",
- * that a printer can use to retrieve print data stored at a URI location.
- * If a printer supports doc flavors with a print data representation class of
+ * Class {@code ReferenceUriSchemesSupported} is a printing attribute class an
+ * enumeration, that indicates a "URI scheme," such as "http:" or "ftp:", that a
+ * printer can use to retrieve print data stored at a {@code URI} location. If a
+ * printer supports doc flavors with a print data representation class of
* {@code "java.net.URL"}, the printer uses instances of class
- * ReferenceUriSchemesSupported to advertise the URI schemes it can accept.
- * The acceptable URI schemes are included as service attributes in the
- * lookup service; this lets clients search the
- * for printers that can get print data using a certain URI scheme. The
- * acceptable URI schemes can also be queried using the capability methods in
- * interface {@code PrintService}. However,
- * ReferenceUriSchemesSupported attributes are used solely for determining
- * acceptable URI schemes, they are never included in a doc's,
- * print request's, print job's, or print service's attribute set.
- *
+ * {@code ReferenceUriSchemesSupported} to advertise the {@code URI} schemes it
+ * can accept. The acceptable {@code URI} schemes are included as service
+ * attributes in the lookup service; this lets clients search the for printers
+ * that can get print data using a certain {@code URI} scheme. The acceptable
+ * {@code URI} schemes can also be queried using the capability methods in
+ * interface {@code PrintService}. However, {@code ReferenceUriSchemesSupported}
+ * attributes are used solely for determining acceptable {@code URI} schemes,
+ * they are never included in a doc's, print request's, print job's, or print
+ * service's attribute set.
+ *
* The Internet Assigned Numbers Authority maintains the
- * official
- * list of URI schemes.
+ * official list of
+ * URI schemes.
*
- * Class ReferenceUriSchemesSupported defines enumeration values for widely
- * used URI schemes. A printer that supports additional URI schemes
- * can define them in a subclass of class ReferenceUriSchemesSupported.
- *
- * IPP Compatibility: The category name returned by
- * {@code getName()} is the IPP attribute name. The enumeration's
- * integer value is the IPP enum value. The {@code toString()} method
- * returns the IPP string representation of the attribute value.
+ * Class {@code ReferenceUriSchemesSupported} defines enumeration values for
+ * widely used {@code URI} schemes. A printer that supports additional
+ * {@code URI} schemes can define them in a subclass of class
+ * {@code ReferenceUriSchemesSupported}.
+ *
+ * IPP Compatibility: The category name returned by {@code getName()} is
+ * the IPP attribute name. The enumeration's integer value is the IPP enum
+ * value. The {@code toString()} method returns the IPP string representation of
+ * the attribute value.
*
- * @author Alan Kaminsky
+ * @author Alan Kaminsky
*/
public class ReferenceUriSchemesSupported
extends EnumSyntax implements Attribute {
+ /**
+ * Use serialVersionUID from JDK 1.4 for interoperability.
+ */
private static final long serialVersionUID = -8989076942813442805L;
/**
@@ -105,15 +110,18 @@
public static final ReferenceUriSchemesSupported FILE = new ReferenceUriSchemesSupported(7);
/**
- * Construct a new reference URI scheme enumeration value with the given
- * integer value.
+ * Construct a new reference {@code URI} scheme enumeration value with the
+ * given integer value.
*
- * @param value Integer value.
+ * @param value Integer value
*/
protected ReferenceUriSchemesSupported(int value) {
super (value);
}
+ /**
+ * The string table for class {@code ReferenceUriSchemesSupported}.
+ */
private static final String[] myStringTable = {
"ftp",
"http",
@@ -125,6 +133,10 @@
"file",
};
+ /**
+ * The enumeration value table for class
+ * {@code ReferenceUriSchemesSupported}.
+ */
private static final ReferenceUriSchemesSupported[] myEnumValueTable = {
FTP,
HTTP,
@@ -137,7 +149,7 @@
};
/**
- * Returns the string table for class ReferenceUriSchemesSupported.
+ * Returns the string table for class {@code ReferenceUriSchemesSupported}.
*/
protected String[] getStringTable() {
return myStringTable.clone();
@@ -145,7 +157,7 @@
/**
* Returns the enumeration value table for class
- * ReferenceUriSchemesSupported.
+ * {@code ReferenceUriSchemesSupported}.
*/
protected EnumSyntax[] getEnumValueTable() {
return (EnumSyntax[])myEnumValueTable.clone();
@@ -154,12 +166,13 @@
/**
* Get the printing attribute class which is to be used as the "category"
* for this printing attribute value.
- *
- * For class ReferenceUriSchemesSupported and any vendor-defined
- * subclasses, the category is class ReferenceUriSchemesSupported itself.
+ *
+ * For class {@code ReferenceUriSchemesSupported} and any vendor-defined
+ * subclasses, the category is class {@code ReferenceUriSchemesSupported}
+ * itself.
*
- * @return Printing attribute class (category), an instance of class
- * {@link java.lang.Class java.lang.Class}.
+ * @return printing attribute class (category), an instance of class
+ * {@link Class java.lang.Class}
*/
public final Class extends Attribute> getCategory() {
return ReferenceUriSchemesSupported.class;
@@ -168,15 +181,14 @@
/**
* Get the name of the category of which this attribute value is an
* instance.
- *
- * For class ReferenceUriSchemesSupported and any vendor-defined
+ *
+ * For class {@code ReferenceUriSchemesSupported} and any vendor-defined
* subclasses, the category name is
* {@code "reference-uri-schemes-supported"}.
*
- * @return Attribute category name.
+ * @return attribute category name
*/
public final String getName() {
return "reference-uri-schemes-supported";
}
-
}
diff -r 000f4e4ddd39 -r 57173ad5c534 jdk/src/java.desktop/share/classes/javax/print/attribute/standard/RequestingUserName.java
--- a/jdk/src/java.desktop/share/classes/javax/print/attribute/standard/RequestingUserName.java Fri Sep 01 14:13:40 2017 +0000
+++ b/jdk/src/java.desktop/share/classes/javax/print/attribute/standard/RequestingUserName.java Sat Sep 09 14:36:45 2017 +0200
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2000, 2014, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2000, 2017, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
@@ -22,77 +22,73 @@
* or visit www.oracle.com if you need additional information or have any
* questions.
*/
+
package javax.print.attribute.standard;
import java.util.Locale;
import javax.print.attribute.Attribute;
+import javax.print.attribute.PrintRequestAttribute;
import javax.print.attribute.TextSyntax;
-import javax.print.attribute.PrintRequestAttribute;
/**
- * Class RequestingUserName is a printing attribute class, a text attribute,
- * that specifies the name of the end user that submitted the print job. A
- * requesting user name is an arbitrary string defined by the client. The
- * printer does not put the client-specified RequestingUserName attribute into
- * the Print Job's attribute set; rather, the printer puts in a {@link
- * JobOriginatingUserName JobOriginatingUserName} attribute.
- * This means that services which support specifying a username with this
- * attribute should also report a JobOriginatingUserName in the job's
- * attribute set. Note that many print services may have a way to independently
- * authenticate the user name, and so may state support for a
- * requesting user name, but in practice will then report the user name
- * authenticated by the service rather than that specified via this
- * attribute.
- *
- * IPP Compatibility: The string value gives the IPP name value. The
+ * Class {@code RequestingUserName} is a printing attribute class, a text
+ * attribute, that specifies the name of the end user that submitted the print
+ * job. A requesting user name is an arbitrary string defined by the client. The
+ * printer does not put the client-specified {@code RequestingUserName}
+ * attribute into the Print Job's attribute set; rather, the printer puts in a
+ * {@link JobOriginatingUserName JobOriginatingUserName} attribute. This means
+ * that services which support specifying a username with this attribute should
+ * also report a {@code JobOriginatingUserName} in the job's attribute set. Note
+ * that many print services may have a way to independently authenticate the
+ * user name, and so may state support for a requesting user name, but in
+ * practice will then report the user name authenticated by the service rather
+ * than that specified via this attribute.
+ *
+ * IPP Compatibility: The string value gives the IPP name value. The
* locale gives the IPP natural language. The category name returned by
* {@code getName()} gives the IPP attribute name.
*
- * @author Alan Kaminsky
+ * @author Alan Kaminsky
*/
public final class RequestingUserName extends TextSyntax
implements PrintRequestAttribute {
+ /**
+ * Use serialVersionUID from JDK 1.4 for interoperability.
+ */
private static final long serialVersionUID = -2683049894310331454L;
/**
- * Constructs a new requesting user name attribute with the given user
- * name and locale.
+ * Constructs a new requesting user name attribute with the given user name
+ * and locale.
*
- * @param userName User name.
- * @param locale Natural language of the text string. null
- * is interpreted to mean the default locale as returned
- * by {@code Locale.getDefault()}
- *
- * @exception NullPointerException
- * (unchecked exception) Thrown if {@code userName} is null.
+ * @param userName user name
+ * @param locale natural language of the text string. {@code null} is
+ * interpreted to mean the default locale as returned by
+ * {@code Locale.getDefault()}
+ * @throws NullPointerException if {@code userName} is {@code null}
*/
public RequestingUserName(String userName, Locale locale) {
super (userName, locale);
}
/**
- * Returns whether this requesting user name attribute is equivalent to
- * the passed in object. To be equivalent, all of the following
- * conditions must be true:
- *
- * For class RequestingUserName, the
- * category is class RequestingUserName itself.
+ *
+ * For class {@code RequestingUserName}, the category is class
+ * {@code RequestingUserName} itself.
*
- * @return Printing attribute class (category), an instance of class
- * {@link java.lang.Class java.lang.Class}.
+ * @return printing attribute class (category), an instance of class
+ * {@link Class java.lang.Class}
*/
public final Class extends Attribute> getCategory() {
return RequestingUserName.class;
@@ -116,14 +112,13 @@
/**
* Get the name of the category of which this attribute value is an
* instance.
- *
- * For class RequestingUserName, the
- * category name is {@code "requesting-user-name"}.
+ *
+ * For class {@code RequestingUserName}, the category name is
+ * {@code "requesting-user-name"}.
*
- * @return Attribute category name.
+ * @return attribute category name
*/
public final String getName() {
return "requesting-user-name";
}
-
}
diff -r 000f4e4ddd39 -r 57173ad5c534 jdk/src/java.desktop/share/classes/javax/print/attribute/standard/Severity.java
--- a/jdk/src/java.desktop/share/classes/javax/print/attribute/standard/Severity.java Fri Sep 01 14:13:40 2017 +0000
+++ b/jdk/src/java.desktop/share/classes/javax/print/attribute/standard/Severity.java Sat Sep 09 14:36:45 2017 +0200
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2000, 2014, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2000, 2017, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
@@ -22,54 +22,53 @@
* or visit www.oracle.com if you need additional information or have any
* questions.
*/
+
package javax.print.attribute.standard;
+import javax.print.attribute.Attribute;
import javax.print.attribute.EnumSyntax;
-import javax.print.attribute.Attribute;
/**
- * Class Severity is a printing attribute class, an enumeration, that denotes
- * the severity of a {@link PrinterStateReason PrinterStateReason} attribute.
- *
- * Instances of Severity do not appear in a Print Service's attribute set
- * directly. Rather, a {@link PrinterStateReasons PrinterStateReasons}
+ * Class {@code Severity} is a printing attribute class, an enumeration, that
+ * denotes the severity of a {@link PrinterStateReason PrinterStateReason}
+ * attribute.
+ *
+ * Instances of {@code Severity} do not appear in a Print Service's attribute
+ * set directly. Rather, a {@link PrinterStateReasons PrinterStateReasons}
* attribute appears in the Print Service's attribute set.
- * The {@link PrinterStateReasons
- * PrinterStateReasons} attribute contains zero, one, or more than one {@link
- * PrinterStateReason PrinterStateReason} objects which pertain to the Print
- * Service's status, and each {@link PrinterStateReason PrinterStateReason}
- * object is associated with a Severity level of REPORT (least severe),
- * WARNING, or ERROR (most severe).
- * The printer adds a {@link PrinterStateReason
- * PrinterStateReason} object to the Print Service's
+ * The {@link PrinterStateReasons PrinterStateReasons} attribute contains zero,
+ * one, or more than one {@link PrinterStateReason PrinterStateReason} objects
+ * which pertain to the Print Service's status, and each
+ * {@link PrinterStateReason PrinterStateReason} object is associated with a
+ * Severity level of {@code REPORT} (least severe), {@code WARNING}, or
+ * {@code ERROR} (most severe). The printer adds a
+ * {@link PrinterStateReason PrinterStateReason} object to the Print Service's
* {@link PrinterStateReasons PrinterStateReasons} attribute when the
- * corresponding condition becomes true
- * of the printer, and the printer removes the {@link PrinterStateReason
- * PrinterStateReason} object again when the corresponding condition becomes
- * false, regardless of whether the Print Service's overall
- * {@link PrinterState PrinterState} also changed.
- *
- * IPP Compatibility:
- * {@code Severity.toString()} returns either "error", "warning", or
- * "report". The string values returned by
- * each individual {@link PrinterStateReason} and
- * associated {@link Severity} object's {@code toString()}
- * methods, concatenated together with a hyphen ({@code "-"}) in
- * between, gives the IPP keyword value for a {@link PrinterStateReasons}.
- * The category name returned by {@code getName()} gives the IPP
- * attribute name.
+ * corresponding condition becomes true of the printer, and the printer removes
+ * the {@link PrinterStateReason PrinterStateReason} object again when the
+ * corresponding condition becomes false, regardless of whether the Print
+ * Service's overall {@link PrinterState PrinterState} also changed.
+ *
+ * IPP Compatibility: {@code Severity.toString()} returns either "error",
+ * "warning", or "report". The string values returned by each individual
+ * {@link PrinterStateReason} and associated {@link Severity} object's
+ * {@code toString()} methods, concatenated together with a hyphen ({@code "-"})
+ * in between, gives the IPP keyword value for a {@link PrinterStateReasons}.
+ * The category name returned by {@code getName()} gives the IPP attribute name.
*
- * @author Alan Kaminsky
+ * @author Alan Kaminsky
*/
public final class Severity extends EnumSyntax implements Attribute {
+ /**
+ * Use serialVersionUID from JDK 1.4 for interoperability.
+ */
private static final long serialVersionUID = 8781881462717925380L;
/**
* Indicates that the {@link PrinterStateReason PrinterStateReason} is a
- * "report" (least severe). An implementation may choose to omit some or
- * all reports.
- * Some reports specify finer granularity about the printer state;
+ * "report" (least severe). An implementation may choose to omit some or all
+ * reports. Some reports specify finer granularity about the printer state;
* others serve as a precursor to a warning. A report must contain nothing
* that could affect the printed output.
*/
@@ -78,36 +77,41 @@
/**
* Indicates that the {@link PrinterStateReason PrinterStateReason} is a
* "warning." An implementation may choose to omit some or all warnings.
- * Warnings serve as a precursor to an error. A warning must contain
- * nothing that prevents a job from completing, though in some cases the
- * output may be of lower quality.
+ * Warnings serve as a precursor to an error. A warning must contain nothing
+ * that prevents a job from completing, though in some cases the output may
+ * be of lower quality.
*/
public static final Severity WARNING = new Severity (1);
/**
* Indicates that the {@link PrinterStateReason PrinterStateReason} is an
- * "error" (most severe). An implementation must include all errors.
- * If this attribute contains one or more errors, the printer's
- * {@link PrinterState PrinterState} must be STOPPED.
+ * "error" (most severe). An implementation must include all errors. If this
+ * attribute contains one or more errors, the printer's
+ * {@link PrinterState PrinterState} must be {@code STOPPED}.
*/
public static final Severity ERROR = new Severity (2);
/**
- * Construct a new severity enumeration value with the given integer
- * value.
+ * Construct a new severity enumeration value with the given integer value.
*
- * @param value Integer value.
+ * @param value Integer value
*/
protected Severity(int value) {
super (value);
}
+ /**
+ * The string table for class {@code Severity}.
+ */
private static final String[] myStringTable = {
"report",
"warning",
"error"
};
+ /**
+ * The enumeration value table for class {@code Severity}.
+ */
private static final Severity[] myEnumValueTable = {
REPORT,
WARNING,
@@ -115,28 +119,28 @@
};
/**
- * Returns the string table for class Severity.
+ * Returns the string table for class {@code Severity}.
*/
protected String[] getStringTable() {
return myStringTable;
}
/**
- * Returns the enumeration value table for class Severity.
+ * Returns the enumeration value table for class {@code Severity}.
*/
protected EnumSyntax[] getEnumValueTable() {
return myEnumValueTable;
}
-
/**
* Get the printing attribute class which is to be used as the "category"
* for this printing attribute value.
- *
- * For class Severity, the category is class Severity itself.
+ *
+ * For class {@code Severity}, the category is class
+ * {@code Severity} itself.
*
- * @return Printing attribute class (category), an instance of class
- * {@link java.lang.Class java.lang.Class}.
+ * @return printing attribute class (category), an instance of class
+ * {@link Class java.lang.Class}
*/
public final Class extends Attribute> getCategory() {
return Severity.class;
@@ -145,13 +149,12 @@
/**
* Get the name of the category of which this attribute value is an
* instance.
- *
- * For class Severit, the category name is {@code "severity"}.
+ *
+ * For class {@code Severity}, the category name is {@code "severity"}.
*
- * @return Attribute category name.
+ * @return attribute category name
*/
public final String getName() {
return "severity";
}
-
}
diff -r 000f4e4ddd39 -r 57173ad5c534 jdk/src/java.desktop/share/classes/javax/print/attribute/standard/SheetCollate.java
--- a/jdk/src/java.desktop/share/classes/javax/print/attribute/standard/SheetCollate.java Fri Sep 01 14:13:40 2017 +0000
+++ b/jdk/src/java.desktop/share/classes/javax/print/attribute/standard/SheetCollate.java Sat Sep 09 14:36:45 2017 +0200
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2000, 2014, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2000, 2017, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
@@ -22,146 +22,134 @@
* or visit www.oracle.com if you need additional information or have any
* questions.
*/
+
package javax.print.attribute.standard;
import javax.print.attribute.Attribute;
+import javax.print.attribute.DocAttribute;
import javax.print.attribute.EnumSyntax;
-import javax.print.attribute.DocAttribute;
+import javax.print.attribute.PrintJobAttribute;
import javax.print.attribute.PrintRequestAttribute;
-import javax.print.attribute.PrintJobAttribute;
/**
- * Class SheetCollate is a printing attribute class, an enumeration, that
- * specifies whether or not the media sheets of each copy of each printed
+ * Class {@code SheetCollate} is a printing attribute class, an enumeration,
+ * that specifies whether or not the media sheets of each copy of each printed
* document in a job are to be in sequence, when multiple copies of the document
- * are specified by the {@link Copies Copies} attribute. When SheetCollate is
- * COLLATED, each copy of each document is printed with the print-stream sheets
- * in sequence. When SheetCollate is UNCOLLATED, each print-stream sheet is
- * printed a number of times equal to the value of the {@link Copies Copies}
- * attribute in succession. For example, suppose a document produces two media
- * sheets as output, {@link Copies Copies} is 6, and SheetCollate is UNCOLLATED;
- * in this case six copies of the first media sheet are printed followed by
- * six copies of the second media sheet.
- *
+ * are specified by the {@link Copies Copies} attribute. When
+ * {@code SheetCollate} is {@code COLLATED}, each copy of each document is
+ * printed with the print-stream sheets in sequence. When {@code SheetCollate}
+ * is {@code UNCOLLATED}, each print-stream sheet is printed a number of times
+ * equal to the value of the {@link Copies Copies} attribute in succession. For
+ * example, suppose a document produces two media sheets as output,
+ * {@link Copies Copies} is 6, and {@code SheetCollate} is UNCOLLATED; in this
+ * case six copies of the first media sheet are printed followed by six copies
+ * of the second media sheet.
+ *
* Whether the effect of sheet collation is achieved by placing copies of a
* document in multiple output bins or in the same output bin with
- * implementation defined document separation is implementation dependent.
- * Also whether it is achieved by making multiple passes over the job or by
- * using an output sorter is implementation dependent.
- *
- * If a printer does not support the SheetCollate attribute (meaning the client
- * cannot specify any particular sheet collation), the printer must behave as
- * though SheetCollate were always set to COLLATED.
- *
- * The SheetCollate attribute interacts with the {@link MultipleDocumentHandling
- * MultipleDocumentHandling} attribute. The {@link MultipleDocumentHandling
- * MultipleDocumentHandling} attribute describes the collation of entire
- * documents, and the SheetCollate attribute describes the semantics of
- * collating individual pages within a document.
- *
- * The effect of a SheetCollate attribute on a multidoc print job (a job with
- * multiple documents) depends on whether all the docs have the same sheet
- * collation specified or whether different docs have different sheet
- * collations specified, and on the (perhaps defaulted) value of the {@link
- * MultipleDocumentHandling MultipleDocumentHandling} attribute.
- *
+ * If a printer does not support the {@code SheetCollate} attribute (meaning the
+ * client cannot specify any particular sheet collation), the printer must
+ * behave as though {@code SheetCollate} were always set to {@code COLLATED}.
+ *
+ * The {@code SheetCollate} attribute interacts with the
+ * {@link MultipleDocumentHandling MultipleDocumentHandling} attribute. The
+ * {@link MultipleDocumentHandling MultipleDocumentHandling} attribute describes
+ * the collation of entire documents, and the {@code SheetCollate} attribute
+ * describes the semantics of collating individual pages within a document.
+ *
+ * The effect of a {@code SheetCollate} attribute on a multidoc print job (a job
+ * with multiple documents) depends on whether all the docs have the same sheet
+ * collation specified or whether different docs have different sheet collations
+ * specified, and on the (perhaps defaulted) value of the
+ * {@link MultipleDocumentHandling MultipleDocumentHandling} attribute.
+ *
+ * IPP Compatibility: SheetCollate is not an IPP attribute at present.
*
- *
- * IPP Compatibility: SheetCollate is not an IPP attribute at present.
- *
- * @see MultipleDocumentHandling
- *
- * @author Alan Kaminsky
+ * @author Alan Kaminsky
+ * @see MultipleDocumentHandling
*/
public final class SheetCollate extends EnumSyntax
implements DocAttribute, PrintRequestAttribute, PrintJobAttribute {
+ /**
+ * Use serialVersionUID from JDK 1.4 for interoperability.
+ */
private static final long serialVersionUID = 7080587914259873003L;
/**
- * Sheets within a document appear in uncollated order when multiple
- * copies are printed.
+ * Sheets within a document appear in uncollated order when multiple copies
+ * are printed.
*/
public static final SheetCollate UNCOLLATED = new SheetCollate(0);
@@ -175,31 +163,37 @@
* Construct a new sheet collate enumeration value with the given integer
* value.
*
- * @param value Integer value.
+ * @param value Integer value
*/
protected SheetCollate(int value) {
super (value);
}
+ /**
+ * The string table for class {@code SheetCollate}.
+ */
private static final String[] myStringTable = {
"uncollated",
"collated"
};
+ /**
+ * The enumeration value table for class {@code SheetCollate}.
+ */
private static final SheetCollate[] myEnumValueTable = {
UNCOLLATED,
COLLATED
};
/**
- * Returns the string table for class SheetCollate.
+ * Returns the string table for class {@code SheetCollate}.
*/
protected String[] getStringTable() {
return myStringTable;
}
/**
- * Returns the enumeration value table for class SheetCollate.
+ * Returns the enumeration value table for class {@code SheetCollate}.
*/
protected EnumSyntax[] getEnumValueTable() {
return myEnumValueTable;
@@ -208,11 +202,12 @@
/**
* Get the printing attribute class which is to be used as the "category"
* for this printing attribute value.
- *
- * For class SheetCollate, the category is class SheetCollate itself.
+ *
+ * For class {@code SheetCollate}, the category is class
+ * {@code SheetCollate} itself.
*
- * @return Printing attribute class (category), an instance of class
- * {@link java.lang.Class java.lang.Class}.
+ * @return printing attribute class (category), an instance of class
+ * {@link Class java.lang.Class}
*/
public final Class extends Attribute> getCategory() {
return SheetCollate.class;
@@ -221,13 +216,13 @@
/**
* Get the name of the category of which this attribute value is an
* instance.
- *
- * For class SheetCollate, the category name is {@code "sheet-collate"}.
+ *
+ * For class {@code SheetCollate}, the category name is
+ * {@code "sheet-collate"}.
*
- * @return Attribute category name.
+ * @return attribute category name
*/
public final String getName() {
return "sheet-collate";
}
-
}
diff -r 000f4e4ddd39 -r 57173ad5c534 jdk/src/java.desktop/share/classes/javax/print/attribute/standard/Sides.java
--- a/jdk/src/java.desktop/share/classes/javax/print/attribute/standard/Sides.java Fri Sep 01 14:13:40 2017 +0000
+++ b/jdk/src/java.desktop/share/classes/javax/print/attribute/standard/Sides.java Sat Sep 09 14:36:45 2017 +0200
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2000, 2013, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2000, 2017, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
@@ -22,104 +22,96 @@
* or visit www.oracle.com if you need additional information or have any
* questions.
*/
+
package javax.print.attribute.standard;
import javax.print.attribute.Attribute;
+import javax.print.attribute.DocAttribute;
import javax.print.attribute.EnumSyntax;
-import javax.print.attribute.DocAttribute;
+import javax.print.attribute.PrintJobAttribute;
import javax.print.attribute.PrintRequestAttribute;
-import javax.print.attribute.PrintJobAttribute;
/**
- * Class Sides is a printing attribute class, an enumeration, that specifies
- * how print-stream pages are to be imposed upon the sides of an instance of a
- * selected medium, i.e., an impression.
- *
- * The effect of a Sides attribute on a multidoc print job (a job with multiple
- * documents) depends on whether all the docs have the same sides values
- * specified or whether different docs have different sides values specified,
- * and on the (perhaps defaulted) value of the {@link MultipleDocumentHandling
- * MultipleDocumentHandling} attribute.
- *
+ * The effect of a {@code Sides} attribute on a multidoc print job (a job with
+ * multiple documents) depends on whether all the docs have the same sides
+ * values specified or whether different docs have different sides values
+ * specified, and on the (perhaps defaulted) value of the
+ * {@link MultipleDocumentHandling MultipleDocumentHandling} attribute.
+ *
+ * IPP Compatibility: The category name returned by {@code getName()} is
+ * the IPP attribute name. The enumeration's integer value is the IPP enum
+ * value. The {@code toString()} method returns the IPP string representation of
+ * the attribute value.
*
- *
- * IPP Compatibility: The category name returned by
- * {@code getName()} is the IPP attribute name. The enumeration's
- * integer value is the IPP enum value. The {@code toString()} method
- * returns the IPP string representation of the attribute value.
- *
- * @author Alan Kaminsky
+ * @author Alan Kaminsky
*/
-
public final class Sides extends EnumSyntax
implements DocAttribute, PrintRequestAttribute, PrintJobAttribute {
+ /**
+ * Use serialVersionUID from JDK 1.4 for interoperability.
+ */
private static final long serialVersionUID = -6890309414893262822L;
/**
@@ -130,49 +122,55 @@
/**
* Imposes each consecutive pair of print-stream pages upon front and back
- * sides of consecutive media sheets, such that the orientation of each
- * pair of print-stream pages on the medium would be correct for the
- * reader as if for binding on the long edge. This imposition is also
- * known as "duplex" (see {@link #DUPLEX DUPLEX}).
+ * sides of consecutive media sheets, such that the orientation of each pair
+ * of print-stream pages on the medium would be correct for the reader as if
+ * for binding on the long edge. This imposition is also known as "duplex"
+ * (see {@link #DUPLEX DUPLEX}).
*/
public static final Sides TWO_SIDED_LONG_EDGE = new Sides(1);
/**
* Imposes each consecutive pair of print-stream pages upon front and back
- * sides of consecutive media sheets, such that the orientation of each
- * pair of print-stream pages on the medium would be correct for the
- * reader as if for binding on the short edge. This imposition is also
- * known as "tumble" (see {@link #TUMBLE TUMBLE}).
+ * sides of consecutive media sheets, such that the orientation of each pair
+ * of print-stream pages on the medium would be correct for the reader as if
+ * for binding on the short edge. This imposition is also known as "tumble"
+ * (see {@link #TUMBLE TUMBLE}).
*/
public static final Sides TWO_SIDED_SHORT_EDGE = new Sides(2);
/**
- * An alias for "two sided long edge" (see {@link #TWO_SIDED_LONG_EDGE
- * TWO_SIDED_LONG_EDGE}).
+ * An alias for "two sided long edge" (see
+ * {@link #TWO_SIDED_LONG_EDGE TWO_SIDED_LONG_EDGE}).
*/
public static final Sides DUPLEX = TWO_SIDED_LONG_EDGE;
/**
- * An alias for "two sided short edge" (see {@link #TWO_SIDED_SHORT_EDGE
- * TWO_SIDED_SHORT_EDGE}).
+ * An alias for "two sided short edge" (see
+ * {@link #TWO_SIDED_SHORT_EDGE TWO_SIDED_SHORT_EDGE}).
*/
public static final Sides TUMBLE = TWO_SIDED_SHORT_EDGE;
/**
* Construct a new sides enumeration value with the given integer value.
*
- * @param value Integer value.
+ * @param value Integer value
*/
protected Sides(int value) {
super (value);
}
+ /**
+ * The string table for class {@code Sides}.
+ */
private static final String[] myStringTable = {
"one-sided",
"two-sided-long-edge",
"two-sided-short-edge"
};
+ /**
+ * The enumeration value table for class {@code Sides}.
+ */
private static final Sides[] myEnumValueTable = {
ONE_SIDED,
TWO_SIDED_LONG_EDGE,
@@ -180,14 +178,14 @@
};
/**
- * Returns the string table for class Sides.
+ * Returns the string table for class {@code Sides}.
*/
protected String[] getStringTable() {
return myStringTable;
}
/**
- * Returns the enumeration value table for class Sides.
+ * Returns the enumeration value table for class {@code Sides}.
*/
protected EnumSyntax[] getEnumValueTable() {
return myEnumValueTable;
@@ -196,11 +194,11 @@
/**
* Get the printing attribute class which is to be used as the "category"
* for this printing attribute value.
- *
- * For class Sides, the category is class Sides itself.
+ *
+ * For class {@code Sides}, the category is class {@code Sides} itself.
*
- * @return Printing attribute class (category), an instance of class
- * {@link java.lang.Class java.lang.Class}.
+ * @return printing attribute class (category), an instance of class
+ * {@link Class java.lang.Class}
*/
public final Class extends Attribute> getCategory() {
return Sides.class;
@@ -209,13 +207,12 @@
/**
* Get the name of the category of which this attribute value is an
* instance.
- *
- * For class Sides, the category name is {@code "sides"}.
+ *
+ * For class {@code Sides}, the category name is {@code "sides"}.
*
- * @return Attribute category name.
+ * @return attribute category name
*/
public final String getName() {
return "sides";
}
-
}
diff -r 000f4e4ddd39 -r 57173ad5c534 jdk/src/java.desktop/share/classes/javax/print/attribute/standard/package-info.java
--- a/jdk/src/java.desktop/share/classes/javax/print/attribute/standard/package-info.java Fri Sep 01 14:13:40 2017 +0000
+++ b/jdk/src/java.desktop/share/classes/javax/print/attribute/standard/package-info.java Sat Sep 09 14:36:45 2017 +0200
@@ -24,8 +24,8 @@
*/
/**
- * Package javax.print.attribute.standard contains classes for specific printing
- * attributes. The parent package,
+ * Package {@code javax.print.attribute.standard} contains classes for specific
+ * printing attributes. The parent package,
* javax.print.attribute, provides classes and interfaces that describe the
* types of Java Print Service attributes and how they can be collected into
* attribute sets.
@@ -43,19 +43,19 @@
* support them. These support requirements are recorded in the documentation
* for each attribute class.
*
- * Package javax.print.attribute.standard contains standard printing attributes
- * and standard printing attribute values that are widely used in the printing
- * domain. A print service vendor can provide new vendor-specific printing
- * attributes in addition to the standard ones. A vendor can also provide
- * vendor-specific extensions (subclasses) of the standard printing attributes
- * -- for example, to provide additional vendor-specific values for an existing
- * standard attribute. Of course, if a vendor wants clients to be able to use
- * any added or extended attributes, the vendor must publish the new attribute
- * classes.
+ * Package {@code javax.print.attribute.standard} contains standard printing
+ * attributes and standard printing attribute values that are widely used in the
+ * printing domain. A print service vendor can provide new vendor-specific
+ * printing attributes in addition to the standard ones. A vendor can also
+ * provide vendor-specific extensions (subclasses) of the standard printing
+ * attributes -- for example, to provide additional vendor-specific values for
+ * an existing standard attribute. Of course, if a vendor wants clients to be
+ * able to use any added or extended attributes, the vendor must publish the new
+ * attribute classes.
*
* Many of the standard attribute classes extend one of the abstract syntax
- * classes of the javax.print.attribute package. These abstract syntax classes
- * each represent a different type. The
+ * classes of the {@code javax.print.attribute} package. These abstract syntax
+ * classes each represent a different type. The
* EnumSyntax class, for example, represents a type-safe enumeration. The
* abstract syntax class provides a wrapper for the attribute value.
*
@@ -73,9 +73,9 @@
* attribute classes in package javax.print.attribute.standard, just the ones
* that pertain to the application.
*
- * The attribute classes in package javax.print.attribute.standard are based on
- * the Internet Printing Protocol (IPP) attributes as defined in the Internet
- * RFC document, RFC 2911 Internet Printing Protocol/1.1: Model and
+ * The attribute classes in package {@code javax.print.attribute.standard} are
+ * based on the Internet Printing Protocol (IPP) attributes as defined in the
+ * Internet RFC document, RFC 2911 Internet Printing Protocol/1.1: Model and
* Semantics dated September 2000. See
* RFC 2911 for more
* information. The descriptive text for each attribute class was taken largely
@@ -152,485 +152,418 @@
* indicates the supported values for that attribute category.
*
- * Please note: In the javax.print APIs, a null reference parameter to methods
- * is incorrect unless explicitly documented on the method as having a
- * meaningful interpretation. Usage to the contrary is incorrect coding and may
- * result in a run time exception either immediately or at some later time.
- * IllegalArgumentException and NullPointerException are examples of typical and
- * acceptable run time exceptions for such cases.
+ * Please note: In the {@code javax.print} APIs, a {@code null} reference
+ * parameter to methods is incorrect unless explicitly documented on the method
+ * as having a meaningful interpretation. Usage to the contrary is incorrect
+ * coding and may result in a run time exception either immediately or at some
+ * later time. {@code IllegalArgumentException} and {@code NullPointerException}
+ * are examples of typical and acceptable run time exceptions for such cases.
*
* @since 1.4
*/
diff -r 000f4e4ddd39 -r 57173ad5c534 jdk/src/java.desktop/share/classes/javax/print/event/PrintEvent.java
--- a/jdk/src/java.desktop/share/classes/javax/print/event/PrintEvent.java Fri Sep 01 14:13:40 2017 +0000
+++ b/jdk/src/java.desktop/share/classes/javax/print/event/PrintEvent.java Sat Sep 09 14:36:45 2017 +0200
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2000, 2003, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2000, 2017, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
@@ -26,29 +26,31 @@
package javax.print.event;
/**
- *
- * Class PrintEvent is the super class of all Print Service API events.
+ * Class {@code PrintEvent} is the super class of all Print Service API events.
*/
-
public class PrintEvent extends java.util.EventObject {
+ /**
+ * Use serialVersionUID from JDK 1.4 for interoperability.
+ */
private static final long serialVersionUID = 2286914924430763847L;
/**
- * Constructs a PrintEvent object.
- * @param source is the source of the event
- * @throws IllegalArgumentException if {@code source} is
- * {@code null}.
+ * Constructs a {@code PrintEvent} object.
+ *
+ * @param source is the source of the event
+ * @throws IllegalArgumentException if {@code source} is {@code null}
*/
public PrintEvent (Object source) {
super(source);
}
/**
+ * Returns a string representation of this {@code PrintEvent}.
+ *
* @return a message describing the event
*/
public String toString() {
return ("PrintEvent on " + getSource().toString());
}
-
}
diff -r 000f4e4ddd39 -r 57173ad5c534 jdk/src/java.desktop/share/classes/javax/print/event/PrintJobAdapter.java
--- a/jdk/src/java.desktop/share/classes/javax/print/event/PrintJobAdapter.java Fri Sep 01 14:13:40 2017 +0000
+++ b/jdk/src/java.desktop/share/classes/javax/print/event/PrintJobAdapter.java Sat Sep 09 14:36:45 2017 +0200
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2000, 2001, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2000, 2017, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
@@ -26,27 +26,23 @@
package javax.print.event;
/**
- * An abstract adapter class for receiving print job events.
- * The methods in this class are empty.
- * This class exists as a convenience for creating listener objects.
- * Extend this class to create a {@link PrintJobEvent} listener and override
- * the methods for the events of interest. Unlike the
- * {@link java.awt.event.ComponentListener ComponentListener}
- * interface, this abstract interface provides null methods so that you
- * only need to define the methods you need, rather than all of the methods.
- *
- */
-
+ * An abstract adapter class for receiving print job events. The methods in this
+ * class are empty. This class exists as a convenience for creating listener
+ * objects. Extend this class to create a {@link PrintJobEvent} listener and
+ * override the methods for the events of interest. Unlike the
+ * {@link java.awt.event.ComponentListener ComponentListener} interface, this
+ * abstract interface provides empty methods so that you only need to define the
+ * methods you need, rather than all of the methods.
+ */
public abstract class PrintJobAdapter implements PrintJobListener {
/**
- * Called to notify the client that data has been successfully
- * transferred to the print service, and the client may free
- * local resources allocated for that data. The client should
- * not assume that the data has been completely printed after
- * receiving this event.
+ * Called to notify the client that data has been successfully transferred
+ * to the print service, and the client may free local resources allocated
+ * for that data. The client should not assume that the data has been
+ * completely printed after receiving this event.
*
- * @param pje the event being notified
+ * @param pje the event being notified
*/
public void printDataTransferCompleted(PrintJobEvent pje) {
}
@@ -54,52 +50,46 @@
/**
* Called to notify the client that the job completed successfully.
*
- * @param pje the event being notified
+ * @param pje the event being notified
*/
public void printJobCompleted(PrintJobEvent pje) {
}
-
/**
- * Called to notify the client that the job failed to complete
- * successfully and will have to be resubmitted.
+ * Called to notify the client that the job failed to complete successfully
+ * and will have to be resubmitted.
*
- * @param pje the event being notified
+ * @param pje the event being notified
*/
public void printJobFailed(PrintJobEvent pje) {
}
/**
- * Called to notify the client that the job was canceled
- * by user or program.
+ * Called to notify the client that the job was canceled by user or program.
*
- * @param pje the event being notified
+ * @param pje the event being notified
*/
public void printJobCanceled(PrintJobEvent pje) {
}
-
/**
- * Called to notify the client that no more events will be delivered.
- * One cause of this event being generated is if the job
- * has successfully completed, but the printing system
- * is limited in capability and cannot verify this.
- * This event is required to be delivered if none of the other
+ * Called to notify the client that no more events will be delivered. One
+ * cause of this event being generated is if the job has successfully
+ * completed, but the printing system is limited in capability and cannot
+ * verify this. This event is required to be delivered if none of the other
* terminal events (completed/failed/canceled) are delivered.
*
- * @param pje the event being notified
+ * @param pje the event being notified
*/
public void printJobNoMoreEvents(PrintJobEvent pje) {
}
-
/**
- * Called to notify the client that some possibly user rectifiable
- * problem occurs (eg printer out of paper).
+ * Called to notify the client that some possibly user rectifiable problem
+ * occurs (eg printer out of paper).
*
- * @param pje the event being notified
+ * @param pje the event being notified
*/
public void printJobRequiresAttention(PrintJobEvent pje) {
}
-
}
diff -r 000f4e4ddd39 -r 57173ad5c534 jdk/src/java.desktop/share/classes/javax/print/event/PrintJobAttributeEvent.java
--- a/jdk/src/java.desktop/share/classes/javax/print/event/PrintJobAttributeEvent.java Fri Sep 01 14:13:40 2017 +0000
+++ b/jdk/src/java.desktop/share/classes/javax/print/event/PrintJobAttributeEvent.java Sat Sep 09 14:36:45 2017 +0200
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2000, 2003, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2000, 2017, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
@@ -30,23 +30,28 @@
import javax.print.attribute.PrintJobAttributeSet;
/**
- * Class PrintJobAttributeEvent encapsulates an event a PrintService
- * reports to let the client know that one or more printing attributes for a
- * PrintJob have changed.
+ * Class {@code PrintJobAttributeEvent} encapsulates an event a
+ * {@code PrintService} reports to let the client know that one or more printing
+ * attributes for a {@code PrintJob} have changed.
*/
-
public class PrintJobAttributeEvent extends PrintEvent {
+ /**
+ * Use serialVersionUID from JDK 1.4 for interoperability.
+ */
private static final long serialVersionUID = -6534469883874742101L;
+ /**
+ * The printing service attributes that changed.
+ */
private PrintJobAttributeSet attributes;
/**
- * Constructs a PrintJobAttributeEvent object.
- * @param source the print job generating this event
- * @param attributes the attribute changes being reported
- * @throws IllegalArgumentException if {@code source} is
- * {@code null}.
+ * Constructs a {@code PrintJobAttributeEvent} object.
+ *
+ * @param source the print job generating this event
+ * @param attributes the attribute changes being reported
+ * @throws IllegalArgumentException if {@code source} is {@code null}
*/
public PrintJobAttributeEvent (DocPrintJob source,
PrintJobAttributeSet attributes) {
@@ -55,28 +60,24 @@
this.attributes = AttributeSetUtilities.unmodifiableView(attributes);
}
-
/**
- * Determine the Print Job to which this print job event pertains.
+ * Determine the {@code PrintJob} to which this print job event pertains.
*
- * @return Print Job object.
+ * @return {@code PrintJob} object
*/
public DocPrintJob getPrintJob() {
return (DocPrintJob) getSource();
}
-
/**
* Determine the printing attributes that changed and their new values.
*
- * @return Attributes containing the new values for the print job
- * attributes that changed. The returned set may not be modifiable.
+ * @return attributes containing the new values for the print job attributes
+ * that changed. The returned set may not be modifiable.
*/
public PrintJobAttributeSet getAttributes() {
return attributes;
-
}
-
}
diff -r 000f4e4ddd39 -r 57173ad5c534 jdk/src/java.desktop/share/classes/javax/print/event/PrintJobAttributeListener.java
--- a/jdk/src/java.desktop/share/classes/javax/print/event/PrintJobAttributeListener.java Fri Sep 01 14:13:40 2017 +0000
+++ b/jdk/src/java.desktop/share/classes/javax/print/event/PrintJobAttributeListener.java Sat Sep 09 14:36:45 2017 +0200
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2000, 2001, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2000, 2017, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
@@ -26,21 +26,19 @@
package javax.print.event;
/**
- * Implementations of this interface are attached to a
- * {@link javax.print.DocPrintJob DocPrintJob} to monitor
- * the status of attribute changes associated with the print job.
- *
- */
+ * Implementations of this interface are attached to a
+ * {@link javax.print.DocPrintJob DocPrintJob} to monitor the status of
+ * attribute changes associated with the print job.
+ */
public interface PrintJobAttributeListener {
/**
- * Notifies the listener of a change in some print job attributes.
- * One example of an occurrence triggering this event is if the
- * {@link javax.print.attribute.standard.JobState JobState}
- * attribute changed from
- * {@code PROCESSING} to {@code PROCESSING_STOPPED}.
- * @param pjae the event.
+ * Notifies the listener of a change in some print job attributes. One
+ * example of an occurrence triggering this event is if the
+ * {@link javax.print.attribute.standard.JobState JobState} attribute
+ * changed from {@code PROCESSING} to {@code PROCESSING_STOPPED}.
+ *
+ * @param pjae the event being notified
*/
public void attributeUpdate(PrintJobAttributeEvent pjae) ;
-
}
diff -r 000f4e4ddd39 -r 57173ad5c534 jdk/src/java.desktop/share/classes/javax/print/event/PrintJobEvent.java
--- a/jdk/src/java.desktop/share/classes/javax/print/event/PrintJobEvent.java Fri Sep 01 14:13:40 2017 +0000
+++ b/jdk/src/java.desktop/share/classes/javax/print/event/PrintJobEvent.java Sat Sep 09 14:36:45 2017 +0200
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2000, 2003, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2000, 2017, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
@@ -28,98 +28,95 @@
import javax.print.DocPrintJob;
/**
- *
- * Class {@code PrintJobEvent} encapsulates common events a print job
- * reports to let a listener know of progress in the processing of the
- * {@link DocPrintJob}.
- *
+ * Class {@code PrintJobEvent} encapsulates common events a print job reports to
+ * let a listener know of progress in the processing of the {@link DocPrintJob}.
*/
-
public class PrintJobEvent extends PrintEvent {
- private static final long serialVersionUID = -1711656903622072997L;
-
- private int reason;
+ /**
+ * Use serialVersionUID from JDK 1.4 for interoperability.
+ */
+ private static final long serialVersionUID = -1711656903622072997L;
- /**
- * The job was canceled by the {@link javax.print.PrintService PrintService}.
- */
- public static final int JOB_CANCELED = 101;
+ /**
+ * The reason of this event.
+ */
+ private int reason;
- /**
- * The document cis completely printed.
- */
- public static final int JOB_COMPLETE = 102;
+ /**
+ * The job was canceled by the
+ * {@link javax.print.PrintService PrintService}.
+ */
+ public static final int JOB_CANCELED = 101;
- /**
- * The print service reports that the job cannot be completed.
- * The application must resubmit the job.
- */
+ /**
+ * The document is completely printed.
+ */
+ public static final int JOB_COMPLETE = 102;
- public static final int JOB_FAILED = 103;
+ /**
+ * The print service reports that the job cannot be completed. The
+ * application must resubmit the job.
+ */
+ public static final int JOB_FAILED = 103;
- /**
- * The print service indicates that a - possibly transient - problem
- * may require external intervention before the print service can
- * continue. One example of an event that can
- * generate this message is when the printer runs out of paper.
- */
- public static final int REQUIRES_ATTENTION = 104;
+ /**
+ * The print service indicates that a - possibly transient - problem may
+ * require external intervention before the print service can continue. One
+ * example of an event that can generate this message is when the printer
+ * runs out of paper.
+ */
+ public static final int REQUIRES_ATTENTION = 104;
- /**
- * Not all print services may be capable of delivering interesting
- * events, or even telling when a job is complete. This message indicates
- * the print job has no further information or communication
- * with the print service. This message should always be delivered
- * if a terminal event (completed/failed/canceled) is not delivered.
- * For example, if messages such as JOB_COMPLETE have NOT been received
- * before receiving this message, the only inference that should be drawn
- * is that the print service does not support delivering such an event.
- */
- public static final int NO_MORE_EVENTS = 105;
+ /**
+ * Not all print services may be capable of delivering interesting events,
+ * or even telling when a job is complete. This message indicates the print
+ * job has no further information or communication with the print service.
+ * This message should always be delivered if a terminal event
+ * (completed/failed/canceled) is not delivered. For example, if messages
+ * such as {@code JOB_COMPLETE} have NOT been received before receiving this
+ * message, the only inference that should be drawn is that the print
+ * service does not support delivering such an event.
+ */
+ public static final int NO_MORE_EVENTS = 105;
- /**
- * The job is not necessarily printed yet, but the data has been transferred
- * successfully from the client to the print service. The client may
- * free data resources.
- */
- public static final int DATA_TRANSFER_COMPLETE = 106;
+ /**
+ * The job is not necessarily printed yet, but the data has been transferred
+ * successfully from the client to the print service. The client may free
+ * data resources.
+ */
+ public static final int DATA_TRANSFER_COMPLETE = 106;
- /**
+ /**
* Constructs a {@code PrintJobEvent} object.
*
- * @param source a {@code DocPrintJob} object
- * @param reason an int specifying the reason.
- * @throws IllegalArgumentException if {@code source} is
- * {@code null}.
+ * @param source a {@code DocPrintJob} object
+ * @param reason an int specifying the reason
+ * @throws IllegalArgumentException if {@code source} is {@code null}
*/
-
public PrintJobEvent( DocPrintJob source, int reason) {
super(source);
this.reason = reason;
- }
+ }
/**
* Gets the reason for this event.
- * @return reason int.
+ *
+ * @return reason int
*/
public int getPrintEventType() {
return reason;
}
/**
- * Determines the {@code DocPrintJob} to which this print job
- * event pertains.
+ * Determines the {@code DocPrintJob} to which this print job event
+ * pertains.
*
- * @return the {@code DocPrintJob} object that represents the
- * print job that reports the events encapsulated by this
- * {@code PrintJobEvent}.
- *
+ * @return the {@code DocPrintJob} object that represents the print job that
+ * reports the events encapsulated by this {@code PrintJobEvent}
*/
public DocPrintJob getPrintJob() {
return (DocPrintJob) getSource();
}
-
-
}
diff -r 000f4e4ddd39 -r 57173ad5c534 jdk/src/java.desktop/share/classes/javax/print/event/PrintJobListener.java
--- a/jdk/src/java.desktop/share/classes/javax/print/event/PrintJobListener.java Fri Sep 01 14:13:40 2017 +0000
+++ b/jdk/src/java.desktop/share/classes/javax/print/event/PrintJobListener.java Sat Sep 09 14:36:45 2017 +0200
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2000, 2001, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2000, 2017, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
@@ -26,70 +26,66 @@
package javax.print.event;
/**
- * Implementations of this listener interface should be attached to a
- * {@link javax.print.DocPrintJob DocPrintJob} to monitor the status of
- * the printer job.
- * These callback methods may be invoked on the thread processing the
- * print job, or a service created notification thread. In either case
- * the client should not perform lengthy processing in these callbacks.
- */
-
+ * Implementations of this listener interface should be attached to a
+ * {@link javax.print.DocPrintJob DocPrintJob} to monitor the status of the
+ * printer job. These callback methods may be invoked on the thread processing
+ * the print job, or a service created notification thread. In either case the
+ * client should not perform lengthy processing in these callbacks.
+ */
public interface PrintJobListener {
/**
- * Called to notify the client that data has been successfully
- * transferred to the print service, and the client may free
- * local resources allocated for that data. The client should
- * not assume that the data has been completely printed after
- * receiving this event.
- * If this event is not received the client should wait for a terminal
- * event (completed/canceled/failed) before freeing the resources.
- * @param pje the job generating this event
+ * Called to notify the client that data has been successfully transferred
+ * to the print service, and the client may free local resources allocated
+ * for that data. The client should not assume that the data has been
+ * completely printed after receiving this event. If this event is not
+ * received the client should wait for a terminal event
+ * (completed/canceled/failed) before freeing the resources.
+ *
+ * @param pje the job generating this event
*/
public void printDataTransferCompleted(PrintJobEvent pje) ;
-
/**
* Called to notify the client that the job completed successfully.
- * @param pje the job generating this event
+ *
+ * @param pje the job generating this event
*/
public void printJobCompleted(PrintJobEvent pje) ;
-
/**
- * Called to notify the client that the job failed to complete
- * successfully and will have to be resubmitted.
- * @param pje the job generating this event
+ * Called to notify the client that the job failed to complete successfully
+ * and will have to be resubmitted.
+ *
+ * @param pje the job generating this event
*/
public void printJobFailed(PrintJobEvent pje) ;
-
/**
- * Called to notify the client that the job was canceled
- * by a user or a program.
- * @param pje the job generating this event
+ * Called to notify the client that the job was canceled by a user or a
+ * program.
+ *
+ * @param pje the job generating this event
*/
public void printJobCanceled(PrintJobEvent pje) ;
-
/**
- * Called to notify the client that no more events will be delivered.
- * One cause of this event being generated is if the job
- * has successfully completed, but the printing system
- * is limited in capability and cannot verify this.
- * This event is required to be delivered if none of the other
+ * Called to notify the client that no more events will be delivered. One
+ * cause of this event being generated is if the job has successfully
+ * completed, but the printing system is limited in capability and cannot
+ * verify this. This event is required to be delivered if none of the other
* terminal events (completed/failed/canceled) are delivered.
- * @param pje the job generating this event
+ *
+ * @param pje the job generating this event
*/
public void printJobNoMoreEvents(PrintJobEvent pje) ;
-
/**
- * Called to notify the client that an error has occurred that the
- * user might be able to fix. One example of an error that can
- * generate this event is when the printer runs out of paper.
- * @param pje the job generating this event
+ * Called to notify the client that an error has occurred that the user
+ * might be able to fix. One example of an error that can generate this
+ * event is when the printer runs out of paper.
+ *
+ * @param pje the job generating this event
*/
public void printJobRequiresAttention(PrintJobEvent pje) ;
-
}
diff -r 000f4e4ddd39 -r 57173ad5c534 jdk/src/java.desktop/share/classes/javax/print/event/PrintServiceAttributeEvent.java
--- a/jdk/src/java.desktop/share/classes/javax/print/event/PrintServiceAttributeEvent.java Fri Sep 01 14:13:40 2017 +0000
+++ b/jdk/src/java.desktop/share/classes/javax/print/event/PrintServiceAttributeEvent.java Sat Sep 09 14:36:45 2017 +0200
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2000, 2003, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2000, 2017, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
@@ -30,25 +30,28 @@
import javax.print.attribute.PrintServiceAttributeSet;
/**
- *
- * Class PrintServiceAttributeEvent encapsulates an event a
- * Print Service instance reports to let the client know of
- * changes in the print service state.
+ * Class {@code PrintServiceAttributeEvent} encapsulates an event a Print
+ * Service instance reports to let the client know of changes in the print
+ * service state.
*/
-
public class PrintServiceAttributeEvent extends PrintEvent {
+ /**
+ * Use serialVersionUID from JDK 1.4 for interoperability.
+ */
private static final long serialVersionUID = -7565987018140326600L;
+ /**
+ * The printing service attributes that changed.
+ */
private PrintServiceAttributeSet attributes;
/**
- * Constructs a PrintServiceAttributeEvent object.
+ * Constructs a {@code PrintServiceAttributeEvent} object.
*
- * @param source the print job generating this event
- * @param attributes the attribute changes being reported
- * @throws IllegalArgumentException if {@code source} is
- * {@code null}.
+ * @param source the print job generating this event
+ * @param attributes the attribute changes being reported
+ * @throws IllegalArgumentException if {@code source} is {@code null}
*/
public PrintServiceAttributeEvent(PrintService source,
PrintServiceAttributeSet attributes) {
@@ -57,28 +60,25 @@
this.attributes = AttributeSetUtilities.unmodifiableView(attributes);
}
-
/**
* Returns the print service.
-
- * @return Print Service object.
+ *
+ * @return {@code PrintService} object
*/
public PrintService getPrintService() {
return (PrintService) getSource();
}
-
/**
* Determine the printing service attributes that changed and their new
* values.
*
- * @return Attributes containing the new values for the service
- * attributes that changed. The returned set may be unmodifiable.
+ * @return attributes containing the new values for the service attributes
+ * that changed. The returned set may be unmodifiable.
*/
public PrintServiceAttributeSet getAttributes() {
return attributes;
}
-
}
diff -r 000f4e4ddd39 -r 57173ad5c534 jdk/src/java.desktop/share/classes/javax/print/event/PrintServiceAttributeListener.java
--- a/jdk/src/java.desktop/share/classes/javax/print/event/PrintServiceAttributeListener.java Fri Sep 01 14:13:40 2017 +0000
+++ b/jdk/src/java.desktop/share/classes/javax/print/event/PrintServiceAttributeListener.java Sat Sep 09 14:36:45 2017 +0200
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2000, 2001, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2000, 2017, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
@@ -26,23 +26,22 @@
package javax.print.event;
/**
- * Implementations of this listener interface are attached to a
- * {@link javax.print.PrintService PrintService} to monitor
- * the status of the print service.
- *
- * To monitor a particular job see {@link PrintJobListener} and
- * {@link PrintJobAttributeListener}.
- */
-
+ * Implementations of this listener interface are attached to a
+ * {@link javax.print.PrintService PrintService} to monitor the status of the
+ * print service.
+ *
+ * To monitor a particular job see {@link PrintJobListener} and
+ * {@link PrintJobAttributeListener}.
+ */
public interface PrintServiceAttributeListener {
/**
- * Called to notify a listener of an event in the print service.
- * The service will call this method on an event notification thread.
- * The client should not perform lengthy processing in this callback
- * or subsequent event notifications may be blocked.
- * @param psae the event being notified
+ * Called to notify a listener of an event in the print service. The service
+ * will call this method on an event notification thread. The client should
+ * not perform lengthy processing in this callback or subsequent event
+ * notifications may be blocked.
+ *
+ * @param psae the event being notified
*/
public void attributeUpdate(PrintServiceAttributeEvent psae) ;
-
}
diff -r 000f4e4ddd39 -r 57173ad5c534 jdk/src/java.desktop/share/classes/javax/print/event/package-info.java
--- a/jdk/src/java.desktop/share/classes/javax/print/event/package-info.java Fri Sep 01 14:13:40 2017 +0000
+++ b/jdk/src/java.desktop/share/classes/javax/print/event/package-info.java Sat Sep 09 14:36:45 2017 +0200
@@ -24,17 +24,18 @@
*/
/**
- * Package javax.print.event contains event classes and listener interfaces.
+ * Package {@code javax.print.event} contains event classes and listener
+ * interfaces.
*
* They may be used to monitor both print services (such as printers going
* on-line & off-line), and the progress of a specific print job.
*
- * Please note: In the javax.print APIs, a null reference parameter to methods
- * is incorrect unless explicitly documented on the method as having a
- * meaningful interpretation. Usage to the contrary is incorrect coding and may
- * result in a run time exception either immediately or at some later time.
- * IllegalArgumentException and NullPointerException are examples of typical and
- * acceptable run time exceptions for such cases.
+ * Please note: In the {@code javax.print} APIs, a {@code null} reference
+ * parameter to methods is incorrect unless explicitly documented on the method
+ * as having a meaningful interpretation. Usage to the contrary is incorrect
+ * coding and may result in a run time exception either immediately or at some
+ * later time. {@code IllegalArgumentException} and {@code NullPointerException}
+ * are examples of typical and acceptable run time exceptions for such cases.
*
* @since 1.4
*/
diff -r 000f4e4ddd39 -r 57173ad5c534 jdk/src/java.desktop/share/classes/javax/print/package-info.java
--- a/jdk/src/java.desktop/share/classes/javax/print/package-info.java Fri Sep 01 14:13:40 2017 +0000
+++ b/jdk/src/java.desktop/share/classes/javax/print/package-info.java Sat Sep 09 14:36:45 2017 +0200
@@ -28,10 +28,10 @@
* Service API. The Java Print Service API enables client and server
* applications to:
*
* The {@code javax.print.attribute} package describes the types of attributes
* and how they can be collected into sets. The
* {@code javax.print.attribute.standard} package enumerates all of the standard
* attributes supported by the API, most of which are implementations of
* attributes specified in the IETF Specification,
- * RFC 2911 Internet Printing
+ * RFC 2911 Internet Printing
* Protocol, 1.1: Model and Semantics, dated September 2000. The attributes
* specified in {@code javax.print.attribute.standard} include common
* capabilities, such as: resolution, copies, media sizes, job priority, and
@@ -78,16 +78,16 @@
* A typical application using the Java Print Service API performs these steps
* to process a print request:
*
- *
- * Each of these corresponds to the IPP "media" attribute.
- * The current API does not support describing media by characteristics
- * (eg colour, opacity).
- * This may be supported in a later revision of the specification.
+ * Each of these corresponds to the IPP "media" attribute. The current API does
+ * not support describing media by characteristics (eg colour, opacity). This
+ * may be supported in a later revision of the specification.
*
- *
+ *
+ *
*
- * @param object Object to compare to.
- *
- * @return True if {@code object} is equivalent to this media
- * attribute, false otherwise.
+ * @param object {@code Object} to compare to
+ * @return {@code true} if {@code object} is equivalent to this media
+ * attribute, {@code false} otherwise
*/
public boolean equals(Object object) {
return(object != null && object instanceof Media &&
@@ -95,12 +95,12 @@
/**
* Get the printing attribute class which is to be used as the "category"
* for this printing attribute value.
- *
- *
+ * in object. To be equivalent, all of the following conditions must be
+ * true:
+ *
+ *
*
- * @param object Object to compare to.
- *
- * @return True if {@code object} is equivalent to this media margins
- * attribute, false otherwise.
+ * @param object {@code Object} to compare to
+ * @return {@code true} if {@code object} is equivalent to this media
+ * margins attribute, {@code false} otherwise
*/
public boolean equals(Object object) {
boolean ret = false;
@@ -264,12 +252,12 @@
/**
* Get the printing attribute class which is to be used as the "category"
* for this printing attribute value.
- *
- *
+ * Returns whether this media size attribute is equivalent to the passed in
+ * object. To be equivalent, all of the following conditions must be true:
+ *
+ *
*
- * @param object Object to compare to.
- *
- * @return True if {@code object} is equivalent to this media size
- * attribute, false otherwise.
+ * @param object {@code Object} to compare to
+ * @return {@code true} if {@code object} is equivalent to this media size
+ * attribute, {@code false} otherwise
*/
public boolean equals(Object object) {
return (super.equals(object) && object instanceof MediaSize);
@@ -260,12 +248,12 @@
/**
* Get the printing attribute class which is to be used as the "category"
* for this printing attribute value.
- *
- *
- *
- *
- *
+ *
+ * In the detailed explanations below, if "{@code a}" represents an instance of
+ * document data, then the result of processing the data in document "{@code a}"
+ * is a sequence of media sheets represented by "{@code a(*)}".
+ *
+ *
+ *
- *
- *
+ *
+ * Note: None of these values provide means to produce uncollated sheets
+ * within a document, i.e., where multiple copies of sheet n are produced
+ * before sheet n+1 of the same document. To specify that, see the
+ * {@link SheetCollate SheetCollate} attribute.
+ *
- *
+ * passed in object. To be equivalent, all of the following conditions must
+ * be true:
+ *
+ *
*
- * @param object Object to compare to.
- *
- * @return True if {@code object} is equivalent to this number of
- * documents attribute, false otherwise.
+ * @param object {@code Object} to compare to
+ * @return {@code true} if {@code object} is equivalent to this number of
+ * documents attribute, {@code false} otherwise
*/
public boolean equals(Object object) {
return (super.equals (object) &&
@@ -86,12 +82,12 @@
/**
* Get the printing attribute class which is to be used as the "category"
* for this printing attribute value.
- *
- *
+ *
+ *
*
- * @param object Object to compare to.
- *
- * @return True if {@code object} is equivalent to this number of
- * intervening jobs attribute, false otherwise.
+ * @param object {@code Object} to compare to
+ * @return {@code true} if {@code object} is equivalent to this number of
+ * intervening jobs attribute, {@code false} otherwise
*/
public boolean equals(Object object) {
return (super.equals (object) &&
@@ -85,12 +83,12 @@
/**
* Get the printing attribute class which is to be used as the "category"
* for this printing attribute value.
- *
- *
- * IPP Compatibility: The integer value gives the IPP integer value.
- * The category name returned by {@code getName()} gives the IPP
- * attribute name.
- *
- * @author Alan Kaminsky
+ * @author Alan Kaminsky
*/
public final class NumberUp extends IntegerSyntax
implements DocAttribute, PrintRequestAttribute, PrintJobAttribute {
+ /**
+ * Use serialVersionUID from JDK 1.4 for interoperability.
+ */
private static final long serialVersionUID = -3040436486786527811L;
-
/**
* Construct a new number up attribute with the given integer value.
*
- * @param value Integer value.
- *
- * @exception IllegalArgumentException
- * (Unchecked exception) Thrown if {@code value} is less than 1.
+ * @param value Integer value
+ * @throws IllegalArgumentException if {@code value < 1}
*/
public NumberUp(int value) {
super (value, 1, Integer.MAX_VALUE);
@@ -144,20 +131,16 @@
/**
* Returns whether this number up attribute is equivalent to the passed in
* object. To be equivalent, all of the following conditions must be true:
- *
- *
- *
+ *
+ * IPP Compatibility: The integer value gives the IPP integer value. The
+ * category name returned by {@code getName()} gives the IPP attribute name.
*
- *
+ *
+ *
+ *
+ *
- *
- *
- *
+ *
+ *
*
- * @param object Object to compare to.
- *
- * @return True if {@code object} is equivalent to this number up
- * attribute, false otherwise.
+ * @param object {@code Object} to compare to
+ * @return {@code true} if {@code object} is equivalent to this number up
+ * attribute, {@code false} otherwise
*/
public boolean equals(Object object) {
return (super.equals(object) && object instanceof NumberUp);
@@ -166,11 +149,12 @@
/**
* Get the printing attribute class which is to be used as the "category"
* for this printing attribute value.
- *
- *
+ * passed in object. To be equivalent, all of the following conditions must
+ * be true:
+ *
+ *
*
- * @param object Object to compare to.
- *
- * @return True if {@code object} is equivalent to this number up
- * supported attribute, false otherwise.
+ * @param object {@code Object} to compare to
+ * @return {@code true} if {@code object} is equivalent to this number up
+ * supported attribute, {@code false} otherwise
*/
public boolean equals(Object object) {
return (super.equals (object) &&
@@ -151,12 +141,12 @@
/**
* Get the printing attribute class which is to be used as the "category"
* for this printing attribute value.
- *
- *
+ *
+ *
*
- * @param object Object to compare to.
- *
- * @return True if {@code object} is equivalent to this output
- * device assigned attribute, false otherwise.
+ * @param object {@code Object} to compare to
+ * @return {@code true} if {@code object} is equivalent to this output
+ * device assigned attribute, {@code false} otherwise
*/
public boolean equals(Object object) {
return (super.equals (object) &&
@@ -100,12 +98,12 @@
/**
* Get the printing attribute class which is to be used as the "category"
* for this printing attribute value.
- * "n-m"
is specified, the first page
- * to be printed will be page n. All subsequent pages of the document
- * will be printed through and including page m.
- *
- *
- *
- *
- * "n-m"
is specified, the first page
+ * to be printed will be page n. All subsequent pages of the document
+ * will be printed through and including page m.
+ *
+ *
+ *
+ *
+ *
+ *
+ *
- *
- *
- *
+ * Returns whether this page ranges attribute is equivalent to the passed in
+ * object. To be equivalent, all of the following conditions must be true:
+ *
+ *
*
- * @param object Object to compare to.
- *
- * @return True if {@code object} is equivalent to this page ranges
- * attribute, false otherwise.
+ * @param object {@code Object} to compare to
+ * @return {@code true} if {@code object} is equivalent to this page ranges
+ * attribute, {@code false} otherwise
*/
public boolean equals(Object object) {
return (super.equals(object) && object instanceof PageRanges);
@@ -239,11 +213,12 @@
/**
* Get the printing attribute class which is to be used as the "category"
* for this printing attribute value.
- *
- *
+ * passed in object. To be equivalent, all of the following conditions must
+ * be true:
+ *
+ *
*
- * @param object Object to compare to.
- *
- * @return True if {@code object} is equivalent to this pages per
- * minute attribute, false otherwise.
+ * @param object {@code Object} to compare to
+ * @return {@code true} if {@code object} is equivalent to this pages per
+ * minute attribute, {@code false} otherwise
*/
public boolean equals(Object object) {
return (super.equals (object) &&
@@ -87,11 +83,12 @@
/**
* Get the printing attribute class which is to be used as the "category"
* for this printing attribute value.
- *
- *
+ *
+ *
*
- * @param object Object to compare to.
- *
- * @return True if {@code object} is equivalent to this pages per
- * minute color attribute, false otherwise.
+ * @param object {@code Object} to compare to
+ * @return {@code true} if {@code object} is equivalent to this pages per
+ * minute color attribute, {@code false} otherwise
*/
public boolean equals(Object object) {
return (super.equals(object) &&
@@ -98,12 +96,12 @@
/**
* Get the printing attribute class which is to be used as the "category"
* for this printing attribute value.
- *
- *
+ *
+ *
*
- * @param object Object to compare to.
- *
- * @return True if {@code object} is equivalent to this printer
- * info attribute, false otherwise.
+ * @param object {@code Object} to compare to
+ * @return {@code true} if {@code object} is equivalent to this printer info
+ * attribute, {@code false} otherwise
*/
public boolean equals(Object object) {
return (super.equals(object) && object instanceof PrinterInfo);
@@ -95,11 +92,12 @@
/**
* Get the printing attribute class which is to be used as the "category"
* for this printing attribute value.
- *
- *
+ * passed in object. To be equivalent, all of the following conditions must
+ * be true:
+ *
+ *
*
- * @param object Object to compare to.
- *
- * @return True if {@code object} is equivalent to this printer
- * location attribute, false otherwise.
+ * @param object {@code Object} to compare to
+ * @return {@code true} if {@code object} is equivalent to this printer
+ * location attribute, {@code false} otherwise
*/
public boolean equals(Object object) {
return (super.equals(object) && object instanceof PrinterLocation);
@@ -91,12 +88,12 @@
/**
* Get the printing attribute class which is to be used as the "category"
* for this printing attribute value.
- *
- *
+ *
+ *
*
- * @param object Object to compare to.
- *
- * @return True if {@code object} is equivalent to this printer
- * make and model attribute, false otherwise.
+ * @param object {@code Object} to compare to
+ * @return {@code true} if {@code object} is equivalent to this printer make
+ * and model attribute, {@code false} otherwise
*/
public boolean equals(Object object) {
return (super.equals(object) &&
@@ -90,12 +88,12 @@
/**
* Get the printing attribute class which is to be used as the "category"
* for this printing attribute value.
- *
- *
+ *
+ *
*
- * @param object Object to compare to.
- *
- * @return True if {@code object} is equivalent to this printer
- * message from operator attribute, false otherwise.
+ * @param object {@code Object} to compare to
+ * @return {@code true} if {@code object} is equivalent to this printer
+ * message from operator attribute, {@code false} otherwise
*/
public boolean equals(Object object) {
return (super.equals(object) &&
@@ -106,12 +101,12 @@
/**
* Get the printing attribute class which is to be used as the "category"
* for this printing attribute value.
- *
- *
+ * passed in object. To be equivalent, all of the following conditions must
+ * be true:
+ *
+ *
*
- * @param object Object to compare to.
- *
- * @return True if {@code object} is equivalent to this printer
- * more info attribute, false otherwise.
+ * @param object {@code Object} to compare to
+ * @return {@code true} if {@code object} is equivalent to this printer more
+ * info attribute, {@code false} otherwise
*/
public boolean equals(Object object) {
return (super.equals(object) &&
@@ -96,11 +94,12 @@
/**
* Get the printing attribute class which is to be used as the "category"
* for this printing attribute value.
- *
- *
+ *
+ *
*
- * @param object Object to compare to.
- *
- * @return True if {@code object} is equivalent to this printer
- * more info manufacturer attribute, false otherwise.
+ * @param object {@code Object} to compare to
+ * @return {@code true} if {@code object} is equivalent to this printer more
+ * info manufacturer attribute, {@code false} otherwise
*/
public boolean equals(Object object) {
return (super.equals(object) &&
@@ -98,12 +94,12 @@
/**
* Get the printing attribute class which is to be used as the "category"
* for this printing attribute value.
- *
- *
+ *
+ *
*
- * @param object Object to compare to.
- *
- * @return True if {@code object} is equivalent to this printer
- * name attribute, false otherwise.
+ * @param object {@code Object} to compare to
+ * @return {@code true} if {@code object} is equivalent to this printer name
+ * attribute, {@code false} otherwise
*/
public boolean equals(Object object) {
return (super.equals(object) && object instanceof PrinterName);
@@ -93,12 +90,12 @@
/**
* Get the printing attribute class which is to be used as the "category"
* for this printing attribute value.
- *
- *
- * If a client wants to locate a printer supporting a resolution
- * greater than some required minimum, then it may be necessary to exclude
- * this attribute from a lookup request and to directly query the set of
- * supported resolutions, and specify the one that most closely meets
- * the client's requirements.
- * In some cases this may be more simply achieved by specifying a
- * PrintQuality attribute which often controls resolution.
- *
+ *
+ * If a client wants to locate a printer supporting a resolution greater than
+ * some required minimum, then it may be necessary to exclude this attribute
+ * from a lookup request and to directly query the set of supported resolutions,
+ * and specify the one that most closely meets the client's requirements. In
+ * some cases this may be more simply achieved by specifying a
+ * {@code PrintQuality} attribute which often controls resolution.
+ *
- *
+ * passed in object. To be equivalent, all of the following conditions must
+ * be true:
+ *
+ *
*
- * @param object Object to compare to.
- *
- * @return True if {@code object} is equivalent to this printer
- * resolution attribute, false otherwise.
+ * @param object {@code Object} to compare to
+ * @return {@code true} if {@code object} is equivalent to this printer
+ * resolution attribute, {@code false} otherwise
*/
public boolean equals(Object object) {
return (super.equals (object) &&
@@ -123,27 +113,27 @@
/**
* Get the printing attribute class which is to be used as the "category"
* for this printing attribute value.
- *
- *
+ *
+ *
*
- * @param object Object to compare to.
- *
- * @return True if {@code object} is equivalent to this PrinterURI
- * attribute, false otherwise.
+ * @param object {@code Object} to compare to
+ * @return {@code true} if {@code object} is equivalent to this
+ * {@code PrinterURI} attribute, {@code false} otherwise
*/
public boolean equals(Object object) {
return (super.equals(object) && object instanceof PrinterURI);
}
- /**
+ /**
* Get the printing attribute class which is to be used as the "category"
* for this printing attribute value.
- *
- *
+ * passed in object. To be equivalent, all of the following conditions mus
+ * be true:
+ *
+ *
*
- * @param object Object to compare to.
- *
- * @return True if {@code object} is equivalent to this queued job
- * count attribute, false otherwise.
+ * @param object {@code Object} to compare to
+ * @return {@code true} if {@code object} is equivalent to this queued job
+ * count attribute, {@code false} otherwise
*/
public boolean equals(Object object) {
return (super.equals (object) &&
@@ -84,11 +81,12 @@
/**
* Get the printing attribute class which is to be used as the "category"
* for this printing attribute value.
- *
- *
+ * Returns whether this requesting user name attribute is equivalent to the
+ * passed in object. To be equivalent, all of the following conditions must
+ * be true:
+ *
+ *
*
- * @param object Object to compare to.
- *
- * @return True if {@code object} is equivalent to this requesting
- * user name attribute, false otherwise.
+ * @param object {@code Object} to compare to
+ * @return {@code true} if {@code object} is equivalent to this requesting
+ * user name attribute, {@code false} otherwise
*/
public boolean equals(Object object) {
return (super.equals(object) &&
@@ -102,12 +98,12 @@
/**
* Get the printing attribute class which is to be used as the "category"
* for this printing attribute value.
- *
- *
- *
- *
- *
- *
+ *
+ *
+ *
+ *
+ *
+ *
- *
- *
- *
- *
- *
+ * Class {@code Sides} is a printing attribute class, an enumeration, that
+ * specifies how print-stream pages are to be imposed upon the sides of an
+ * instance of a selected medium, i.e., an impression.
+ *
+ *
+ *
+ *
+ *
+ *
+ *
- *
- *
- *
*
- *
- * Attribute Class
- * Doc
- *
AttributePrint
- *
Request
AttributePrint
- *
Job
AttributePrint
- *
Service
AttributeSupportedValuesAttribute
- *
- *
- * Compression
- * X
- *
- *
- *
- *
- *
- *
- * DocumentName
- * X
- *
- *
- *
- *
- *
- *
- * Chromaticity
- * X
- * X
- * X
- *
- *
- *
- *
- * Copies
- *
- * X
- * X
- *
- * CopiesSupported
- *
- *
- * Finishings
- * X
- * X
- * X
- *
- *
- *
- *
- * JobHoldUntil
- *
- * X
- * X
- *
- *
- *
- *
- * JobImpressions
- *
- * X
- * X
- *
- *
- * JobImpressionsSupported
- *
- *
- * JobKOctets
- *
- * X
- * X
- *
- * JobKOctetsSupported
- *
- *
- * JobMediaSheets
- *
- * X
- * X
- *
- *
- * JobMediaSheetsSupported
- *
- *
- * JobName
- *
- * X
- * X
- *
- *
- *
- *
- * JobPriority
- *
- * X
- * X
- *
- * JobPrioritySupported
- *
- *
- * JobSheets
- *
- * X
- * X
- *
- *
- *
- *
- * Media
- * X
- * X
- * X
- *
- *
- *
- *
- * MediaSize
- *
- *
- *
- *
- *
- *
- *
- *
- * MultipleDocumentHandling
- *
- * X
- * X
- *
- *
- *
- *
- * NumberUp
- * X
- * X
- * X
- *
- * NumberUpSupported
- *
- *
- * OrientationRequested
- * X
- * X
- * X
- *
- *
- *
- *
- * PageRanges
- * X
- * X
- * X
- *
- *
- *
- *
- *
- * PresentationDirection
- * X
- * X
- * X
- *
- *
- *
- *
- * PrinterResolution
- * X
- * X
- * X
- *
- *
- *
- *
- * PrintQuality
- * X
- * X
- * X
- *
- *
- *
- *
- * RequestingUserName
- *
- * X
- * X
- *
- *
- *
- *
- * SheetCollate
- * X
- * X
- * X
- *
- *
- *
- *
- * Sides
- * X
- * X
- * X
- *
- *
- *
- *
- * DateTimeAtCompleted
- *
- *
- * X
- *
- *
- *
- *
- * DateTimeAtCreation
- *
- *
- * X
- *
- *
- *
- *
- * DateTimeAtProcessing
- *
- *
- * X
- *
- *
- *
- *
- *
- * JobImpressionsCompleted
- *
- *
- * X
- *
- *
- *
- *
- * JobKOctetsProcessed
- *
- *
- * X
- *
- *
- *
- *
- *
- * JobMediaSheetsCompleted
- *
- *
- * X
- *
- *
- *
- *
- *
- * JobMessageFromOperator
- *
- *
- * X
- *
- *
- *
- *
- *
- * JobOriginatingUserName
- *
- *
- * X
- *
- *
- *
- *
- * JobState
- *
- *
- * X
- *
- *
- *
- *
- * JobStateReasons
- *
- * Contains zero or more --
- *
- * X
- *
- *
- *
- *
- * -- JobStateReason
- *
- *
- *
- *
- *
- *
- *
- * NumberOfDocuments
- *
- *
- * X
- *
- *
- *
- *
- *
- * NumberOfInterveningJobs
- *
- *
- * X
- *
- *
- *
- *
- * OutputDeviceAssigned
- *
- *
- * X
- *
- *
- *
- *
- * ColorSupported
- *
- *
- *
- * X
- *
- *
- *
- * PagesPerMinute
- *
- *
- *
- * X
- *
- *
- *
- * PagesPerMinuteColor
- *
- *
- *
- * X
- *
- *
- *
- * PDLOverrideSupported
- *
- *
- *
- * X
- *
- *
- *
- *
- * PrinterIsAcceptingJobs
- *
- *
- *
- * X
- *
- *
- *
- * PrinterInfo
- *
- *
- *
- * X
- *
- *
- *
- * PrinterLocation
- *
- *
- *
- * X
- *
- *
- *
- *
- * PrinterMessageFromOperator
- *
- *
- *
- * X
- *
- *
- *
- * PrinterMakeAndModel
- *
- *
- *
- * X
- *
- *
- *
- * PrinterMoreInfo
- *
- *
- *
- * X
- *
- *
- *
- *
- * PrinterMoreInfoManufacturer
- *
- *
- *
- * X
- *
- *
- *
- * PrinterName
- *
- *
- *
- * X
- *
- *
- *
- * PrinterState
- *
- *
- *
- * X
- *
- *
- *
- * PrinterStateReasons
- *
- * Contains zero or more --
- *
- *
- * X
- *
- *
- *
- * -- PrinterStateReason
- *
- *
- *
- *
- *
- *
- *
- * -- Severity
- *
- *
- *
- *
- *
- *
- *
- * QueuedJobCount
- *
- *
- *
- * X
- *
- *
- *
+ *
- * ReferenceUriSchemesSupported
- *
- *
- *
- *
- *
- *
+ * Attribute Class
+ * Doc
Attribute
+ * Print
Request
Attribute
+ * Print
Job
Attribute
+ * Print
Service
Attribute
+ * SupportedValuesAttribute
+ *
+ * Compression
+ * X
+ *
+ *
+ *
+ *
+ *
+ * DocumentName
+ * X
+ *
+ *
+ *
+ *
+ *
+ * Chromaticity
+ * X
+ * X
+ * X
+ *
+ *
+ *
+ * Copies
+ *
+ * X
+ * X
+ *
+ * CopiesSupported
+ *
+ * Finishings
+ * X
+ * X
+ * X
+ *
+ *
+ *
+ * JobHoldUntil
+ *
+ * X
+ * X
+ *
+ *
+ *
+ * JobImpressions
+ *
+ * X
+ * X
+ *
+ * JobImpressionsSupported
+ *
+ * JobKOctets
+ *
+ * X
+ * X
+ *
+ * JobKOctetsSupported
+ *
+ * JobMediaSheets
+ *
+ * X
+ * X
+ *
+ * JobMediaSheetsSupported
+ *
+ * JobName
+ *
+ * X
+ * X
+ *
+ *
+ *
+ * JobPriority
+ *
+ * X
+ * X
+ *
+ * JobPrioritySupported
+ *
+ * JobSheets
+ *
+ * X
+ * X
+ *
+ *
+ *
+ * Media
+ * X
+ * X
+ * X
+ *
+ *
+ *
+ * MediaSize
+ *
+ *
+ *
+ *
+ *
+ *
+ * MultipleDocumentHandling
+ *
+ * X
+ * X
+ *
+ *
+ *
+ * NumberUp
+ * X
+ * X
+ * X
+ *
+ * NumberUpSupported
+ *
+ * OrientationRequested
+ * X
+ * X
+ * X
+ *
+ *
+ *
+ * PageRanges
+ * X
+ * X
+ * X
+ *
+ *
+ *
+ * PresentationDirection
+ * X
+ * X
+ * X
+ *
+ *
+ *
+ * PrinterResolution
+ * X
+ * X
+ * X
+ *
+ *
+ *
+ * PrintQuality
+ * X
+ * X
+ * X
+ *
+ *
+ *
+ * RequestingUserName
+ *
+ * X
+ * X
+ *
+ *
+ *
+ * SheetCollate
+ * X
+ * X
+ * X
+ *
+ *
+ *
+ * Sides
+ * X
+ * X
+ * X
+ *
+ *
+ *
+ * DateTimeAtCompleted
+ *
+ *
+ * X
+ *
+ *
+ *
+ * DateTimeAtCreation
+ *
+ *
+ * X
+ *
+ *
+ *
+ * DateTimeAtProcessing
+ *
+ *
+ * X
+ *
+ *
+ *
+ * JobImpressionsCompleted
+ *
+ *
+ * X
+ *
+ *
+ *
+ * JobKOctetsProcessed
+ *
+ *
+ * X
+ *
+ *
+ *
+ * JobMediaSheetsCompleted
+ *
+ *
+ * X
+ *
+ *
+ *
+ * JobMessageFromOperator
+ *
+ *
+ * X
+ *
+ *
+ *
+ * JobOriginatingUserName
+ *
+ *
+ * X
+ *
+ *
+ *
+ * JobState
+ *
+ *
+ * X
+ *
+ *
+ *
+ * JobStateReasons
+ * Contains zero or more --
+ *
+ *
+ * X
+ *
+ *
+ *
+ * -- JobStateReason
+ *
+ *
+ *
+ *
+ *
+ *
+ * NumberOfDocuments
+ *
+ *
+ * X
+ *
+ *
+ *
+ * NumberOfInterveningJobs
+ *
+ *
+ * X
+ *
+ *
+ *
+ * OutputDeviceAssigned
+ *
+ *
+ * X
+ *
+ *
+ *
+ * ColorSupported
+ *
+ *
+ *
+ * X
+ *
+ *
+ * PagesPerMinute
+ *
+ *
+ *
+ * X
+ *
+ *
+ * PagesPerMinuteColor
+ *
+ *
+ *
+ * X
+ *
+ *
+ * PDLOverrideSupported
+ *
+ *
+ *
+ * X
+ *
+ *
+ * PrinterIsAcceptingJobs
+ *
+ *
+ *
+ * X
+ *
+ *
+ * PrinterInfo
+ *
+ *
+ *
+ * X
+ *
+ *
+ * PrinterLocation
+ *
+ *
+ *
+ * X
+ *
+ *
+ *
+ * PrinterMessageFromOperator
+ *
+ *
+ *
+ * X
+ *
+ *
+ * PrinterMakeAndModel
+ *
+ *
+ *
+ * X
+ *
+ *
+ * PrinterMoreInfo
+ *
+ *
+ *
+ * X
+ *
+ *
+ *
+ * PrinterMoreInfoManufacturer
+ *
+ *
+ *
+ * X
+ *
+ *
+ * PrinterName
+ *
+ *
+ *
+ * X
+ *
+ *
+ * PrinterState
+ *
+ *
+ *
+ * X
+ *
+ *
+ * PrinterStateReasons
+ * Contains zero or more --
+ *
+ *
+ *
+ * X
+ *
+ *
+ * -- PrinterStateReason
+ *
+ *
+ *
+ *
+ *
+ *
+ * -- Severity
+ *
+ *
+ *
+ *
+ *
+ *
+ * QueuedJobCount
+ *
+ *
+ *
+ * X
+ *
+ *
+ *
+ * ReferenceUriSchemesSupported
+ *
+ *
+ *
+ *
+ *
*
- *
*
* Print Service Discovery
@@ -51,15 +51,15 @@
* Attribute Definitions
* The {@link javax.print.attribute} and {@link javax.print.attribute.standard}
* packages define print attributes, which describe the capabilities of a print
- * service, specify the requirements of a print job, and track the progress of
- * a print job.
+ * service, specify the requirements of a print job, and track the progress of a
+ * print job.
*
- *
* The following code sample demonstrates a typical use of the Java Print
* Service API: locating printers that can print five double-sided copies of a
@@ -119,13 +119,13 @@
* }
* }
*
- * Please note: In the javax.print APIs, a null reference parameter to methods - * is incorrect unless explicitly documented on the method as having a - * meaningful interpretation. Usage to the contrary is incorrect coding and may - * result in a run time exception either immediately or at some later time. - * IllegalArgumentException and NullPointerException are examples of typical and - * acceptable run time exceptions for such cases. + *
+ * Please note: In the {@code javax.print} APIs, a {@code null} reference + * parameter to methods is incorrect unless explicitly documented on the method + * as having a meaningful interpretation. Usage to the contrary is incorrect + * coding and may result in a run time exception either immediately or at some + * later time. {@code IllegalArgumentException} and {@code NullPointerException} + * are examples of typical and acceptable run time exceptions for such cases. * * @since 1.4 */ diff -r 000f4e4ddd39 -r 57173ad5c534 jdk/src/java.desktop/share/classes/javax/sound/midi/InvalidMidiDataException.java --- a/jdk/src/java.desktop/share/classes/javax/sound/midi/InvalidMidiDataException.java Fri Sep 01 14:13:40 2017 +0000 +++ b/jdk/src/java.desktop/share/classes/javax/sound/midi/InvalidMidiDataException.java Sat Sep 09 14:36:45 2017 +0200 @@ -1,5 +1,5 @@ /* - * Copyright (c) 1999, 2014, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1999, 2017, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -39,6 +39,9 @@ */ public class InvalidMidiDataException extends Exception { + /** + * Use serialVersionUID from JDK 1.3 for interoperability. + */ private static final long serialVersionUID = 2780771756789932067L; /** diff -r 000f4e4ddd39 -r 57173ad5c534 jdk/src/java.desktop/share/classes/javax/sound/midi/MetaMessage.java --- a/jdk/src/java.desktop/share/classes/javax/sound/midi/MetaMessage.java Fri Sep 01 14:13:40 2017 +0000 +++ b/jdk/src/java.desktop/share/classes/javax/sound/midi/MetaMessage.java Sat Sep 09 14:36:45 2017 +0200 @@ -1,5 +1,5 @@ /* - * Copyright (c) 1999, 2014, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1999, 2017, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -54,8 +54,8 @@ /** * Status byte for {@code MetaMessage} (0xFF, or 255), which is used in MIDI - * files. It has the same value as SYSTEM_RESET, which is used in the - * real-time "MIDI wire" protocol. + * files. It has the same value as {@link ShortMessage#SYSTEM_RESET}, which + * is used in the real-time "MIDI wire" protocol. * * @see MidiMessage#getStatus */ diff -r 000f4e4ddd39 -r 57173ad5c534 jdk/src/java.desktop/share/classes/javax/sound/midi/MidiDevice.java --- a/jdk/src/java.desktop/share/classes/javax/sound/midi/MidiDevice.java Fri Sep 01 14:13:40 2017 +0000 +++ b/jdk/src/java.desktop/share/classes/javax/sound/midi/MidiDevice.java Sat Sep 09 14:36:45 2017 +0200 @@ -1,5 +1,5 @@ /* - * Copyright (c) 1999, 2014, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1999, 2017, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -64,11 +64,11 @@ * {@code MidiDevice} instance, the following rules apply: * *
{@code * MidiDevice device = ...; - * if ( ! (device instanceof Sequencer) && ! (device instanceof Synthesizer)) { + * if (!(device instanceof Sequencer) && !(device instanceof Synthesizer)) { * // we're now sure that device represents a MIDI port * // ... * } @@ -112,7 +112,8 @@ * resources and allow applications to exit cleanly. ** Note that some devices, once closed, cannot be reopened. Attempts to - * reopen such a device will always result in a MidiUnavailableException. + * reopen such a device will always result in a + * {@code MidiUnavailableException}. * * @throws MidiUnavailableException thrown if the device cannot be opened * due to resource restrictions @@ -198,7 +199,8 @@ /** * Returns all currently active, non-closed receivers connected with this - * MidiDevice. A receiver can be removed from the device by closing it. + * {@code MidiDevice}. A receiver can be removed from the device by closing + * it. *
* Usually the returned receivers implement the {@code MidiDeviceReceiver} * interface. @@ -231,7 +233,8 @@ /** * Returns all currently active, non-closed transmitters connected with this - * MidiDevice. A transmitter can be removed from the device by closing it. + * {@code MidiDevice}. A transmitter can be removed from the device by + * closing it. *
* Usually the returned transmitters implement the * {@code MidiDeviceTransmitter} interface. @@ -288,12 +291,12 @@ } /** - * Reports whether two objects are equal. Returns {@code true} if the - * objects are identical. + * Indicates whether the specified object is equal to this info object, + * returning {@code true} if the objects are the same. * - * @param obj the reference object with which to compare this object - * @return {@code true} if this object is the same as the {@code obj} - * argument; {@code false} otherwise + * @param obj the reference object with which to compare + * @return {@code true} if the specified object is equal to this info + * object; {@code false} otherwise */ @Override public final boolean equals(Object obj) { @@ -301,7 +304,9 @@ } /** - * Finalizes the hashcode method. + * Returns a hash code value for this info object. + * + * @return a hash code value for this info object */ @Override public final int hashCode() { @@ -353,5 +358,5 @@ public final String toString() { return name; } - } // class Info + } } diff -r 000f4e4ddd39 -r 57173ad5c534 jdk/src/java.desktop/share/classes/javax/sound/midi/MidiDeviceReceiver.java --- a/jdk/src/java.desktop/share/classes/javax/sound/midi/MidiDeviceReceiver.java Fri Sep 01 14:13:40 2017 +0000 +++ b/jdk/src/java.desktop/share/classes/javax/sound/midi/MidiDeviceReceiver.java Sat Sep 09 14:36:45 2017 +0200 @@ -1,5 +1,5 @@ /* - * Copyright (c) 2010, 2014, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2010, 2017, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -35,9 +35,11 @@ public interface MidiDeviceReceiver extends Receiver { /** - * Obtains a MidiDevice object which is an owner of this Receiver. + * Obtains a {@code MidiDevice} object which is an owner of this + * {@code Receiver}. * - * @return a MidiDevice object which is an owner of this Receiver + * @return a {@code MidiDevice} object which is an owner of this + * {@code Receiver} */ MidiDevice getMidiDevice(); } diff -r 000f4e4ddd39 -r 57173ad5c534 jdk/src/java.desktop/share/classes/javax/sound/midi/MidiDeviceTransmitter.java --- a/jdk/src/java.desktop/share/classes/javax/sound/midi/MidiDeviceTransmitter.java Fri Sep 01 14:13:40 2017 +0000 +++ b/jdk/src/java.desktop/share/classes/javax/sound/midi/MidiDeviceTransmitter.java Sat Sep 09 14:36:45 2017 +0200 @@ -1,5 +1,5 @@ /* - * Copyright (c) 2010, 2014, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2010, 2017, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -35,9 +35,11 @@ public interface MidiDeviceTransmitter extends Transmitter { /** - * Obtains a MidiDevice object which is an owner of this Transmitter. + * Obtains a {@code MidiDevice} object which is an owner of this + * {@code Transmitter}. * - * @return a MidiDevice object which is an owner of this Transmitter + * @return a {@code MidiDevice} object which is an owner of this + * {@code Transmitter} */ MidiDevice getMidiDevice(); } diff -r 000f4e4ddd39 -r 57173ad5c534 jdk/src/java.desktop/share/classes/javax/sound/midi/MidiFileFormat.java --- a/jdk/src/java.desktop/share/classes/javax/sound/midi/MidiFileFormat.java Fri Sep 01 14:13:40 2017 +0000 +++ b/jdk/src/java.desktop/share/classes/javax/sound/midi/MidiFileFormat.java Sat Sep 09 14:36:45 2017 +0200 @@ -1,5 +1,5 @@ /* - * Copyright (c) 1999, 2014, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1999, 2017, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -44,37 +44,31 @@ * implementations: * *
Property key | - *Value type | - *Description | - *
---|---|---|
"author" | - *{@link java.lang.String String} | - *name of the author of this file | - *
"title" | - *{@link java.lang.String String} | - *title of this file | - *
"copyright" | - *{@link java.lang.String String} | - *copyright message | - *
"date" | - *{@link java.util.Date Date} | - *date of the recording or release | - *
"comment" | - *{@link java.lang.String String} | - *an arbitrary text | - *
Property key + * | Value type + * | Description + * |
"author" + * | {@link String String} + * | name of the author of this file + * |
"title" + * | {@link String String} + * | title of this file + * |
"copyright" + * | {@link String String} + * | copyright message + * |
"date" + * | {@link java.util.Date Date} + * | date of the recording or release + * |
"comment" + * | {@link String String} + * | an arbitrary text * |
- * The MIDI standard expresses MIDI data in - * bytes. However, because JavaTM uses signed bytes, the Java Sound - * API uses integers instead of bytes when expressing MIDI data. For example, - * the {@link #getStatus()} method of {@code MidiMessage} returns MIDI status - * bytes as integers. If you are processing MIDI data that originated outside - * Java Sound and now is encoded as signed bytes, the bytes can be - * converted to integers using this conversion: + * The MIDI standard expresses MIDI data in bytes. + * However, because Java™ uses signed bytes, the Java Sound API uses + * integers instead of bytes when expressing MIDI data. For example, the + * {@link #getStatus()} method of {@code MidiMessage} returns MIDI status bytes + * as integers. If you are processing MIDI data that originated outside Java + * Sound and now is encoded as signed bytes, the bytes can be converted to + * integers using this conversion: *
* {@code int i = (int)(byte & 0xFF)} *
* If you simply need to pass a known MIDI byte value as a method parameter, it * can be expressed directly as an integer, using (for example) decimal or * hexadecimal notation. For instance, to pass the "active sensing" status byte - * as the first argument to ShortMessage's + * as the first argument to {@code ShortMessage}'s * {@link ShortMessage#setMessage(int) setMessage(int)} method, you can express * it as 254 or 0xFE. * diff -r 000f4e4ddd39 -r 57173ad5c534 jdk/src/java.desktop/share/classes/javax/sound/midi/MidiSystem.java --- a/jdk/src/java.desktop/share/classes/javax/sound/midi/MidiSystem.java Fri Sep 01 14:13:40 2017 +0000 +++ b/jdk/src/java.desktop/share/classes/javax/sound/midi/MidiSystem.java Sat Sep 09 14:36:45 2017 +0200 @@ -57,7 +57,7 @@ * one or more {@code MidiSystem} methods to learn what devices are installed * and to obtain the ones needed in that application. *
- * The class also has methods for reading files, streams, and URLs that contain + * The class also has methods for reading files, streams, and URLs that contain * standard MIDI file data or soundbanks. You can query the {@code MidiSystem} * for the format of a specified MIDI file. *
@@ -77,33 +77,28 @@ *
Property Key | - *Interface | - *Affected Method | - *
---|---|---|
Property Key + * | Interface + * | Affected Method * |
{@code javax.sound.midi.Receiver} | - *{@link Receiver} | - *{@link #getReceiver} | - *
{@code javax.sound.midi.Sequencer} | - *{@link Sequencer} | - *{@link #getSequencer} | - *
{@code javax.sound.midi.Synthesizer} | - *{@link Synthesizer} | - *{@link #getSynthesizer} | - *
{@code javax.sound.midi.Transmitter} | - *{@link Transmitter} | - *{@link #getTransmitter} | - *
{@code javax.sound.midi.Receiver} + * | {@link Receiver} + * | {@link #getReceiver} + * |
{@code javax.sound.midi.Sequencer} + * | {@link Sequencer} + * | {@link #getSequencer} + * |
{@code javax.sound.midi.Synthesizer} + * | {@link Synthesizer} + * | {@link #getSynthesizer} + * |
{@code javax.sound.midi.Transmitter} + * | {@link Transmitter} + * | {@link #getTransmitter} * |
* "Loading" an instrument means that that instrument becomes available for * synthesizing notes. The instrument is loaded into the bank and program diff -r 000f4e4ddd39 -r 57173ad5c534 jdk/src/java.desktop/share/classes/javax/sound/midi/SysexMessage.java --- a/jdk/src/java.desktop/share/classes/javax/sound/midi/SysexMessage.java Fri Sep 01 14:13:40 2017 +0000 +++ b/jdk/src/java.desktop/share/classes/javax/sound/midi/SysexMessage.java Sat Sep 09 14:36:45 2017 +0200 @@ -1,5 +1,5 @@ /* - * Copyright (c) 1998, 2014, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1998, 2017, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -40,8 +40,8 @@ * As dictated by the Standard MIDI Files specification, two status byte values * are legal for a {@code SysexMessage} read from a MIDI file: *
- * If the voice is not currently processing - * a MIDI note, it is considered inactive. A voice is inactive when it has been + * If the voice is not currently processing a + * MIDI note, it is considered inactive. A voice is inactive when it has been * given no note-on commands, or when every note-on command received has been * terminated by a corresponding note-off (or by an "all notes off" message). * For example, this happens when a synthesizer capable of playing 16 diff -r 000f4e4ddd39 -r 57173ad5c534 jdk/src/java.desktop/share/classes/javax/sound/midi/package-info.java --- a/jdk/src/java.desktop/share/classes/javax/sound/midi/package-info.java Fri Sep 01 14:13:40 2017 +0000 +++ b/jdk/src/java.desktop/share/classes/javax/sound/midi/package-info.java Sat Sep 09 14:36:45 2017 +0200 @@ -30,8 +30,8 @@ *
Property key | - *Value type | - *Description | - *
---|---|---|
"duration" | - *{@link java.lang.Long Long} | - *playback duration of the file in microseconds | - *
"author" | - *{@link java.lang.String String} | - *name of the author of this file | - *
"title" | - *{@link java.lang.String String} | - *title of this file | - *
"copyright" | - *{@link java.lang.String String} | - *copyright message | - *
"date" | - *{@link java.util.Date Date} | - *date of the recording or release | - *
"comment" | - *{@link java.lang.String String} | - *an arbitrary text | - *
Property key + * | Value type + * | Description + * |
"duration" + * | {@link Long Long} + * | playback duration of the file in microseconds + * |
"author" + * | {@link String String} + * | name of the author of this file + * |
"title" + * | {@link String String} + * | title of this file + * |
"copyright" + * | {@link String String} + * | copyright message + * |
"date" + * | {@link java.util.Date Date} + * | date of the recording or release + * |
"comment" + * | {@link String String} + * | an arbitrary text * |
* Sound files also have audio formats, of course. The {@link AudioFileFormat} * class encapsulates an {@code AudioFormat} in addition to other, file-specific * information. Similarly, an {@link AudioInputStream} has an @@ -92,29 +93,24 @@ *
Property key | - *Value type | - *Description | - *
---|---|---|
Property key + * | Value type + * | Description * |
"bitrate" | - *{@link java.lang.Integer Integer} | - *average bit rate in bits per second | - *
"vbr" | - *{@link java.lang.Boolean Boolean} | - *{@code true}, if the file is encoded in variable bit - * rate (VBR) | - *
"quality" | - *{@link java.lang.Integer Integer} | - *encoding/conversion quality, 1..100 | - *
"bitrate" + * | {@link java.lang.Integer Integer} + * | average bit rate in bits per second + * |
"vbr" + * | {@link java.lang.Boolean Boolean} + * | {@code true}, if the file is encoded in variable bit rate (VBR) + * |
"quality" + * | {@link java.lang.Integer Integer} + * | encoding/conversion quality, 1..100 * |
@@ -183,8 +179,8 @@
* @param encoding the audio encoding technique
* @param sampleRate the number of samples per second
* @param sampleSizeInBits the number of bits in each sample
- * @param channels the number of channels (1 for mono, 2 for stereo,
- * and so on)
+ * @param channels the number of channels (1 for mono, 2 for stereo, and so
+ * on)
* @param frameSize the number of bytes in each frame
* @param frameRate the number of frames per second
* @param bigEndian indicates whether the data for a single sample is
@@ -217,7 +213,8 @@
* @param frameSize the number of bytes in each frame
* @param frameRate the number of frames per second
* @param bigEndian indicates whether the data for a single sample is
- * stored in big-endian byte order ({@code false} means little-endian)
+ * stored in big-endian byte order ({@code false} means
+ * little-endian)
* @param properties a {@code Map
* You can use a predefined encoding by referring to one of the static
- * objects created by this class, such as PCM_SIGNED or PCM_UNSIGNED.
- * Service providers can create new encodings, such as compressed audio
- * formats, and make these available through the {@link AudioSystem} class.
+ * objects created by this class, such as {@code PCM_SIGNED} or
+ * {@code PCM_UNSIGNED}. Service providers can create new encodings, such as
+ * compressed audio formats, and make these available through the
+ * {@link AudioSystem} class.
*
* The {@code Encoding} class is static, so that all {@code AudioFormat}
* objects that have the same encoding will refer to the same object (rather
@@ -609,7 +608,12 @@
}
/**
- * Finalizes the equals method.
+ * Indicates whether the specified object is equal to this encoding,
+ * returning {@code true} if the objects are equal.
+ *
+ * @param obj the reference object with which to compare
+ * @return {@code true} if the specified object is equal to this
+ * encoding; {@code false} otherwise
*/
@Override
public final boolean equals(final Object obj) {
@@ -623,7 +627,9 @@
}
/**
- * Finalizes the hashCode method.
+ * Returns a hash code value for this encoding.
+ *
+ * @return a hash code value for this encoding
*/
@Override
public final int hashCode() {
diff -r 000f4e4ddd39 -r 57173ad5c534 jdk/src/java.desktop/share/classes/javax/sound/sampled/AudioInputStream.java
--- a/jdk/src/java.desktop/share/classes/javax/sound/sampled/AudioInputStream.java Fri Sep 01 14:13:40 2017 +0000
+++ b/jdk/src/java.desktop/share/classes/javax/sound/sampled/AudioInputStream.java Sat Sep 09 14:36:45 2017 +0200
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 1999, 2016, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1999, 2017, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
@@ -28,7 +28,6 @@
import java.io.IOException;
import java.io.InputStream;
-
/**
* An audio input stream is an input stream with a specified audio format and
* length. The length is expressed in sample frames, not bytes. Several methods
@@ -42,9 +41,10 @@
* The {@code AudioSystem} class includes many methods that manipulate
* {@code AudioInputStream} objects. For example, the methods let you:
*
- *
*
* @author David Rivas
@@ -139,7 +139,7 @@
/**
* Constructs an audio input stream that reads its data from the target data
* line indicated. The format of the stream is the same as that of the
- * target data line, and the length is AudioSystem#NOT_SPECIFIED.
+ * target data line, and the length is {@code AudioSystem#NOT_SPECIFIED}.
*
* @param line the target data line from which this stream obtains its data
* @see AudioSystem#NOT_SPECIFIED
@@ -370,11 +370,11 @@
/**
* Returns the maximum number of bytes that can be read (or skipped over)
- * from this audio input stream without blocking. This limit applies only
- * to the next invocation of a {@code read} or {@code skip} method for this
+ * from this audio input stream without blocking. This limit applies only to
+ * the next invocation of a {@code read} or {@code skip} method for this
* audio input stream; the limit can vary each time these methods are
- * invoked. Depending on the underlying stream, an IOException may be thrown
- * if this stream is closed.
+ * invoked. Depending on the underlying stream, an {@code IOException} may
+ * be thrown if this stream is closed.
*
* @return the number of bytes that can be read from this audio input stream
* without blocking
diff -r 000f4e4ddd39 -r 57173ad5c534 jdk/src/java.desktop/share/classes/javax/sound/sampled/AudioPermission.java
--- a/jdk/src/java.desktop/share/classes/javax/sound/sampled/AudioPermission.java Fri Sep 01 14:13:40 2017 +0000
+++ b/jdk/src/java.desktop/share/classes/javax/sound/sampled/AudioPermission.java Sat Sep 09 14:36:45 2017 +0200
@@ -45,34 +45,30 @@
*
- *
+ * Permission Target Name
- * What the Permission Allows
- * Risks of Allowing this Permission
- *
+ *
*
- * Permission Target Name
+ * What the Permission Allows
+ * Risks of Allowing this Permission
*
- *
- *
- * play
- * Audio playback through the audio device or devices on the system.
- * Allows the application to obtain and manipulate lines and mixers for
- * audio playback (rendering).
- * In some cases use of this permission may affect other
- * applications because the audio from one line may be mixed with other audio
- * being played on the system, or because manipulation of a mixer affects the
- * audio for all lines using that mixer.
- *
- *
+ * record
- * Audio recording through the audio device or devices on the system.
- * Allows the application to obtain and manipulate lines and mixers for
- * audio recording (capture).
- * In some cases use of this permission may affect other
- * applications because manipulation of a mixer affects the audio for all lines
- * using that mixer.
- * This permission can enable an applet or application to eavesdrop on a user.
- *
+ * play
+ * Audio playback through the audio device or devices on the system.
+ * Allows the application to obtain and manipulate lines and mixers for
+ * audio playback (rendering).
+ * In some cases use of this permission may affect other
+ * applications because the audio from one line may be mixed with other
+ * audio being played on the system, or because manipulation of a mixer
+ * affects the audio for all lines using that mixer.
+ *
+ *
* record
+ * Audio recording through the audio device or devices on the system.
+ * Allows the application to obtain and manipulate lines and mixers for
+ * audio recording (capture).
+ * In some cases use of this permission may affect other applications
+ * because manipulation of a mixer affects the audio for all lines using
+ * that mixer. This permission can enable an applet or application to
+ * eavesdrop on a user.
*
Property Key | - *Interface | - *Affected Method(s) | - *
---|---|---|
Property Key + * | Interface + * | Affected Method(s) * |
{@code javax.sound.sampled.Clip} | - *{@link Clip} | - *{@link #getLine}, {@link #getClip} | - *
{@code javax.sound.sampled.Port} | - *{@link Port} | - *{@link #getLine} | - *
{@code javax.sound.sampled.SourceDataLine} | - *{@link SourceDataLine} | - *{@link #getLine}, {@link #getSourceDataLine} | - *
{@code javax.sound.sampled.TargetDataLine} | - *{@link TargetDataLine} | - *{@link #getLine}, {@link #getTargetDataLine} | - *
{@code javax.sound.sampled.Clip} + * | {@link Clip} + * | {@link #getLine}, {@link #getClip} + * |
{@code javax.sound.sampled.Port} + * | {@link Port} + * | {@link #getLine} + * |
{@code javax.sound.sampled.SourceDataLine} + * | {@link SourceDataLine} + * | {@link #getLine}, {@link #getSourceDataLine} + * |
{@code javax.sound.sampled.TargetDataLine} + * | {@link TargetDataLine} + * | {@link #getLine}, {@link #getTargetDataLine} * |
* For example, the property {@code javax.sound.sampled.Clip} with a value
- * {@code "com.sun.media.sound.MixerProvider#SunClip"}
- * will have the following consequences when {@code getLine} is called
- * requesting a {@code Clip} instance: if the class
- * {@code com.sun.media.sound.MixerProvider} exists in the list of installed
- * mixer providers, the first {@code Clip} from the first mixer with name
- * {@code "SunClip"} will be returned. If it cannot be found, the
- * first {@code Clip} from the first mixer of the specified provider will be
+ * {@code "com.sun.media.sound.MixerProvider#SunClip"} will have the following
+ * consequences when {@code getLine} is called requesting a {@code Clip}
+ * instance: if the class {@code com.sun.media.sound.MixerProvider} exists in
+ * the list of installed mixer providers, the first {@code Clip} from the first
+ * mixer with name {@code "SunClip"} will be returned. If it cannot be found,
+ * the first {@code Clip} from the first mixer of the specified provider will be
* returned, regardless of name. If there is none, the first {@code Clip} from
- * the first {@code Mixer} with name {@code "SunClip"} in the list of
- * all mixers (as returned by {@code getMixerInfo}) will be returned, or, if not
- * found, the first {@code Clip} of the first {@code Mixer} that can be found in
- * the list of all mixers is returned. If that fails, too, an
+ * the first {@code Mixer} with name {@code "SunClip"} in the list of all mixers
+ * (as returned by {@code getMixerInfo}) will be returned, or, if not found, the
+ * first {@code Clip} of the first {@code Mixer} that can be found in the list
+ * of all mixers is returned. If that fails, too, an
* {@code IllegalArgumentException} is thrown.
*
* @author Kara Kytle
@@ -479,7 +472,6 @@
* @param mixerInfo a {@code Mixer.Info} object representing the desired
* mixer, or {@code null} for the system default mixer
* @return a clip object from the specified mixer
- *
* @throws LineUnavailableException if a clip is not available from this
* mixer due to resource restrictions
* @throws SecurityException if a clip is not available from this mixer due
@@ -670,9 +662,9 @@
*
* @param sourceEncoding the encoding for which conversion support is
* queried
- * @return array of encodings. If {@code sourceEncoding}is not supported, an
- * array of length 0 is returned. Otherwise, the array will have a
- * length of at least 1, representing {@code sourceEncoding}
+ * @return array of encodings. If {@code sourceEncoding} is not supported,
+ * an array of length 0 is returned. Otherwise, the array will have
+ * a length of at least 1, representing {@code sourceEncoding}
* (no conversion).
* @throws NullPointerException if {@code sourceEncoding} is {@code null}
*/
@@ -935,15 +927,15 @@
}
/**
- * Obtains the audio file format of the specified URL. The URL must point to
- * valid audio file data.
+ * Obtains the audio file format of the specified {@code URL}. The
+ * {@code URL} must point to valid audio file data.
*
- * @param url the URL from which file format information should be
+ * @param url the {@code URL} from which file format information should be
* extracted
* @return an {@code AudioFileFormat} object describing the audio file
* format
- * @throws UnsupportedAudioFileException if the URL does not point to valid
- * audio file data recognized by the system
+ * @throws UnsupportedAudioFileException if the {@code URL} does not point
+ * to valid audio file data recognized by the system
* @throws IOException if an input/output exception occurs
* @throws NullPointerException if {@code url} is {@code null}
*/
@@ -1021,15 +1013,15 @@
}
/**
- * Obtains an audio input stream from the URL provided. The URL must point
- * to valid audio file data.
+ * Obtains an audio input stream from the {@code URL} provided. The
+ * {@code URL} must point to valid audio file data.
*
- * @param url the URL for which the {@code AudioInputStream} should be
- * constructed
+ * @param url the {@code URL} for which the {@code AudioInputStream} should
+ * be constructed
* @return an {@code AudioInputStream} object based on the audio file data
- * pointed to by the URL
- * @throws UnsupportedAudioFileException if the URL does not point to valid
- * audio file data recognized by the system
+ * pointed to by the {@code URL}
+ * @throws UnsupportedAudioFileException if the {@code URL} does not point
+ * to valid audio file data recognized by the system
* @throws IOException if an I/O exception occurs
* @throws NullPointerException if {@code url} is {@code null}
*/
@@ -1121,8 +1113,8 @@
* Obtains the file types that the system can write from the audio input
* stream specified.
*
- * @param stream the audio input stream for which audio file type
- * support is queried
+ * @param stream the audio input stream for which audio file type support
+ * is queried
* @return array of file types. If no file types are supported, an array of
* length 0 is returned.
* @throws NullPointerException if {@code stream} is {@code null}
@@ -1175,8 +1167,8 @@
* type to the output stream provided. Some file types require that the
* length be written into the file header; such files cannot be written from
* start to finish unless the length is known in advance. An attempt to
- * write a file of such a type will fail with an IOException if the length
- * in the audio file type is {@code AudioSystem.NOT_SPECIFIED}.
+ * write a file of such a type will fail with an {@code IOException} if the
+ * length in the audio file type is {@code AudioSystem.NOT_SPECIFIED}.
*
* @param stream the audio input stream containing audio data to be written
* to the file
@@ -1250,7 +1242,9 @@
// METHODS FOR INTERNAL IMPLEMENTATION USE
/**
- * Obtains the set of MixerProviders on the system.
+ * Obtains the list of MixerProviders currently installed on the system.
+ *
+ * @return the list of MixerProviders currently installed on the system
*/
@SuppressWarnings("unchecked")
private static List
* Mixers often support synchronized control of multiple data lines.
- * Synchronization can be established through the Mixer interface's
+ * Synchronization can be established through the {@code Mixer} interface's
* {@link Mixer#synchronize synchronize} method. See the description of the
* {@link Mixer Mixer} interface for a more complete description.
*
@@ -181,7 +181,7 @@
* are bytes, but will always correspond to an integral number of sample
* frames of audio data.
*
- * @return the size of the buffer in bytes
+ * @return the size of the buffer, in bytes
*/
int getBufferSize();
@@ -260,8 +260,8 @@
* {@code DataLine.Info} provides additional information specific to data
* lines. This information includes:
*
- * Some fields in the AudioFormat instances can be set to
+ * Some fields in the {@code AudioFormat} instances can be set to
* {@link AudioSystem#NOT_SPECIFIED NOT_SPECIFIED} if that field does
* not apply to the format, or if the format supports a wide range of
* values for that field. For example, a multi-channel device supporting
@@ -419,6 +430,7 @@
* large as that of the object specified, and all of its formats must
* match formats supported by the object specified.
*
+ * @param info the info object which is being compared to this one
* @return {@code true} if this object matches the one specified,
* otherwise {@code false}
*/
diff -r 000f4e4ddd39 -r 57173ad5c534 jdk/src/java.desktop/share/classes/javax/sound/sampled/Line.java
--- a/jdk/src/java.desktop/share/classes/javax/sound/sampled/Line.java Fri Sep 01 14:13:40 2017 +0000
+++ b/jdk/src/java.desktop/share/classes/javax/sound/sampled/Line.java Sat Sep 09 14:36:45 2017 +0200
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 1999, 2014, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1999, 2017, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
@@ -237,8 +237,8 @@
* class. This constructor is typically used by an application to
* describe a desired line.
*
- * @param lineClass the class of the line that the new Line.Info object
- * describes
+ * @param lineClass the class of the line that the new
+ * {@code Line.Info} object describes
*/
public Info(Class> lineClass) {
@@ -250,7 +250,8 @@
}
/**
- * Obtains the class of the line that this Line.Info object describes.
+ * Obtains the class of the line that this {@code Line.Info} object
+ * describes.
*
* @return the described line's class
*/
@@ -261,13 +262,13 @@
/**
* Indicates whether the specified info object matches this one. To
* match, the specified object must be identical to or a special case of
- * this one. The specified info object must be either an instance of
- * the same class as this one, or an instance of a sub-type of this one.
- * In addition, the attributes of the specified object must be
- * compatible with the capabilities of this one. Specifically, the
- * routing configuration for the specified info object must be
- * compatible with that of this one. Subclasses may add other criteria
- * to determine whether the two objects match.
+ * this one. The specified info object must be either an instance of the
+ * same class as this one, or an instance of a sub-type of this one. In
+ * addition, the attributes of the specified object must be compatible
+ * with the capabilities of this one. Specifically, the routing
+ * configuration for the specified info object must be compatible with
+ * that of this one. Subclasses may add other criteria to determine
+ * whether the two objects match.
*
* @param info the info object which is being compared to this one
* @return {@code true} if the specified object matches this one,
diff -r 000f4e4ddd39 -r 57173ad5c534 jdk/src/java.desktop/share/classes/javax/sound/sampled/LineEvent.java
--- a/jdk/src/java.desktop/share/classes/javax/sound/sampled/LineEvent.java Fri Sep 01 14:13:40 2017 +0000
+++ b/jdk/src/java.desktop/share/classes/javax/sound/sampled/LineEvent.java Sat Sep 09 14:36:45 2017 +0200
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 1999, 2014, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1999, 2017, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
@@ -48,14 +48,17 @@
*/
public class LineEvent extends EventObject {
+ /**
+ * Use serialVersionUID from JDK 1.3 for interoperability.
+ */
private static final long serialVersionUID = -1274246333383880410L;
/**
* The kind of line event ({@code OPEN}, {@code CLOSE}, {@code START}, or
* {@code STOP}).
*
+ * @see #getType
* @serial
- * @see #getType
*/
private final Type type;
@@ -67,8 +70,8 @@
* this value is not known, the position value should be
* {@link AudioSystem#NOT_SPECIFIED}.
*
+ * @see #getFramePosition
* @serial
- * @see #getFramePosition
*/
private final long position;
@@ -184,11 +187,11 @@
/**
* Indicates whether the specified object is equal to this event type,
- * returning {@code true} if the objects are identical.
+ * returning {@code true} if the objects are the same.
*
* @param obj the reference object with which to compare
- * @return {@code true} if this event type is the same as {@code obj};
- * {@code false} otherwise
+ * @return {@code true} if the specified object is equal to this event
+ * type; {@code false} otherwise
*/
@Override
public final boolean equals(Object obj) {
@@ -196,7 +199,9 @@
}
/**
- * Finalizes the hashcode method.
+ * Returns a hash code value for this event type.
+ *
+ * @return a hash code value for this event type
*/
@Override
public final int hashCode() {
@@ -205,6 +210,8 @@
/**
* Returns the type name as the string representation.
+ *
+ * @return the type name as the string representation
*/
@Override
public String toString() {
@@ -253,22 +260,24 @@
/**
* A type of event that is sent when a line ceases to engage in active
- * input or output of audio data because the end of media has been reached.
+ * input or output of audio data because the end of media has been
+ * reached.
*/
/*
- * ISSUE: we may want to get rid of this. Is JavaSound
- * responsible for reporting this??
+ * ISSUE: we may want to get rid of this. Is JavaSound responsible for
+ * reporting this??
*
- * [If it's decided to keep this API, the docs will need to be updated to include mention
- * of EOM events elsewhere.]
+ * [If it's decided to keep this API, the docs will need to be updated
+ * to include mention of EOM events elsewhere.]
*/
//public static final Type EOM = new Type("EOM");
/**
* A type of event that is sent when a line begins to engage in active
- * input or output of audio data. Examples of when this happens are
- * when a source line begins or resumes writing data to its mixer, and
- * when a target line begins or resumes reading data from its mixer.
+ * input or output of audio data. Examples of when this happens are when
+ * a source line begins or resumes writing data to its mixer, and when a
+ * target line begins or resumes reading data from its mixer.
+ *
* @see #STOP
* @see SourceDataLine#write
* @see TargetDataLine#read
@@ -277,8 +286,9 @@
//public static final Type ACTIVE = new Type("ACTIVE");
/**
- * A type of event that is sent when a line ceases active input or output
- * of audio data.
+ * A type of event that is sent when a line ceases active input or
+ * output of audio data.
+ *
* @see #START
* @see DataLine#stop
*/
diff -r 000f4e4ddd39 -r 57173ad5c534 jdk/src/java.desktop/share/classes/javax/sound/sampled/LineUnavailableException.java
--- a/jdk/src/java.desktop/share/classes/javax/sound/sampled/LineUnavailableException.java Fri Sep 01 14:13:40 2017 +0000
+++ b/jdk/src/java.desktop/share/classes/javax/sound/sampled/LineUnavailableException.java Sat Sep 09 14:36:45 2017 +0200
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 1999, 2014, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1999, 2017, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
@@ -35,6 +35,9 @@
*/
public class LineUnavailableException extends Exception {
+ /**
+ * Use serialVersionUID from JDK 1.3 for interoperability.
+ */
private static final long serialVersionUID = -2046718279487432130L;
/**
diff -r 000f4e4ddd39 -r 57173ad5c534 jdk/src/java.desktop/share/classes/javax/sound/sampled/Mixer.java
--- a/jdk/src/java.desktop/share/classes/javax/sound/sampled/Mixer.java Fri Sep 01 14:13:40 2017 +0000
+++ b/jdk/src/java.desktop/share/classes/javax/sound/sampled/Mixer.java Sat Sep 09 14:36:45 2017 +0200
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 1999, 2014, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1999, 2017, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
@@ -58,7 +58,7 @@
* version, vendor, etc.
*
* @return a mixer info object that describes this mixer
- * @see Mixer.Info
+ * @see Info
*/
Info getMixerInfo();
@@ -144,19 +144,19 @@
/**
* Obtains the approximate maximum number of lines of the requested type
* that can be open simultaneously on the mixer.
- *
+ *
* Certain types of mixers do not have a hard bound and may allow opening
* more lines. Since certain lines are a shared resource, a mixer may not be
* able to open the maximum number of lines if another process has opened
* lines of this mixer.
- *
+ *
* The requested type is any line that matches the description in the
* provided {@code Line.Info} object. For example, if the info object
* represents a speaker port, and the mixer supports exactly one speaker
- * port, this method should return 1. If the info object represents a
- * source data line and the mixer supports the use of 32 source data lines
+ * port, this method should return 1. If the info object represents a source
+ * data line and the mixer supports the use of 32 source data lines
* simultaneously, the return value should be 32. If there is no limit, this
- * function returns {@code AudioSystem.NOT_SPECIFIED}.
+ * function returns {@link AudioSystem#NOT_SPECIFIED}.
*
* @param info a {@code Line.Info} that describes the line for which the
* number of supported instances is queried
@@ -215,11 +215,10 @@
* this mixer are unsynchronized.
*
* @param lines the synchronized lines for which synchronization should be
- * released, or {@code null} for all this mixer's synchronized
- * lines
+ * released, or {@code null} for all this mixer's synchronized lines
* @throws IllegalArgumentException if the lines cannot be unsynchronized.
- * This may occur if the argument specified does not exactly match
- * a set of lines for which synchronization has already been
+ * This may occur if the argument specified does not exactly match a
+ * set of lines for which synchronization has already been
* established.
*/
void unsynchronize(Line[] lines);
@@ -277,8 +276,8 @@
* information.
*
* @param name the name of the mixer
- * @param vendor the company who manufactures or creates the
- * hardware or software mixer
+ * @param vendor the company who manufactures or creates the hardware
+ * or software mixer
* @param description descriptive text about the mixer
* @param version version information for the mixer
*/
@@ -291,13 +290,12 @@
}
/**
- * Indicates whether two info objects are equal, returning {@code true}
- * if they are identical.
+ * Indicates whether the specified object is equal to this info object,
+ * returning {@code true} if the objects are the same.
*
- * @param obj the reference object with which to compare this info
- * object
- * @return {@code true} if this info object is the same as the
- * {@code obj} argument; {@code false} otherwise
+ * @param obj the reference object with which to compare
+ * @return {@code true} if the specified object is equal to this info
+ * object; {@code false} otherwise
*/
@Override
public final boolean equals(Object obj) {
@@ -305,9 +303,9 @@
}
/**
- * Finalizes the hashcode method.
+ * Returns a hash code value for this info object.
*
- * @return the hashcode for this object
+ * @return a hash code value for this info object
*/
@Override
public final int hashCode() {
diff -r 000f4e4ddd39 -r 57173ad5c534 jdk/src/java.desktop/share/classes/javax/sound/sampled/Port.java
--- a/jdk/src/java.desktop/share/classes/javax/sound/sampled/Port.java Fri Sep 01 14:13:40 2017 +0000
+++ b/jdk/src/java.desktop/share/classes/javax/sound/sampled/Port.java Sat Sep 09 14:36:45 2017 +0200
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 1999, 2014, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1999, 2017, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
@@ -100,7 +100,14 @@
// DAT
// DVD
+ /**
+ * The string that names the port.
+ */
private final String name;
+
+ /**
+ * Whether this port is source or not.
+ */
private final boolean isSource;
/**
@@ -111,8 +118,8 @@
* @param lineClass the class of the port described by the info object
* @param name the string that names the port
* @param isSource {@code true} if the port is a source port (such as a
- * microphone), {@code false} if the port is a target port
- * (such as a speaker)
+ * microphone), {@code false} if the port is a target port (such
+ * as a speaker)
*/
public Info(Class> lineClass, String name, boolean isSource) {
@@ -134,8 +141,8 @@
* Indicates whether the port is a source or a target for its mixer.
*
* @return {@code true} if the port is a source port (such as a
- * microphone), {@code false} if the port is a target port
- * (such as a speaker)
+ * microphone), {@code false} if the port is a target port (such
+ * as a speaker)
*/
public boolean isSource() {
return isSource;
@@ -147,6 +154,8 @@
* types must be equal.
*
* @param info the info object for which the match is queried
+ * @return {@code true} if the specified object matches this one,
+ * {@code false} otherwise
*/
@Override
public boolean matches(Line.Info info) {
@@ -167,7 +176,12 @@
}
/**
- * Finalizes the equals method.
+ * Indicates whether the specified object is equal to this info object,
+ * returning {@code true} if the objects are the same.
+ *
+ * @param obj the reference object with which to compare
+ * @return {@code true} if the specified object is equal to this info
+ * object; {@code false} otherwise
*/
@Override
public final boolean equals(Object obj) {
@@ -175,7 +189,9 @@
}
/**
- * Finalizes the hashCode method.
+ * Returns a hash code value for this info object.
+ *
+ * @return a hash code value for this info object
*/
@Override
public final int hashCode() {
diff -r 000f4e4ddd39 -r 57173ad5c534 jdk/src/java.desktop/share/classes/javax/sound/sampled/ReverbType.java
--- a/jdk/src/java.desktop/share/classes/javax/sound/sampled/ReverbType.java Fri Sep 01 14:13:40 2017 +0000
+++ b/jdk/src/java.desktop/share/classes/javax/sound/sampled/ReverbType.java Sat Sep 09 14:36:45 2017 +0200
@@ -38,7 +38,7 @@
* delay time and intensity of early reflections, the delay time and intensity
* of late reflections, and an overall decay time. Early reflections are the
* initial individual low-order reflections of the direct signal off the
- * surfaces in the room. The late Reflections are the dense, high-order
+ * surfaces in the room. The late reflections are the dense, high-order
* reflections that characterize the room's reverberation. The delay times for
* the start of these two reflection types give the listener a sense of the
* overall size and complexity of the room's shape and contents. The larger the
@@ -63,8 +63,8 @@
*
* If implementing JavaSound on a I3DL2-compliant device:
*
* The following table shows what parameter values an implementation might use
@@ -74,60 +74,50 @@
*
- *
* Because a {@code Line.Info} knows the class of the line its describes, a
* {@code DataLine.Info} object can describe {@code DataLine} subinterfaces
@@ -270,14 +270,25 @@
* appropriate instance of {@code DataLine.Info} as the argument to a method
* such as {@link Mixer#getLine(Line.Info)}.
*
+ * @author Kara Kytle
* @see Line.Info
- * @author Kara Kytle
* @since 1.3
*/
class Info extends Line.Info {
+ /**
+ * The set of supported formats.
+ */
private final AudioFormat[] formats;
+
+ /**
+ * Minimum buffer size supported by the data line, in bytes.
+ */
private final int minBufferSize;
+
+ /**
+ * Maximum buffer size supported by the data line, in bytes.
+ */
private final int maxBufferSize;
/**
@@ -289,10 +300,10 @@
* @param lineClass the class of the data line described by the info
* object
* @param formats set of formats supported
- * @param minBufferSize minimum buffer size supported by the data
- * line, in bytes
- * @param maxBufferSize maximum buffer size supported by the data
- * line, in bytes
+ * @param minBufferSize minimum buffer size supported by the data line,
+ * in bytes
+ * @param maxBufferSize maximum buffer size supported by the data line,
+ * in bytes
*/
public Info(Class> lineClass, AudioFormat[] formats, int minBufferSize, int maxBufferSize) {
@@ -317,7 +328,7 @@
* @param lineClass the class of the data line described by the info
* object
* @param format desired format
- * @param bufferSize desired buffer size in bytes
+ * @param bufferSize desired buffer size, in bytes
*/
public Info(Class> lineClass, AudioFormat format, int bufferSize) {
@@ -354,7 +365,7 @@
* {@code isFormatSupported(AudioFormat)} is guaranteed to return
* {@code true} for all formats returned by {@code getFormats()}.
*
- *
*
- *
+ * Type
- * Decay Time (ms)
- * Late Intensity (dB)
- * Late Delay (ms)
- * Early Intensity (dB)
- * Early Delay(ms)
- *
+ *
*
- * Type
+ * Decay Time (ms)
+ * Late Intensity (dB)
+ * Late Delay (ms)
+ * Early Intensity (dB)
+ * Early Delay(ms)
*
- *
- *
- * Cavern
- * 2250
- * -2.0
- * 41.3
- * -1.4
- * 10.3
- *
- *
- *
- * Dungeon
- * 1600
- * -1.0
- * 10.3
- * -0.7
- * 2.6
- *
- *
- *
- * Garage
- * 900
- * -6.0
- * 14.7
- * -4.0
- * 3.9
- *
- *
- *
- * Acoustic Lab
- * 280
- * -3.0
- * 8.0
- * -2.0
- * 2.0
- *
- *
+ * Closet
- * 150
- * -10.0
- * 2.5
- * -7.0
- * 0.6
- *
+ * Cavern
+ * 2250
+ * -2.0
+ * 41.3
+ * -1.4
+ * 10.3
+ *
+ * Dungeon
+ * 1600
+ * -1.0
+ * 10.3
+ * -0.7
+ * 2.6
+ *
+ * Garage
+ * 900
+ * -6.0
+ * 14.7
+ * -4.0
+ * 3.9
+ *
+ * Acoustic Lab
+ * 280
+ * -3.0
+ * 8.0
+ * -2.0
+ * 2.0
+ *
+ *
* Closet
+ * 150
+ * -10.0
+ * 2.5
+ * -7.0
+ * 0.6
*
ButtonGroup
that the button belongs to
+ * @since 10
+ */
+ default ButtonGroup getGroup() {
+ return null;
+ }
+
+ /**
* Adds an ActionListener
to the model.
*
* @param l the listener to add
diff -r 000f4e4ddd39 -r 57173ad5c534 jdk/src/java.desktop/share/classes/javax/swing/JInternalFrame.java
--- a/jdk/src/java.desktop/share/classes/javax/swing/JInternalFrame.java Fri Sep 01 14:13:40 2017 +0000
+++ b/jdk/src/java.desktop/share/classes/javax/swing/JInternalFrame.java Sat Sep 09 14:36:45 2017 +0200
@@ -1077,8 +1077,15 @@
firePropertyChange(IS_SELECTED_PROPERTY, oldValue, newValue);
if (isSelected)
fireInternalFrameEvent(InternalFrameEvent.INTERNAL_FRAME_ACTIVATED);
- else
+ else {
fireInternalFrameEvent(InternalFrameEvent.INTERNAL_FRAME_DEACTIVATED);
+ try {
+ java.awt.Toolkit.getDefaultToolkit().getSystemEventQueue().postEvent(
+ new sun.awt.UngrabEvent(this));
+ } catch (SecurityException e) {
+ this.dispatchEvent(new sun.awt.UngrabEvent(this));
+ }
+ }
repaint();
}
@@ -1758,6 +1765,12 @@
isClosed = true;
}
fireInternalFrameEvent(InternalFrameEvent.INTERNAL_FRAME_CLOSED);
+ try {
+ java.awt.Toolkit.getDefaultToolkit().getSystemEventQueue().postEvent(
+ new sun.awt.UngrabEvent(this));
+ } catch (SecurityException e) {
+ this.dispatchEvent(new sun.awt.UngrabEvent(this));
+ }
}
/**
diff -r 000f4e4ddd39 -r 57173ad5c534 jdk/src/java.desktop/share/classes/javax/swing/JOptionPane.java
--- a/jdk/src/java.desktop/share/classes/javax/swing/JOptionPane.java Fri Sep 01 14:13:40 2017 +0000
+++ b/jdk/src/java.desktop/share/classes/javax/swing/JOptionPane.java Sat Sep 09 14:36:45 2017 +0200
@@ -1233,6 +1233,16 @@
messageType, icon, null, null);
}
+ private static boolean checkFrameForComponent(Component parentComponent) {
+ if (parentComponent == null) {
+ return false;
+ }
+ if (parentComponent instanceof Frame) {
+ return true;
+ }
+ return checkFrameForComponent(parentComponent.getParent());
+ }
+
/**
* Brings up an internal dialog panel with a specified icon, where
* the initial choice is determined by the initialValue
@@ -1293,32 +1303,39 @@
getFocusOwner();
pane.setInitialValue(initialValue);
-
- JInternalFrame dialog =
- pane.createInternalFrame(parentComponent, title);
- pane.selectInitialValue();
- dialog.setVisible(true);
+ if (checkFrameForComponent(parentComponent)) {
+ JInternalFrame dialog =
+ pane.createInternalFrame(parentComponent, title);
+ pane.selectInitialValue();
+ dialog.setVisible(true);
- /* Since all input will be blocked until this dialog is dismissed,
- * make sure its parent containers are visible first (this component
- * is tested below). This is necessary for JApplets, because
- * because an applet normally isn't made visible until after its
- * start() method returns -- if this method is called from start(),
- * the applet will appear to hang while an invisible modal frame
- * waits for input.
- */
- if (dialog.isVisible() && !dialog.isShowing()) {
- Container parent = dialog.getParent();
- while (parent != null) {
- if (parent.isVisible() == false) {
- parent.setVisible(true);
+ /* Since all input will be blocked until this dialog is dismissed,
+ * make sure its parent containers are visible first (this component
+ * is tested below). This is necessary for JApplets, because
+ * because an applet normally isn't made visible until after its
+ * start() method returns -- if this method is called from start(),
+ * the applet will appear to hang while an invisible modal frame
+ * waits for input.
+ */
+ if (dialog.isVisible() && !dialog.isShowing()) {
+ Container parent = dialog.getParent();
+ while (parent != null) {
+ if (parent.isVisible() == false) {
+ parent.setVisible(true);
+ }
+ parent = parent.getParent();
}
- parent = parent.getParent();
}
+
+ AWTAccessor.getContainerAccessor().startLWModal(dialog);
+ } else {
+ pane.setComponentOrientation(getRootFrame().getComponentOrientation());
+ int style = styleFromMessageType(messageType);
+ JDialog dialog = pane.createDialog(parentComponent, title, style);
+ pane.selectInitialValue();
+ dialog.setVisible(true);
}
- AWTAccessor.getContainerAccessor().startLWModal(dialog);
-
if (parentComponent instanceof JInternalFrame) {
try {
((JInternalFrame)parentComponent).setSelected(true);
diff -r 000f4e4ddd39 -r 57173ad5c534 jdk/src/java.desktop/share/classes/javax/swing/JToggleButton.java
--- a/jdk/src/java.desktop/share/classes/javax/swing/JToggleButton.java Fri Sep 01 14:13:40 2017 +0000
+++ b/jdk/src/java.desktop/share/classes/javax/swing/JToggleButton.java Sat Sep 09 14:36:45 2017 +0200
@@ -219,8 +219,8 @@
case TRAVERSAL_BACKWARD:
ButtonModel model = getModel();
JToggleButton selection = this;
- if (model instanceof DefaultButtonModel) {
- ButtonGroup group = ((DefaultButtonModel) model).getGroup();
+ if (model != null) {
+ ButtonGroup group = model.getGroup();
if (group != null && group.getSelection() != null
&& !group.isSelected(model)) {
Iterator