jdk/src/share/classes/com/sun/java/util/jar/pack/PropMap.java
author duke
Sat, 01 Dec 2007 00:00:00 +0000
changeset 2 90ce3da70b43
child 5506 202f599c92aa
permissions -rw-r--r--
Initial load
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
     1
/*
90ce3da70b43 Initial load
duke
parents:
diff changeset
     2
 * Copyright 2003 Sun Microsystems, Inc.  All Rights Reserved.
90ce3da70b43 Initial load
duke
parents:
diff changeset
     3
 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
90ce3da70b43 Initial load
duke
parents:
diff changeset
     4
 *
90ce3da70b43 Initial load
duke
parents:
diff changeset
     5
 * This code is free software; you can redistribute it and/or modify it
90ce3da70b43 Initial load
duke
parents:
diff changeset
     6
 * under the terms of the GNU General Public License version 2 only, as
90ce3da70b43 Initial load
duke
parents:
diff changeset
     7
 * published by the Free Software Foundation.  Sun designates this
90ce3da70b43 Initial load
duke
parents:
diff changeset
     8
 * particular file as subject to the "Classpath" exception as provided
90ce3da70b43 Initial load
duke
parents:
diff changeset
     9
 * by Sun in the LICENSE file that accompanied this code.
90ce3da70b43 Initial load
duke
parents:
diff changeset
    10
 *
90ce3da70b43 Initial load
duke
parents:
diff changeset
    11
 * This code is distributed in the hope that it will be useful, but WITHOUT
90ce3da70b43 Initial load
duke
parents:
diff changeset
    12
 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
90ce3da70b43 Initial load
duke
parents:
diff changeset
    13
 * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
90ce3da70b43 Initial load
duke
parents:
diff changeset
    14
 * version 2 for more details (a copy is included in the LICENSE file that
90ce3da70b43 Initial load
duke
parents:
diff changeset
    15
 * accompanied this code).
90ce3da70b43 Initial load
duke
parents:
diff changeset
    16
 *
90ce3da70b43 Initial load
duke
parents:
diff changeset
    17
 * You should have received a copy of the GNU General Public License version
90ce3da70b43 Initial load
duke
parents:
diff changeset
    18
 * 2 along with this work; if not, write to the Free Software Foundation,
90ce3da70b43 Initial load
duke
parents:
diff changeset
    19
 * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
90ce3da70b43 Initial load
duke
parents:
diff changeset
    20
 *
90ce3da70b43 Initial load
duke
parents:
diff changeset
    21
 * Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara,
90ce3da70b43 Initial load
duke
parents:
diff changeset
    22
 * CA 95054 USA or visit www.sun.com if you need additional information or
90ce3da70b43 Initial load
duke
parents:
diff changeset
    23
 * have any questions.
90ce3da70b43 Initial load
duke
parents:
diff changeset
    24
 */
90ce3da70b43 Initial load
duke
parents:
diff changeset
    25
90ce3da70b43 Initial load
duke
parents:
diff changeset
    26
package com.sun.java.util.jar.pack;
90ce3da70b43 Initial load
duke
parents:
diff changeset
    27
90ce3da70b43 Initial load
duke
parents:
diff changeset
    28
import java.util.*;
90ce3da70b43 Initial load
duke
parents:
diff changeset
    29
import java.util.jar.*;
90ce3da70b43 Initial load
duke
parents:
diff changeset
    30
import java.util.jar.Pack200;
90ce3da70b43 Initial load
duke
parents:
diff changeset
    31
import java.util.zip.*;
90ce3da70b43 Initial load
duke
parents:
diff changeset
    32
import java.io.*;
90ce3da70b43 Initial load
duke
parents:
diff changeset
    33
import java.beans.PropertyChangeListener;
90ce3da70b43 Initial load
duke
parents:
diff changeset
    34
import java.beans.PropertyChangeEvent;
90ce3da70b43 Initial load
duke
parents:
diff changeset
    35
/**
90ce3da70b43 Initial load
duke
parents:
diff changeset
    36
 * Control block for publishing Pack200 options to the other classes.
90ce3da70b43 Initial load
duke
parents:
diff changeset
    37
 */
90ce3da70b43 Initial load
duke
parents:
diff changeset
    38
