/** * Creates and returns a new unparented simple name node for the given * identifier. The identifier should be a legal Java identifier, but not * a keyword, boolean literal ("true", "false") or null literal ("null"). * * @param identifier the identifier * @return a new unparented simple name node * @exception IllegalArgumentException if the identifier is invalid */ public SimpleName newSimpleName(String identifier) { if (identifier == null) { throw new IllegalArgumentException(); } SimpleName result = new SimpleName(this); result.setIdentifier(identifier); return result; }
/** * Creates and returns a new unparented simple name node for the given * identifier. The identifier should be a legal Java identifier, but not * a keyword, boolean literal ("true", "false") or null literal ("null"). * * @param identifier the identifier * @return a new unparented simple name node * @exception IllegalArgumentException if the identifier is invalid */ public SimpleName newSimpleName(String identifier) { if (identifier == null) { throw new IllegalArgumentException(); } SimpleName result = new SimpleName(this); result.setIdentifier(identifier); return result; }
/** * Creates and returns a new unparented simple name node for the given * identifier. The identifier should be a legal Java identifier, but not * a keyword, boolean literal ("true", "false") or null literal ("null"). * * @param identifier the identifier * @return a new unparented simple name node * @exception IllegalArgumentException if the identifier is invalid */ public SimpleName newSimpleName(String identifier) { if (identifier == null) { throw new IllegalArgumentException(); } SimpleName result = new SimpleName(this); result.setIdentifier(identifier); return result; }
/** * Creates and returns a new unparented simple name node for the given * identifier. The identifier should be a legal Java identifier, but not * a keyword, boolean literal ("true", "false") or null literal ("null"). * * @param identifier the identifier * @return a new unparented simple name node * @exception IllegalArgumentException if the identifier is invalid */ public SimpleName newSimpleName(String identifier) { if (identifier == null) { throw new IllegalArgumentException(); } SimpleName result = new SimpleName(this); result.setIdentifier(identifier); return result; }
final Object internalGetSetObjectProperty(SimplePropertyDescriptor property, boolean get, Object value) { if (property == IDENTIFIER_PROPERTY) { if (get) { return getIdentifier(); } else { setIdentifier((String) value); return null; } } // allow default implementation to flag the error return super.internalGetSetObjectProperty(property, get, value); }
final Object internalGetSetObjectProperty(SimplePropertyDescriptor property, boolean get, Object value) { if (property == IDENTIFIER_PROPERTY) { if (get) { return getIdentifier(); } else { setIdentifier((String) value); return null; } } // allow default implementation to flag the error return super.internalGetSetObjectProperty(property, get, value); }
List types = cu.types(); TypeDeclaration typeDec = (TypeDeclaration) types.get(0); //typeDec is the class System.out.println("className:" + typeDec.getName()); SimpleName sn = typeDec.getName(); sn.setIdentifier("aqaa"); typeDec.setName(sn);
final Object internalGetSetObjectProperty(SimplePropertyDescriptor property, boolean get, Object value) { if (property == IDENTIFIER_PROPERTY) { if (get) { return getIdentifier(); } else { setIdentifier((String) value); return null; } } // allow default implementation to flag the error return super.internalGetSetObjectProperty(property, get, value); }
final Object internalGetSetObjectProperty(SimplePropertyDescriptor property, boolean get, Object value) { if (property == IDENTIFIER_PROPERTY) { if (get) { return getIdentifier(); } else { setIdentifier((String) value); return null; } } // allow default implementation to flag the error return super.internalGetSetObjectProperty(property, get, value); }
@Override public boolean visit(SimpleName node) { if (strMatcher.matches( node.getIdentifier())) { node.setIdentifier(neo); } return true; } }
@Override final Object internalGetSetObjectProperty(SimplePropertyDescriptor property, boolean get, Object value) { if (property == IDENTIFIER_PROPERTY) { if (get) { return getIdentifier(); } else { setIdentifier((String) value); return null; } } // allow default implementation to flag the error return super.internalGetSetObjectProperty(property, get, value); }
final Object internalGetSetObjectProperty(SimplePropertyDescriptor property, boolean get, Object value) { if (property == IDENTIFIER_PROPERTY) { if (get) { return getIdentifier(); } else { setIdentifier((String) value); return null; } } // allow default implementation to flag the error return super.internalGetSetObjectProperty(property, get, value); }
@Override public boolean visit(SimpleName node) { if (Strings.areEqual(oldName, node.getIdentifier())) { node.setIdentifier(name); } return super.visit(node); }
@Override public boolean visit(SimpleName node) { if (Strings.areEqual(oldName, node.getIdentifier())) { node.setIdentifier(name); } return super.visit(node); }
@Override ASTNode clone0(AST target) { SimpleName result = new SimpleName(target); result.setSourceRange(getStartPosition(), getLength()); result.setIdentifier(getIdentifier()); if (this.ast.apiLevel >= AST.JLS10_INTERNAL && Long.compare(this.ast.scanner.complianceLevel, 10) >= 0) { result.setVar(isVar()); } return result; }
ASTNode clone0(AST target) { SimpleName result = new SimpleName(target); result.setSourceRange(getStartPosition(), getLength()); result.setIdentifier(getIdentifier()); return result; }
ASTNode clone0(AST target) { SimpleName result = new SimpleName(target); result.setSourceRange(getStartPosition(), getLength()); result.setIdentifier(getIdentifier()); return result; }
ASTNode clone0(AST target) { SimpleName result = new SimpleName(target); result.setSourceRange(getStartPosition(), getLength()); result.setIdentifier(getIdentifier()); return result; }
ASTNode clone0(AST target) { SimpleName result = new SimpleName(target); result.setSourceRange(getStartPosition(), getLength()); result.setIdentifier(getIdentifier()); return result; }
ASTNode clone0(AST target) { SimpleName result = new SimpleName(target); result.setSourceRange(getStartPosition(), getLength()); result.setIdentifier(getIdentifier()); return result; }