Class AbstractJExpr

    • Constructor Summary

      Constructors 
      Modifier Constructor Description
      protected AbstractJExpr​(int prec)  
    • Method Summary

      All Methods Static Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      JExpr _instanceof​(java.lang.Class<?> type)
      Get a type-testing expression using the instanceof operator.
      JExpr _instanceof​(java.lang.String type)
      Get a type-testing expression using the instanceof operator.
      JExpr _instanceof​(JType type)
      Get a type-testing expression using the instanceof operator.
      JCall _new​(java.lang.Class<?> type)
      Get an expression to construct a new inner class instance of this instance expression.
      JCall _new​(java.lang.String type)
      Get an expression to construct a new inner class instance of this instance expression.
      JCall _new​(JType type)
      Get an expression to construct a new inner class instance of this instance expression.
      JAnonymousClassDef _newAnon​(java.lang.Class<?> type)
      Construct a new anonymous subclass of the given type, which must be an inner class of the type of this expression.
      JAnonymousClassDef _newAnon​(java.lang.String type)
      Construct a new anonymous subclass of the given type, which must be an inner class of the type of this expression.
      JAnonymousClassDef _newAnon​(JType type)
      Construct a new anonymous subclass of the given type, which must be an inner class of the type of this expression.
      JAssignableExpr $v​(java.lang.String name)
      Get a field of this object instance (shorthand for JExpr.field(String).
      JExpr and​(JExpr e1)
      Combine this expression with another using the binary && operator.
      JExpr band​(JExpr e1)
      Combine this expression with another using the binary & operator.
      JExpr bor​(JExpr e1)
      Combine this expression with another using the binary | operator.
      JExpr bxor​(JExpr e1)
      Combine this expression with another using the binary ^ operator.
      JCall call​(java.lang.String name)
      Call the given method on this expression.
      JExpr cast​(java.lang.Class<?> type)
      Get an expression which is a cast of this expression to the given type.
      JExpr cast​(java.lang.String type)
      Get an expression which is a cast of this expression to the given type.
      JExpr cast​(JType type)
      Get an expression which is a cast of this expression to the given type.
      JExpr comp()
      Invert this expression using the unary ~ operator.
      JExpr cond​(JExpr ifTrue, JExpr ifFalse)
      Combine this expression with two others using the ternary ? : operator.
      JExpr div​(JExpr e1)
      Combine this expression with another using the binary / operator.
      JExpr eq​(JExpr e1)
      Combine this expression with another using the binary == operator.
      JAssignableExpr field​(java.lang.String name)
      Get a field of this object instance.
      JExpr ge​(JExpr e1)
      Combine this expression with another using the binary >= operator.
      JExpr gt​(JExpr e1)
      Combine this expression with another using the binary > operator.
      JExpr idx​(int idx)
      Get an element of this array expression.
      JAssignableExpr idx​(JExpr idx)
      Get an element of this array expression.
      JExpr le​(JExpr e1)
      Combine this expression with another using the binary <= operator.
      JExpr length()
      Get the length expression of this array expression.
      JExpr lshr​(JExpr e1)
      Combine this expression with another using the binary >>> operator.
      JExpr lt​(JExpr e1)
      Combine this expression with another using the binary < operator.
      JExpr minus​(JExpr e1)
      Combine this expression with another using the binary - operator.
      JExpr mod​(JExpr e1)
      Combine this expression with another using the binary % operator.
      JExpr ne​(JExpr e1)
      Combine this expression with another using the binary != operator.
      JExpr neg()
      Negate this expression using the unary - operator.
      JExpr not()
      Invert this expression using the unary ! operator.
      (package private) static AbstractJExpr of​(JExpr expr)  
      JExpr or​(JExpr e1)
      Combine this expression with another using the binary || operator.
      JExpr paren()
      Explicitly wrap this expression in parentheses.
      JExpr plus​(JExpr e1)
      Combine this expression with another using the binary + operator.
      int prec()  
      JExpr shl​(JExpr e1)
      Combine this expression with another using the binary << operator.
      JExpr shr​(JExpr e1)
      Combine this expression with another using the binary >> operator.
      JExpr times​(JExpr e1)
      Combine this expression with another using the binary * operator.
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
      • Methods inherited from interface org.jboss.jdeparser.Writable

        write
    • Constructor Detail

      • AbstractJExpr

        protected AbstractJExpr​(int prec)
    • Method Detail

      • plus

        public JExpr plus​(JExpr e1)
        Description copied from interface: JExpr
        Combine this expression with another using the binary + operator.
        Specified by:
        plus in interface JExpr
        Parameters:
        e1 - the other expression
        Returns:
        the combined expression
      • minus

        public JExpr minus​(JExpr e1)
        Description copied from interface: JExpr
        Combine this expression with another using the binary - operator.
        Specified by:
        minus in interface JExpr
        Parameters:
        e1 - the other expression
        Returns:
        the combined expression
      • times

        public JExpr times​(JExpr e1)
        Description copied from interface: JExpr
        Combine this expression with another using the binary * operator.
        Specified by:
        times in interface JExpr
        Parameters:
        e1 - the other expression
        Returns:
        the combined expression
      • div

        public JExpr div​(JExpr e1)
        Description copied from interface: JExpr
        Combine this expression with another using the binary / operator.
        Specified by:
        div in interface JExpr
        Parameters:
        e1 - the other expression
        Returns:
        the combined expression
      • mod

        public JExpr mod​(JExpr e1)
        Description copied from interface: JExpr
        Combine this expression with another using the binary % operator.
        Specified by:
        mod in interface JExpr
        Parameters:
        e1 - the other expression
        Returns:
        the combined expression
      • neg

        public JExpr neg()
        Description copied from interface: JExpr
        Negate this expression using the unary - operator.
        Specified by:
        neg in interface JExpr
        Returns:
        the new expression
      • band

        public JExpr band​(JExpr e1)
        Description copied from interface: JExpr
        Combine this expression with another using the binary & operator.
        Specified by:
        band in interface JExpr
        Parameters:
        e1 - the other expression
        Returns:
        the combined expression
      • bor

        public JExpr bor​(JExpr e1)
        Description copied from interface: JExpr
        Combine this expression with another using the binary | operator.
        Specified by:
        bor in interface JExpr
        Parameters:
        e1 - the other expression
        Returns:
        the combined expression
      • bxor

        public JExpr bxor​(JExpr e1)
        Description copied from interface: JExpr
        Combine this expression with another using the binary ^ operator.
        Specified by:
        bxor in interface JExpr
        Parameters:
        e1 - the other expression
        Returns:
        the combined expression
      • shr

        public JExpr shr​(JExpr e1)
        Description copied from interface: JExpr
        Combine this expression with another using the binary >> operator.
        Specified by:
        shr in interface JExpr
        Parameters:
        e1 - the other expression
        Returns:
        the combined expression
      • lshr

        public JExpr lshr​(JExpr e1)
        Description copied from interface: JExpr
        Combine this expression with another using the binary >>> operator.
        Specified by:
        lshr in interface JExpr
        Parameters:
        e1 - the other expression
        Returns:
        the combined expression
      • shl

        public JExpr shl​(JExpr e1)
        Description copied from interface: JExpr
        Combine this expression with another using the binary << operator.
        Specified by:
        shl in interface JExpr
        Parameters:
        e1 - the other expression
        Returns:
        the combined expression
      • comp

        public JExpr comp()
        Description copied from interface: JExpr
        Invert this expression using the unary ~ operator.
        Specified by:
        comp in interface JExpr
        Returns:
        the new expression
      • and

        public JExpr and​(JExpr e1)
        Description copied from interface: JExpr
        Combine this expression with another using the binary && operator.
        Specified by:
        and in interface JExpr
        Parameters:
        e1 - the other expression
        Returns:
        the combined expression
      • or

        public JExpr or​(JExpr e1)
        Description copied from interface: JExpr
        Combine this expression with another using the binary || operator.
        Specified by:
        or in interface JExpr
        Parameters:
        e1 - the other expression
        Returns:
        the combined expression
      • not

        public JExpr not()
        Description copied from interface: JExpr
        Invert this expression using the unary ! operator.
        Specified by:
        not in interface JExpr
        Returns:
        the new expression
      • eq

        public JExpr eq​(JExpr e1)
        Description copied from interface: JExpr
        Combine this expression with another using the binary == operator.
        Specified by:
        eq in interface JExpr
        Parameters:
        e1 - the other expression
        Returns:
        the combined expression
      • ne

        public JExpr ne​(JExpr e1)
        Description copied from interface: JExpr
        Combine this expression with another using the binary != operator.
        Specified by:
        ne in interface JExpr
        Parameters:
        e1 - the other expression
        Returns:
        the combined expression
      • lt

        public JExpr lt​(JExpr e1)
        Description copied from interface: JExpr
        Combine this expression with another using the binary < operator.
        Specified by:
        lt in interface JExpr
        Parameters:
        e1 - the other expression
        Returns:
        the combined expression
      • gt

        public JExpr gt​(JExpr e1)
        Description copied from interface: JExpr
        Combine this expression with another using the binary > operator.
        Specified by:
        gt in interface JExpr
        Parameters:
        e1 - the other expression
        Returns:
        the combined expression
      • le

        public JExpr le​(JExpr e1)
        Description copied from interface: JExpr
        Combine this expression with another using the binary <= operator.
        Specified by:
        le in interface JExpr
        Parameters:
        e1 - the other expression
        Returns:
        the combined expression
      • ge

        public JExpr ge​(JExpr e1)
        Description copied from interface: JExpr
        Combine this expression with another using the binary >= operator.
        Specified by:
        ge in interface JExpr
        Parameters:
        e1 - the other expression
        Returns:
        the combined expression
      • cond

        public JExpr cond​(JExpr ifTrue,
                          JExpr ifFalse)
        Description copied from interface: JExpr
        Combine this expression with two others using the ternary ? : operator.
        Specified by:
        cond in interface JExpr
        Parameters:
        ifTrue - the true expression branch
        ifFalse - the false expression branch
        Returns:
        the combined expression
      • paren

        public JExpr paren()
        Description copied from interface: JExpr
        Explicitly wrap this expression in parentheses.
        Specified by:
        paren in interface JExpr
        Returns:
        the wrapped expression
      • _instanceof

        public JExpr _instanceof​(java.lang.String type)
        Description copied from interface: JExpr
        Get a type-testing expression using the instanceof operator.
        Specified by:
        _instanceof in interface JExpr
        Parameters:
        type - the type to test
        Returns:
        the expression
      • _instanceof

        public JExpr _instanceof​(JType type)
        Description copied from interface: JExpr
        Get a type-testing expression using the instanceof operator.
        Specified by:
        _instanceof in interface JExpr
        Parameters:
        type - the type to test
        Returns:
        the expression
      • _instanceof

        public JExpr _instanceof​(java.lang.Class<?> type)
        Description copied from interface: JExpr
        Get a type-testing expression using the instanceof operator.
        Specified by:
        _instanceof in interface JExpr
        Parameters:
        type - the type to test
        Returns:
        the expression
      • cast

        public JExpr cast​(java.lang.String type)
        Description copied from interface: JExpr
        Get an expression which is a cast of this expression to the given type.
        Specified by:
        cast in interface JExpr
        Parameters:
        type - the type to cast to
        Returns:
        the expression
      • cast

        public JExpr cast​(JType type)
        Description copied from interface: JExpr
        Get an expression which is a cast of this expression to the given type.
        Specified by:
        cast in interface JExpr
        Parameters:
        type - the type to cast to
        Returns:
        the expression
      • cast

        public JExpr cast​(java.lang.Class<?> type)
        Description copied from interface: JExpr
        Get an expression which is a cast of this expression to the given type.
        Specified by:
        cast in interface JExpr
        Parameters:
        type - the type to cast to
        Returns:
        the expression
      • call

        public JCall call​(java.lang.String name)
        Description copied from interface: JExpr
        Call the given method on this expression.
        Specified by:
        call in interface JExpr
        Parameters:
        name - the method name
        Returns:
        the method call
      • _new

        public JCall _new​(java.lang.String type)
        Description copied from interface: JExpr
        Get an expression to construct a new inner class instance of this instance expression.
        Specified by:
        _new in interface JExpr
        Parameters:
        type - the inner class type to construct
        Returns:
        the new constructor call
      • _new

        public JCall _new​(JType type)
        Description copied from interface: JExpr
        Get an expression to construct a new inner class instance of this instance expression.
        Specified by:
        _new in interface JExpr
        Parameters:
        type - the inner class type to construct
        Returns:
        the new constructor call
      • _new

        public JCall _new​(java.lang.Class<?> type)
        Description copied from interface: JExpr
        Get an expression to construct a new inner class instance of this instance expression.
        Specified by:
        _new in interface JExpr
        Parameters:
        type - the inner class type to construct
        Returns:
        the new constructor call
      • _newAnon

        public JAnonymousClassDef _newAnon​(java.lang.String type)
        Description copied from interface: JExpr
        Construct a new anonymous subclass of the given type, which must be an inner class of the type of this expression.
        Specified by:
        _newAnon in interface JExpr
        Parameters:
        type - the type of object to construct
        Returns:
        the anonymous subclass definition
      • _newAnon

        public JAnonymousClassDef _newAnon​(JType type)
        Description copied from interface: JExpr
        Construct a new anonymous subclass of the given type, which must be an inner class of the type of this expression.
        Specified by:
        _newAnon in interface JExpr
        Parameters:
        type - the type of object to construct
        Returns:
        the anonymous subclass definition
      • _newAnon

        public JAnonymousClassDef _newAnon​(java.lang.Class<?> type)
        Description copied from interface: JExpr
        Construct a new anonymous subclass of the given type, which must be an inner class of the type of this expression.
        Specified by:
        _newAnon in interface JExpr
        Parameters:
        type - the type of object to construct
        Returns:
        the anonymous subclass definition
      • field

        public JAssignableExpr field​(java.lang.String name)
        Description copied from interface: JExpr
        Get a field of this object instance.
        Specified by:
        field in interface JExpr
        Parameters:
        name - the field name
        Returns:
        the expression
      • $v

        public JAssignableExpr $v​(java.lang.String name)
        Description copied from interface: JExpr
        Get a field of this object instance (shorthand for JExpr.field(String).
        Specified by:
        $v in interface JExpr
        Parameters:
        name - the field name
        Returns:
        the expression
      • idx

        public JAssignableExpr idx​(JExpr idx)
        Description copied from interface: JExpr
        Get an element of this array expression.
        Specified by:
        idx in interface JExpr
        Parameters:
        idx - the array index expression
        Returns:
        the array dereference expression
      • idx

        public JExpr idx​(int idx)
        Description copied from interface: JExpr
        Get an element of this array expression.
        Specified by:
        idx in interface JExpr
        Parameters:
        idx - the array index
        Returns:
        the array dereference expression
      • length

        public JExpr length()
        Description copied from interface: JExpr
        Get the length expression of this array expression.
        Specified by:
        length in interface JExpr
        Returns:
        the length expression
      • prec

        public int prec()