@JsonCreator public static MethodReference parse(String string) { MethodReference reference = parseIfPossible(string); if (reference == null) { throw new IllegalArgumentException("Illegal method reference: " + string); } return reference; }
private MethodReference getJavaMethodSelector(AstNode node) { if (!(node instanceof FunctionCall)) { return null; } FunctionCall call = (FunctionCall) node; if (!isJavaMethodRepository(call.getTarget())) { return null; } if (call.getArguments().size() != 1) { diagnostics.error(location, "javaMethods.get method should take exactly one argument"); return null; } StringBuilder nameBuilder = new StringBuilder(); if (!extractMethodName(call.getArguments().get(0), nameBuilder)) { diagnostics.error(location, "javaMethods.get method should take string constant"); return null; } MethodReference method = MethodReference.parseIfPossible(nameBuilder.toString()); if (method == null) { diagnostics.error(location, "Wrong method reference: " + nameBuilder); } return method; }
MethodReference method = MethodReference.parseIfPossible((String) lexer.getTokenValue()); if (method == null) { throw new ListingParseException("Unparseable method", lexer.getIndex());
private boolean tryJavaInvocation(FunctionCall node) throws IOException { if (!(node.getTarget() instanceof PropertyGet)) { return false; } PropertyGet propertyGet = (PropertyGet) node.getTarget(); String callMethod = getJavaMethod(propertyGet.getTarget()); if (callMethod == null || !propertyGet.getProperty().getIdentifier().equals("invoke")) { return false; } MethodReference method = MethodReference.parseIfPossible(callMethod); if (method == null) { return false; } writer.appendMethodBody(method).append('('); printList(node.getArguments()); writer.append(')'); return true; }
@JsonCreator public static MethodReference parse(String string) { MethodReference reference = parseIfPossible(string); if (reference == null) { throw new IllegalArgumentException("Illegal method reference: " + string); } return reference; }
private MethodReference getJavaMethodSelector(AstNode node) { if (!(node instanceof FunctionCall)) { return null; } FunctionCall call = (FunctionCall) node; if (!isJavaMethodRepository(call.getTarget())) { return null; } if (call.getArguments().size() != 1) { diagnostics.error(location, "javaMethods.get method should take exactly one argument"); return null; } StringBuilder nameBuilder = new StringBuilder(); if (!extractMethodName(call.getArguments().get(0), nameBuilder)) { diagnostics.error(location, "javaMethods.get method should take string constant"); return null; } MethodReference method = MethodReference.parseIfPossible(nameBuilder.toString()); if (method == null) { diagnostics.error(location, "Wrong method reference: " + nameBuilder); } return method; }
MethodReference method = MethodReference.parseIfPossible((String) lexer.getTokenValue()); if (method == null) { throw new ListingParseException("Unparseable method", lexer.getIndex());
private boolean tryJavaInvocation(FunctionCall node) throws IOException { if (!(node.getTarget() instanceof PropertyGet)) { return false; } PropertyGet propertyGet = (PropertyGet) node.getTarget(); String callMethod = getJavaMethod(propertyGet.getTarget()); if (callMethod == null || !propertyGet.getProperty().getIdentifier().equals("invoke")) { return false; } MethodReference method = MethodReference.parseIfPossible(callMethod); if (method == null) { return false; } writer.appendMethodBody(method).append('('); printList(node.getArguments()); writer.append(')'); return true; }