Class FunctionSTR2GO
- java.lang.Object
-
- com.igormaznitsa.jcp.expression.functions.AbstractFunction
-
- com.igormaznitsa.jcp.expression.functions.FunctionSTR2GO
-
- All Implemented Interfaces:
ExpressionItem
public final class FunctionSTR2GO extends AbstractFunction
The class implements escape function handler to escape strings to be used in Go.
-
-
Field Summary
Fields Modifier and Type Field Description private static ValueType[][]ARG_TYPES-
Fields inherited from class com.igormaznitsa.jcp.expression.functions.AbstractFunction
ALL_FUNCTIONS, EXECUTION_PREFIX, FUNCTION_NAME_MAP, UID_COUNTER
-
-
Constructor Summary
Constructors Constructor Description FunctionSTR2GO()
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description private static java.lang.StringescapeGo(java.lang.String value)ValueexecuteStrBool(PreprocessorContext context, Value source, Value splitAndQuoteLines)ValueType[][]getAllowedArgumentTypes()Get arrays of supported argument typesintgetArity()Get the function arityjava.lang.StringgetName()Get the function namejava.lang.StringgetReference()Get the function reference to be output for a help requestValueTypegetResultType()Get the result typeprivate static java.lang.StringtoUnicode(char c)-
Methods inherited from class com.igormaznitsa.jcp.expression.functions.AbstractFunction
findForClass, findForName, getExpressionItemPriority, getExpressionItemType, toString
-
-
-
-
Field Detail
-
ARG_TYPES
private static final ValueType[][] ARG_TYPES
-
-
Method Detail
-
getName
public java.lang.String getName()
Description copied from class:AbstractFunctionGet the function name- Specified by:
getNamein classAbstractFunction- Returns:
- the function name in lower case, must not be null
-
executeStrBool
public Value executeStrBool(PreprocessorContext context, Value source, Value splitAndQuoteLines)
-
toUnicode
private static java.lang.String toUnicode(char c)
-
escapeGo
private static java.lang.String escapeGo(java.lang.String value)
-
getArity
public int getArity()
Description copied from class:AbstractFunctionGet the function arity- Specified by:
getArityin classAbstractFunction- Returns:
- the function arity (zero or greater)
-
getAllowedArgumentTypes
@MustNotContainNull public ValueType[][] getAllowedArgumentTypes()
Description copied from class:AbstractFunctionGet arrays of supported argument types- Specified by:
getAllowedArgumentTypesin classAbstractFunction- Returns:
- the array of argument type combinations allowed by the function handler, must not be null
-
getReference
public java.lang.String getReference()
Description copied from class:AbstractFunctionGet the function reference to be output for a help request- Specified by:
getReferencein classAbstractFunction- Returns:
- the function information as a String, must not be null
-
getResultType
public ValueType getResultType()
Description copied from class:AbstractFunctionGet the result type- Specified by:
getResultTypein classAbstractFunction- Returns:
- the result type of the function, must not be null
-
-