Class StringParser
- java.lang.Object
-
- com.inductiveautomation.ignition.common.expressions.parsing.StringParser
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static classStringParser.EscapeStrategyprotected static classStringParser.StringOrPath
-
Field Summary
Fields Modifier and Type Field Description static java.lang.StringCLOSE_DELIMstatic java.lang.StringESCAPEstatic java.lang.StringOPEN_DELIM
-
Constructor Summary
Constructors Modifier Constructor Description StringParser()protectedStringParser(java.lang.Class<? extends AbstractExpression> exprType)This constructor specifies what type of expression should be created.
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description protected voidaddPart(java.util.List<StringParser.StringOrPath> parts, StringParser.StringOrPath newPart)StringParser.EscapeStrategygetAllowsReferenceEscape()static StringParsernewQueryParser()Returns a parser that expects to parse sql queries for referencesstatic StringParsernewStandardParser_Localized()Returns a parser who creates expressions that simply toString sub-expressions, adjusting the values for the locale.static StringParsernewStandardParser_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.Expressionparse(java.lang.String expr, ExpressionParseContext binder)protected StringParser.StringOrPath[]parseQueryWithBoundPaths(java.lang.String query)protected StringParser.StringOrPath[]parseQueryWithBoundPathsEscapedCharacters(java.lang.String query)protected static StringParser.StringOrPath[]parseQueryWithBoundPathsNoEscape(java.lang.String query)protected StringParser.StringOrPath[]parseQueryWithEscapedBoundPaths(java.lang.String query)Chops up a query, returning the string segments and path segments separatelyvoidsetAllowsReferenceEscape(boolean escapeReference)If true, allows item reference syntax, such as "{blah}" to be escaped with "\", to avoid expansion.voidsetEscapeStrategy(StringParser.EscapeStrategy strategy)
-
-
-
Field Detail
-
ESCAPE
public static final java.lang.String ESCAPE
- See Also:
- Constant Field Values
-
OPEN_DELIM
public static final java.lang.String OPEN_DELIM
- See Also:
- Constant Field Values
-
CLOSE_DELIM
public static final java.lang.String CLOSE_DELIM
- See Also:
- Constant Field Values
-
-
Constructor Detail
-
StringParser
public StringParser()
-
StringParser
protected StringParser(java.lang.Class<? extends AbstractExpression> exprType)
This constructor specifies what type of expression should be created. Different expressions will behave differently.
-
-
Method Detail
-
newStandardParser_Localized
public static StringParser newStandardParser_Localized()
Returns a parser who creates expressions that simply toString sub-expressions, adjusting the values for the locale.
-
newStandardParser_NonLocalized
public static StringParser 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
public static StringParser 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.NONETrue, usesStringParser.EscapeStrategy.REFERENCE
-
setEscapeStrategy
public void setEscapeStrategy(StringParser.EscapeStrategy strategy)
-
getAllowsReferenceEscape
public StringParser.EscapeStrategy getAllowsReferenceEscape()
-
parse
public Expression parse(java.lang.String expr, ExpressionParseContext binder) throws java.lang.Exception
-
addPart
protected void addPart(java.util.List<StringParser.StringOrPath> parts, StringParser.StringOrPath newPart)
-
parseQueryWithBoundPaths
protected StringParser.StringOrPath[] parseQueryWithBoundPaths(java.lang.String query) throws java.lang.Exception
- Throws:
java.lang.Exception
-
parseQueryWithBoundPathsEscapedCharacters
protected StringParser.StringOrPath[] parseQueryWithBoundPathsEscapedCharacters(java.lang.String query)
-
parseQueryWithEscapedBoundPaths
protected StringParser.StringOrPath[] parseQueryWithEscapedBoundPaths(java.lang.String query) throws java.lang.Exception
Chops up a query, returning the string segments and path segments separately- Throws:
java.lang.Exception
-
parseQueryWithBoundPathsNoEscape
protected static StringParser.StringOrPath[] parseQueryWithBoundPathsNoEscape(java.lang.String query) throws java.lang.Exception
- Throws:
java.lang.Exception
-
-