class PropMap extends TreeMap {
90ce3da70b43 Initial load
duke
parents:
diff changeset
    39
    ArrayList _listeners = new ArrayList(1);
90ce3da70b43 Initial load
duke
parents:
diff changeset
    40
90ce3da70b43 Initial load
duke
parents:
diff changeset
    41
    void addListener(PropertyChangeListener listener) {
90ce3da70b43 Initial load
duke
parents:
diff changeset
    42
        _listeners.add(listener);
90ce3da70b43 Initial load
duke
parents:
diff changeset
    43
    }
90ce3da70b43 Initial load
duke
parents:
diff changeset
    44
90ce3da70b43 Initial load
duke
parents:
diff changeset
    45
    void removeListener(PropertyChangeListener listener) {
90ce3da70b43 Initial load
duke
parents:
diff changeset
    46
        _listeners.remove(listener);
90ce3da70b43 Initial load
duke
parents:
diff changeset
    47
    }
90ce3da70b43 Initial load
duke
parents:
diff changeset
    48
90ce3da70b43 Initial load
duke
parents:
diff changeset
    49
    void addListeners(ArrayList listeners) {
90ce3da70b43 Initial load
duke
parents:
diff changeset
    50
        _listeners.addAll(listeners);
90ce3da70b43 Initial load
duke
parents:
diff changeset
    51
    }
90ce3da70b43 Initial load
duke
parents:
diff changeset
    52
90ce3da70b43 Initial load
duke
parents:
diff changeset
    53
    void removeListeners(ArrayList listeners) {
90ce3da70b43 Initial load
duke
parents:
diff changeset
    54
        _listeners.removeAll(listeners);
90ce3da70b43 Initial load
duke
parents:
diff changeset
    55
    }
90ce3da70b43 Initial load
duke
parents:
diff changeset
    56
90ce3da70b43 Initial load
duke
parents:
diff changeset
    57
    // Override:
90ce3da70b43 Initial load
duke
parents:
diff changeset
    58
    public Object put(Object key, Object value) {
90ce3da70b43 Initial load
duke
parents:
diff changeset
    59
        Object oldValue = super.put(key, value);
90ce3da70b43 Initial load
duke
parents:
diff changeset
    60
        if (value != oldValue && _listeners.size() > 0) {
90ce3da70b43 Initial load
duke
parents:
diff changeset
    61
            // Post the property change event.
90ce3da70b43 Initial load
duke
parents:
diff changeset
    62
            PropertyChangeEvent event =
90ce3da70b43 Initial load
duke
parents:
diff changeset
    63
                new PropertyChangeEvent(this, (String) key,
90ce3da70b43 Initial load
duke
parents:
diff changeset
    64
                                        oldValue, value);
90ce3da70b43 Initial load
duke
parents:
diff changeset
    65
            for (Iterator i = _listeners.iterator(); i.hasNext(); ) {
90ce3da70b43 Initial load
duke
parents:
diff changeset
    66
                PropertyChangeListener listener =
90ce3da70b43 Initial load
duke
parents:
diff changeset
    67
                    (PropertyChangeListener) i.next();
90ce3da70b43 Initial load
duke
parents:
diff changeset
    68
                listener.propertyChange(event);
90ce3da70b43 Initial load
duke
parents:
diff changeset
    69
            }
90ce3da70b43 Initial load
duke
parents:
diff changeset
    70
        }
90ce3da70b43 Initial load
duke
parents:
diff changeset
    71
        return oldValue;
90ce3da70b43 Initial load
duke
parents:
diff changeset
    72
    }
90ce3da70b43 Initial load
duke
parents:
diff changeset
    73
90ce3da70b43 Initial load
duke
parents:
diff changeset
    74
    // All this other stuff is private to the current package.
90ce3da70b43 Initial load
duke
parents:
diff changeset
    75
    // Outide clients of Pack200 do not need to use it; they can
90ce3da70b43 Initial load
duke
parents:
diff changeset
    76
    // get by with generic SortedMap functionality.
90ce3da70b43 Initial load
duke
parents:
diff changeset
    77
    private static Map defaultProps;
90ce3da70b43 Initial load
duke
parents:
diff changeset
    78
    static {
90ce3da70b43 Initial load
duke
parents:
diff changeset
    79
        Properties props = new Properties();
90ce3da70b43 Initial load
duke
parents:
diff changeset
    80
90ce3da70b43 Initial load
duke
parents:
diff changeset
    81
        // Allow implementation selected via -Dpack.disable.native=true
90ce3da70b43 Initial load
duke
parents:
diff changeset
    82
        props.put(Utils.DEBUG_DISABLE_NATIVE,
90ce3da70b43 Initial load
duke
parents:
diff changeset
    83
                  String.valueOf(Boolean.getBoolean(Utils.DEBUG_DISABLE_NATIVE)));
90ce3da70b43 Initial load
duke
parents:
diff changeset
    84
90ce3da70b43 Initial load
duke
parents:
diff changeset
    85
        // Set the DEBUG_VERBOSE from system
90ce3da70b43 Initial load
duke
parents:
diff changeset
    86
        props.put(Utils.DEBUG_VERBOSE,
90ce3da70b43 Initial load
duke
parents:
diff changeset
    87
                  String.valueOf(Integer.getInteger(Utils.DEBUG_VERBOSE,0)));
90ce3da70b43 Initial load
duke
parents:
diff changeset
    88
90ce3da70b43 Initial load
duke
parents:
diff changeset
    89
        // Set the PACK_TIMEZONE_NO_UTC
90ce3da70b43 Initial load
duke
parents:
diff changeset
    90
        props.put(Utils.PACK_DEFAULT_TIMEZONE,
90ce3da70b43 Initial load
duke
parents:
diff changeset
    91
                  String.valueOf(Boolean.getBoolean(Utils.PACK_DEFAULT_TIMEZONE)));
90ce3da70b43 Initial load
duke
parents:
diff changeset
    92
90ce3da70b43 Initial load
duke
parents:
diff changeset
    93
        // Limit segment size to less than a megabyte.
90ce3da70b43 Initial load
duke
parents:
diff changeset
    94
        props.put(Pack200.Packer.SEGMENT_LIMIT, ""+(1*1000*1000));
90ce3da70b43 Initial load
duke
parents:
diff changeset
    95
90ce3da70b43 Initial load
duke
parents:
diff changeset
    96
        // Preserve file ordering by default.
90ce3da70b43 Initial load
duke
parents:
diff changeset
    97
        props.put(Pack200.Packer.KEEP_FILE_ORDER, Pack200.Packer.TRUE);
90ce3da70b43 Initial load
duke
parents:
diff changeset
    98
90ce3da70b43 Initial load
duke
parents:
diff changeset
    99
        // Preserve all modification times by default.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   100
        props.put(Pack200.Packer.MODIFICATION_TIME, Pack200.Packer.KEEP);
90ce3da70b43 Initial load
duke
parents:
diff changeset
   101
90ce3da70b43 Initial load
duke
parents:
diff changeset
   102
        // Preserve deflation hints by default.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   103
        props.put(Pack200.Packer.DEFLATE_HINT, Pack200.Packer.KEEP);
90ce3da70b43 Initial load
duke
parents:
diff changeset
   104
90ce3da70b43 Initial load
duke
parents:
diff changeset
   105
        // Pass through files with unrecognized attributes by default.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   106
        props.put(Pack200.Packer.UNKNOWN_ATTRIBUTE, Pack200.Packer.PASS);
90ce3da70b43 Initial load
duke
parents:
diff changeset
   107
90ce3da70b43 Initial load
duke
parents:
diff changeset
   108
        // Default effort is 5, midway between 1 and 9.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   109
        props.put(Pack200.Packer.EFFORT, "5");
90ce3da70b43 Initial load
duke
parents:
diff changeset
   110
90ce3da70b43 Initial load
duke
parents:
diff changeset
   111
        // Define certain attribute layouts by default.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   112
        // Do this after the previous props are put in place,
90ce3da70b43 Initial load
duke
parents:
diff changeset
   113
        // to allow override if necessary.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   114
        try {
90ce3da70b43 Initial load
duke
parents:
diff changeset
   115
            String propFile = "intrinsic.properties";
90ce3da70b43 Initial load
duke
parents:
diff changeset
   116
            InputStream propStr = PackerImpl.class.getResourceAsStream(propFile);
90ce3da70b43 Initial load
duke
parents:
diff changeset
   117
            props.load(new BufferedInputStream(propStr));
90ce3da70b43 Initial load
duke
parents:
diff changeset
   118
            propStr.close();
90ce3da70b43 Initial load
duke
parents:
diff changeset
   119
            for (Iterator i = props.entrySet().iterator(); i.hasNext(); ) {
90ce3da70b43 Initial load
duke
parents:
diff changeset
   120
                Map.Entry e = (Map.Entry) i.next();
90ce3da70b43 Initial load
duke
parents:
diff changeset
   121
                String key = (String) e.getKey();
90ce3da70b43 Initial load
duke
parents:
diff changeset
   122
                String val = (String) e.getValue();
90ce3da70b43 Initial load
duke
parents:
diff changeset
   123
                if (key.startsWith("attribute.")) {
90ce3da70b43 Initial load
duke
parents:
diff changeset
   124
                    e.setValue(Attribute.normalizeLayoutString(val));
90ce3da70b43 Initial load
duke
parents:
diff changeset
   125
                }
90ce3da70b43 Initial load
duke
parents:
diff changeset
   126
            }
90ce3da70b43 Initial load
duke
parents:
diff changeset
   127
        } catch (IOException ee) {
90ce3da70b43 Initial load
duke
parents:
diff changeset
   128
            throw new RuntimeException(ee);
90ce3da70b43 Initial load
duke
parents:
diff changeset
   129
        }
90ce3da70b43 Initial load
duke
parents:
diff changeset
   130
90ce3da70b43 Initial load
duke
parents:
diff changeset
   131
        defaultProps = (new HashMap(props));  // shrink to fit
90ce3da70b43 Initial load
duke
parents:
diff changeset
   132
    }
90ce3da70b43 Initial load
duke
parents:
diff changeset
   133
90ce3da70b43 Initial load
duke
parents:
diff changeset
   134
    PropMap() {
90ce3da70b43 Initial load
duke
parents:
diff changeset
   135
        putAll(defaultProps);
90ce3da70b43 Initial load
duke
parents:
diff changeset
   136
    }
90ce3da70b43 Initial load
duke
parents:
diff changeset
   137
90ce3da70b43 Initial load
duke
parents:
diff changeset
   138
    // Return a view of this map which includes only properties
90ce3da70b43 Initial load
duke
parents:
diff changeset
   139
    // that begin with the given prefix.  This is easy because
90ce3da70b43 Initial load
duke
parents:
diff changeset
   140
    // the map is sorted, and has a subMap accessor.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   141
    SortedMap prefixMap(String prefix) {
90ce3da70b43 Initial load
duke
parents:
diff changeset
   142
        int len = prefix.length();
90ce3da70b43 Initial load
duke
parents:
diff changeset
   143
        if (len == 0)
90ce3da70b43 Initial load
duke
parents:
diff changeset
   144
            return this;
90ce3da70b43 Initial load
duke
parents:
diff changeset
   145
        char nextch = (char)(prefix.charAt(len-1) + 1);
90ce3da70b43 Initial load
duke
parents:
diff changeset
   146
        String limit = prefix.substring(0, len-1)+nextch;
90ce3da70b43 Initial load
duke
parents:
diff changeset
   147
        //System.out.println(prefix+" => "+subMap(prefix, limit));
90ce3da70b43 Initial load
duke
parents:
diff changeset
   148
        return subMap(prefix, limit);
90ce3da70b43 Initial load
duke
parents:
diff changeset
   149
    }
90ce3da70b43 Initial load
duke
parents:
diff changeset
   150
90ce3da70b43 Initial load
duke
parents:
diff changeset
   151
    String getProperty(String s) {
90ce3da70b43 Initial load
duke
parents:
diff changeset
   152
        return (String) get(s);
90ce3da70b43 Initial load
duke
parents:
diff changeset
   153
    }
90ce3da70b43 Initial load
duke
parents:
diff changeset
   154
    String getProperty(String s, String defaultVal) {
90ce3da70b43 Initial load
duke
parents:
diff changeset
   155
        String val = getProperty(s);
90ce3da70b43 Initial load
duke
parents:
diff changeset
   156
        if (val == null)
90ce3da70b43 Initial load
duke
parents:
diff changeset
   157
            return defaultVal;
90ce3da70b43 Initial load
duke
parents:
diff changeset
   158
        return val;
90ce3da70b43 Initial load
duke
parents:
diff changeset
   159
    }
90ce3da70b43 Initial load
duke
parents:
diff changeset
   160
    String setProperty(String s, String val) {
90ce3da70b43 Initial load
duke
parents:
diff changeset
   161
        return (String) put(s, val);
90ce3da70b43 Initial load
duke
parents:
diff changeset
   162
    }
90ce3da70b43 Initial load
duke
parents:
diff changeset
   163
90ce3da70b43 Initial load
duke
parents:
diff changeset
   164
    // Get sequence of props for "prefix", and "prefix.*".
90ce3da70b43 Initial load
duke
parents:
diff changeset
   165
    List getProperties(String prefix) {
90ce3da70b43 Initial load
duke
parents:
diff changeset
   166
        Collection values = prefixMap(prefix).values();
90ce3da70b43 Initial load
duke
parents:
diff changeset
   167
        ArrayList res = new ArrayList(values.size());
90ce3da70b43 Initial load
duke
parents:
diff changeset
   168
        res.addAll(values);
90ce3da70b43 Initial load
duke
parents:
diff changeset
   169
        while (res.remove(null));
90ce3da70b43 Initial load
duke
parents:
diff changeset
   170
        return res;
90ce3da70b43 Initial load
duke
parents:
diff changeset
   171
    }
90ce3da70b43 Initial load
duke
parents:
diff changeset
   172
90ce3da70b43 Initial load
duke
parents:
diff changeset
   173
    private boolean toBoolean(String val) {
90ce3da70b43 Initial load
duke
parents:
diff changeset
   174
        return Boolean.valueOf(val).booleanValue();
90ce3da70b43 Initial load
duke
parents:
diff changeset
   175
    }
90ce3da70b43 Initial load
duke
parents:
diff changeset
   176
    boolean getBoolean(String s) {
90ce3da70b43 Initial load
duke
parents:
diff changeset
   177
        return toBoolean(getProperty(s));
90ce3da70b43 Initial load
duke
parents:
diff changeset
   178
    }
90ce3da70b43 Initial load
duke
parents:
diff changeset
   179
    boolean setBoolean(String s, boolean val) {
90ce3da70b43 Initial load
duke
parents:
diff changeset
   180
        return toBoolean(setProperty(s, String.valueOf(val)));
90ce3da70b43 Initial load
duke
parents:
diff changeset
   181
    }
90ce3da70b43 Initial load
duke
parents:
diff changeset
   182
90ce3da70b43 Initial load
duke
parents:
diff changeset
   183
    int toInteger(String val) {
90ce3da70b43 Initial load
duke
parents:
diff changeset
   184
        if (val == null)  return 0;
90ce3da70b43 Initial load
duke
parents:
diff changeset
   185
        if (Pack200.Packer.TRUE.equals(val))   return 1;
90ce3da70b43 Initial load
duke
parents:
diff changeset
   186
        if (Pack200.Packer.FALSE.equals(val))  return 0;
90ce3da70b43 Initial load
duke
parents:
diff changeset
   187
        return Integer.parseInt(val);
90ce3da70b43 Initial load
duke
parents:
diff changeset
   188
    }
90ce3da70b43 Initial load
duke
parents:
diff changeset
   189
    int getInteger(String s) {
90ce3da70b43 Initial load
duke
parents:
diff changeset
   190
        return toInteger(getProperty(s));
90ce3da70b43 Initial load
duke
parents:
diff changeset
   191
    }
90ce3da70b43 Initial load
duke
parents:
diff changeset
   192
    int setInteger(String s, int val) {
90ce3da70b43 Initial load
duke
parents:
diff changeset
   193
        return toInteger(setProperty(s, String.valueOf(val)));
90ce3da70b43 Initial load
duke
parents:
diff changeset
   194
    }
90ce3da70b43 Initial load
duke
parents:
diff changeset
   195
90ce3da70b43 Initial load
duke
parents:
diff changeset
   196
    long toLong(String val) {
90ce3da70b43 Initial load
duke
parents:
diff changeset
   197
        try {
90ce3da70b43 Initial load
duke
parents:
diff changeset
   198
            return val == null ? 0 : Long.parseLong(val);
90ce3da70b43 Initial load
duke
parents:
diff changeset
   199
        } catch (java.lang.NumberFormatException nfe) {
90ce3da70b43 Initial load
duke
parents:
diff changeset
   200
            throw new IllegalArgumentException("Invalid value");
90ce3da70b43 Initial load
duke
parents:
diff changeset
   201
        }
90ce3da70b43 Initial load
duke
parents:
diff changeset
   202
    }
90ce3da70b43 Initial load
duke
parents:
diff changeset
   203
    long getLong(String s) {
90ce3da70b43 Initial load
duke
parents:
diff changeset
   204
        return toLong(getProperty(s));
90ce3da70b43 Initial load
duke
parents:
diff changeset
   205
    }
90ce3da70b43 Initial load
duke
parents:
diff changeset
   206
    long setLong(String s, long val) {
90ce3da70b43 Initial load
duke
parents:
diff changeset
   207
        return toLong(setProperty(s, String.valueOf(val)));
90ce3da70b43 Initial load
duke
parents:
diff changeset
   208
    }
90ce3da70b43 Initial load
duke
parents:
diff changeset
   209
90ce3da70b43 Initial load
duke
parents:
diff changeset
   210
    int getTime(String s) {
90ce3da70b43 Initial load
duke
parents:
diff changeset
   211
        String sval = getProperty(s, "0");
90ce3da70b43 Initial load
duke
parents:
diff changeset
   212
        if (Utils.NOW.equals(sval)) {
90ce3da70b43 Initial load
duke
parents:
diff changeset
   213
            return (int)((System.currentTimeMillis()+500)/1000);
90ce3da70b43 Initial load
duke
parents:
diff changeset
   214
        }
90ce3da70b43 Initial load
duke
parents:
diff changeset
   215
        long lval = toLong(sval);
90ce3da70b43 Initial load
duke
parents:
diff changeset
   216
        final long recentSecondCount = 1000000000;
90ce3da70b43 Initial load
duke
parents:
diff changeset
   217
90ce3da70b43 Initial load
duke
parents:
diff changeset
   218
        if (lval < recentSecondCount*10 && !"0".equals(sval))
90ce3da70b43 Initial load
duke
parents:
diff changeset
   219
            Utils.log.warning("Supplied modtime appears to be seconds rather than milliseconds: "+sval);
90ce3da70b43 Initial load
duke
parents:
diff changeset
   220
90ce3da70b43 Initial load
duke
parents:
diff changeset
   221
        return (int)((lval+500)/1000);
90ce3da70b43 Initial load
duke
parents:
diff changeset
   222
    }
90ce3da70b43 Initial load
duke
parents:
diff changeset
   223
90ce3da70b43 Initial load
duke
parents:
diff changeset
   224
    void list(PrintStream out) {
90ce3da70b43 Initial load
duke
parents:
diff changeset
   225
        PrintWriter outw = new PrintWriter(out);
90ce3da70b43 Initial load
duke
parents:
diff changeset
   226
        list(outw);
90ce3da70b43 Initial load
duke
parents:
diff changeset
   227
        outw.flush();
90ce3da70b43 Initial load
duke
parents:
diff changeset
   228
    }
90ce3da70b43 Initial load
duke
parents:
diff changeset
   229
    void list(PrintWriter out) {
90ce3da70b43 Initial load
duke
parents:
diff changeset
   230
        out.println("#"+Utils.PACK_ZIP_ARCHIVE_MARKER_COMMENT+"[");
90ce3da70b43 Initial load
duke
parents:
diff changeset
   231
        Set defaults = defaultProps.entrySet();
90ce3da70b43 Initial load
duke
parents:
diff changeset
   232
        for (Iterator i = entrySet().iterator(); i.hasNext(); ) {
90ce3da70b43 Initial load
duke
parents:
diff changeset
   233
            Map.Entry e = (Map.Entry) i.next();
90ce3da70b43 Initial load
duke
parents:
diff changeset
   234
            if (defaults.contains(e))  continue;
90ce3da70b43 Initial load
duke
parents:
diff changeset
   235
            out.println("  " + e.getKey() + " = " + e.getValue());
90ce3da70b43 Initial load
duke
parents:
diff changeset
   236
        }
90ce3da70b43 Initial load
duke
parents:
diff changeset
   237
        out.println("#]");
90ce3da70b43 Initial load
duke
parents:
diff changeset
   238
    }
90ce3da70b43 Initial load
duke
parents:
diff changeset
   239
}