Class ASTIn
java.lang.Object
org.apache.cayenne.exp.Expression
org.apache.cayenne.exp.parser.SimpleNode
org.apache.cayenne.exp.parser.ConditionNode
org.apache.cayenne.exp.parser.ASTIn
- All Implemented Interfaces:
Serializable, Node, XMLSerializable
-
Field Summary
Fields inherited from class SimpleNode
children, id, parentFields inherited from class Expression
ADD, ALL, AND, ANY, ASTERISK, BETWEEN, BITWISE_AND, BITWISE_LEFT_SHIFT, BITWISE_NOT, BITWISE_OR, BITWISE_RIGHT_SHIFT, BITWISE_XOR, CASE_WHEN, CUSTOM_OP, DB_PATH, DBID_PATH, DIVIDE, ELSE, ENCLOSING_OBJECT, EQUAL_TO, EXISTS, FALSE, FULL_OBJECT, FUNCTION_CALL, GREATER_THAN, GREATER_THAN_EQUAL_TO, IN, LESS_THAN, LESS_THAN_EQUAL_TO, LIKE, LIKE_IGNORE_CASE, LIST, MULTIPLY, NEGATIVE, NOT, NOT_BETWEEN, NOT_EQUAL_TO, NOT_EXISTS, NOT_IN, NOT_LIKE, NOT_LIKE_IGNORE_CASE, OBJ_PATH, OR, PRUNED_NODE, SCALAR, SUBQUERY, SUBTRACT, THEN, TRUE, type, WHENModifier and TypeFieldDescriptionstatic final intstatic final intstatic final intstatic final intstatic final intstatic final intstatic final intstatic final intstatic final intstatic final intstatic final intstatic final intstatic final intstatic final intstatic final intExpression describes a path relative to a DbEntity.static final intstatic final intstatic final intstatic final intstatic final intstatic final intstatic final intstatic final intstatic final intstatic final intstatic final intstatic final intstatic final intstatic final intstatic final intstatic final intstatic final intInterpreted as a comma-separated list of literals.static final intstatic final intstatic final intstatic final intstatic final intstatic final intstatic final intstatic final intstatic final intstatic final intExpression describes a path relative to an ObjEntity.static final intstatic final ObjectA value that a Transformer might return to indicate that a node has to be pruned from the expression during the transformation.static final intstatic final intstatic final intstatic final intstatic final intprotected intstatic final int -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprotected BooleanevaluateSubNode(Object o, Object[] evaluatedChildren) protected StringgetExpressionOperator(int index) protected intintgetType()Returns a type of expression.Creates a copy of this expression node, without copying children.protected ObjecttransformExpression(Function<Object, Object> transformer) A recursive method called from "transform" to do the actual transformation.Methods inherited from class ConditionNode
evaluateNode, exists, isValidParent, notExistsModifier and TypeMethodDescriptionprotected ObjectEvaluates itself with object, pushing result on the stack.exists()Returns expression that will be dynamically resolved to proper subqueries based on a relationships used (if no relationships are present in the original expression no subqueries will be used).protected booleanAdditional parent check that we can't handle properly in the grammar By default it just returns true.Returns expression that will be dynamically resolved to proper subqueries based on a relationships used (if no relationships are present in the original expression no subqueries will be used).Methods inherited from class SimpleNode
appendAsEJBQL, appendAsEJBQL, appendAsEscapedString, appendAsString, appendChildrenAsEJBQL, appendScalarAsString, connectChildren, encodeScalarAsEJBQL, evaluate, evaluateChild, expName, flattenTree, getEJBQLExpressionOperator, getOperand, getOperandCount, getPathAliases, jjtAddChild, jjtClose, jjtGetChild, jjtGetNumChildren, jjtGetParent, jjtOpen, jjtSetParent, notExp, numericToString, pruneNodeForPrunedChild, setOperand, unwrapChild, wrapChildModifier and TypeMethodDescriptionvoidappendAsEJBQL(Appendable out, String rootId) Stores a String representation of Expression as EJBQL using a provided Appendable.voidappendAsEJBQL(List<Object> parameterAccumulator, Appendable out, String rootId) Stores a String representation of Expression as EJBQL using a provided PrintWriter.protected static voidappendAsEscapedString(Appendable out, String source) Utility method that prints a string to the provided Appendable, escaping special characters.voidappendAsString(Appendable out) Appends own content as a String to the provided Appendable.protected voidappendChildrenAsEJBQL(List<Object> parameterAccumulator, Appendable out, String rootId) Encodes child of this node with specified index to EJBQLprotected static voidappendScalarAsString(Appendable out, Object scalar, char quoteChar) Utility method that encodes an object that is not an expression Node to String.protected voidSets the parent to this for all children.protected static voidencodeScalarAsEJBQL(List<Object> parameterAccumulator, Appendable out, Object scalar) This is a utility method that can represent the supplied scalar as either an EJBQL literal into the suppliedPrintWriteror is able to add the scalar to the parameters and to instead write a positional parameter to the EJBQL written to thePrintWriter.Calculates expression value with object as a context for path expressions.protected ObjectevaluateChild(int index, Object o) expName()Implemented for backwards compatibility with exp package.protected voidFlattens the tree under this node by eliminating any children that are of the same class as this node and copying their children to this node.protected StringgetEJBQLExpressionOperator(int index) Returns operator for EJBQL statements, which can differ for Cayenne expression operatorgetOperand(int index) Returns a value of operand atindex.intReturns a count of operands of this expression.Always returns empty map.voidjjtAddChild(Node n, int i) This method tells the node to add its argument to the node's list of children.voidjjtClose()Called after all the child nodes have been added.jjtGetChild(int i) This method returns a child node.final intReturn the number of children the node has.voidjjtOpen()Called after the node has been made the current node.voidjjtSetParent(Node n) This pair of methods are used to inform the node of its parent.notExp()Returns a logical NOT of current expression.protected static StringnumericToString(Number number) protected booleanpruneNodeForPrunedChild(Object prunedChild) Returns true if this node should be pruned from expression tree in the event a child is removed.voidsetOperand(int index, Object value) Sets a value of operand atindex.protected ObjectunwrapChild(Node child) protected NodeMethods inherited from class Expression
andExp, andExp, deepCopy, encodeAsXML, equals, filter, filterObjects, first, hashCode, joinExp, joinExp, match, orExp, orExp, params, params, paramsArray, setType, toEJBQL, toEJBQL, toString, transform, traverse, traverseModifier and TypeMethodDescriptionandExp(Expression exp) Chains this expression with another expression using "and".andExp(Expression exp, Expression... expressions) Chains this expression with other expressions using "and".deepCopy()Clones this expression.voidencodeAsXML(XMLEncoder encoder, ConfigurationNodeVisitor delegate) Encodes itself, wrapping the string into XML CDATA section.boolean<T> Collection<?> filter(Collection<T> source, Collection<T> target) Adds objects matching this expression from the source collection to the target collection.<T> List<T> filterObjects(Collection<T> objects) Returns a list of objects that match the expression.<T> TReturns the first object in the list that matches the expression.inthashCode()joinExp(int type, Expression exp) Creates a new expression that joins this object with another expression, using specified join type.joinExp(int type, Expression exp, Expression... expressions) Creates a new expression that joins this object with other expressions, using specified join type.booleanCalculates expression boolean value with object as a context for path expressions.orExp(Expression exp) Chains this expression with another expression using "or".orExp(Expression exp, Expression... expressions) Chains this expression with other expressions using "or".Creates and returns a new Expression instance based on this expression, but with named parameters substituted with provided values.Creates and returns a new Expression instance based on this expression, but with named parameters substituted with provided values.If any subexpressions containing parameters not matching the "name" argument are found, the behavior depends on "pruneMissing" argument.paramsArray(Object... parameters) Creates and returns a new Expression instance based on this expression, but with parameters substituted with provided values.voidsetType(int type) Produces an EJBQL string that represents this expression.Produces an EJBQL string that represents this expression.toString()Creates a transformed copy of this expression, applying transformation provided by Transformer to all its nodes.protected voidtraverse(Expression parentExp, TraversalHandler visitor) Traverses itself and child expressions, notifying visitor via callback methods as it goes.voidtraverse(TraversalHandler visitor) Traverses itself and child expressions, notifying visitor via callback methods as it goes.
-
Constructor Details
-
ASTIn
public ASTIn() -
ASTIn
-
-
Method Details
-
getRequiredChildrenCount
protected int getRequiredChildrenCount()- Specified by:
getRequiredChildrenCountin classConditionNode
-
evaluateSubNode
- Specified by:
evaluateSubNodein classConditionNode- Throws:
Exception
-
shallowCopy
Creates a copy of this expression node, without copying children.- Specified by:
shallowCopyin classExpression
-
getExpressionOperator
- Specified by:
getExpressionOperatorin classSimpleNode
-
getType
public int getType()Description copied from class:ExpressionReturns a type of expression. Most common types are defined as public static fields of this interface.- Overrides:
getTypein classExpression
-
transformExpression
Description copied from class:ExpressionA recursive method called from "transform" to do the actual transformation.- Overrides:
transformExpressionin classExpression- Returns:
- null, Expression.PRUNED_NODE or transformed expression.
-