View | Details | Raw Unified | Return to bug 45390
Collapse All | Expand All

(-)src/java/META-INF/services/org.apache.fop.fo.ElementMapping (+1 lines)
Lines 1-4 Link Here
1
org.apache.fop.fo.FOElementMapping
1
org.apache.fop.fo.FOElementMapping
2
org.apache.fop.fo.extensions.pdf.PDFExtensionElementMapping
2
org.apache.fop.fo.extensions.svg.SVGElementMapping
3
org.apache.fop.fo.extensions.svg.SVGElementMapping
3
org.apache.fop.fo.extensions.svg.BatikExtensionElementMapping
4
org.apache.fop.fo.extensions.svg.BatikExtensionElementMapping
4
org.apache.fop.fo.extensions.ExtensionElementMapping
5
org.apache.fop.fo.extensions.ExtensionElementMapping
(-)src/java/org/apache/fop/fo/extensions/pdf/AbstractPDFExtension.java (+78 lines)
Line 0 Link Here
1
/*
2
 * Licensed to the Apache Software Foundation (ASF) under one or more
3
 * contributor license agreements.  See the NOTICE file distributed with
4
 * this work for additional information regarding copyright ownership.
5
 * The ASF licenses this file to You under the Apache License, Version 2.0
6
 * (the "License"); you may not use this file except in compliance with
7
 * the License.  You may obtain a copy of the License at
8
 
9
 *      http://www.apache.org/licenses/LICENSE-2.0
10
 *
11
 * Unless required by applicable law or agreed to in writing, software
12
 * distributed under the License is distributed on an "AS IS" BASIS,
13
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14
 * See the License for the specific language governing permissions and
15
 * limitations under the License.
16
 */
17
/* $Id$ */
18
package org.apache.fop.fo.extensions.pdf;
19
20
import org.apache.fop.fo.extensions.ExtensionObj;
21
import org.apache.fop.fo.extensions.ExtensionAttachment;
22
import org.apache.fop.fo.FONode;
23
import org.apache.fop.fo.PropertyList;
24
import org.apache.fop.apps.FOPException;
25
import org.xml.sax.Locator;
26
import org.xml.sax.Attributes;
27
28
public abstract class AbstractPDFExtension extends ExtensionObj {
29
30
    /** The key of this object */
31
    protected String key;
32
    
33
    /**
34
     * Create a new AbstractPDFExtension that is a child of the given
35
     * {@link FONode}
36
     * 
37
     * @param parent    the parent {@link FONode}
38
     */
39
    public AbstractPDFExtension(FONode parent) {
40
        super(parent);
41
    }
42
43
    /** {@inheritDoc} */
44
    public void processNode(String elementName, Locator locator, Attributes attlist, PropertyList pList) throws FOPException {
45
        this.key = attlist.getValue("key");
46
    }
47
48
    /** {@inheritDoc} */
49
    public ExtensionAttachment getExtensionAttachment() {
50
        return new PDFExtensionAttachment(this);
51
    }
52
53
    /**
54
     * Get the key of this object
55
     * 
56
     * @return the key of this object
57
     */
58
    public String getKey() {
59
        return this.key;
60
    }
61
    
62
    /**
63
     * {@inheritDoc}
64
     * @return  {@link PDFExtensionElementMapping#URI}
65
     */
66
    public String getNamespaceURI() {
67
        return PDFExtensionElementMapping.URI;
68
    }
69
70
    /**
71
     * {@inheritDoc}
72
     * @return  {@link PDFExtensionElementMapping#PREFIX}
73
     */
74
    public String getNormalNamespacePrefix() {
75
        return PDFExtensionElementMapping.PREFIX;
76
    }
77
78
}
0
  + Id
79
  + Id
1
  + native
80
  + native
(-)src/java/org/apache/fop/fo/extensions/pdf/PDFDictionaryExtension.java (+130 lines)
Line 0 Link Here
1
/*
2
 * Licensed to the Apache Software Foundation (ASF) under one or more
3
 * contributor license agreements.  See the NOTICE file distributed with
4
 * this work for additional information regarding copyright ownership.
5
 * The ASF licenses this file to You under the Apache License, Version 2.0
6
 * (the "License"); you may not use this file except in compliance with
7
 * the License.  You may obtain a copy of the License at
8
 *
9
 *      http://www.apache.org/licenses/LICENSE-2.0
10
 *
11
 * Unless required by applicable law or agreed to in writing, software
12
 * distributed under the License is distributed on an "AS IS" BASIS,
13
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14
 * See the License for the specific language governing permissions and
15
 * limitations under the License.
16
 */
