Java Code Examples for com.github.javaparser.ast.expr.SimpleName#getIdentifier()
The following examples show how to use
com.github.javaparser.ast.expr.SimpleName#getIdentifier() .
You can vote up the ones you like or vote down the ones you don't like,
and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example 1
Source File: LocationSearcher.java From meghanada-server with GNU General Public License v3.0 | 6 votes |
@SuppressWarnings("try") private static Location getFieldLocation( SearchContext context, File targetFile, FieldDeclaration declaration) throws IOException { try (TelemetryUtils.ScopedSpan scope = TelemetryUtils.startScopedSpan("LocationSearcher.getFieldLocation")) { TelemetryUtils.ScopedSpan.addAnnotation( TelemetryUtils.annotationBuilder().put("targetFile", targetFile.getPath()).build("args")); final List<VariableDeclarator> variables = declaration.getVariables(); for (final VariableDeclarator variable : variables) { final SimpleName simpleName = variable.getName(); final String name = simpleName.getIdentifier(); final Optional<Position> begin = simpleName.getBegin(); if (name.equals(context.name) && begin.isPresent()) { final Position position = begin.get(); return new Location(targetFile.getCanonicalPath(), position.line, position.column); } } return null; } }
Example 2
Source File: AbstractResourceGenerator.java From kogito-runtimes with Apache License 2.0 | 5 votes |
private void interpolateUserTaskTypes(SimpleName returnType, String inputClazzName, String outputClazzName) { String identifier = returnType.getIdentifier(); returnType.setIdentifier(identifier.replace("$TaskInput$", inputClazzName)); identifier = returnType.getIdentifier(); returnType.setIdentifier(identifier.replace("$TaskOutput$", outputClazzName)); }