Package org.apache.fop.area
Class Trait.InternalLink
java.lang.Object
org.apache.fop.area.Trait.InternalLink
- All Implemented Interfaces:
Serializable
- Enclosing class:
- Trait
Class for internal link traits.
Stores PageViewport key and producer ID
- See Also:
-
Constructor Summary
ConstructorDescriptionInternalLink
(String attrValue) Create an InternalLink based on the given XML attribute value.InternalLink
(String pvKey, String idRef) Create an InternalLink to the given PageViewport and target ID -
Method Summary
Modifier and TypeMethodDescriptiongetIDRef()
Returns the target ID.getPVKey()
Returns the key of the targeted PageViewport.static String
makeXMLAttribute
(String pvKey, String idRef) Returns the XML attribute value for the given PV key and ID ref.static String[]
parseXMLAttribute
(String attrValue) Parses XML attribute value from the area tree into PageViewport key + IDRef strings.void
Sets the target ID.void
Sets the key of the targeted PageViewport.toString()
Return the human-friendly string for debugging.Returns the attribute value for this object as used in the area tree XML.
-
Constructor Details
-
InternalLink
Create an InternalLink to the given PageViewport and target ID- Parameters:
pvKey
- the PageViewport keyidRef
- the target ID
-
InternalLink
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 Details
-
setPVKey
Sets the key of the targeted PageViewport.- Parameters:
pvKey
- the PageViewport key
-
getPVKey
Returns the key of the targeted PageViewport.- Returns:
- the PageViewport key
-
setIDRef
Sets the target ID.- Parameters:
idRef
- the target ID
-
getIDRef
Returns the target ID.- Returns:
- the target ID
-
xmlAttribute
Returns the attribute value for this object as used in the area tree XML.- Returns:
- a string of the type "(thisPVKey,thisIDRef)"
-
makeXMLAttribute
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 targetidRef
- the ID of the link target- Returns:
- a string of the type "(thisPVKey,thisIDRef)"
-
parseXMLAttribute
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
Return the human-friendly string for debugging.
-