17
18
/* $Id$ */
19
20
package org.apache.fop.fo.extensions.pdf;
21
22
import org.apache.fop.fo.FONode;
23
import org.apache.fop.fo.ValidationException;
24
import org.apache.fop.fo.PropertyList;
25
import org.apache.fop.fo.extensions.ExtensionObj;
26
import org.apache.fop.apps.FOPException;
27
import org.apache.xmlgraphics.util.QName;
28
import org.xml.sax.Locator;
29
import org.xml.sax.Attributes;
30
31
import java.nio.CharBuffer;
32
import java.util.ListIterator;
33
34
/**
35
 * Class modelling the pdf:dictionary extension object.
36
 *
37
 * This extension, in co-operation with {@link PDFEntryExtension} allows 
38
 * the user to build dictionaries that will be injected into the 
39
 * PDF document.
40
 * If the type is specified as "catalog", the entries/subdictionaries will be added to
41
 * the document catalog.
42
 */
43
public class PDFDictionaryExtension extends AbstractPDFExtension {
44
45
    public static final int TYPE_CATALOG = 0;
46
    public static final int TYPE_NORMAL = 1;
47
    
48
    static final String[] TYPES = { "catalog", "normal" };
49
    
50
    private int type;
51
    private String name;
52
53
    /**
54
     * Create a new PDFDictionaryExtension instance that is
55
     * a child of the given {@link FONode}.
56
     *
57
     * @param parent the parent {@link FONode}
58
     */
59
    public PDFDictionaryExtension(FONode parent) {
60
        super(parent);
61
    }
62
63
    private static int getType(String typeString) {
64
        for (int i = TYPES.length; --i >= 0;) {
65
            if (TYPES[i].equals(typeString)) {
66
                return i;
67
            }
68
        }
69
        assert false;
70
        return -1;
71
    }
72
    
73
    /** {@inheritDoc} */
74
    public void processNode(String elementName, Locator locator, Attributes attlist, PropertyList pList) throws FOPException {
75
        String dictType = attlist.getValue("type");
76
        if (dictType == null || "".equals(dictType)) {
77
            //assume "normal" if absent
78
            dictType = TYPES[TYPE_NORMAL];
79
        }
80
        this.type = getType(dictType);
81
        this.key = attlist.getValue("key");
82
    }
83
84
    /** {@inheritDoc} */
85
    protected void validateChildNode(Locator loc, String namespaceURI, String localName) throws ValidationException {
86
        if (PDFExtensionElementMapping.URI.equals(namespaceURI)) {
87
            if ("name".equals(localName) 
88
                    || "boolean".equals(localName) 
89
                    || "string".equals(localName)
90
                    || "dictionary".equals(localName)) {
91
                return; //no problem
92
            }
93
        }
94
        //TODO: Replace by extension-specific event (?)
95
        this.invalidChildError(loc, namespaceURI, localName);
96
    }
97
98
    /**
99
     * Return an <code>int</code> identifying the type of PDF dictionary.
100
     *
101
     * @return  one of {@link #TYPE_CATALOG}, or {@link #TYPE_NORMAL}
102
     */
103
    public int getType() {
104
        return this.type;
105
    }
106
107
    /**
108
     * Return a <code>java.lang.String</code> naming the type of PDF dictionary.
109
     * 
110
     * @return one of "catalog" or "normal"
111
     */
112
    public String getTypeName() {
113
        return TYPES[this.type];
114
    }
115
116
    /**
117
     * Return the name of this dictionary
118
     * 
119
     * @return the name of the dictionary
120
     */
121
    public String getDictionaryName() {
122
        return this.key;
123
    }
124
    
125
    /** {@inheritDoc} */
126
    public String getLocalName() {
127
        return "dictionary";
128
    }
129
    
130
}
(-)src/java/org/apache/fop/fo/extensions/pdf/PDFEntryExtension.java (+151 lines)
Line 0 Link Here
1
/*
2
 * Licensed to the Apache Software Foundation (ASF) under one or more
3
 * contributor license agreements.  See the NOTICE file distributed with
4
 * this work for additional information regarding copyright ownership.
5
 * The ASF licenses this file to You under the Apache License, Version 2.0
6
 * (the "License"); you may not use this file except in compliance with
7
 * the License.  You may obtain a copy of the License at
8
 
9
 *      http://www.apache.org/licenses/LICENSE-2.0
10
 *
11
 * Unless required by applicable law or agreed to in writing, software
12
 * distributed under the License is distributed on an "AS IS" BASIS,
13
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14
 * See the License for the specific language governing permissions and
15
 * limitations under the License.
16
 */
