Java 类javax.lang.model.type.TypeVisitor 实例源码

项目:lombok-ianchiu    文件:Javac.java   
@Override
public <R, P> R accept(TypeVisitor<R, P> v, P p) {
    return v.visitNoType(this, p);
}
项目:auto-parse    文件:TypeSimplifier.java   
/**
 * Finds all declared types (classes and interfaces) that are referenced in the given
 * {@code Set<TypeMirror>}. This includes classes and interfaces that appear directly in the set,
 * but also ones that appear in type parameters and the like. For example, if the set contains
 * {@code java.util.List<? extends java.lang.Number>} then both {@code java.util.List} and
 * {@code java.lang.Number} will be in the resulting set.
 */
private static Set<TypeMirror> referencedClassTypes(Types typeUtil, Set<TypeMirror> types) {
  Set<TypeMirror> referenced = new HashSet<TypeMirror>();
  TypeVisitor<Void, Void> typeVisitor = new ReferencedClassTypeVisitor(typeUtil, referenced);
  for (TypeMirror type : types) {
    type.accept(typeVisitor, null);
  }
  return referenced;
}
项目:Eclipse-Postfix-Code-Completion    文件:NoTypeImpl.java   
@Override
public <R, P> R accept(TypeVisitor<R, P> v, P p)
{
    switch(this.getKind())
    {
        case NULL :
            return v.visitNull(this, p);
        default: 
            return v.visitNoType(this, p);
    }
}
项目:revapi    文件:Util.java   
@Override
public Void visitIntersection(IntersectionType t, StringBuilderAndState<TypeMirror> state) {
    Iterator<? extends TypeMirror> it = IgnoreCompletionFailures.in(t::getBounds).iterator();
    if (it.hasNext()) {
        it.next().accept(this, state);
    }

    TypeVisitor<Void, StringBuilderAndState<TypeMirror>> me = this;

    it.forEachRemaining(b -> { state.bld.append(", "); b.accept(me, state); });

    return null;
}
项目:Eclipse-Postfix-Code-Completion-Juno38    文件:NoTypeImpl.java   
@Override
public <R, P> R accept(TypeVisitor<R, P> v, P p)
{
    switch(this.getKind())
    {
        case NULL :
            return v.visitNull(this, p);
        default: 
            return v.visitNoType(this, p);
    }
}
项目:external-android-mock    文件:UsesMocksProcessorTest.java   
private DeclaredType getMockAnnotationType() {
  return new DeclaredType() {
    @Override
    public String toString() {
      return UsesMocks.class.getName();
    }

    @Override
    public Element asElement() {
      return null;
    }

    @Override
    public TypeMirror getEnclosingType() {
      return null;
    }

    @Override
    public List<? extends TypeMirror> getTypeArguments() {
      return null;
    }

    @Override
    public <R, P> R accept(TypeVisitor<R, P> v, P p) {
      return null;
    }

    @Override
    public TypeKind getKind() {
      return null;
    }
  };
}
项目:contracts    文件:ParameterMapAnnotationProcessor.java   
private String getMethodDescriptor(ExecutableElement element) {
    final StringBuilder buf = new StringBuilder();
    buf.append(element.getSimpleName()).append('(');
    TypeVisitor<Void, Void> typeWriter = new BinaryTypeWriter(buf);
    for ( VariableElement param : element.getParameters() ) {
        TypeMirror type = processingEnv.getTypeUtils().erasure(param.asType());
        type.accept(typeWriter, null);
    }
    buf.append(')');
    processingEnv.getTypeUtils().erasure(element.getReturnType()).accept(typeWriter, null);
    return buf.toString();
}
项目:buck    文件:StandaloneTypeMirror.java   
@Override
public <R, P> R accept(TypeVisitor<R, P> v, P p) {
  switch (kind) {
    case BOOLEAN:
    case BYTE:
    case SHORT:
    case INT:
    case LONG:
    case CHAR:
    case FLOAT:
    case DOUBLE:
      return v.visitPrimitive((PrimitiveType) this, p);
    case PACKAGE:
    case VOID:
    case NONE:
      return v.visitNoType((NoType) this, p);
    case NULL:
      return v.visitNull((NullType) this, p);
    case ARRAY:
      return v.visitArray((ArrayType) this, p);
    case DECLARED:
      return v.visitDeclared((DeclaredType) this, p);
    case ERROR:
      return v.visitError((ErrorType) this, p);
    case TYPEVAR:
      return v.visitTypeVariable((TypeVariable) this, p);
    case WILDCARD:
      return v.visitWildcard((WildcardType) this, p);
    case EXECUTABLE:
      return v.visitExecutable((ExecutableType) this, p);
    case OTHER:
      return v.visit(this, p);
    case UNION:
      return v.visitUnion((UnionType) this, p);
    case INTERSECTION:
      return v.visitIntersection((IntersectionType) this, p);
    default:
      throw new AssertionError(String.format("Unknown TypeKind: %s", kind));
  }
}
项目:jenkins-csvexporter    文件:ExportBeanListRetrieverTest.java   
private static TypeMirror noType() {
    return new NoType() {
        @Override
        public <R, P> R accept(TypeVisitor<R, P> v, P p) {
            throw new UnsupportedOperationException();
        }

        @Override
        public TypeKind getKind() {
            throw new UnsupportedOperationException();
        }
    };
}
项目:GitHub    文件:CachingElements.java   
@Override
public <R, P> R accept(TypeVisitor<R, P> v, P p) {
  return delegate.accept(v, p);
}
项目:javaide    文件:Type.java   
public <R, P> R accept(TypeVisitor<R, P> v, P p) {
    if (isPrimitive())
        return v.visitPrimitive(this, p);
    else
        throw new AssertionError();
}
项目:javaide    文件:Type.java   
public <R, P> R accept(TypeVisitor<R, P> v, P p) {
    return v.visitWildcard(this, p);
}
项目:javaide    文件:Type.java   
public <R, P> R accept(TypeVisitor<R, P> v, P p) {
    return v.visitDeclared(this, p);
}
项目:javaide    文件:Type.java   
@Override
public <R, P> R accept(TypeVisitor<R, P> v, P p) {
    return v.visitUnion(this, p);
}
项目:javaide    文件:Type.java   
public <R, P> R accept(TypeVisitor<R, P> v, P p) {
    return v.visitArray(this, p);
}
项目:javaide    文件:Type.java   
public <R, P> R accept(TypeVisitor<R, P> v, P p) {
    return v.visitExecutable(this, p);
}
项目:javaide    文件:Type.java   
public <R, P> R accept(TypeVisitor<R, P> v, P p) {
    return v.visitNoType(this, p);
}
项目:javaide    文件:Type.java   
public <R, P> R accept(TypeVisitor<R, P> v, P p) {
    return v.visitTypeVariable(this, p);
}
项目:javaide    文件:Type.java   
public <R, P> R accept(TypeVisitor<R, P> v, P p) {
    return v.visitExecutable(this, p);
}
项目:javaide    文件:Type.java   
@Override
public <R, P> R accept(TypeVisitor<R, P> v, P p) {
    return v.visitNoType(this, p);
}
项目:javaide    文件:Type.java   
@Override
public <R, P> R accept(TypeVisitor<R, P> v, P p) {
    return v.visitNull(this, p);
}
项目:javaide    文件:Type.java   
public <R, P> R accept(TypeVisitor<R, P> v, P p) {
    return v.visitError(this, p);
}
项目:OpenJSharp    文件:ApNavigator.java   
@Override
public <R, P> R accept(TypeVisitor<R, P> v, P p) {
    throw new IllegalStateException();
}
项目:data-mediator    文件:MockTypeMirror.java   
@Override
public <R, P> R accept(TypeVisitor<R, P> v, P p) {
    return null;
}
项目:data-mediator    文件:PoetTest.java   
@Override
public <R, P> R accept(TypeVisitor<R, P> v, P p) {
    return null;
}
项目:openjdk-jdk10    文件:ApNavigator.java   
@Override
public <R, P> R accept(TypeVisitor<R, P> v, P p) {
    throw new IllegalStateException();
}
项目:openjdk9    文件:ApNavigator.java   
@Override
public <R, P> R accept(TypeVisitor<R, P> v, P p) {
    throw new IllegalStateException();
}
项目:neo4j-sproc-compiler    文件:ParameterVisitor.java   
public ParameterVisitor( TypeVisitor<Boolean,Void> parameterTypeVisitor )
{
    this.parameterTypeVisitor = parameterTypeVisitor;
}
项目:neo4j-sproc-compiler    文件:RecordFieldTypeVisitorTest.java   
@Override
protected TypeVisitor<Boolean,Void> visitor()
{
    return new RecordFieldTypeVisitor( types, typeMirrorUtils );
}
项目:neo4j-sproc-compiler    文件:ParameterTypeVisitorTest.java   
@Override
protected TypeVisitor<Boolean,Void> visitor()
{
    return new ParameterTypeVisitor( types, typeMirrorUtils );
}
项目:wava    文件:TestAbstractTypes.java   
@Override
public <R, P> R accept(TypeVisitor<R, P> typeVisitor, P p)
{
    return typeVisitor.visitError(this, p);
}
项目:listing    文件:DeclaredTypeAsErrorType.java   
@Override
public <R, P> R accept(TypeVisitor<R, P> typeVisitor, P p) {
  return typeVisitor.visitError(this, p);
}
项目:cloudkeeper    文件:DeclaredTypeImpl.java   
@Override
@Nullable
public <R, P> R accept(TypeVisitor<R, P> visitor, @Nullable P parameter) {
    return visitor.visitDeclared(this, parameter);
}
项目:cloudkeeper    文件:PrimitiveTypeImpl.java   
@Override
@Nullable
public <R, P> R accept(TypeVisitor<R, P> visitor, @Nullable P parameter) {
    return visitor.visitPrimitive(this, parameter);
}
项目:cloudkeeper    文件:TypeVariableImpl.java   
@Override
@Nullable
public <R, P> R accept(TypeVisitor<R, P> visitor, @Nullable P parameter) {
    return visitor.visitTypeVariable(this, parameter);
}
项目:cloudkeeper    文件:NoTypeImpl.java   
@Override
@Nullable
public <R, P> R accept(TypeVisitor<R, P> visitor, @Nullable P parameter) {
    return visitor.visitNoType(this, parameter);
}
项目:cloudkeeper    文件:WildcardTypeImpl.java   
@Override
public <R, P> R accept(TypeVisitor<R, P> visitor, @Nullable P parameter) {
    return visitor.visitWildcard(this, parameter);
}
项目:cloudkeeper    文件:ArrayTypeImpl.java   
@Override
@Nullable
public <R, P> R accept(TypeVisitor<R, P> visitor, @Nullable P parameter) {
    return visitor.visitArray(this, parameter);
}
项目:cloudkeeper    文件:IntersectionTypeImpl.java   
@Override
@Nullable
public <R, P> R accept(TypeVisitor<R, P> visitor, @Nullable P parameter) {
    return visitor.visitUnknown(this, parameter);
}
项目:cloudkeeper    文件:NullTypeImpl.java   
@Override
@Nullable
public <R, P> R accept(TypeVisitor<R, P> visitor, @Nullable P parameter) {
    return visitor.visitNull(this, parameter);
}