0
VariableDeclarationFragment node;
SimpleName name = node.getName();
如果node.getName()
是String
類型的使用ASTParser可變的,則輸出應該String
。 如果node.getName()
是Integer
類型,則輸出應爲Integer
。數據類型在Java
有沒有辦法使用ASTParser
或以其他方式做到這一點?
可能的[Java JDT parser。獲取變量類型的VariableDeclarationFragment](http://stackoverflow.com/questions/18454697/java-jdt-parser-get-variable-type-of-variabledeclarationfragment) –