17
/* $Id$ */
18
package org.apache.fop.fo.extensions.pdf;
19
20
import org.apache.fop.fo.FONode;
21
import org.apache.fop.fo.PropertyList;
22
import org.apache.fop.fo.ValidationException;
23
import org.apache.fop.apps.FOPException;
24
import org.xml.sax.Locator;
25
import org.xml.sax.Attributes;
26
27
import java.nio.CharBuffer;
28
29
/**
30
 * Class modelling the PDF entry extension object.
31
 * This extension can be used to create PDF entries in a
32
 * <code>pdf:dictionary</code> object.
33
 * The object is mapped virtually one-on-one to PDF.
34
 * <br/><br/>
35
 * <code>&lt;pdf:name key="PageMode">FullScreen&lt;/pdf:name></code>
36
 * <br/><br/>
37
 * will result in "/PageMode /FullScreen" being added as an entry
38
 * to the dictionary.
39
 */
40
public class PDFEntryExtension extends AbstractPDFExtension {
41
42
    public static final int TYPE_NUMBER = 0;
43
    public static final int TYPE_BOOLEAN = 1;
44
    public static final int TYPE_NAME = 2;
45
    public static final int TYPE_ARRAY = 3;
46
    public static final int TYPE_STRING = 4;
47
    
48
    static final String[] TYPES = { 
49
            "number", "boolean", "name", "array", "string" };
50
    
51
    private int entryType;
52
    private CharBuffer entryValue;
53
    
54
    /**
55
     * Construct a new PDFEntryExtension instance that is a child
56
     * of the given {@link org.apache.fop.fo.FONode}
57
     * 
58
     * @param parent    the parent {@link org.apache.fop.fo.FONode}
59
     */
60
    public PDFEntryExtension(FONode parent) {
61
        super(parent);
62
    }
63
    
64
    private static int getType(String typeName) {
65
        for (int i = TYPES.length; --i >= 0;) {
66
            if (TYPES[i].equals(typeName)) {
67
                return i;
68
            }
69
        }
70
        assert false;
71
        return -1;
72
    }
73
    
74
    /** {@inheritDoc} */
75
    protected void validateChildNode(Locator loc, String namespaceURI, String localName) throws ValidationException {
76
        //TODO: Replace by extension-specific event (?)
77
        this.invalidChildError(loc, namespaceURI, localName);
78
    }
79
80
    /** {@inheritDoc} */
81
    public void processNode(String elementName, Locator locator, Attributes attlist, PropertyList pList) throws FOPException {
82
        super.processNode(elementName, locator, attlist, pList);
83
        if (this.key == null || "".equals(this.key)) {
84
            this.missingPropertyError("key");
85
        }
86
        
87
        this.entryType = getType(elementName);
88
    }
89
90
    /** {@inheritDoc} */
91
    protected void addCharacters(char[] data, int start, int length, PropertyList pList, Locator locator) throws FOPException {
92
        if (this.entryValue == null) {
93
            this.entryValue = CharBuffer.allocate(length);
94
        } else {
95
            /* Note: this branch will only be entered in the exceptional case the parser reports
96
             * multiple characters() events; in that case the contents of the existing buffer will 
97
             * first be transferred to a new buffer, with increased length
98
             */
99
            CharBuffer newExpr = CharBuffer.allocate(
100
                                    this.entryValue.length() + length);
101
            this.entryValue.position(0);
102
            newExpr.put(this.entryValue);
103
            this.entryValue = newExpr;
104
        }
105
        this.entryValue.put(data, start, length);
106
    }
107
108
    /**
109
     * Return the key of the PDF entry.
110
     * 
111
     * @return the key of the entry
112
     */
113
    public String getEntryKey() {
114
        return this.key;
115
    }
116
117
    /**
118
     * Return the value of the PDF entry (= the #PCDATA 
119
     * content of the node in the source document)
120
     * 
121
     * @return the value of the entry
122
     */
123
    public String getEntryValue() {
124
        return this.entryValue.rewind().toString();
125
    }
126
127
    /**
128
     * Return the type of this entry.
129
     * 
130
     * @return one of {@link #TYPE_NUMBER}, {@link #TYPE_BOOLEAN}, 
131
     *         {@link #TYPE_NAME}, or {@link#TYPE_ARRAY}
132
     */
133
    public int getEntryType() {
134
        return this.entryType;
135
    }
136
137
    /**
138
     * Return the type of this entry as a String.
139
     * 
140
     * @return the type name of this entry
141
     */
142
    public String getEntryTypeName() {
143
        return TYPES[this.entryType];
144
    }
145
    
146
    /** {@inheritDoc} */
147
    public String getLocalName() {
148
        return TYPES[this.entryType];
149
    }
150
    
151
}
0
  + Id
