Class XPathHandler

java.lang.Object
com.x2j.converter.mgr.handlers.impl.XPathHandler
All Implemented Interfaces:
X2JStringHandler

public class XPathHandler extends Object implements X2JStringHandler
The handler for the X2JStringHandler interface for the XPATH keyword. This handler will resolve the XPATH as provided in the schema and returns the String value for the same.
  1. If the XPATH is for an XML attribute, this will return the attribute's value.
  2. If the XPATH is for an XML Element, this will return the child element (if present) for the given element in an encoded string format.
  • Constructor Details

    • XPathHandler

      public XPathHandler()
  • Method Details

    • handleString

      public String handleString(String rawValueString, Element rootElement) throws X2JException
      Returns the resolved XPATH value string.
      Specified by:
      handleString in interface X2JStringHandler
      Parameters:
      rawValueString - the raw JSON value string
      rootElement - the root element in the input XML
      Returns:
      the resolved XPATH value string
      Throws:
      X2JException - X2JException