Package org.apache.fop.area
Class LinkResolver
- java.lang.Object
-
- org.apache.fop.area.LinkResolver
-
- All Implemented Interfaces:
java.io.Serializable
,Resolvable
public class LinkResolver extends java.lang.Object implements Resolvable, java.io.Serializable
Link resolving for resolving internal links.- See Also:
- Serialized Form
-
-
Constructor Summary
Constructors Constructor Description LinkResolver()
LinkResolver(java.lang.String id, Area a)
Create a new link resolver.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
addDependent(Resolvable dependent)
Add dependent resolvable.java.lang.String[]
getIDRefs()
Get the references for this link.boolean
isResolved()
Check if this area has been resolved.void
resolveIDRef(java.lang.String id, java.util.List<PageViewport> pages)
Resolve by adding an internal link to the first PageViewport in the list.void
resolveIDRef(java.lang.String id, PageViewport pv)
Resolve by adding an InternalLink trait to the area
-
-
-
Constructor Detail
-
LinkResolver
public LinkResolver()
-
LinkResolver
public LinkResolver(java.lang.String id, Area a)
Create a new link resolver.- Parameters:
id
- the id to resolvea
- the area that will have the link attribute
-
-
Method Detail
-
isResolved
public boolean isResolved()
Description copied from interface:Resolvable
Check if this area has been resolved.- Specified by:
isResolved
in interfaceResolvable
- Returns:
- true if this link is resolved
-
getIDRefs
public java.lang.String[] getIDRefs()
Get the references for this link.- Specified by:
getIDRefs
in interfaceResolvable
- Returns:
- the String array of references.
-
resolveIDRef
public void resolveIDRef(java.lang.String id, java.util.List<PageViewport> pages)
Resolve by adding an internal link to the first PageViewport in the list. This method allows the Resolvable object to resolve one of its unresolved idrefs with the actual set of PageViewports containing the target ID. The Resolvable object initially identifies to the AreaTreeHandler which idrefs it needs resolved. After the idrefs are resolved, the ATH calls this method to allow the Resolvable object to update itself with the PageViewport information.- Specified by:
resolveIDRef
in interfaceResolvable
- Parameters:
id
- an ID matching one of the Resolvable object's unresolved idref's.pages
- the list of PageViewports with the given ID
-
resolveIDRef
public void resolveIDRef(java.lang.String id, PageViewport pv)
Resolve by adding an InternalLink trait to the area- Parameters:
id
- the target id (should be equal to the object's idRef)pv
- the PageViewport containing the first area with the given id
-
addDependent
public void addDependent(Resolvable dependent)
Add dependent resolvable. Used to resolve second-order resolvables that depend on resolution of this resolver.- Parameters:
dependent
- resolvable
-
-