Class FieldExpression

    • Field Detail

      • EMPTY_ARRAY

        protected static final FieldExpression[] EMPTY_ARRAY
        Empty array of field expressions.
    • Constructor Detail

      • FieldExpression

        protected FieldExpression()
    • Method Detail

      • isConstant

        public abstract boolean isConstant()
        Returns true if this field expression evaluates to a constant value.
      • getDefaultName

        public final java.lang.String getDefaultName()
        Get the default name to use for this FieldExpression.
      • getFieldName

        public java.lang.String getFieldName()
        Get the field name for this expression.

        This is used as a hint to the search engine to tie back to the schema. null may be returned if this expression contains no field. If this expression is composed of many fields, this can be either the "primary" field for the expression, or null.

      • hasChildren

        public abstract boolean hasChildren()
        Returns true if this field expression has any sub FieldExpressions.
      • rewriteChildren

        @Deprecated
        public final FieldExpression rewriteChildren​(FieldExpressionHandler handler)
        Deprecated.
        Traverse this FieldExpression using handler to visit/rewrite direct child elements if this expression.

        NOTE: this method traverses direct child expressions (if any) only.

      • rewrite

        public void rewrite​(QueryHandler handler,
                            boolean recursive)
        Rewrite any query objects in this FieldExpression using handler.
      • hashCode

        public int hashCode()
        Overrides:
        hashCode in class java.lang.Object
      • toString

        public final java.lang.String toString()
        Return String representation of expression.
        Overrides:
        toString in class java.lang.Object
      • toString

        public final void toString​(java.lang.StringBuilder buffer)
        Writes the string representation of this field expression to buffer.
      • toString

        protected abstract void toString​(java.lang.StringBuilder buffer,
                                         FieldExpression.StringMode mode)
        Writes the string representation of this field expression to buffer.
      • quote

        protected static void quote​(java.lang.StringBuilder buffer,
                                    java.lang.String text)
        Add text to buffer as quoted string.

        NOTE: value will only be quoted if it contains non-alphanumeric characters.

      • clone

        public FieldExpression clone()
        Overrides:
        clone in class java.lang.Object
      • isConstant

        protected static boolean isConstant​(FieldExpression value)
      • valueOf

        public static FieldExpression valueOf​(java.lang.String value)