src/java.desktop/share/classes/javax/swing/text/html/CSS.java

Print this page




2416                      throws IOException {
2417             s.defaultWriteObject();
2418             if (style == null) {
2419                 s.writeObject(null);
2420             }
2421             else {
2422                 s.writeObject(style.toString());
2423             }
2424         }
2425 
2426         private void readObject(ObjectInputStream s)
2427                 throws ClassNotFoundException, IOException {
2428             s.defaultReadObject();
2429             Object value = s.readObject();
2430             if (value != null) {
2431                 style = CSS.getValue((String)value);
2432             }
2433         }
2434 
2435         // CSS.Values are static, don't archive it.
2436         transient private CSS.Value style;
2437     }
2438 
2439     @SuppressWarnings("serial") // Same-version serialization only
2440     static class LengthValue extends CssValue {
2441 
2442         /**
2443          * if this length value may be negative.
2444          */
2445         boolean mayBeNegative;
2446 
2447         LengthValue() {
2448             this(false);
2449         }
2450 
2451         LengthValue(boolean mayBeNegative) {
2452             this.mayBeNegative = mayBeNegative;
2453         }
2454 
2455         /**
2456          * Returns the length (span) to use.




2416                      throws IOException {
2417             s.defaultWriteObject();
2418             if (style == null) {
2419                 s.writeObject(null);
2420             }
2421             else {
2422                 s.writeObject(style.toString());
2423             }
2424         }
2425 
2426         private void readObject(ObjectInputStream s)
2427                 throws ClassNotFoundException, IOException {
2428             s.defaultReadObject();
2429             Object value = s.readObject();
2430             if (value != null) {
2431                 style = CSS.getValue((String)value);
2432             }
2433         }
2434 
2435         // CSS.Values are static, don't archive it.
2436         private transient CSS.Value style;
2437     }
2438 
2439     @SuppressWarnings("serial") // Same-version serialization only
2440     static class LengthValue extends CssValue {
2441 
2442         /**
2443          * if this length value may be negative.
2444          */
2445         boolean mayBeNegative;
2446 
2447         LengthValue() {
2448             this(false);
2449         }
2450 
2451         LengthValue(boolean mayBeNegative) {
2452             this.mayBeNegative = mayBeNegative;
2453         }
2454 
2455         /**
2456          * Returns the length (span) to use.