List of usage examples for org.eclipse.jdt.core.dom EnumConstantDeclaration getProperty
public final Object getProperty(String propertyName)
null
if none. From source file:com.ibm.wala.cast.java.translator.jdt.JDTJava2CAstTranslator.java
License:Open Source License
/** * Called only from visitFieldInitNode(node,context) *//*from w ww .ja v a2 s.c om*/ private CAstNode createEnumConstantDeclarationInit(EnumConstantDeclaration node, WalkContext context) { String hiddenVariableName = (String) node .getProperty("com.ibm.wala.cast.java.translator.jdt.fakeValuesDeclName"); if (hiddenVariableName == null) { FieldReference fieldRef = fIdentityMapper.getFieldRef(node.resolveVariable()); // We use null to indicate an OBJECT_REF to a static field CAstNode lhsNode = makeNode(context, fFactory, node, CAstNode.OBJECT_REF, makeNode(context, fFactory, null, CAstNode.VOID), fFactory.makeConstant(fieldRef)); // CONSTRUCT ARGUMENTS & "new MyEnum(...)" statement ArrayList<Object> arguments = new ArrayList<Object>(); arguments.add(fFactory.makeConstant(node.getName().getIdentifier())); // name of constant arguments.add(fFactory.makeConstant(node.resolveVariable().getVariableId())); // id arguments.addAll(node.arguments()); CAstNode rhsNode = createClassInstanceCreation(node, arguments, node.resolveConstructorBinding(), null, node.getAnonymousClassDeclaration(), context); CAstNode assNode = makeNode(context, fFactory, node, CAstNode.ASSIGN, lhsNode, rhsNode); return assNode; // their naming, not mine } else { // String[] x = (new Direction[] { // NORTH, EAST, SOUTH, WEST, $VALUES, $VALUES$ // }); return null; } }