@Override public Element getEnclosingElement() { return this._env.getFactory().newPackageElement(this._env.getLookupEnvironment().defaultPackage); }
public void addNewClassFile(ReferenceBinding binding) { _env.addNewClassFile(binding); }
public void addNewUnit(ICompilationUnit unit) { _env.addNewUnit(unit); }
@Override public Element asElement() { // The JDT compiler does not distinguish between type elements and declared types return _env.getFactory().newElement((ReferenceBinding)_binding, _elementKindHint); }
@Override public LookupEnvironment getLookupEnvironment() { LookupEnvironment _le = super.getLookupEnvironment(); return _le; } }
@Override public void printMessage(Kind kind, CharSequence msg, Element e, AnnotationMirror a, AnnotationValue v) { if (kind == Kind.ERROR) { _processingEnv.setErrorRaised(true); } CategorizedProblem problem = createProblem(kind, msg, e, a, v); if (problem != null) { this._compiler.addExtraProblems(problem); } } }
@Override public ReferenceBinding[] getNewClassFiles() { return _processingEnv.getNewClassFiles(); }
@Override public boolean errorRaised() { return _processingEnv.errorRaised(); }
@Override public ICompilationUnit[] getNewUnits() { return _processingEnv.getNewUnits(); }
@Override public ICompilationUnit[] getDeletedUnits() { return _processingEnv.getDeletedUnits(); }
@Override public Set<? extends Element> getElementsAnnotatedWith(Class<? extends Annotation> a) { String canonicalName = a.getCanonicalName(); if (canonicalName == null) { // null for anonymous and local classes or an array of those throw new IllegalArgumentException("Argument must represent an annotation type"); //$NON-NLS-1$ } TypeElement annoType = _processingEnv.getElementUtils().getTypeElement(canonicalName); return getElementsAnnotatedWith(annoType); }
public AnnotationDiscoveryVisitor(BaseProcessingEnvImpl env) { _env = env; _factory = env.getFactory(); _annoToElement = new ManyToMany<>(); }
@Override public ModuleElement getModuleElement(CharSequence name) { LookupEnvironment lookup = _env.getLookupEnvironment(); ModuleBinding binding = lookup.getModule(name.length() == 0 ? ModuleBinding.UNNAMED : name.toString().toCharArray()); //TODO: Surely there has to be a better way than calling toString().toCharArray()? if (binding == null) { return null; } return new ModuleElementImpl(_env, binding); }
@Override public void printMessage(Kind kind, CharSequence msg, Element e, AnnotationMirror a, AnnotationValue v) { if (kind == Kind.ERROR) { _processingEnv.setErrorRaised(true); } CategorizedProblem problem = createProblem(kind, msg, e, a, v); if (problem != null) { this._compiler.addExtraProblems(problem); } } }
@Override public ReferenceBinding[] getNewClassFiles() { return _processingEnv.getNewClassFiles(); }
@Override public boolean errorRaised() { return _processingEnv.errorRaised(); }
@Override public ICompilationUnit[] getNewUnits() { return _processingEnv.getNewUnits(); }
@Override public ICompilationUnit[] getDeletedUnits() { return _processingEnv.getDeletedUnits(); }
@Override public Set<? extends Element> getElementsAnnotatedWith(Class<? extends Annotation> a) { String canonicalName = a.getCanonicalName(); if (canonicalName == null) { // null for anonymous and local classes or an array of those throw new IllegalArgumentException("Argument must represent an annotation type"); //$NON-NLS-1$ } TypeElement annoType = _processingEnv.getElementUtils().getTypeElement(canonicalName); return getElementsAnnotatedWith(annoType); }
@Override public Element getEnclosingElement() { return this._env.getFactory().newPackageElement(this._env.getLookupEnvironment().defaultPackage); }