KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > apache > fop > fo > pagination > PageSequenceWrapper


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: PageSequenceWrapper.java 426576 2006-07-28 15:44:37Z jeremias $ */
19
20 package org.apache.fop.fo.pagination;
21
22 import org.xml.sax.Locator JavaDoc;
23
24 import org.apache.fop.apps.FOPException;
25 import org.apache.fop.fo.FObj;
26 import org.apache.fop.fo.FONode;
27 import org.apache.fop.fo.PropertyList;
28 import org.apache.fop.fo.ValidationException;
29
30 /**
31  * The fo:page-sequence-wrapper formatting object, first introduced
32  * in the XSL 1.1 WD. Prototype version only, subject to change as
33  * XSL 1.1 WD evolves.
34  */

35 public class PageSequenceWrapper extends FObj {
36     // The value of properties relevant for this FO
37
private String JavaDoc id;
38     private String JavaDoc indexClass;
39     private String JavaDoc indexKey;
40     // End of property values
41

42     /**
43      * @param parent FONode that is the parent of this object
44      */

45     public PageSequenceWrapper(FONode parent) {
46         super(parent);
47     }
48
49     /**
50      * @see org.apache.fop.fo.FObj#bind(PropertyList)
51      */

52     public void bind(PropertyList pList) throws FOPException {
53         id = pList.get(PR_ID).getString();
54         indexClass = pList.get(PR_INDEX_CLASS).getString();
55         indexKey = pList.get(PR_INDEX_KEY).getString();
56     }
57
58     /**
59      * @see org.apache.fop.fo.FONode#startOfNode
60      */

61     protected void startOfNode() throws FOPException {
62         checkId(id);
63     }
64
65     /**
66      * @see org.apache.fop.fo.FONode#validateChildNode(Locator, String, String)
67         XSL/FOP: (bookmark+)
68      */

69     protected void validateChildNode(Locator JavaDoc loc, String JavaDoc nsURI, String JavaDoc localName)
70         throws ValidationException {
71         if (!(FO_URI.equals(nsURI) && (localName.equals("page-sequence") ||
72             localName.equals("page-sequence-wrapper")))) {
73                 invalidChildError(loc, nsURI, localName);
74         }
75     }
76
77     /** @return the "id" property. */
78     public String JavaDoc getId() {
79         return id;
80     }
81
82     /** @return the "index-class" property. */
83     public String JavaDoc getIndexClass() {
84         return indexClass;
85     }
86
87     /** @return the "index-key" property. */
88     public String JavaDoc getIndexKey() {
89         return indexKey;
90     }
91
92     /** @see org.apache.fop.fo.FONode#getLocalName() */
93     public String JavaDoc getLocalName() {
94         return "page-sequence-wrapper";
95     }
96
97     /**
98      * @see org.apache.fop.fo.FObj#getNameId()
99      */

100     public int getNameId() {
101         return FO_PAGE_SEQUENCE_WRAPPER;
102     }
103 }
104
105
Popular Tags