Many resources are needed to download a project. Please understand that we have to compensate our server costs. Thank you in advance. Project price only 1 $
You can buy this project and download/modify it how often you want.
package net.zerobuilder.compiler.common;
import javax.lang.model.element.Element;
import javax.lang.model.element.ElementKind;
import javax.lang.model.element.ElementVisitor;
import javax.lang.model.element.ExecutableElement;
import javax.lang.model.element.Modifier;
import javax.lang.model.element.PackageElement;
import javax.lang.model.element.TypeElement;
import javax.lang.model.type.TypeKind;
import javax.lang.model.type.TypeMirror;
import javax.lang.model.util.SimpleElementVisitor6;
import java.util.Collection;
import java.util.LinkedHashMap;
import java.util.Map;
import java.util.function.Predicate;
import static javax.lang.model.element.ElementKind.PACKAGE;
import static javax.lang.model.util.ElementFilter.methodsIn;
import static net.zerobuilder.compiler.common.LessTypes.asTypeElement;
/**
* Guava-free versions of some helpers from auto-common.
*/
public final class LessElements {
private static final ElementVisitor TYPE_ELEMENT_VISITOR =
new SimpleElementVisitor6() {
@Override
protected TypeElement defaultAction(Element e, Void p) {
throw new IllegalArgumentException();
}
@Override
public TypeElement visitType(TypeElement e, Void p) {
return e;
}
};
private static final ElementVisitor EXECUTABLE_ELEMENT_VISITOR =
new SimpleElementVisitor6() {
@Override
protected ExecutableElement defaultAction(Element e, Void p) {
throw new IllegalArgumentException();
}
@Override
public ExecutableElement visitExecutable(ExecutableElement e, Void p) {
return e;
}
};
/**
* Find all non-static, visible methods that match the predicate, and group by name.
* In case of name conflict, the first found wins.
* The iteration order is:
*