List of usage examples for org.eclipse.jdt.internal.compiler.lookup Binding readableName
public abstract char[] readableName();
From source file:com.google.gwt.dev.jjs.impl.TypeMap.java
License:Apache License
/** * Returns a list of JNodes that have the same name as the JDT Binding. This * method is only used during debugging sessions from the interactive * expression evaluator./* w ww . j a v a 2 s . co m*/ */ @SuppressWarnings("unused") private List<JNode> haveSameName(Binding binding) { IdentityHashSet<JNode> nodes = new IdentityHashSet<JNode>(); for (Binding b : crossRefMap.keySet()) { if (String.valueOf(b.readableName()).equals(String.valueOf(binding.readableName()))) { nodes.add(crossRefMap.get(b)); } } return new ArrayList<JNode>(nodes); }
From source file:lombok.eclipse.agent.PatchDelegate.java
License:Open Source License
private static void failIfContainsAnnotation(TypeBinding parent, Binding[] bindings) throws DelegateRecursion { if (bindings == null) return;//w ww.j av a 2 s . c om for (Binding b : bindings) { AnnotationBinding[] anns = null; if (b instanceof MethodBinding) anns = ((MethodBinding) b).getAnnotations(); if (b instanceof FieldBinding) anns = ((FieldBinding) b).getAnnotations(); // anns = b.getAnnotations() would make a heck of a lot more sense, but that is a late addition to ecj, so would cause NoSuchMethodErrors! Don't use that! if (anns == null) continue; for (AnnotationBinding ann : anns) { char[][] name = null; try { name = ann.getAnnotationType().compoundName; } catch (Exception ignore) { } if (name == null || name.length < 2 || name.length > 3) continue; if (!Arrays.equals(STRING_LOMBOK, name[0])) continue; if (!Arrays.equals(STRING_DELEGATE, name[name.length - 1])) continue; if (name.length == 3 && !Arrays.equals(STRING_EXPERIMENTAL, name[1])) continue; throw new DelegateRecursion(parent.readableName(), b.readableName()); } } }
From source file:org.eclipse.recommenders.internal.chain.rcp.ChainCompletionProposal.java
License:Open Source License
@VisibleForTesting public List<String> getChainElementNames() { final List<String> b = new LinkedList<String>(); for (final ChainElement edge : chain.getElements()) { final Binding bind = edge.getElementBinding(); final char[] name = bind instanceof MethodBinding ? ((MethodBinding) bind).selector : bind.readableName(); b.add(String.valueOf(name)); }/* w ww .jav a 2 s . c o m*/ return b; }
From source file:org.eclipse.recommenders.internal.chain.rcp.ChainCompletionProposalComputer.java
License:Open Source License
private boolean matchesExpectedPrefix(final Binding binding) { return String.valueOf(binding.readableName()).startsWith(ctx.getPrefix()); }
From source file:org.eclipse.recommenders.internal.chain.rcp.ChainCompletionProposalComputer.java
License:Open Source License
private boolean matchesPrefixToken(final Binding decl) { return String.valueOf(decl.readableName()).startsWith(ctx.getPrefix()); }