Class ReferenceMappingVisitor<T extends Visitable>

  • Type Parameters:
    T - The type to copy. Only visitables of this type should be visited.
    All Implemented Interfaces:
    Visitor
    Direct Known Subclasses:
    IdReferenceMappingVisitor

    public class ReferenceMappingVisitor<T extends Visitable>
    extends CopyingVisitor<T>
    Copy the value of each element within a Resource/Element to a new element with the same values, replacing Reference.reference values with a new value
    • Constructor Detail

      • ReferenceMappingVisitor

        public ReferenceMappingVisitor​(Map<String,​String> localRefMap)
        Parameters:
        localRefMap - a mapping from the current Reference values to the desired ones
    • Method Detail

      • visit

        public boolean visit​(String elementName,
                             int elementIndex,
                             Reference reference)
        Description copied from class: DefaultVisitor
        Delegates to #visit(elementName, elementIndex, Element)
        Specified by:
        visit in interface Visitor
        Overrides:
        visit in class DefaultVisitor
        Returns:
        true if the children of this reference should be visited; otherwise false