org.apache.fop.area

## Class Trait.InternalLink

- java.lang.Object
- - org.apache.fop.area.Trait.InternalLink

- All Implemented Interfaces:
    java.io.Serializable
  Enclosing class:
    Trait

      public static class Trait.InternalLink
      extends java.lang.Object
      implements java.io.Serializable

  Class for internal link traits. Stores PageViewport key and producer ID
  See Also:
    Serialized Form

- - ### Constructor Summary

    Constructors
    Constructor and Description
    `Trait.InternalLink(java.lang.String attrValue)` Create an InternalLink based on the given XML attribute value.
    `Trait.InternalLink(java.lang.String pvKey, java.lang.String idRef)` Create an InternalLink to the given PageViewport and target ID

  - ### Method Summary

    Methods
    Modifier and Type | Method and Description
    --- | ---
    `java.lang.String` | `getIDRef()` Returns the target ID.
    `java.lang.String` | `getPVKey()` Returns the key of the targeted PageViewport.
    `static java.lang.String` | `makeXMLAttribute(java.lang.String pvKey, java.lang.String idRef)` Returns the XML attribute value for the given PV key and ID ref.
    `static java.lang.String[]` | `parseXMLAttribute(java.lang.String attrValue)` Parses XML attribute value from the area tree into PageViewport key + IDRef strings.
    `void` | `setIDRef(java.lang.String idRef)` Sets the target ID.
    `void` | `setPVKey(java.lang.String pvKey)` Sets the key of the targeted PageViewport.
    `java.lang.String` | `toString()` Return the human-friendly string for debugging.
    `java.lang.String` | `xmlAttribute()` Returns the attribute value for this object as used in the area tree XML.

    - ### Methods inherited from class java.lang.Object

      `clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait`

- - ### Constructor Detail

    - #### Trait.InternalLink

          public Trait.InternalLink(java.lang.String pvKey,
                            java.lang.String idRef)

      Create an InternalLink to the given PageViewport and target ID
      Parameters:
        `pvKey` - the PageViewport key
        `idRef` - the target ID

    - #### Trait.InternalLink

          public Trait.InternalLink(java.lang.String attrValue)

      Create an InternalLink based on the given XML attribute value. This is typically called when data are read from an XML area tree.
      Parameters:
        `attrValue` - attribute value to be parsed by InternalLink.parseXMLAttribute

  - ### Method Detail

    - #### setPVKey

          public void setPVKey(java.lang.String pvKey)

      Sets the key of the targeted PageViewport.
      Parameters:
        `pvKey` - the PageViewport key

    - #### getPVKey

          public java.lang.String getPVKey()

      Returns the key of the targeted PageViewport.
      Returns:
        the PageViewport key

    - #### setIDRef

          public void setIDRef(java.lang.String idRef)

      Sets the target ID.
      Parameters:
        `idRef` - the target ID

    - #### getIDRef

          public java.lang.String getIDRef()

      Returns the target ID.
      Returns:
        the target ID

    - #### xmlAttribute

          public java.lang.String xmlAttribute()

      Returns the attribute value for this object as used in the area tree XML.
      Returns:
        a string of the type "(thisPVKey,thisIDRef)"

    - #### makeXMLAttribute

          public static java.lang.String makeXMLAttribute(java.lang.String pvKey,
                                          java.lang.String idRef)

      Returns the XML attribute value for the given PV key and ID ref. This value is used in the area tree XML.
      Parameters:
        `pvKey` - the PageViewport key of the link target
        `idRef` - the ID of the link target
      Returns:
        a string of the type "(thisPVKey,thisIDRef)"

    - #### parseXMLAttribute

          public static java.lang.String[] parseXMLAttribute(java.lang.String attrValue)

      Parses XML attribute value from the area tree into PageViewport key + IDRef strings. If the attribute value is formatted like "(s1,s2)", then s1 and s2 are considered to be the PV key and the IDRef, respectively. Otherwise, the entire string is the PV key and the IDRef is null.
      Parameters:
        `attrValue` - the atribute value (PV key and possibly IDRef)
      Returns:
        a 2-String array containing the PV key and the IDRef. Both may be null.

    - #### toString

          public java.lang.String toString()

      Return the human-friendly string for debugging.
      Overrides:
        `toString` in class `java.lang.Object`

Copyright 1999-2019 The Apache Software Foundation. All Rights Reserved.