de.vc.xml

## Class ReferenceRebuilder

- java.lang.Object
- - de.vc.xml.ReferenceRebuilder

-     public class ReferenceRebuilder
      extends java.lang.Object

  This class renames ID-attributes to resolve conflicts when merging XSL-FO documents or parts of it. It first you need to set, which attributes are relevant for renaming (call addAttribute()). Then add the mapping which values should be renamed (call addMapping or addAutoMapping).

- - ### Constructor Summary

    Constructors
    Constructor and Description
    `ReferenceRebuilder()`

  - ### Method Summary

    Methods
    Modifier and Type | Method and Description
    --- | ---
    `void` | `addAttribute(java.lang.String name)` Adds an attribute which values are mapped.
    `void` | `addAutoMapping(Node node)` Parses the given node and all child-nodes for relevant attributes (see addAttribute) and adds a mapping from their values (IDs) to new values (auto-assigned IDs).
    `void` | `addAutoMapping(java.lang.String reservedId)` Adds a reserved ID which is mapped to another (auto-assigned) id.
    `void` | `addMapping(java.lang.String reserveredId, java.lang.String newId)` Adds a reserved ID which is mapped to the give `newId`.
    `java.lang.String` | `getMappedId(java.lang.String reserveredId)` Gets the mapped ID of a reservered ID.
    `boolean` | `isMapped(java.lang.String id)` Return true, if the given ID is mapped.
    `void` | `rebuild(Node node)` Maps all relevant attributes of the given node and child-nodes.
    `void` | `rebuild(Node[] nodes)` Maps all relevant attributes of given nodes and their child-nodes.

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

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

- - ### Constructor Detail

    - #### ReferenceRebuilder

          public ReferenceRebuilder()

  - ### Method Detail

    - #### addAttribute

          public void addAttribute(java.lang.String name)

      Adds an attribute which values are mapped.
      Parameters:
        `name` - Attribute name.

    - #### addAutoMapping

          public void addAutoMapping(Node node)

      Parses the given node and all child-nodes for relevant attributes (see addAttribute) and adds a mapping from their values (IDs) to new values (auto-assigned IDs).
      Parameters:
        `node` - Node

    - #### addAutoMapping

          public void addAutoMapping(java.lang.String reservedId)

      Adds a reserved ID which is mapped to another (auto-assigned) id.
      Parameters:
        `reservedId` - Reserved id.

    - #### addMapping

          public void addMapping(java.lang.String reserveredId,
                        java.lang.String newId)

      Adds a reserved ID which is mapped to the give `newId`.
      Parameters:
        `reserveredId` - Reserved id.
        `newId` - New id.

    - #### isMapped

          public boolean isMapped(java.lang.String id)

      Return true, if the given ID is mapped.
      Parameters:
        `id` - ID.
      Returns:
        true if mapped.

    - #### getMappedId

          public java.lang.String getMappedId(java.lang.String reserveredId)

      Gets the mapped ID of a reservered ID.
      Parameters:
        `reserveredId` - Reserved ID.
      Returns:
        Mapped ID.

    - #### rebuild

          public void rebuild(Node node)

      Maps all relevant attributes of the given node and child-nodes.
      Parameters:
        `node` - Node

    - #### rebuild

          public void rebuild(Node[] nodes)

      Maps all relevant attributes of given nodes and their child-nodes.
      Parameters:
        `nodes` - Nodes

© 2003-2011 by Sascha Schmidt (vision-cloud.de). All Rights Reserved.