Class StringParser
java.lang.Object
com.inductiveautomation.ignition.common.expressions.parsing.StringParser
- All Implemented Interfaces:
Parser
This parser handles a literal string which contains references. The resulting
expression will produce the string values
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic enum
protected static class
-
Field Summary
Fields -
Constructor Summary
ConstructorsModifierConstructorDescriptionprotected
StringParser
(Class<? extends AbstractExpression> exprType) This constructor specifies what type of expression should be created. -
Method Summary
Modifier and TypeMethodDescriptionprotected void
addPart
(List<StringParser.StringOrPath> parts, StringParser.StringOrPath newPart) static StringParser
Returns a parser that expects to parse sql queries for referencesstatic StringParser
Returns a parser who creates expressions that simply toString sub-expressions, adjusting the values for the locale.static StringParser
Returns a parser who creates an expression that is the toString of all of the sub-expressions, but with no consideration of the locale.parse
(String expr, ExpressionParseContext binder) protected StringParser.StringOrPath[]
parseQueryWithBoundPaths
(String query) protected StringParser.StringOrPath[]
protected static StringParser.StringOrPath[]
protected StringParser.StringOrPath[]
Chops up a query, returning the string segments and path segments separatelyvoid
preventToStringSingleExpression
(boolean prevent) If set to true and the parsed expression only contains one expression.void
setAllowsReferenceEscape
(boolean escapeReference) If true, allows item reference syntax, such as "{blah}" to be escaped with "\", to avoid expansion.void
setEscapeStrategy
(StringParser.EscapeStrategy strategy)
-
Field Details
-
ESCAPE
- See Also:
-
OPEN_DELIM
- See Also:
-
CLOSE_DELIM
- See Also:
-
-
Constructor Details
-
StringParser
public StringParser() -
StringParser
This constructor specifies what type of expression should be created. Different expressions will behave differently.
-
-
Method Details
-
newStandardParser_Localized
Returns a parser who creates expressions that simply toString sub-expressions, adjusting the values for the locale. -
newStandardParser_NonLocalized
Returns a parser who creates an expression that is the toString of all of the sub-expressions, but with no consideration of the locale. -
newQueryParser
Returns a parser that expects to parse sql queries for references -
setAllowsReferenceEscape
public void setAllowsReferenceEscape(boolean escapeReference) If true, allows item reference syntax, such as "{blah}" to be escaped with "\", to avoid expansion. False, usesStringParser.EscapeStrategy.NONE
True, usesStringParser.EscapeStrategy.REFERENCE
-
setEscapeStrategy
-
getAllowsReferenceEscape
-
preventToStringSingleExpression
public void preventToStringSingleExpression(boolean prevent) If set to true and the parsed expression only contains one expression. The direct result of that expression will not be wrapped with a toString expression. -
parse
-
addPart
-
parseQueryWithBoundPaths
- Throws:
Exception
-
parseQueryWithBoundPathsEscapedCharacters
-
parseQueryWithEscapedBoundPaths
protected StringParser.StringOrPath[] parseQueryWithEscapedBoundPaths(String query) throws Exception Chops up a query, returning the string segments and path segments separately- Throws:
Exception
-
parseQueryWithBoundPathsNoEscape
protected static StringParser.StringOrPath[] parseQueryWithBoundPathsNoEscape(String query) throws Exception - Throws:
Exception
-