org.apache.cloudstack.api.Parameter.entityType()方法的使用及代码示例

x33g5p2x  于2022-01-26 转载在 其他  
字(2.2k)|赞(0)|评价(0)|浏览(112)

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

Parameter.entityType介绍

暂无

代码示例

代码示例来源:origin: apache/cloudstack

if (parameterAnnotation.entityType() != null && parameterAnnotation.entityType().length > 0
    && parameterAnnotation.entityType()[0].getAnnotation(EntityReference.class) != null) {
  final Class<?>[] entityList = parameterAnnotation.entityType()[0].getAnnotation(EntityReference.class).value();

代码示例来源:origin: apache/cloudstack

final Class<?>[] entities = annotation.entityType()[0].getAnnotation(EntityReference.class).value();

代码示例来源:origin: apache/cloudstack

private ApiDiscoveryResponse getCmdRequestMap(Class<?> cmdClass, APICommand apiCmdAnnotation) {
  String apiName = apiCmdAnnotation.name();
  ApiDiscoveryResponse response = new ApiDiscoveryResponse();
  response.setName(apiName);
  response.setDescription(apiCmdAnnotation.description());
  if (!apiCmdAnnotation.since().isEmpty()) {
    response.setSince(apiCmdAnnotation.since());
  }
  Set<Field> fields = ReflectUtil.getAllFieldsForClass(cmdClass, new Class<?>[] {BaseCmd.class, BaseAsyncCmd.class, BaseAsyncCreateCmd.class});
  boolean isAsync = ReflectUtil.isCmdClassAsync(cmdClass, new Class<?>[] {BaseAsyncCmd.class, BaseAsyncCreateCmd.class});
  response.setAsync(isAsync);
  for (Field field : fields) {
    Parameter parameterAnnotation = field.getAnnotation(Parameter.class);
    if (parameterAnnotation != null && parameterAnnotation.expose() && parameterAnnotation.includeInApiDoc()) {
      ApiParameterResponse paramResponse = new ApiParameterResponse();
      paramResponse.setName(parameterAnnotation.name());
      paramResponse.setDescription(parameterAnnotation.description());
      paramResponse.setType(parameterAnnotation.type().toString().toLowerCase());
      paramResponse.setLength(parameterAnnotation.length());
      paramResponse.setRequired(parameterAnnotation.required());
      if (!parameterAnnotation.since().isEmpty()) {
        paramResponse.setSince(parameterAnnotation.since());
      }
      paramResponse.setRelated(parameterAnnotation.entityType()[0].getName());
      response.addParam(paramResponse);
    }
  }
  return response;
}

相关文章