Class 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
    • Field Detail

      • resolved

        private boolean resolved
      • idRef

        private java.lang.String idRef
      • area

        private Area area
      • dependents

        private transient java.util.List<Resolvable> dependents
    • Constructor Detail

      • LinkResolver

        public LinkResolver()
      • LinkResolver

        public LinkResolver​(java.lang.String id,
                            Area a)
        Create a new link resolver.
        Parameters:
        id - the id to resolve
        a - the area that will have the link attribute
    • Method Detail

      • readObject

        private void readObject​(java.io.ObjectInputStream ois)
                         throws java.lang.ClassNotFoundException,
                                java.io.IOException
        Throws:
        java.lang.ClassNotFoundException
        java.io.IOException
      • isResolved

        public boolean isResolved()
        Description copied from interface: Resolvable
        Check if this area has been resolved.
        Specified by:
        isResolved in interface Resolvable
        Returns:
        true if this link is resolved
      • getIDRefs

        public java.lang.String[] getIDRefs()
        Get the references for this link.
        Specified by:
        getIDRefs in interface Resolvable
        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 interface Resolvable
        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
      • resolveDependents

        private void resolveDependents​(java.lang.String id,
                                       PageViewport pv)