javax.enterprise.util.TypeLiteral.getTypeLiteralSubclass()方法的使用及代码示例

x33g5p2x  于2022-01-30 转载在 其他  
字(6.9k)|赞(0)|评价(0)|浏览(64)

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

TypeLiteral.getTypeLiteralSubclass介绍

暂无

代码示例

代码示例来源:origin: javax.enterprise/cdi-api

private static Class<?> getTypeLiteralSubclass(Class<?> clazz) {
  Class<?> superclass = clazz.getSuperclass();
  if (superclass.equals(TypeLiteral.class)) {
    return clazz;
  } else if (superclass.equals(Object.class)) {
    return null;
  } else {
    return (getTypeLiteralSubclass(superclass));
  }
}

代码示例来源:origin: javax.enterprise/cdi-api

/**
 * @return the actual type represented by this object
 */
public final Type getType() {
  if (actualType == null) {
    Class<?> typeLiteralSubclass = getTypeLiteralSubclass(this.getClass());
    if (typeLiteralSubclass == null) {
      throw new RuntimeException(getClass() + " is not a subclass of TypeLiteral");
    }
    actualType = getTypeParameter(typeLiteralSubclass);
    if (actualType == null) {
      throw new RuntimeException(getClass() + " does not specify the type parameter T of TypeLiteral<T>");
    }
  }
  return actualType;
}

代码示例来源:origin: javax/javaee-web-api

private static Class<?> getTypeLiteralSubclass(Class<?> clazz) {
  Class<?> superclass = clazz.getSuperclass();
  if (superclass.equals(TypeLiteral.class)) {
    return clazz;
  } else if (superclass.equals(Object.class)) {
    return null;
  } else {
    return (getTypeLiteralSubclass(superclass));
  }
}

代码示例来源:origin: weld/core

private static Class<?> getTypeLiteralSubclass(Class<?> clazz) {
  Class<?> superclass = clazz.getSuperclass();
  if (superclass.equals(TypeLiteral.class)) {
    return clazz;
  } else if (superclass.equals(Object.class)) {
    return null;
  } else {
    return (getTypeLiteralSubclass(superclass));
  }
}

代码示例来源:origin: weld/core

private static Class<?> getTypeLiteralSubclass(Class<?> clazz) {
  Class<?> superclass = clazz.getSuperclass();
  if (superclass.equals(TypeLiteral.class)) {
    return clazz;
  } else if (superclass.equals(Object.class)) {
    return null;
  } else {
    return (getTypeLiteralSubclass(superclass));
  }
}

代码示例来源:origin: org.jboss.weld.servlet/weld-servlet-shaded

private static Class<?> getTypeLiteralSubclass(Class<?> clazz) {
  Class<?> superclass = clazz.getSuperclass();
  if (superclass.equals(TypeLiteral.class)) {
    return clazz;
  } else if (superclass.equals(Object.class)) {
    return null;
  } else {
    return (getTypeLiteralSubclass(superclass));
  }
}

代码示例来源:origin: org.jboss.weld.se/weld-se

private static Class<?> getTypeLiteralSubclass(Class<?> clazz) {
  Class<?> superclass = clazz.getSuperclass();
  if (superclass.equals(TypeLiteral.class)) {
    return clazz;
  } else if (superclass.equals(Object.class)) {
    return null;
  } else {
    return (getTypeLiteralSubclass(superclass));
  }
}

代码示例来源:origin: jboss/jboss-javaee-specs

private static Class<?> getTypeLiteralSubclass(Class<?> clazz) {
  Class<?> superclass = clazz.getSuperclass();
  if (superclass.equals(TypeLiteral.class)) {
    return clazz;
  } else if (superclass.equals(Object.class)) {
    return null;
  } else {
    return (getTypeLiteralSubclass(superclass));
  }
}

代码示例来源:origin: org.jboss.weld.se/weld-se-shaded

private static Class<?> getTypeLiteralSubclass(Class<?> clazz) {
  Class<?> superclass = clazz.getSuperclass();
  if (superclass.equals(TypeLiteral.class)) {
    return clazz;
  } else if (superclass.equals(Object.class)) {
    return null;
  } else {
    return (getTypeLiteralSubclass(superclass));
  }
}

代码示例来源:origin: org.jboss.weld.se/weld-se

