javax.lang.model.element.ElementVisitor Java Examples

The following examples show how to use javax.lang.model.element.ElementVisitor. 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 Project: logging-log4j2   Author: apache   File: PluginProcessor.java    License: Apache License 2.0 6 votes vote down vote up
private String collectPlugins(String packageName, final Iterable<? extends Element> elements, List<PluginEntry> list) {
    boolean calculatePackage = packageName == null;
    final Elements elementUtils = processingEnv.getElementUtils();
    final ElementVisitor<PluginEntry, Plugin> pluginVisitor = new PluginElementVisitor(elementUtils);
    final ElementVisitor<Collection<PluginEntry>, Plugin> pluginAliasesVisitor = new PluginAliasesElementVisitor(
            elementUtils);
    for (final Element element : elements) {
        final Plugin plugin = element.getAnnotation(Plugin.class);
        if (plugin == null) {
            continue;
        }
        final PluginEntry entry = element.accept(pluginVisitor, plugin);
        list.add(entry);
        if (calculatePackage) {
            packageName = calculatePackage(elementUtils, element, packageName);
        }
        final Collection<PluginEntry> entries = element.accept(pluginAliasesVisitor, plugin);
        for (final PluginEntry pluginEntry : entries) {
            list.add(pluginEntry);
        }
    }
    return packageName;
}
 
Example #2
Source Project: netbeans   Author: apache   File: LayerBuilderTest.java    License: Apache License 2.0 5 votes vote down vote up
public void testOriginatingElementComments() throws Exception {
    b = new LayerBuilder(doc, new Element() {
        public @Override ElementKind getKind() {
            return ElementKind.OTHER;
        }
        public @Override String toString() {
            return "originating.Type";
        }
        public @Override TypeMirror asType() {return null;}
        public @Override List<? extends AnnotationMirror> getAnnotationMirrors() {return null;}
        public @Override <A extends Annotation> A getAnnotation(Class<A> annotationType) {return null;}
        public @Override Set<Modifier> getModifiers() {return null;}
        public @Override Name getSimpleName() {return null;}
        public @Override Element getEnclosingElement() {return null;}
        public @Override List<? extends Element> getEnclosedElements() {return null;}
        public @Override <R, P> R accept(ElementVisitor<R, P> v, P p) {return null;}
        @Override
        public <A extends Annotation> A[] getAnnotationsByType(Class<A> annotationType) {
            return (A[]) Array.newInstance(annotationType, 0);
        }
    }, null);
    b.folder("f").write();
    assertEquals("<filesystem><folder name='f'><!--originating.Type--></folder></filesystem>", dump());
    // #180154: do not repeat after an incremental build
    b.folder("f").write();
    assertEquals("<filesystem><folder name='f'><!--originating.Type--></folder></filesystem>", dump());
}
 
Example #3
Source Project: TencentKona-8   Author: Tencent   File: Resolve.java    License: GNU General Public License v2.0 4 votes vote down vote up
@Override
public <R, P> R accept(ElementVisitor<R, P> v, P p) {
    throw new AssertionError();
}
 
Example #4
Source Project: jdk8u60   Author: chenghanpeng   File: Resolve.java    License: GNU General Public License v2.0 4 votes vote down vote up
@Override
public <R, P> R accept(ElementVisitor<R, P> v, P p) {
    throw new AssertionError();
}
 
Example #5
Source Project: java-n-IDE-for-Android   Author: shenghuntianlang   File: Resolve.java    License: Apache License 2.0 4 votes vote down vote up
@Override
public <R, P> R accept(ElementVisitor<R, P> v, P p) {
    throw new AssertionError();
}
 
Example #6
Source Project: openjdk-jdk8u   Author: AdoptOpenJDK   File: Resolve.java    License: GNU General Public License v2.0 4 votes vote down vote up
@Override
public <R, P> R accept(ElementVisitor<R, P> v, P p) {
    throw new AssertionError();
}
 
