Class PathAwareVisitor
- java.lang.Object
-
- org.linuxforhealth.fhir.model.visitor.DefaultVisitor
-
- org.linuxforhealth.fhir.model.visitor.PathAwareVisitor
-
- All Implemented Interfaces:
Visitor
- Direct Known Subclasses:
GeneratingVisitor
,PathAwareCollectingVisitor
,ResourceFingerprintVisitor
@NotThreadSafe public class PathAwareVisitor extends DefaultVisitor
PathAwareVisitor extends the DefaultVisitor with agetPath()
method that can be used to get the FHIRPath path of a Resource or Element during a visit.
-
-
Field Summary
-
Fields inherited from class org.linuxforhealth.fhir.model.visitor.DefaultVisitor
visitChildren
-
-
Constructor Summary
Constructors Constructor Description PathAwareVisitor()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description protected void
doVisit(java.lang.String elementName, byte[] value)
protected void
doVisit(java.lang.String elementName, java.lang.Boolean value)
protected void
doVisit(java.lang.String elementName, java.lang.Integer value)
protected void
doVisit(java.lang.String elementName, java.lang.String value)
protected void
doVisit(java.lang.String elementName, java.math.BigDecimal value)
protected void
doVisit(java.lang.String elementName, java.time.LocalDate value)
protected void
doVisit(java.lang.String elementName, java.time.LocalTime value)
protected void
doVisit(java.lang.String elementName, java.time.Year value)
protected void
doVisit(java.lang.String elementName, java.time.YearMonth value)
protected void
doVisit(java.lang.String elementName, java.time.ZonedDateTime value)
protected void
doVisitEnd(java.lang.String elementName, int elementIndex, Resource resource)
protected void
doVisitEnd(java.lang.String elementName, int elementIndex, Element element)
protected void
doVisitStart(java.lang.String elementName, int elementIndex, Resource resource)
protected void
doVisitStart(java.lang.String elementName, int elementIndex, Element element)
java.lang.String
getPath()
Get the FHIRPath path of the Resource or Element currently being visited.void
reset()
Reset the state of the PathAwareVisitor.void
visit(java.lang.String elementName, byte[] value)
void
visit(java.lang.String elementName, java.lang.Boolean value)
void
visit(java.lang.String elementName, java.lang.Integer value)
void
visit(java.lang.String elementName, java.lang.String value)
void
visit(java.lang.String elementName, java.math.BigDecimal value)
void
visit(java.lang.String elementName, java.time.LocalDate value)
void
visit(java.lang.String elementName, java.time.LocalTime value)
void
visit(java.lang.String elementName, java.time.Year value)
void
visit(java.lang.String elementName, java.time.YearMonth value)
void
visit(java.lang.String elementName, java.time.ZonedDateTime value)
void
visitEnd(java.lang.String elementName, int elementIndex, Resource resource)
void
visitEnd(java.lang.String elementName, int elementIndex, Element element)
void
visitStart(java.lang.String elementName, int elementIndex, Resource resource)
void
visitStart(java.lang.String elementName, int elementIndex, Element element)
-
Methods inherited from class org.linuxforhealth.fhir.model.visitor.DefaultVisitor
postVisit, postVisit, preVisit, preVisit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visitEnd, visitStart
-
-
-
-
Method Detail
-
getPath
public final java.lang.String getPath()
Get the FHIRPath path of the Resource or Element currently being visited. This method is primarily for subclasses but can also be used externally to retrieve a path to the Resource or Element that was being visited when an Exception occurs.- Returns:
- The path of the Resource or Element currently being visited, the path that was being visited when an exception was thrown, or null if there is no Resource or Element being visited.
-
reset
public final void reset()
Reset the state of the PathAwareVisitor. Invoke this method when visiting has failed and you want to clear the path in order to re-use the visitor.
-
doVisitStart
protected void doVisitStart(java.lang.String elementName, int elementIndex, Element element)
-
doVisitStart
protected void doVisitStart(java.lang.String elementName, int elementIndex, Resource resource)
-
doVisitEnd
protected void doVisitEnd(java.lang.String elementName, int elementIndex, Element element)
-
doVisitEnd
protected void doVisitEnd(java.lang.String elementName, int elementIndex, Resource resource)
-
visitEnd
public final void visitEnd(java.lang.String elementName, int elementIndex, Element element)
- Specified by:
visitEnd
in interfaceVisitor
- Overrides:
visitEnd
in classDefaultVisitor
-
visitEnd
public final void visitEnd(java.lang.String elementName, int elementIndex, Resource resource)
- Specified by:
visitEnd
in interfaceVisitor
- Overrides:
visitEnd
in classDefaultVisitor
-
visitStart
public final void visitStart(java.lang.String elementName, int elementIndex, Element element)
- Specified by:
visitStart
in interfaceVisitor
- Overrides:
visitStart
in classDefaultVisitor
-
visitStart
public final void visitStart(java.lang.String elementName, int elementIndex, Resource resource)
- Specified by:
visitStart
in interfaceVisitor
- Overrides:
visitStart
in classDefaultVisitor
-
visit
public final void visit(java.lang.String elementName, byte[] value)
- Specified by:
visit
in interfaceVisitor
- Overrides:
visit
in classDefaultVisitor
-
visit
public final void visit(java.lang.String elementName, java.math.BigDecimal value)
- Specified by:
visit
in interfaceVisitor
- Overrides:
visit
in classDefaultVisitor
-
visit
public final void visit(java.lang.String elementName, java.lang.Boolean value)
- Specified by:
visit
in interfaceVisitor
- Overrides:
visit
in classDefaultVisitor
-
visit
public final void visit(java.lang.String elementName, java.lang.Integer value)
- Specified by:
visit
in interfaceVisitor
- Overrides:
visit
in classDefaultVisitor
-
visit
public final void visit(java.lang.String elementName, java.time.LocalDate value)
- Specified by:
visit
in interfaceVisitor
- Overrides:
visit
in classDefaultVisitor
-
visit
public final void visit(java.lang.String elementName, java.time.LocalTime value)
- Specified by:
visit
in interfaceVisitor
- Overrides:
visit
in classDefaultVisitor
-
visit
public final void visit(java.lang.String elementName, java.lang.String value)
- Specified by:
visit
in interfaceVisitor
- Overrides:
visit
in classDefaultVisitor
-
visit
public final void visit(java.lang.String elementName, java.time.Year value)
- Specified by:
visit
in interfaceVisitor
- Overrides:
visit
in classDefaultVisitor
-
visit
public final void visit(java.lang.String elementName, java.time.YearMonth value)
- Specified by:
visit
in interfaceVisitor
- Overrides:
visit
in classDefaultVisitor
-
visit
public final void visit(java.lang.String elementName, java.time.ZonedDateTime value)
- Specified by:
visit
in interfaceVisitor
- Overrides:
visit
in classDefaultVisitor
-
doVisit
protected void doVisit(java.lang.String elementName, byte[] value)
-
doVisit
protected void doVisit(java.lang.String elementName, java.math.BigDecimal value)
-
doVisit
protected void doVisit(java.lang.String elementName, java.lang.Boolean value)
-
doVisit
protected void doVisit(java.lang.String elementName, java.lang.Integer value)
-
doVisit
protected void doVisit(java.lang.String elementName, java.time.LocalDate value)
-
doVisit
protected void doVisit(java.lang.String elementName, java.time.LocalTime value)
-
doVisit
protected void doVisit(java.lang.String elementName, java.lang.String value)
-
doVisit
protected void doVisit(java.lang.String elementName, java.time.Year value)
-
doVisit
protected void doVisit(java.lang.String elementName, java.time.YearMonth value)
-
doVisit
protected void doVisit(java.lang.String elementName, java.time.ZonedDateTime value)
-
-