152
  + Id
1
  + native
153
  + native
(-)src/java/org/apache/fop/fo/extensions/pdf/PDFExtensionAttachment.java (+47 lines)
Line 0 Link Here
1
/*
2
 * Licensed to the Apache Software Foundation (ASF) under one or more
3
 * contributor license agreements.  See the NOTICE file distributed with
4
 * this work for additional information regarding copyright ownership.
5
 * The ASF licenses this file to You under the Apache License, Version 2.0
6
 * (the "License"); you may not use this file except in compliance with
7
 * the License.  You may obtain a copy of the License at
8
 
9
 *      http://www.apache.org/licenses/LICENSE-2.0
10
 *
11
 * Unless required by applicable law or agreed to in writing, software
12
 * distributed under the License is distributed on an "AS IS" BASIS,
13
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14
 * See the License for the specific language governing permissions and
15
 * limitations under the License.
16
 */
17
/* $Id$ */
18
package org.apache.fop.fo.extensions.pdf;
19
20
import org.apache.fop.fo.extensions.ExtensionAttachment;
21
22
import java.io.Serializable;
23
24
public class PDFExtensionAttachment implements ExtensionAttachment, Serializable {
25
26
    private AbstractPDFExtension ext;
27
    
28
    public PDFExtensionAttachment() {
29
        //nop
30
    }
31
    
32
    public PDFExtensionAttachment(AbstractPDFExtension ext) {
33
        this.ext = ext;
34
    }
35
    
36
    public AbstractPDFExtension getExtensionObject() {
37
        return this.ext;
38
    }
39
    
40
    /**
41
     * {@inheritDoc}
42
     * @return  {@link PDFExtensionElementMapping#URI}
43
     */
44
    public String getCategory() {
45
        return PDFExtensionElementMapping.URI;
46
    }
47
}
0
  + Id
48
  + Id
1
  + native
49
  + native
(-)src/java/org/apache/fop/fo/extensions/pdf/PDFExtensionElementMapping.java (+73 lines)
Line 0 Link Here
1
/*
2
 * Licensed to the Apache Software Foundation (ASF) under one or more
3
 * contributor license agreements.  See the NOTICE file distributed with
4
 * this work for additional information regarding copyright ownership.
5
 * The ASF licenses this file to You under the Apache License, Version 2.0
6
 * (the "License"); you may not use this file except in compliance with
7
 * the License.  You may obtain a copy of the License at
8
 
9
 *      http://www.apache.org/licenses/LICENSE-2.0
10
 *
11
 * Unless required by applicable law or agreed to in writing, software
12
 * distributed under the License is distributed on an "AS IS" BASIS,
13
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14
 * See the License for the specific language governing permissions and
15
 * limitations under the License.
16
 */
