Class PathAwareCollectingVisitor<T>

  • Type Parameters:
    T - The type of object to collect
    All Implemented Interfaces:
    Visitor

    public class PathAwareCollectingVisitor<T>
    extends PathAwareVisitor
    Visits a Resource or Element and collects all of its descendants of a given type into a collection of those elements, indexed by their simple FHIRPath path.
    • Field Detail

      • result

        protected final java.util.Map<java.lang.String,​T> result
      • type

        protected final java.lang.Class<T> type
    • Constructor Detail

      • PathAwareCollectingVisitor

        public PathAwareCollectingVisitor​(java.lang.Class<T> type)
    • Method Detail

      • collect

        protected void collect​(java.lang.Object object)
      • getResult

        public java.util.Map<java.lang.String,​T> getResult()
      • visit

        public boolean visit​(java.lang.String elementName,
                             int elementIndex,
                             Visitable visitable)
        Description copied from class: DefaultVisitor
        Subclasses can override this method to provide a default action for all visit methods.
        Specified by:
        visit in interface Visitor
        Overrides:
        visit in class DefaultVisitor
        Returns:
        whether to visit the children of this resource; returns the value of the visitChildren boolean by default
      • doVisit

        public void doVisit​(java.lang.String elementName,
                            byte[] value)
        Overrides:
        doVisit in class PathAwareVisitor
      • doVisit

        public void doVisit​(java.lang.String elementName,
                            java.math.BigDecimal value)
        Overrides:
        doVisit in class PathAwareVisitor
      • doVisit

        public void doVisit​(java.lang.String elementName,
                            java.lang.Boolean value)
        Overrides:
        doVisit in class PathAwareVisitor
      • doVisit

        public void doVisit​(java.lang.String elementName,
                            java.lang.Integer value)
        Overrides:
        doVisit in class PathAwareVisitor
      • doVisit

        public void doVisit​(java.lang.String elementName,
                            java.time.LocalDate value)
        Overrides:
        doVisit in class PathAwareVisitor
      • doVisit

        public void doVisit​(java.lang.String elementName,
                            java.time.LocalTime value)
        Overrides:
        doVisit in class PathAwareVisitor
      • doVisit

        public void doVisit​(java.lang.String elementName,
                            java.lang.String value)
        Overrides:
        doVisit in class PathAwareVisitor
      • doVisit

        public void doVisit​(java.lang.String elementName,
                            java.time.Year value)
        Overrides:
        doVisit in class PathAwareVisitor
      • doVisit

        public void doVisit​(java.lang.String elementName,
                            java.time.YearMonth value)
        Overrides:
        doVisit in class PathAwareVisitor
      • doVisit

        public void doVisit​(java.lang.String elementName,
                            java.time.ZonedDateTime value)
        Overrides:
        doVisit in class PathAwareVisitor