jaxx.compiler.binding
Class JavaParserUtil

java.lang.Object
  extended by jaxx.compiler.binding.JavaParserUtil

public class JavaParserUtil
extends Object

Created: 4 déc. 2009

Version:
$Revision: 2118 $

Mise a jour: $Date: 2010-10-26 19:44:57 +0200 (Tue, 26 Oct 2010) $ par : $Author: tchemit $

Author:
tchemit

Constructor Summary
JavaParserUtil()
           
 
Method Summary
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.
static String getMethodInvocationParameters(String code)
           
static String getPropertyNameFromMethod(String code)
           
static Set<String> getRequired(Set<SimpleNode> store, Map<SimpleNode,List<SimpleNode>> casts)
           
static void removeLiteralExpressions(Map<SimpleNode,List<SimpleNode>> store, List<SimpleNode> literalExpressions)
          Remove from expressions store, all literal expressions and dependencies on it.
static void removeNoneStandaloneExpressions(Map<SimpleNode,List<SimpleNode>> store, Map<SimpleNode,List<SimpleNode>> castsExpressions)
          Remove from expressions sotre, all expressions with dependencies.
static void scanForExpressions(SimpleNode node, SimpleNode lastExpressionNode, Map<SimpleNode,List<SimpleNode>> store, List<SimpleNode> literals, Map<SimpleNode,List<SimpleNode>> casts)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

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

getRequired

public static Set<String> getRequired(Set<SimpleNode> store,
                                      Map<SimpleNode,List<SimpleNode>> casts)

getMethodInvocationParameters

public static String getMethodInvocationParameters(String code)

getPropertyNameFromMethod

public static String getPropertyNameFromMethod(String code)

scanForExpressions

public static void scanForExpressions(SimpleNode node,
                                      SimpleNode lastExpressionNode,
                                      Map<SimpleNode,List<SimpleNode>> store,
                                      List<SimpleNode> literals,
                                      Map<SimpleNode,List<SimpleNode>> casts)


Copyright © 2008-2010 CodeLutin. All Rights Reserved.