Example #7
Source Project: lua-for-android   Author: qtiuto   File: Symbol.java    License: BSD 3-Clause "New" or "Revised" License 4 votes vote down vote up
@DefinedBy(Api.LANGUAGE_MODEL)
public <R, P> R accept(ElementVisitor<R, P> v, P p) {
    return other.accept(v, p);
}
 
Example #8
Source Project: lua-for-android   Author: qtiuto   File: Symbol.java    License: BSD 3-Clause "New" or "Revised" License 4 votes vote down vote up
@Override @DefinedBy(Api.LANGUAGE_MODEL)
public <R, P> R accept(ElementVisitor<R, P> v, P p) {
    return v.visitTypeParameter(this, p);
}
 
Example #9
Source Project: lua-for-android   Author: qtiuto   File: Symbol.java    License: BSD 3-Clause "New" or "Revised" License 4 votes vote down vote up
@Override @DefinedBy(Api.LANGUAGE_MODEL)
public <R, P> R accept(ElementVisitor<R, P> v, P p) {
    return v.visitModule(this, p);
}
 
Example #10
Source Project: lua-for-android   Author: qtiuto   File: Symbol.java    License: BSD 3-Clause "New" or "Revised" License 4 votes vote down vote up
@DefinedBy(Api.LANGUAGE_MODEL)
public <R, P> R accept(ElementVisitor<R, P> v, P p) {
    return v.visitPackage(this, p);
}
 
Example #11
Source Project: lua-for-android   Author: qtiuto   File: Symbol.java    License: BSD 3-Clause "New" or "Revised" License 4 votes vote down vote up
@DefinedBy(Api.LANGUAGE_MODEL)
public <R, P> R accept(ElementVisitor<R, P> v, P p) {
    return v.visitType(this, p);
}
 
Example #12
Source Project: lua-for-android   Author: qtiuto   File: Symbol.java    License: BSD 3-Clause "New" or "Revised" License 4 votes vote down vote up
@DefinedBy(Api.LANGUAGE_MODEL)
public <R, P> R accept(ElementVisitor<R, P> v, P p) {
    return v.visitVariable(this, p);
}
 
Example #13
Source Project: lua-for-android   Author: qtiuto   File: Symbol.java    License: BSD 3-Clause "New" or "Revised" License 4 votes vote down vote up
@DefinedBy(Api.LANGUAGE_MODEL)
public <R, P> R accept(ElementVisitor<R, P> v, P p) {
    return v.visitExecutable(this, p);
}
 
Example #14
Source Project: netbeans   Author: apache   File: ElementOverlay.java    License: Apache License 2.0 4 votes vote down vote up
@Override
public <R, P> R accept(ElementVisitor<R, P> v, P p) {
    throw new UnsupportedOperationException("Not supported yet.");
}
 
Example #15
Source Project: netbeans   Author: apache   File: ElementOverlay.java    License: Apache License 2.0 4 votes vote down vote up
@Override
public <R, P> R accept(ElementVisitor<R, P> v, P p) {
    throw new UnsupportedOperationException("Not supported yet.");
}
 
Example #16
Source Project: netbeans   Author: apache   File: ElementOverlay.java    License: Apache License 2.0 4 votes vote down vote up
@Override
public <R, P> R accept(ElementVisitor<R, P> v, P p) {
    throw new UnsupportedOperationException("Not supported yet.");
}
 
Example #17
Source Project: netbeans   Author: apache   File: ElementOverlay.java    License: Apache License 2.0 4 votes vote down vote up
@Override
public <R, P> R accept(ElementVisitor<R, P> v, P p) {
    throw new UnsupportedOperationException("Not supported yet.");
}
 
Example #18
Source Project: dataenum   Author: spotify   File: AccessSelectorTest.java    License: Apache License 2.0 4 votes vote down vote up
@Override
public <R, P> R accept(ElementVisitor<R, P> v, P p) {
  return null;
}
 
