Top Description Fields Constructors Methods
com.mysql.cj.xdevapi

public Class ExprUnparser

extends Object
Class Inheritance
Imports
java.util.ArrayList, .HashSet, .List, .Set, java.util.stream.Collectors, com.mysql.cj.x.protobuf.MysqlxDatatypes.Scalar, .MysqlxExpr.Array, .MysqlxExpr.ColumnIdentifier, .MysqlxExpr.DocumentPathItem, .MysqlxExpr.Expr, .MysqlxExpr.FunctionCall, .MysqlxExpr.Identifier, .MysqlxExpr.Object, .MysqlxExpr.Operator

Serializer utility for dealing with X Protocol expression trees.

Field Summary

Modifier and TypeField and Description
pack-priv static Set<String>
infixOperators

List of operators which will be serialized as infix operators.

Constructor Summary

AccessConstructor and Description
public

Method Summary

Modifier and TypeMethod and Description
pack-priv static String
pack-priv static String

Returns:

Column identifier or JSON path string.
columnIdentifierToString
(MysqlxExpr.ColumnIdentifier e)

Column identifier (or JSON path) to string.

pack-priv static String

Returns:

JSON document path string
documentPathToString
(List<MysqlxExpr.DocumentPathItem>
list of DocumentPathItem objects
items
)

JSON document path to string.

public static String

Returns:

escaped literal
escapeLiteral
(String
literal
s
)

Escape a string literal.

public static String

Returns:

string expression
exprToString
(MysqlxExpr.Expr e)

Serialize an expression to a string.

pack-priv static String

Returns:

Function call string
functionCallToString
(MysqlxExpr.FunctionCall e)

Function call to string.

pack-priv static String
pack-priv static String

Returns:

Operator string
operatorToString
(MysqlxExpr.Operator e)

Convert an operator to a string.

pack-priv static String

Returns:

param list string
paramListToString
(List<String>
list of param strings
params
)

Create a string from a list of (already stringified) parameters.

public static String

Returns:

quoted path member
quoteDocumentPathMember
(String
path member
member
)

Quote a JSON document path member.

public static String

Returns:

quoted identifier
quoteIdentifier
(String
identifier
ident
)

Quote a named identifier.

public static String

Returns:

quoted key
quoteJsonKey
(String
key
key
)

Quote a JSON document field key.

pack-priv static String

Returns:

scalar string
scalarToString
(MysqlxDatatypes.Scalar e)

Scalar to string.

Inherited from java.lang.Object:
cloneequalsfinalizegetClasshashCodenotifynotifyAlltoStringwaitwaitwait

Field Detail

infixOperatorsback to summary
pack-priv static Set<String> infixOperators

List of operators which will be serialized as infix operators.

Constructor Detail

ExprUnparserback to summary
public ExprUnparser()

Method Detail

arrayToStringback to summary
pack-priv static String arrayToString(MysqlxExpr.Array e)
columnIdentifierToStringback to summary
pack-priv static String columnIdentifierToString(MysqlxExpr.ColumnIdentifier e)

Column identifier (or JSON path) to string.

Parameters
e:MysqlxExpr.ColumnIdentifier

ColumnIdentifier

Returns:String

Column identifier or JSON path string.

documentPathToStringback to summary
pack-priv static String documentPathToString(List<MysqlxExpr.DocumentPathItem> items)

JSON document path to string.

Parameters
items:List<MysqlxExpr.DocumentPathItem>

list of DocumentPathItem objects

Returns:String

JSON document path string

escapeLiteralback to summary
public static String escapeLiteral(String s)

Escape a string literal.

Parameters
s:String

literal

Returns:String

escaped literal

exprToStringback to summary
public static String exprToString(MysqlxExpr.Expr e)

Serialize an expression to a string.

Parameters
e:MysqlxExpr.Expr

Expr

Returns:String

string expression

functionCallToStringback to summary
pack-priv static String functionCallToString(MysqlxExpr.FunctionCall e)

Function call to string.

Parameters
e:MysqlxExpr.FunctionCall

FunctionCall

Returns:String

Function call string

objectToStringback to summary
pack-priv static String objectToString(MysqlxExpr.Object o)
operatorToStringback to summary
pack-priv static String operatorToString(MysqlxExpr.Operator e)

Convert an operator to a string. Includes special cases for chosen infix operators (AND, OR) and special forms such as LIKE and BETWEEN.

Parameters
e:MysqlxExpr.Operator

Operator

Returns:String

Operator string

paramListToStringback to summary
pack-priv static String paramListToString(List<String> params)

Create a string from a list of (already stringified) parameters. Surround by parens and separate by commas.

Parameters
params:List<String>

list of param strings

Returns:String

param list string

quoteDocumentPathMemberback to summary
public static String quoteDocumentPathMember(String member)

Quote a JSON document path member.

Parameters
member:String

path member

Returns:String

quoted path member

quoteIdentifierback to summary
public static String quoteIdentifier(String ident)

Quote a named identifier.

Parameters
ident:String

identifier

Returns:String

quoted identifier

quoteJsonKeyback to summary
public static String quoteJsonKey(String key)

Quote a JSON document field key.

Parameters
key:String

key

Returns:String

quoted key

scalarToStringback to summary
pack-priv static String scalarToString(MysqlxDatatypes.Scalar e)

Scalar to string.

Parameters
e:MysqlxDatatypes.Scalar

Scalar

Returns:String

scalar string