Java Code Examples for javax.lang.model.type.TypeVisitor#visitPrimitive()

The following examples show how to use javax.lang.model.type.TypeVisitor#visitPrimitive() . 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: 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 2
Source File: Type.java    From java-n-IDE-for-Android with Apache License 2.0 4 votes vote down vote up
public <R, P> R accept(TypeVisitor<R, P> v, P p) {
    if (isPrimitive())
        return v.visitPrimitive(this, p);
    else
        throw new AssertionError();
}
 
Example 3
Source File: Type.java    From javaide with GNU General Public License v3.0 4 votes vote down vote up
public <R, P> R accept(TypeVisitor<R, P> v, P p) {
    if (isPrimitive())
        return v.visitPrimitive(this, p);
    else
        throw new AssertionError();
}
 
Example 4
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.visitPrimitive(this, p);
}
 
Example 5
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 6
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 7
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));
  }
}