Example #19
Source Project: dataenum   Author: spotify   File: AccessSelectorTest.java    License: Apache License 2.0 4 votes vote down vote up
@Override
public <R, P> R accept(ElementVisitor<R, P> v, P p) {
  return null;
}
 
Example #20
Source Project: openjdk-jdk8u-backup   Author: AdoptOpenJDK   File: Resolve.java    License: GNU General Public License v2.0 4 votes vote down vote up
@Override
public <R, P> R accept(ElementVisitor<R, P> v, P p) {
    throw new AssertionError();
}
 
Example #21
Source Project: javaide   Author: tranleduy2000   File: Resolve.java    License: GNU General Public License v3.0 4 votes vote down vote up
@Override
public <R, P> R accept(ElementVisitor<R, P> v, P p) {
    throw new AssertionError();
}
 
Example #22
Source Project: openjdk-jdk9   Author: AdoptOpenJDK   File: Symbol.java    License: GNU General Public License v2.0 4 votes vote down vote up
@DefinedBy(Api.LANGUAGE_MODEL)
public <R, P> R accept(ElementVisitor<R, P> v, P p) {
    return other.accept(v, p);
}
 
Example #23
Source Project: openjdk-jdk9   Author: AdoptOpenJDK   File: Symbol.java    License: GNU General Public License v2.0 4 votes vote down vote up
@Override @DefinedBy(Api.LANGUAGE_MODEL)
public <R, P> R accept(ElementVisitor<R, P> v, P p) {
    return v.visitTypeParameter(this, p);
}
 
Example #24
Source Project: openjdk-jdk9   Author: AdoptOpenJDK   File: Symbol.java    License: GNU General Public License v2.0 4 votes vote down vote up
@Override @DefinedBy(Api.LANGUAGE_MODEL)
public <R, P> R accept(ElementVisitor<R, P> v, P p) {
    return v.visitModule(this, p);
}
 
Example #25
Source Project: openjdk-jdk9   Author: AdoptOpenJDK   File: Symbol.java    License: GNU General Public License v2.0 4 votes vote down vote up
@DefinedBy(Api.LANGUAGE_MODEL)
public <R, P> R accept(ElementVisitor<R, P> v, P p) {
    return v.visitPackage(this, p);
}
 
Example #26
Source Project: openjdk-jdk9   Author: AdoptOpenJDK   File: Symbol.java    License: GNU General Public License v2.0 4 votes vote down vote up
@DefinedBy(Api.LANGUAGE_MODEL)
public <R, P> R accept(ElementVisitor<R, P> v, P p) {
    return v.visitType(this, p);
}
 
Example #27
Source Project: openjdk-jdk9   Author: AdoptOpenJDK   File: Symbol.java    License: GNU General Public License v2.0 4 votes vote down vote up
@DefinedBy(Api.LANGUAGE_MODEL)
public <R, P> R accept(ElementVisitor<R, P> v, P p) {
    return v.visitVariable(this, p);
}
 
Example #28
Source Project: openjdk-jdk9   Author: AdoptOpenJDK   File: Symbol.java    License: GNU General Public License v2.0 4 votes vote down vote up
@DefinedBy(Api.LANGUAGE_MODEL)
public <R, P> R accept(ElementVisitor<R, P> v, P p) {
    return v.visitExecutable(this, p);
}
 
Example #29
Source Project: openjdk-jdk9   Author: AdoptOpenJDK   File: Resolve.java    License: GNU General Public License v2.0 4 votes vote down vote up
@Override @DefinedBy(Api.LANGUAGE_MODEL)
public <R, P> R accept(ElementVisitor<R, P> v, P p) {
    throw new AssertionError();
}
 
Example #30
Source Project: openjdk-jdk9   Author: AdoptOpenJDK   File: OverviewElement.java    License: GNU General Public License v2.0 4 votes vote down vote up
@Override
public <R, P> R accept(ElementVisitor<R, P> v, P p) {
    return v.visitUnknown(this, p);
}