Class AttributeLocation
java.lang.Object
com.deltaxml.core.config.attributeSplitting.AttributeLocation
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 Summary
ConstructorsConstructorDescriptionAttributeLocation(String attributeXpath) Initialises an newAttributeLocationwith an XPath to the attribute.AttributeLocation(String attributeXpath, AttributeSplittingMode mode) Initialises an AttributeLocation with the given parameters.AttributeLocation(String attributeXpath, AttributeSplittingMode mode, Boolean enabled) Initialises an AttributeLocation with the given parameters.AttributeLocation(String attributeXpath, AttributeSplittingMode mode, String separator) Initialises an AttributeLocation with the given parameters.AttributeLocation(String attributeXpath, AttributeSplittingMode mode, String separator, Boolean enabled) Initialises an AttributeLocation with the given parameters.AttributeLocation(String attributeXpath, AttributeSplittingMode mode, String separator, String outputTokenSeparator) Initialises an AttributeLocation with the given parameters.AttributeLocation(String attributeXpath, AttributeSplittingMode mode, String separator, String outputTokenSeparator, Boolean enabled) Initialises an AttributeLocation with the given parameters.AttributeLocation(String attributeXpath, AttributeSplittingMode mode, String separator, String outputTokenSeparator, String regex) Initialises an AttributeLocation with the given parameters.AttributeLocation(String attributeXpath, AttributeSplittingMode mode, String separator, String outputTokenSeparator, String regex, Boolean enabled) Initialises an AttributeLocation with the given parameters.AttributeLocation(String attributeXpath, Boolean enabled) Initialises an AttributeLocation with the given parameters. -
Method Summary
Modifier and TypeMethodDescriptionGet theAttributeSplittingModeused for this location.Return the XPath to the attribute.Get whether Attribute Splitting is enabled at this location.Get the output token separator to use for this location.getRegex()Get the regular expression to use for this location.Get the string of separators for this location.voidSet theAttributeSplittingModeused for this location.voidsetAttributeXPath(String xPath) Change the attribute XPath.voidsetEnabled(Boolean enabled) Set whether Attribute Splitting is enabled at this location only.voidsetOutputTokenSeparator(String outputTokenSeparator) Set the output token separator to use for this location.voidSet the regular expression to use for this location.voidsetSeparator(String separator) Set the separator to use for this location.
-
Constructor Details
-
AttributeLocation
Initialises an newAttributeLocationwith an XPath to the attribute.- Parameters:
attributeXpath- the XPath to the attribute.- Throws:
IllegalArgumentException- if passed attributeXpath is invalid.
-
AttributeLocation
Initialises an AttributeLocation with the given parameters.- Parameters:
attributeXpath- The attribute XPathmode- anAttributeSplittingModeto use for this location- Throws:
IllegalArgumentException- if passed attributeXpath is invalid.
-
AttributeLocation
Initialises an AttributeLocation with the given parameters.- Parameters:
attributeXpath- The attribute XPathenabled- a boolean to enable or disable attribute splitting at this location- Throws:
IllegalArgumentException- if passed attributeXpath is invalid.
-
AttributeLocation
Initialises an AttributeLocation with the given parameters.- Parameters:
attributeXpath- The attribute XPathmode- anAttributeSplittingModeto use for this locationenabled- a boolean to enable or disable attribute splitting at this location- Throws:
IllegalArgumentException- if passed attributeXpath is invalid.
-
AttributeLocation
Initialises an AttributeLocation with the given parameters.- Parameters:
attributeXpath- The attribute XPathmode- anAttributeSplittingModeto use for this locationseparator- 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 XPathmode- anAttributeSplittingModeto use for this locationseparator- 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 XPathmode- anAttributeSplittingModeto use for this locationseparator- 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 XPathmode- anAttributeSplittingModeto use for this locationseparator- 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 outputenabled- 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 XPathmode- anAttributeSplittingModeto use for this locationseparator- 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 outputregex- 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 XPathmode- anAttributeSplittingModeto use for this locationseparator- 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 outputregex- this is used to tokenise the attribute value using regular expression syntaxenabled- a boolean to enable or disable attribute splitting at this location.- Throws:
IllegalArgumentException- if passed attributeXpath is invalid.
-
-
Method Details
-
getAttributeXPath
Return the XPath to the attribute.- Returns:
- string containing the attributes XPath
-
setAttributeXPath
Change the attribute XPath.- Parameters:
xPath- string containing the new attribute XPath to use- Throws:
IllegalArgumentException- if passed attributeXpath is invalid..
-
getAttributeSplittingMode
Get theAttributeSplittingModeused for this location.- Returns:
- an
AttributeSplittingModeenum value
-
setAttributeSplittingMode
Set theAttributeSplittingModeused for this location.- Parameters:
mode- anAttributeSplittingModeenum value
-
getSeparator
Get the string of separators for this location.- Returns:
- a string of separator characters
-
setSeparator
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
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
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
Get the output token separator to use for this location.- Returns:
- a string used to separate tokens in the output
-
setOutputTokenSeparator
Set the output token separator to use for this location.- Parameters:
outputTokenSeparator- string used to separate tokens in the output
-
setEnabled
Set whether Attribute Splitting is enabled at this location only. This will take priority overAttributeSplittingConfigenabled value- Parameters:
enabled- boolean to determine if Attribute Splitting is enabled at this location
-
getEnabled
Get whether Attribute Splitting is enabled at this location.- Returns:
- boolean to determine if Attribute Splitting is enabled at this location
-