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: Resolvable.java 1805173 2017-08-16 10:50:04Z ssteiner $ */
19 
20 package org.apache.fop.area;
21 
22 import java.util.List;
23 
24 /**
25  * Resolvable Interface.  Classes that implement this interface contain
26  * idrefs (see Section 5.11 of spec for definition of <idref> datatype)
27  * that are resolved when their target IDs are added to the area tree.
28  */
29 public interface Resolvable {
30 
31     /**
32      * Check if this area has been resolved.
33      *
34      * @return true once this area is resolved
35      */
isResolved()36     boolean isResolved();
37 
38     /**
39      * Get the array of idrefs of this resolvable object.
40      * If this object contains child resolvables that are
41      * resolved through this then it should return the idref's of
42      * the child also.
43      *
44      * @return the id references for resolving this object
45      */
getIDRefs()46     String[] getIDRefs();
47 
48     /**
49      * This method allows the Resolvable object to resolve one of
50      * its unresolved idrefs with the actual set of PageViewports
51      * containing the target ID.  The Resolvable object initially
52      * identifies to the AreaTreeHandler which idrefs it needs
53      * resolved.  After the idrefs are resolved, the ATH calls this
54      * method to allow the Resolvable object to update itself with
55      * the PageViewport information.
56      *
57      * @param id an ID matching one of the Resolvable object's
58      *      unresolved idref's.
59      * @param pages the list of PageViewports with the given ID
60      *
61      */
resolveIDRef(String id, List<PageViewport> pages)62     void resolveIDRef(String id, List<PageViewport> pages);
63 }
64