17
/* $Id$ */
18
package org.apache.fop.fo.extensions.pdf;
19
20
import org.apache.fop.fo.extensions.ExtensionElementMapping;
21
import org.apache.fop.fo.ElementMapping;
22
import org.apache.fop.fo.FONode;
23
24
import java.util.HashMap;
25
26
public class PDFExtensionElementMapping extends ExtensionElementMapping {
27
    
28
    /** The FOP PDF extension namespace URI */
29
    public static final String URI = "http://xmlgraphics.apache.org/fop/extensions/pdf";
30
    
31
    /** The standard namespace prefix */
32
    public static final String PREFIX = "pdf";
33
    
34
    /**
35
     * Constructor.
36
     */
37
    public PDFExtensionElementMapping() {
38
        namespaceURI = URI;
39
    }
40
41
    /**
42
     * Initialize the data structures.
43
     */
44
    protected void initialize() {
45
        if (foObjs == null) {
46
            foObjs = new HashMap();
47
            foObjs.put("dictionary", new PDFDictionaryExtensionMaker());
48
            foObjs.put("name", new PDFEntryExtensionMaker());
49
            foObjs.put("boolean", new PDFEntryExtensionMaker());
50
            foObjs.put("string", new PDFEntryExtensionMaker());
51
        }
52
    }
53
54
    /** Inner class for making instances of {@link PDFDictionaryExtension} */
55
    static class PDFDictionaryExtensionMaker extends ElementMapping.Maker {
56
        public FONode make(FONode parent) {
57
            return new PDFDictionaryExtension(parent);
58
        }
59
    }
60
61
    /** Inner class for making instances of {@link PDFEntryExtension} */
62
    static class PDFEntryExtensionMaker extends ElementMapping.Maker {
63
        public FONode make(FONode parent) {
64
            return new PDFEntryExtension(parent);
65
        }
66
    }
67
68
    /** {@inheritDoc} */
69
    public String getStandardPrefix() {
70
        return PREFIX;
71
    }
72
73
}
0
  + Id
74
  + Id
1
  + native
75
  + native
(-)src/java/org/apache/fop/render/pdf/PDFRenderer.java (+82 lines)
Lines 76-81 Link Here
76
import org.apache.fop.events.ResourceEventProducer;
76
import org.apache.fop.events.ResourceEventProducer;
77
import org.apache.fop.fo.Constants;
77
import org.apache.fop.fo.Constants;
78
import org.apache.fop.fo.extensions.ExtensionAttachment;
78
import org.apache.fop.fo.extensions.ExtensionAttachment;
79
import org.apache.fop.fo.extensions.pdf.AbstractPDFExtension;
80
import org.apache.fop.fo.extensions.pdf.PDFDictionaryExtension;
81
import org.apache.fop.fo.extensions.pdf.PDFEntryExtension;
82
import org.apache.fop.fo.extensions.pdf.PDFExtensionAttachment;
83
import org.apache.fop.fo.extensions.pdf.PDFExtensionElementMapping;
79
import org.apache.fop.fo.extensions.xmp.XMPMetadata;
84
import org.apache.fop.fo.extensions.xmp.XMPMetadata;
80
import org.apache.fop.fonts.Font;
85
import org.apache.fop.fonts.Font;
81
import org.apache.fop.fonts.LazyFont;
86
import org.apache.fop.fonts.LazyFont;
Lines 98-103 Link Here
98
import org.apache.fop.pdf.PDFInfo;
103
import org.apache.fop.pdf.PDFInfo;
99
import org.apache.fop.pdf.PDFLink;
104
import org.apache.fop.pdf.PDFLink;
100
import org.apache.fop.pdf.PDFMetadata;
105
import org.apache.fop.pdf.PDFMetadata;
106
import org.apache.fop.pdf.PDFName;
101
import org.apache.fop.pdf.PDFNumber;
107
import org.apache.fop.pdf.PDFNumber;
102
import org.apache.fop.pdf.PDFNumsArray;
108
import org.apache.fop.pdf.PDFNumsArray;
103
import org.apache.fop.pdf.PDFOutline;
109
import org.apache.fop.pdf.PDFOutline;
Lines 548-553 Link Here
548
            if (XMPMetadata.CATEGORY.equals(attachment.getCategory())) {
554
            if (XMPMetadata.CATEGORY.equals(attachment.getCategory())) {
549
                renderXMPMetadata((XMPMetadata)attachment);
555
                renderXMPMetadata((XMPMetadata)attachment);
550
            }
556
            }
557
            if (PDFExtensionElementMapping.URI.equals(attachment.getCategory())) {
558
                //only process the extension if no conformance level was specified
559
                if (this.pdfAMode == PDFAMode.DISABLED 
560
                        && this.pdfXMode == PDFXMode.DISABLED) {
561
                    renderPDFExtension((PDFExtensionAttachment)attachment);
562
                }
563
            }
