javax.lang.model.util.SimpleTypeVisitor8 Java Examples

The following examples show how to use javax.lang.model.util.SimpleTypeVisitor8. 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: AutoUtils.java    From fastjgame with Apache License 2.0 5 votes vote down vote up
/**
 * 获取一个元素的声明类型
 */
public static DeclaredType getDeclaredType(TypeMirror typeMirror) {
    return typeMirror.accept(new SimpleTypeVisitor8<>() {
        @Override
        public DeclaredType visitDeclared(DeclaredType t, Object o) {
            return t;
        }
    }, null);
}
 
Example #2
Source File: MoreTypes.java    From doma with Apache License 2.0 5 votes vote down vote up
public DeclaredType toDeclaredType(TypeMirror typeMirror) {
  assertNotNull(typeMirror);
  return typeMirror.accept(
      new SimpleTypeVisitor8<DeclaredType, Void>() {

        public DeclaredType visitDeclared(DeclaredType t, Void p) {
          return t;
        }
      },
      null);
}
 
Example #3
Source File: MoreTypes.java    From doma with Apache License 2.0 5 votes vote down vote up
public TypeVariable toTypeVariable(TypeMirror typeMirror) {
  assertNotNull(typeMirror);
  return typeMirror.accept(
      new SimpleTypeVisitor8<TypeVariable, Void>() {

        public TypeVariable visitTypeVariable(TypeVariable t, Void p) {
          return t;
        }
      },
      null);
}