/**
 * @return the actual type represented by this object
 */
public final Type getType() {
  if (actualType == null) {
    Class<?> typeLiteralSubclass = getTypeLiteralSubclass(this.getClass());
    if (typeLiteralSubclass == null) {
      throw new RuntimeException(getClass() + " is not a subclass of TypeLiteral");
    }
    actualType = getTypeParameter(typeLiteralSubclass);
    if (actualType == null) {
      throw new RuntimeException(getClass() + " does not specify the type parameter T of TypeLiteral<T>");
    }
  }
  return actualType;
}

代码示例来源:origin: javax/javaee-web-api

/**
 * @return the actual type represented by this object
 */
public final Type getType() {
  if (actualType == null) {
    Class<?> typeLiteralSubclass = getTypeLiteralSubclass(this.getClass());
    if (typeLiteralSubclass == null) {
      throw new RuntimeException(getClass() + " is not a subclass of TypeLiteral");
    }
    actualType = getTypeParameter(typeLiteralSubclass);
    if (actualType == null) {
      throw new RuntimeException(getClass() + " does not specify the type parameter T of TypeLiteral<T>");
    }
  }
  return actualType;
}

代码示例来源:origin: org.jboss.weld.servlet/weld-servlet-shaded

/**
 * @return the actual type represented by this object
 */
public final Type getType() {
  if (actualType == null) {
    Class<?> typeLiteralSubclass = getTypeLiteralSubclass(this.getClass());
    if (typeLiteralSubclass == null) {
      throw new RuntimeException(getClass() + " is not a subclass of TypeLiteral");
    }
    actualType = getTypeParameter(typeLiteralSubclass);
    if (actualType == null) {
      throw new RuntimeException(getClass() + " does not specify the type parameter T of TypeLiteral<T>");
    }
  }
  return actualType;
}

代码示例来源:origin: weld/core

/**
 * @return the actual type represented by this object
 */
public final Type getType() {
  if (actualType == null) {
    Class<?> typeLiteralSubclass = getTypeLiteralSubclass(this.getClass());
    if (typeLiteralSubclass == null) {
      throw new RuntimeException(getClass() + " is not a subclass of TypeLiteral");
    }
    actualType = getTypeParameter(typeLiteralSubclass);
    if (actualType == null) {
      throw new RuntimeException(getClass() + " does not specify the type parameter T of TypeLiteral<T>");
    }
  }
  return actualType;
}

代码示例来源:origin: org.jboss.weld.se/weld-se-shaded

/**
 * @return the actual type represented by this object
 */
public final Type getType() {
  if (actualType == null) {
    Class<?> typeLiteralSubclass = getTypeLiteralSubclass(this.getClass());
    if (typeLiteralSubclass == null) {
      throw new RuntimeException(getClass() + " is not a subclass of TypeLiteral");
    }
    actualType = getTypeParameter(typeLiteralSubclass);
    if (actualType == null) {
      throw new RuntimeException(getClass() + " does not specify the type parameter T of TypeLiteral<T>");
    }
  }
  return actualType;
}

代码示例来源:origin: weld/core

/**
 * @return the actual type represented by this object
 */
public final Type getType() {
  if (actualType == null) {
    Class<?> typeLiteralSubclass = getTypeLiteralSubclass(this.getClass());
    if (typeLiteralSubclass == null) {
      throw new RuntimeException(getClass() + " is not a subclass of TypeLiteral");
    }
    actualType = getTypeParameter(typeLiteralSubclass);
    if (actualType == null) {
      throw new RuntimeException(getClass() + " does not specify the type parameter T of TypeLiteral<T>");
    }
  }
  return actualType;
}

代码示例来源:origin: jboss/jboss-javaee-specs

/**
 * @return the actual type represented by this object
 */
public final Type getType() {
  if (actualType == null) {
    Class<?> typeLiteralSubclass = getTypeLiteralSubclass(this.getClass());
    if (typeLiteralSubclass == null) {
      throw new RuntimeException(getClass() + " is not a subclass of TypeLiteral");
    }
    actualType = getTypeParameter(typeLiteralSubclass);
    if (actualType == null) {
      throw new RuntimeException(getClass() + " does not specify the type parameter T of TypeLiteral<T>");
    }
  }
  return actualType;
}

相关文章