|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object com.endeca.portal.lql.LQLUtils
public class LQLUtils
A collection of utilities for use when working with LQL ASTs, expressions, fragments, statements, etc.
Constructor Summary | |
---|---|
LQLUtils()
|
Method Summary | |
---|---|
static void |
addAliases(java.util.Set<java.lang.String> aliases,
com.endeca.mdex.lql_parser.types.SourceBase source)
|
static java.lang.String |
expressionToFilterString(com.endeca.mdex.lql_parser.types.ExpressionBase expr)
Converts the supplied ExpressionBase into a String suitable for serialization, such as persistence into a portlet's preferences. |
static com.endeca.mdex.lql_parser.types.ExpressionBase |
filterStringToExpression(java.lang.String str)
Converts a previously serialized JAXB XML representation of an LQL expression back into a Java ExpressionBase object suitable for use in runtime queries. |
static java.util.Set<java.lang.String> |
getStatementAliases(com.endeca.mdex.lql_parser.types.Statement statement)
|
static java.util.Set<java.lang.String> |
getStatementKeys(com.endeca.mdex.lql_parser.types.Query query)
|
static com.endeca.mdex.lql_parser.types.ExpressionBase |
parseExpression(DataSource ds,
java.lang.String expression)
Parses an expression using the LQL Parsing service This involves a round trip and should be used only if absolutely necessary. |
static void |
prefixDefineKeys(com.endeca.mdex.lql_parser.types.Query query,
java.lang.String prefix)
Prefixes all statement keys. |
static void |
prefixExpression(com.endeca.mdex.lql_parser.types.ExpressionBase expression,
java.lang.String prefix,
java.util.Set<java.lang.String> statementKeys,
java.util.Set<java.lang.String> aliases)
Prefixes statement keys depending on the type of expression. |
static void |
prefixSource(com.endeca.mdex.lql_parser.types.SourceBase source,
java.lang.String prefix,
java.util.Set<java.lang.String> statementKeys,
java.util.Set<java.lang.String> aliases)
Prefixes statement keys depending on the type of source. |
static java.lang.String |
queryToString(com.endeca.mdex.lql_parser.types.Query query)
Converts the supplied Query into a String suitable for serialization, such as persistence into a portlet's preferences. |
static com.endeca.mdex.lql_parser.types.Query |
stringToQuery(java.lang.String str)
Converts a previously serialized JAXB XML representation of an LQL Query back into a Java Query object suitable for use at runtime. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public LQLUtils()
Method Detail |
---|
public static com.endeca.mdex.lql_parser.types.ExpressionBase parseExpression(DataSource ds, java.lang.String expression) throws DataSourceException, LQLException
ds
- a DataSourceexpression
- an expression to be parsed
DataSourceException
LQLException
public static java.lang.String expressionToFilterString(com.endeca.mdex.lql_parser.types.ExpressionBase expr) throws LQLException
filterStringToExpression(String)
expr
- the ExpressionBase to serialize
LQLException
- if the ExpressionBase could not be serialized to a stringpublic static com.endeca.mdex.lql_parser.types.ExpressionBase filterStringToExpression(java.lang.String str) throws LQLException
expressionToFilterString(ExpressionBase)
.
Any other format is not expected to work.
str
- a JAXB representation of a wrapped ExpressionBase
LQLException
- if the string could not be used to generate an ExpressionBasepublic static java.lang.String queryToString(com.endeca.mdex.lql_parser.types.Query query) throws LQLException
stringToQuery(String)
query
- the Query to serialize
LQLException
- if the Query could not be serialized to a stringpublic static com.endeca.mdex.lql_parser.types.Query stringToQuery(java.lang.String str) throws LQLException
queryToString(Query)
.
Any other format is not expected to work.
str
- a JAXB representation of a Query
LQLException
- if the string could not be used to generate a Querypublic static void prefixDefineKeys(com.endeca.mdex.lql_parser.types.Query query, java.lang.String prefix)
query
- prefix
- public static void prefixExpression(com.endeca.mdex.lql_parser.types.ExpressionBase expression, java.lang.String prefix, java.util.Set<java.lang.String> statementKeys, java.util.Set<java.lang.String> aliases)
expression
- prefix
- statementKeys
- public static void prefixSource(com.endeca.mdex.lql_parser.types.SourceBase source, java.lang.String prefix, java.util.Set<java.lang.String> statementKeys, java.util.Set<java.lang.String> aliases)
source
- prefix
- statementKeys
- public static void addAliases(java.util.Set<java.lang.String> aliases, com.endeca.mdex.lql_parser.types.SourceBase source)
public static java.util.Set<java.lang.String> getStatementKeys(com.endeca.mdex.lql_parser.types.Query query)
public static java.util.Set<java.lang.String> getStatementAliases(com.endeca.mdex.lql_parser.types.Statement statement)
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |