javax.lang.model.util.Types.getNullType()方法的使用及代码示例

x33g5p2x  于2022-01-29 转载在 其他  
字(6.7k)|赞(0)|评价(0)|浏览(115)

本文整理了Java中javax.lang.model.util.Types.getNullType()方法的一些代码示例,展示了Types.getNullType()的具体用法。这些代码示例主要来源于Github/Stackoverflow/Maven等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。Types.getNullType()方法的具体详情如下:
包路径:javax.lang.model.util.Types
类名称:Types
方法名:getNullType

Types.getNullType介绍

[英]Returns the null type. This is the type of null.
[中]返回空类型。这是null的类型。

代码示例

代码示例来源:origin: org.uberfire/uberfire-workbench-processors

@Override
public NullType getNullType() {
  return realImpl.getNullType();
}

代码示例来源:origin: org.revapi/revapi-java

@Override
public NullType getNullType() {
  return types.getNullType();
}

代码示例来源:origin: sk.seges.sesam/sesam-annotation-core-support

@Override
public NullType getNullType() {
  return this.types.getNullType();
}

代码示例来源:origin: com.google.dagger/dagger-compiler

@Override
public NullType getNullType() {
 return types.getNullType();
}

代码示例来源:origin: org.mapstruct/mapstruct-processor

@Override
public NullType getNullType() {
  return delegate.getNullType();
}

代码示例来源:origin: org.vesalainen.bcc/bcc

public static NullType getNullType()
{
  return types.getNullType();
}

代码示例来源:origin: domaframework/doma

public NullType getNullType() {
 return typeUtils.getNullType();
}

代码示例来源:origin: kiegroup/appformer

@Override
public NullType getNullType() {
  return realImpl.getNullType();
}

代码示例来源:origin: revapi/revapi

@Override
public NullType getNullType() {
  return types.getNullType();
}

代码示例来源:origin: org.juzu/juzu-core

public NullType getNullType() {
 return env.getTypeUtils().getNullType();
}

代码示例来源:origin: juzu/juzu

public NullType getNullType() {
 return env.getTypeUtils().getNullType();
}

代码示例来源:origin: stoicflame/enunciate

public NullType getNullType() {
 return TypeMirrorDecorator.decorate(delegate.getNullType(), this.env);
}

代码示例来源:origin: com.webcohesion.enunciate/enunciate-javac-support

public NullType getNullType() {
 return TypeMirrorDecorator.decorate(delegate.getNullType(), this.env);
}

代码示例来源:origin: org.datanucleus/datanucleus-jpa-query

TypeMirror param = (params == null || params.size() < position+1) ? typesHandler.getNullType() : params.get(position);
return param;

代码示例来源:origin: org.apache.openejb.patch/openjpa-persistence

/**
 * Gets the parameter type argument at the given index of the given type.
 * 
 * @return if the given type represents a parameterized type, then the
 *         indexed parameter type argument. Otherwise null.
 */
TypeMirror getTypeParameter(Element e, TypeMirror mirror, int index, boolean checkTarget) {
  if (mirror.getKind() == TypeKind.ARRAY)
    return ((ArrayType)mirror).getComponentType();
  if (mirror.getKind() != TypeKind.DECLARED)
    return null;
  if (checkTarget) {
    TypeMirror target = getTargetEntityType(e);
    if (target != null)
      return target;
  }
  List<? extends TypeMirror> params = ((DeclaredType)mirror).getTypeArguments();
  TypeMirror param = (params == null || params.size() < index+1) 
    ? typeUtility.getNullType() : params.get(index);
  if (param.getKind() == TypeKind.NULL || param.getKind() == TypeKind.WILDCARD) {
    logger.warn(_loc.get("generic-type-param", e, getDeclaredType(e), e.getEnclosingElement()));
  }
  return param;
}

代码示例来源:origin: org.apache.openjpa/openjpa-all

/**
 * Gets the parameter type argument at the given index of the given type.
 * 
 * @return if the given type represents a parameterized type, then the
 *         indexed parameter type argument. Otherwise null.
 */
TypeMirror getTypeParameter(Element e, TypeMirror mirror, int index, boolean checkTarget) {
  if (mirror.getKind() == TypeKind.ARRAY)
    return ((ArrayType)mirror).getComponentType();
  if (mirror.getKind() != TypeKind.DECLARED)
    return null;
  if (checkTarget) {
    TypeMirror target = getTargetEntityType(e);
    if (target != null)
      return target;
  }
  List<? extends TypeMirror> params = ((DeclaredType)mirror).getTypeArguments();
  TypeMirror param = (params == null || params.size() < index+1) 
    ? typeUtility.getNullType() : params.get(index);
  if (param.getKind() == TypeKind.NULL || param.getKind() == TypeKind.WILDCARD) {
    logger.warn(_loc.get("generic-type-param", e, getDeclaredType(e), e.getEnclosingElement()));
  }
  return param;
}

代码示例来源:origin: org.apache.openjpa/openjpa-persistence

/**
 * Gets the parameter type argument at the given index of the given type.
 * 
 * @return if the given type represents a parameterized type, then the
 *         indexed parameter type argument. Otherwise null.
 */
TypeMirror getTypeParameter(Element e, TypeMirror mirror, int index, boolean checkTarget) {
  if (mirror.getKind() == TypeKind.ARRAY)
    return ((ArrayType)mirror).getComponentType();
  if (mirror.getKind() != TypeKind.DECLARED)
    return null;
  if (checkTarget) {
    TypeMirror target = getTargetEntityType(e);
    if (target != null)
      return target;
  }
  List<? extends TypeMirror> params = ((DeclaredType)mirror).getTypeArguments();
  TypeMirror param = (params == null || params.size() < index+1) 
    ? typeUtility.getNullType() : params.get(index);
  if (param.getKind() == TypeKind.NULL || param.getKind() == TypeKind.WILDCARD) {
    logger.warn(_loc.get("generic-type-param", e, getDeclaredType(e), e.getEnclosingElement()));
  }
  return param;
}

代码示例来源:origin: org.apache.openejb.patch/openjpa

/**
 * Gets the parameter type argument at the given index of the given type.
 * 
 * @return if the given type represents a parameterized type, then the
 *         indexed parameter type argument. Otherwise null.
 */
TypeMirror getTypeParameter(Element e, TypeMirror mirror, int index, boolean checkTarget) {
  if (mirror.getKind() == TypeKind.ARRAY)
    return ((ArrayType)mirror).getComponentType();
  if (mirror.getKind() != TypeKind.DECLARED)
    return null;
  if (checkTarget) {
    TypeMirror target = getTargetEntityType(e);
    if (target != null)
      return target;
  }
  List<? extends TypeMirror> params = ((DeclaredType)mirror).getTypeArguments();
  TypeMirror param = (params == null || params.size() < index+1) 
    ? typeUtility.getNullType() : params.get(index);
  if (param.getKind() == TypeKind.NULL || param.getKind() == TypeKind.WILDCARD) {
    logger.warn(_loc.get("generic-type-param", e, getDeclaredType(e), e.getEnclosingElement()));
  }
  return param;
}

代码示例来源:origin: org.netbeans.api/org-netbeans-modules-java-source-base

return (T)info.getTypes().getNoType(kind);
case NULL:
  return (T)info.getTypes().getNullType();
case DECLARED:
  Types t = Types.instance(info.impl.getJavacTask().getContext());

代码示例来源:origin: org.vesalainen.bcc/bcc

public static void setTypes(Types types)
{
  Typ.types = types;
  Null = types.getNullType();
  Void = types.getNoType(TypeKind.VOID);
  //Package = types.getNoType(TypeKind.PACKAGE);
  None = types.getNoType(TypeKind.NONE);
  Byte = types.getPrimitiveType(TypeKind.BYTE);
  Boolean = types.getPrimitiveType(TypeKind.BOOLEAN);
  Char = types.getPrimitiveType(TypeKind.CHAR);
  Short = types.getPrimitiveType(TypeKind.SHORT);
  Int = types.getPrimitiveType(TypeKind.INT);
  Long = types.getPrimitiveType(TypeKind.LONG);
  Float = types.getPrimitiveType(TypeKind.FLOAT);
  Double = types.getPrimitiveType(TypeKind.DOUBLE);
  String = (DeclaredType) getTypeFor(String.class);
  Object = (DeclaredType) getTypeFor(Object.class);
  ByteA = types.getArrayType(Byte);
  BooleanA = types.getArrayType(Boolean);
  CharA = types.getArrayType(Char);
  ShortA = types.getArrayType(Short);
  IntA = types.getArrayType(Int);
  LongA = types.getArrayType(Long);
  FloatA = types.getArrayType(Float);
  DoubleA = types.getArrayType(Double);
  StringA = types.getArrayType(String);
  ObjectA = types.getArrayType(Object);
  ReturnAddress = new ReturnAddress();
}

相关文章