KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > apache > fop > fo > pagination > bookmarks > BookmarkTitle


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.pagination.bookmarks;
21
22 import org.xml.sax.Locator JavaDoc;
23
24 import org.apache.fop.fo.FObj;
25 import org.apache.fop.fo.FONode;
26 import org.apache.fop.fo.PropertyList;
27 import org.apache.fop.fo.ValidationException;
28
29 /**
30  * The fo:bookmark-title formatting object, first introduced in the
31  * XSL 1.1 WD. Prototype version only, subject to change as XSL 1.1 WD
32  * evolves.
33  */

34 public class BookmarkTitle extends FObj {
35     private String JavaDoc title = "";
36
37     /**
38      * Create a new BookmarkTitle object.
39      *
40      * @param parent the fo node parent
41      */

42     public BookmarkTitle(FONode parent) {
43         super(parent);
44     }
45
46     /**
47      * Add the characters to this BookmarkTitle.
48      * The text data inside the BookmarkTitle xml element
49      * is used for the BookmarkTitle string.
50      *
51      * @param data the character data
52      * @param start the start position in the data array
53      * @param end the end position in the character array
54      * @param locator location in fo source file.
55      */

56     protected void addCharacters(char data[], int start, int end,
57                                  PropertyList pList,
58                                  Locator JavaDoc locator) {
59         title += new String JavaDoc(data, start, end - start);
60     }
61
62     /**
63      * @see org.apache.fop.fo.FONode#validateChildNode(Locator, String, String)
64         XSL/FOP: empty
65      */

66     protected void validateChildNode(Locator JavaDoc loc, String JavaDoc nsURI, String JavaDoc localName)
67         throws ValidationException {
68             invalidChildError(loc, nsURI, localName);
69     }
70
71     /**
72      * Get the title for this BookmarkTitle.
73      *
74      * @return the bookmark title
75      */

76     public String JavaDoc getTitle() {
77         return title;
78     }
79     
80     /** @see org.apache.fop.fo.FONode#getLocalName() */
81     public String JavaDoc getLocalName() {
82         return "bookmark-title";
83     }
84
85     /**
86      * @see org.apache.fop.fo.FObj#getNameId()
87      */

88     public int getNameId() {
89         return FO_BOOKMARK_TITLE;
90     }
91 }
92
Popular Tags