javax.lang.model.type.TypeVisitor Java Examples

The following examples show how to use javax.lang.model.type.TypeVisitor. 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 File: Util.java    From revapi with Apache License 2.0 6 votes vote down vote up
@Override
protected Void doVisitIntersection(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;
}
 
Example #2
Source File: NoTypeImpl.java    From Eclipse-Postfix-Code-Completion with Eclipse Public License 1.0 5 votes vote down vote up
@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);
	}
}
 
Example #3
Source File: StandaloneTypeMirror.java    From buck with Apache License 2.0 5 votes vote down vote up
@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));
  }
}
 
Example #4
Source File: GeneratedExecutableElement.java    From j2objc with Apache License 2.0 4 votes vote down vote up
@Override
public <R, P> R accept(TypeVisitor<R, P> v, P p) {
  return v.visitExecutable(this, p);
}
 
Example #5
Source File: ClassTypeImpl.java    From FreeBuilder with Apache License 2.0 4 votes vote down vote up
@Override
public <R, P> R accept(TypeVisitor<R, P> v, P p) {
  return v.visitDeclared(this, p);
}
 
Example #6
Source File: GenericElementParameter.java    From FreeBuilder with Apache License 2.0 4 votes vote down vote up
@Override
public <R, P> R accept(TypeVisitor<R, P> v, P p) {
  return v.visitTypeVariable(this, p);
}
 
Example #7
Source File: NoTypes.java    From FreeBuilder with Apache License 2.0 4 votes vote down vote up
@Override
public <R, P> R accept(TypeVisitor<R, P> v, P p) {
  return v.visitNoType(this, p);
}
 
Example #8
Source File: NullTypeImpl.java    From FreeBuilder with Apache License 2.0 4 votes vote down vote up
@Override
public <R, P> R accept(TypeVisitor<R, P> v, P p) {
  return v.visitNull(this, p);
}
 
Example #9
Source File: MissingTypeElement.java    From revapi with Apache License 2.0 4 votes vote down vote up
@Override
public <R, P> R accept(TypeVisitor<R, P> v, P p) {
    return v.visitError(this, p);
}
 
Example #10
Source File: GeneratedTypeElement.java    From j2objc with Apache License 2.0 4 votes vote down vote up
@Override
public <R, P> R accept(TypeVisitor<R, P> v, P p) {
  return v.visitDeclared(this, p);
}
 
Example #11
Source File: PointerType.java    From j2objc with Apache License 2.0 4 votes vote down vote up
@Override
public <R, P> R accept(TypeVisitor<R, P> v, P p) {
  return v.visitUnknown(this, p);
}
 
Example #12
Source File: GenericMirror.java    From FreeBuilder with Apache License 2.0 4 votes vote down vote up
@Override
public <R, P> R accept(TypeVisitor<R, P> v, P p) {
  return v.visitDeclared(this, p);
}
 
Example #13
Source File: MissingTypeElement.java    From revapi with Apache License 2.0 4 votes vote down vote up
@Override
public <R, P> R accept(TypeVisitor<R, P> v, P p) {
    return v.visitNoType(this, p);
}
 
Example #14
Source File: CachingElements.java    From immutables with Apache License 2.0 4 votes vote down vote up
@Override
public <R, P> R accept(TypeVisitor<R, P> v, P p) {
  return delegate.accept(v, p);
}
 
Example #15
Source File: MoreTypesTest.java    From auto with Apache License 2.0 4 votes vote down vote up
@Override
public <R, P> R accept(TypeVisitor<R, P> v, P p) {
  return v.visitError(this, p);
}
 
Example #16
Source File: GeneratedArrayType.java    From j2objc with Apache License 2.0 4 votes vote down vote up
@Override
public <R, P> R accept(TypeVisitor<R, P> v, P p) {
  return v.visitArray(this, p);
}
 
Example #17
Source File: StandaloneTypeMirror.java    From buck with Apache License 2.0 4 votes vote down vote up
@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 MODULE:
    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));
  }
}
 
Example #18
Source File: PrimitiveTypeImpl.java    From Eclipse-Postfix-Code-Completion with Eclipse Public License 1.0 4 votes vote down vote up
@Override
public <R, P> R accept(TypeVisitor<R, P> v, P p)
{
	return v.visitPrimitive(this, p);
}
 
Example #19
Source File: WildcardTypeImpl.java    From FreeBuilder with Apache License 2.0 4 votes vote down vote up
@Override
public <R, P> R accept(TypeVisitor<R, P> v, P p) {
  return v.visitWildcard(this, p);
}
 
Example #20
Source File: PackageElementImpl.java    From FreeBuilder with Apache License 2.0 4 votes vote down vote up
@Override
public <R, P> R accept(TypeVisitor<R, P> v, P p) {
  return v.visitNoType(this, p);
}
 
Example #21
Source File: TypeVariableImpl.java    From FreeBuilder with Apache License 2.0 4 votes vote down vote up
@Override
public <R, P> R accept(TypeVisitor<R, P> v, P p) {
  return v.visitTypeVariable(this, p);
}
 
Example #22
Source File: PrimitiveTypeImpl.java    From FreeBuilder with Apache License 2.0 4 votes vote down vote up
@Override
public <R, P> R accept(TypeVisitor<R, P> v, P p) {
  return v.visitPrimitive(this, p);
}
 
Example #23
Source File: GenericTypeElementImpl.java    From FreeBuilder with Apache License 2.0 4 votes vote down vote up
@Override
public <R, P> R accept(TypeVisitor<R, P> v, P p) {
  return v.visitDeclared(this, p);
}
 
Example #24
Source File: Javac.java    From EasyMPermission with MIT License 4 votes vote down vote up
@Override
public <R, P> R accept(TypeVisitor<R, P> v, P p) {
	return v.visitNoType(this, p);
}
 
Example #25
Source File: ApNavigator.java    From openjdk-8 with GNU General Public License v2.0 4 votes vote down vote up
@Override
public <R, P> R accept(TypeVisitor<R, P> v, P p) {
    throw new IllegalStateException();
}
 
Example #26
Source File: TurbineTypeMirror.java    From turbine with Apache License 2.0 4 votes vote down vote up
@Override
public <R, P> R accept(TypeVisitor<R, P> v, P p) {
  return v.visitExecutable(this, p);
}
 
Example #27
Source File: TurbineTypeMirror.java    From turbine with Apache License 2.0 4 votes vote down vote up
@Override
public <R, P> R accept(TypeVisitor<R, P> v, P p) {
  return v.visitNull(this, p);
}
 
Example #28
Source File: TurbineTypeMirror.java    From turbine with Apache License 2.0 4 votes vote down vote up
@Override
public <R, P> R accept(TypeVisitor<R, P> v, P p) {
  return v.visitIntersection(this, p);
}
 
Example #29
Source File: TurbineTypeMirror.java    From turbine with Apache License 2.0 4 votes vote down vote up
@Override
public <R, P> R accept(TypeVisitor<R, P> v, P p) {
  return v.visitWildcard(this, p);
}
 
Example #30
Source File: ApNavigator.java    From TencentKona-8 with GNU General Public License v2.0 4 votes vote down vote up
@Override
public <R, P> R accept(TypeVisitor<R, P> v, P p) {
    throw new IllegalStateException();
}