Package org.nuiton.jaxx.compiler.binding
Class JavaParserUtil
- java.lang.Object
-
- org.nuiton.jaxx.compiler.binding.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 Summary
Constructors Constructor Description JavaParserUtil()
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static voidgetExpressions(SimpleNode node, Map<SimpleNode,List<SimpleNode>> store, List<SimpleNode> literals, Map<SimpleNode,List<SimpleNode>> casts)Obtain all expressions of a node and store them instorewith their dependencies expressions.static StringgetMethodInvocationParameters(String code)static StringgetPropertyNameFromMethod(String code)static Set<String>getRequired(Set<SimpleNode> store, Map<SimpleNode,List<SimpleNode>> casts)static voidremoveLiteralExpressions(Map<SimpleNode,List<SimpleNode>> store, List<SimpleNode> literalExpressions)Remove from expressions store, all literal expressions and dependencies on it.static voidremoveNoneStandaloneExpressions(Map<SimpleNode,List<SimpleNode>> store, Map<SimpleNode,List<SimpleNode>> castsExpressions)Remove from expressions sotre, all expressions with dependencies.static voidscanForExpressions(SimpleNode node, SimpleNode lastExpressionNode, Map<SimpleNode,List<SimpleNode>> store, List<SimpleNode> literals, Map<SimpleNode,List<SimpleNode>> casts)
-
-
-
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 instorewith their dependencies expressions. Also fill theliteralslist of literal expressions.- Parameters:
node- the node to scanstore- the store of expressions detected with all the expression which compose the expression (can be empty)literals- the list of literal expressions detectedcasts- 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 dependenciesliteralExpressions- 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 dependenciescastsExpressions- list of cast expression to keep
-
getRequired
public static Set<String> getRequired(Set<SimpleNode> store, Map<SimpleNode,List<SimpleNode>> casts)
-
scanForExpressions
public static void scanForExpressions(SimpleNode node, SimpleNode lastExpressionNode, Map<SimpleNode,List<SimpleNode>> store, List<SimpleNode> literals, Map<SimpleNode,List<SimpleNode>> casts)
-
-