Class JavaParserUtil


  • public class JavaParserUtil
    extends Object
    Created: 4 déc. 2009
    Version:
    $Revision$ Mise a jour: $Date$ par : $Author$
    Author:
    Tony Chemit - dev@tchemit.fr
    • Constructor Detail

      • JavaParserUtil

        public JavaParserUtil()
    • Method Detail

      • getExpressions

        public static void getExpressions​(SimpleNode node,
                                          Map<SimpleNode,​List<SimpleNode>> store,
                                          List<SimpleNode> literals,
                                          Map<SimpleNode,​List<SimpleNode>> casts)
        Obtain all expressions of a node and store them in store with their dependencies expressions. Also fill the literals list of literal expressions.
        Parameters:
        node - the node to scan
        store - the store of expressions detected with all the expression which compose the expression (can be empty)
        literals - the list of literal expressions detected
        casts - the list of casted expression detected
      • removeLiteralExpressions

        public static void removeLiteralExpressions​(Map<SimpleNode,​List<SimpleNode>> store,
                                                    List<SimpleNode> literalExpressions)
        Remove from expressions store, all literal expressions and dependencies on it.
        Parameters:
        store - the store of expressions with theirs dependencies
        literalExpressions - the unvierse of literal expressions
      • removeNoneStandaloneExpressions

        public static void removeNoneStandaloneExpressions​(Map<SimpleNode,​List<SimpleNode>> store,
                                                           Map<SimpleNode,​List<SimpleNode>> castsExpressions)
        Remove from expressions sotre, all expressions with dependencies.
        Parameters:
        store - the store of expressions with their dependencies
        castsExpressions - list of cast expression to keep
      • getMethodInvocationParameters

        public static String getMethodInvocationParameters​(String code)
      • getPropertyNameFromMethod

        public static String getPropertyNameFromMethod​(String code)