Package com.tangosol.config.expression
Class ValueMacroExpression.OffsetLengthSubstringExpansionProcessor
java.lang.Object
com.tangosol.config.expression.ValueMacroExpression.MacroExpansionProcessor
com.tangosol.config.expression.ValueMacroExpression.OffsetLengthSubstringExpansionProcessor
- Enclosing class:
- ValueMacroExpression
protected static class ValueMacroExpression.OffsetLengthSubstringExpansionProcessor
extends ValueMacroExpression.MacroExpansionProcessor
Process 
:offset and :length- See Also:
- 
Constructor SummaryConstructors
- 
Method SummaryModifier and TypeMethodDescriptionbooleancanProcess(String sMacro) Return true iffsMacrocontains the delimiter that this processor handles.Return delimiter being used by the processor.process(String sMacro, ParameterResolver resolver, int cDepth) Perform substring expansion onsMacro.Methods inherited from class com.tangosol.config.expression.ValueMacroExpression.MacroExpansionProcessorvalidateMacroExpansion
- 
Constructor Details- 
OffsetLengthSubstringExpansionProcessorprotected OffsetLengthSubstringExpansionProcessor()
 
- 
- 
Method Details- 
getDelimiterDescription copied from class:ValueMacroExpression.MacroExpansionProcessorReturn delimiter being used by the processor.- Overrides:
- getDelimiterin class- ValueMacroExpression.MacroExpansionProcessor
- Returns:
- delimiter used by the processor or empty string if processor does not have a delimiter
 
- 
canProcessDescription copied from class:ValueMacroExpression.MacroExpansionProcessorReturn true iffsMacrocontains the delimiter that this processor handles.- Overrides:
- canProcessin class- ValueMacroExpression.MacroExpansionProcessor
- Parameters:
- sMacro- the macro parameter
- Returns:
- true iff this processor can process sMacro
 
- 
processPerform substring expansion onsMacro.${macro-parameter:offset} ${macro-parameter:offset:length} Note that length and offset are integer values.Substring expansion expands to up to length characters of the value of macro-parameter starting at the character specified by offset.
 If length is omitted, it expands to the substring of the value of macro-parameter starting at the character specified by offset and extending to the end of the value.
 If offset evaluates to a number less than zero, the value is used as an offset in characters from the end of the value of macro-parameter.
 If length evaluates to a number less than zero, it is interpreted as an offset in characters from the end of the value of macro-parameter. rather than a number of characters, and the expansion is the characters between offset and that result.Note that a negative offset or length must be separated from the colon by at least one space to avoid being confused with the macro parameter default delimiter :-. Examples illustrating substring expansion of a parameter: Given property parameter of string value 01234567890abcdefgh. ${parameter:7} evaluates to 7890abcdefgh ${parameter:7:0} evaluates to empty string ${parameter:7:2} evaluates to 78 ${parameter:7: -2} evaluates to 7890abcdef ${parameter: -7} evaluates to bcdefgh ${parameter: -7:0} evaluates to empty string ${parameter: -7:2} evaluates to bc ${parameter: -7: -2} evaluates to bcdef- Overrides:
- processin class- ValueMacroExpression.MacroExpansionProcessor
- Parameters:
- sMacro- a string starting with- prefixand ending with- suffix
- resolver- macro parameter resolver
- cDepth- count of current macro parameter expansions
- Returns:
- the substring expanded value or the original parameter macro if it does not contain substring expansion
 
 
-