Package adql.translator
Class FunctionTranslatorWithPattern
java.lang.Object
adql.translator.FunctionTranslatorWithPattern
- All Implemented Interfaces:
FunctionTranslator
A
FunctionTranslator
working with a translation pattern.
A translation pattern is a string with a syntax allowing to make references
to function arguments. See TranslationPattern
for details about
the pattern syntax and examples.
- Since:
- 2.0
- See Also:
-
Field Summary
Fields -
Constructor Summary
ConstructorsConstructorDescriptionFunctionTranslatorWithPattern
(String translationPattern) Create aFunctionTranslator
with a translation pattern. -
Method Summary
Modifier and TypeMethodDescriptionfinal String
Get the translation pattern used in thisFunctionTranslator
.translate
(ADQLFunction fct, ADQLTranslator caller) Translate the given ADQL function into the language supported by the given translator.
-
Field Details
-
pattern
Pattern to apply to translate a given ADQL function.
-
-
Constructor Details
-
FunctionTranslatorWithPattern
Create aFunctionTranslator
with a translation pattern.- Parameters:
translationPattern
- The translation pattern to use.- Throws:
NullPointerException
- If the given pattern is NULL or empty.
-
-
Method Details
-
getPattern
Get the translation pattern used in thisFunctionTranslator
.- Returns:
- The used translation pattern.
-
translate
Description copied from interface:FunctionTranslator
Translate the given ADQL function into the language supported by the given translator.VERY IMPORTANT: This function MUST NOT use
ADQLTranslator.translate(ADQLFunction)
to translate the givenADQLFunction
. The givenADQLTranslator
must be used ONLY to translate the function's parameters.- Specified by:
translate
in interfaceFunctionTranslator
- Parameters:
fct
- The function to translate.caller
- Translator to use in order to translate ONLY function parameters.- Returns:
- The translation of this function into the language supported by the given translator, or NULL to let the calling translator apply a default translation.
- Throws:
TranslationException
- If the translation fails.
-