Class AttributeLocation

java.lang.Object
com.deltaxml.core.config.attributeSplitting.AttributeLocation

public class AttributeLocation extends Object
This class is used to represent an attribute location by providing an XPath for the attribute. To define an attribute location you must define an XPath which declares what its location is - this is the 'attributeXpath'. You can optionally define an AttributeSplittingMode to use for this location, separators or regex used to tokenize the attribute, output token separator, and finally you can define a value for 'enabled' to toggle attribute splitting for this location
  • Constructor Details

    • AttributeLocation

      public AttributeLocation(String attributeXpath)
      Initialises an new AttributeLocation with an XPath to the attribute.
      Parameters:
      attributeXpath - the XPath to the attribute.
      Throws:
      IllegalArgumentException - if passed attributeXpath is invalid.
    • AttributeLocation

      public AttributeLocation(String attributeXpath, AttributeSplittingMode mode)
      Initialises an AttributeLocation with the given parameters.
      Parameters:
      attributeXpath - The attribute XPath
      mode - an AttributeSplittingMode to use for this location
      Throws:
      IllegalArgumentException - if passed attributeXpath is invalid.
    • AttributeLocation

      public AttributeLocation(String attributeXpath, Boolean enabled)
      Initialises an AttributeLocation with the given parameters.
      Parameters:
      attributeXpath - The attribute XPath
      enabled - a boolean to enable or disable attribute splitting at this location
      Throws:
      IllegalArgumentException - if passed attributeXpath is invalid.
    • AttributeLocation

      public AttributeLocation(String attributeXpath, AttributeSplittingMode mode, Boolean enabled)
      Initialises an AttributeLocation with the given parameters.
      Parameters:
      attributeXpath - The attribute XPath
      mode - an AttributeSplittingMode to use for this location
      enabled - a boolean to enable or disable attribute splitting at this location
      Throws:
      IllegalArgumentException - if passed attributeXpath is invalid.
    • AttributeLocation

      public AttributeLocation(String attributeXpath, AttributeSplittingMode mode, String separator)
      Initialises an AttributeLocation with the given parameters.
      Parameters:
      attributeXpath - The attribute XPath
      mode - an AttributeSplittingMode to use for this location
      separator - a string containing one or more separator characters. The attribute value is split at each point in the string that a separator character is encountered.
      Throws:
      IllegalArgumentException - if passed attributeXpath is invalid.
    • AttributeLocation

      public AttributeLocation(String attributeXpath, AttributeSplittingMode mode, String separator, Boolean enabled)
      Initialises an AttributeLocation with the given parameters.
      Parameters:
      attributeXpath - The attribute XPath
      mode - an AttributeSplittingMode to use for this location
      separator - a string containing one or more separator characters. The attribute value is split at each point in the string that a separator character is encountered.
      enabled - a boolean to enable or disable attribute splitting at this location
      Throws:
      IllegalArgumentException - if passed attributeXpath is invalid.
    • AttributeLocation

      public AttributeLocation(String attributeXpath, AttributeSplittingMode mode, String separator, String outputTokenSeparator)
      Initialises an AttributeLocation with the given parameters.
      Parameters:
      attributeXpath - The attribute XPath
      mode - an AttributeSplittingMode to use for this location
      separator - a string containing one or more separator characters. The attribute value is split at each point in the string that a separator character is encountered.
      outputTokenSeparator - a string used to separate tokens in the output
      Throws:
      IllegalArgumentException - if passed attributeXpath is invalid.
    • AttributeLocation

      public AttributeLocation(String attributeXpath, AttributeSplittingMode mode, String separator, String outputTokenSeparator, Boolean enabled)
      Initialises an AttributeLocation with the given parameters.
      Parameters:
      attributeXpath - The attribute XPath
      mode - an AttributeSplittingMode to use for this location
      separator - a string containing one or more separator characters. The attribute value is split at each point in the string that a separator character is encountered.
      outputTokenSeparator - a string used to separate tokens in the output
      enabled - a boolean to enable or disable attribute splitting at this location
      Throws:
      IllegalArgumentException - if passed attributeXpath is invalid.
    • AttributeLocation

      public AttributeLocation(String attributeXpath, AttributeSplittingMode mode, String separator, String outputTokenSeparator, String regex)
      Initialises an AttributeLocation with the given parameters.
      Parameters:
      attributeXpath - The attribute XPath
      mode - an AttributeSplittingMode to use for this location
      separator - a string containing one or more separator characters. The attribute value is split at each point in the string that a separator character is encountered.
      outputTokenSeparator - a string used to separate tokens in the output
      regex - this is used to tokenise the attribute value using regular expression syntax.
      Throws:
      IllegalArgumentException - if passed attributeXpath is invalid.
    • AttributeLocation

      public AttributeLocation(String attributeXpath, AttributeSplittingMode mode, String separator, String outputTokenSeparator, String regex, Boolean enabled)
      Initialises an AttributeLocation with the given parameters.
      Parameters:
      attributeXpath - The attribute XPath
      mode - an AttributeSplittingMode to use for this location
      separator - a string containing one or more separator characters. The attribute value is split at each point in the string that a separator character is encountered.
      outputTokenSeparator - a string used to separate tokens in the output
      regex - this is used to tokenise the attribute value using regular expression syntax
      enabled - a boolean to enable or disable attribute splitting at this location.
      Throws:
      IllegalArgumentException - if passed attributeXpath is invalid.
  • Method Details

    • getAttributeXPath

      public String getAttributeXPath()
      Return the XPath to the attribute.
      Returns:
      string containing the attributes XPath
    • setAttributeXPath

      public void setAttributeXPath(String xPath)
      Change the attribute XPath.
      Parameters:
      xPath - string containing the new attribute XPath to use
      Throws:
      IllegalArgumentException - if passed attributeXpath is invalid..
    • getAttributeSplittingMode

      public AttributeSplittingMode getAttributeSplittingMode()
      Get the AttributeSplittingMode used for this location.
      Returns:
      an AttributeSplittingMode enum value
    • setAttributeSplittingMode

      public void setAttributeSplittingMode(AttributeSplittingMode mode)
      Set the AttributeSplittingMode used for this location.
      Parameters:
      mode - an AttributeSplittingMode enum value
    • getSeparator

      public String getSeparator()
      Get the string of separators for this location.
      Returns:
      a string of separator characters
    • setSeparator

      public void setSeparator(String separator)
      Set the separator to use for this location.
      Parameters:
      separator - a string containing one or more separator characters. The attribute value is split at each point in the string that a separator character is encountered.
    • getRegex

      public String getRegex()
      Get the regular expression to use for this location.
      Returns:
      a string containing a regular expression. This is used to tokenise the attribute value.
    • setRegex

      public void setRegex(String regex)
      Set the regular expression to use for this location.
      Parameters:
      regex - a string containing a regular expression. This is used to tokenise the attribute value.
    • getOutputTokenSeparator

      public String getOutputTokenSeparator()
      Get the output token separator to use for this location.
      Returns:
      a string used to separate tokens in the output
    • setOutputTokenSeparator

      public void setOutputTokenSeparator(String outputTokenSeparator)
      Set the output token separator to use for this location.
      Parameters:
      outputTokenSeparator - string used to separate tokens in the output
    • setEnabled

      public void setEnabled(Boolean enabled)
      Set whether Attribute Splitting is enabled at this location only. This will take priority over AttributeSplittingConfig enabled value
      Parameters:
      enabled - boolean to determine if Attribute Splitting is enabled at this location
    • getEnabled

      public Boolean getEnabled()
      Get whether Attribute Splitting is enabled at this location.
      Returns:
      boolean to determine if Attribute Splitting is enabled at this location