551
        }
564
        }
552
    }
565
    }
553
566
Lines 621-626 Link Here
621
        pdfDoc.getRoot().setMetadata(pdfMetadata);
634
        pdfDoc.getRoot().setMetadata(pdfMetadata);
622
    }
635
    }
623
636
637
    private void renderPDFEntryExtension(PDFEntryExtension entry, PDFDictionary dict) {
638
        
639
        switch (entry.getEntryType()) {
640
        case PDFEntryExtension.TYPE_BOOLEAN:
641
            dict.put(
642
                    entry.getKey(), 
643
                    ("true".equals(entry.getEntryValue())));
644
            break;
645
        case PDFEntryExtension.TYPE_NAME:
646
            dict.put(
647
                    entry.getKey(), 
648
                    new PDFName(entry.getEntryValue()));
649
            break;
650
        case PDFEntryExtension.TYPE_STRING:
651
            dict.put(
652
                    entry.getKey(),
653
                    entry.getEntryValue());
654
            break;
655
        case PDFEntryExtension.TYPE_NUMBER:
656
        case PDFEntryExtension.TYPE_ARRAY:
657
            //TODO: Implement
658
        default:
659
            assert false;
660
        }
661
        
662
    }
663
    
664
    private void renderPDFDictionaryExtension(PDFDictionaryExtension dict, PDFDictionary parent) {
665
        AbstractPDFExtension entry;
666
        PDFExtensionAttachment att;
667
        PDFDictionary pdfDict = null;
668
        
669
        if (parent == null) {
670
            //add entries to document catalog
671
            pdfDict = pdfDoc.getRoot();
672
        } else {
673
            pdfDict = new PDFDictionary(parent);
674
        }
675
        
676
        for (Iterator entryIter = dict.getExtensionAttachments().iterator(); entryIter.hasNext();) {
677
            att = (PDFExtensionAttachment)entryIter.next();
678
            entry = att.getExtensionObject();
679
            if (entry instanceof PDFEntryExtension) {
680
                //atomic entry
681
                renderPDFEntryExtension((PDFEntryExtension)entry, pdfDict);
682
            } else if (entry instanceof PDFDictionaryExtension) {
683
                //subdictionary
684
                renderPDFDictionaryExtension((PDFDictionaryExtension)entry, pdfDict);
685
            }
686
        }
687
        
688
        if (parent != null) {
689
            parent.put(dict.getKey(), pdfDict);
690
        }
691
    }
692
    
693
    private void renderPDFExtension(PDFExtensionAttachment ext) {
694
        AbstractPDFExtension extNode = ext.getExtensionObject();
695
        if (extNode instanceof PDFDictionaryExtension) {
696
            PDFDictionaryExtension dict = (PDFDictionaryExtension)extNode;
697
            if (dict.getType() == PDFDictionaryExtension.TYPE_CATALOG) {
698
                //add the entries/subdictionaries to pdfDoc.getRoot()
699
                renderPDFDictionaryExtension(dict, null);
700
            } else {
701
                //TODO??
702
            }
703
        }
704
    }
705
    
624
    /** {@inheritDoc} */
706
    /** {@inheritDoc} */
625
    public Graphics2DAdapter getGraphics2DAdapter() {
707
    public Graphics2DAdapter getGraphics2DAdapter() {
626
        return new PDFGraphics2DAdapter(this);
708
        return new PDFGraphics2DAdapter(this);
(-)src/java/org/apache/fop/pdf/PDFDictionary.java (+12 lines)
Lines 88-93 Link Here
88
        }
88
        }
89
        this.entries.put(name, new Integer(value));
89
        this.entries.put(name, new Integer(value));
90
    }
90
    }
91
92
    /**
93
     * Puts a new name/value pair.
94
     * @param name the name
95
     * @param value the value
96
     */
97
    public void put(String name, boolean value) {
98
        if (!entries.containsKey(name)) {
99
            this.order.add(name);
100
        }
101
        this.entries.put(name, value ? Boolean.TRUE : Boolean.FALSE);
102
    }
91
    
103
    
92
    /**
104
    /**
93
     * Returns the value given a name.
105
     * Returns the value given a name.

Return to bug 45390